Commit Graph
171 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 09187194d8 feat(ai): Load Test Script & Report (agent)
- Updated scripts/agent/load-test.mjs to handle empty reports.
- Added scripts/agent/load-test.mjs and load-test-relay.mjs to tracking.
- Generated artifacts/load-report-20260128.json.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-28 19:42:29 +00:00
google-labs-jules[bot]andPR0M3TH3AN 9f60eeaaf2 fix(ai): frontend console error — ignore .torrent urls in probeUrl (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-28 18:50:36 +00:00
google-labs-jules[bot]andPR0M3TH3AN 9f67b9e06b feat: add fuzz testing harnesses and fix crash in nostrEventSchemas
- Expand fuzzing coverage for `js/nostrEventSchemas.js` to include all builder functions.
- Fix a crash in `buildAdminListEvent` where non-array `hexPubkeys` caused a TypeError.
- Update `scripts/agent/fuzz-dmDecryptor.mjs` and `scripts/agent/fuzz-magnetUtils.mjs` iterations.
- Add reproducer for the `buildAdminListEvent` crash.
- Generate fuzz reports in `artifacts/`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-28 16:27:36 +00:00
thePR0M3TH3AN dc7257855a Merge pull request #1870 from PR0M3TH3AN/refactor-auth-providers-v2-4587525965814839162
Refactor Auth Providers to NostrClient with Security Validators
2026-01-28 09:06:46 -05:00
thePR0M3TH3AN 12463c329f Merge pull request #1873 from PR0M3TH3AN/ai/interop-tests-20260128-13833342892400384254
Implement Protocol & Interop Tests with Public Relays
2026-01-28 08:29:23 -05:00
google-labs-jules[bot]andPR0M3TH3AN 3c1227e5be feat(ai): Implement scripts/agent/interop-test.mjs
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-28 07:21:01 +00:00
google-labs-jules[bot]andPR0M3TH3AN 25416af58e fix(ai): rename validation script to .test.mjs
Renamed scripts/agent/validate-events.mjs to scripts/agent/validate-events.test.mjs to prevent potential deployment issues with Netlify or other CI tools treating it as a production asset. Also added shebang.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-28 05:38:33 +00:00
google-labs-jules[bot]andPR0M3TH3AN c46fcf88cd chore(ai): event schema validation tool + fixes
Added scripts/agent/validate-events.mjs to validate event builders against schemas. Verified consistency and added a regression test for event schemas.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-28 05:31:18 +00:00
google-labs-jules[bot]andPR0M3TH3AN 16ad3320fe refactor(auth): consolidate login logic in NostrClient and enhance security
- Move NIP-07 extension login logic from `js/services/authProviders/nip07.js` to `NostrClient.loginWithExtension`.
- Add `validator` support to `NostrClient` login methods (`loginWithExtension`, `connectRemoteSigner`, `useStoredRemoteSigner`, `registerPrivateKeySigner`) to allow pre-session security checks.
- Update `nip07.js`, `nip46.js`, and `nsec.js` providers to inject `accessControl` checks via the new validator hook, ensuring consistent enforcement of whitelists/blacklists before activating the signer.
- This creates a unified "harness" for all signing methods within `NostrClient` while keeping business logic (access control) in the service layer.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-28 04:22:55 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4de7dcb3f4 feat(ci): enhance automated PR review scripts
- Update `scripts/automated-pr-review.mjs` to include missing sensitive paths (`js/auth/`, `js/magnetUtils.js`, `js/nostr/adapters/nip07Adapter.js`) and improve commit messaging for automated fixes.
- Add release channel guidance checks for `unstable` branch in `automated-pr-review.mjs`.
- Create `scripts/agent/review-open-prs.mjs` to robustly batch process open PRs using the updated review script.
- Remove redundant scripts `scripts/agent/automated-pr-review.mjs` and `scripts/agent/review-pr.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 23:16:02 +00:00
thePR0M3TH3AN 0d3dbafa73 Merge pull request #1848 from PR0M3TH3AN/ai/smoke-tests-20260127-8639087444619345059
chore(ai): add smoke test script (agent)
2026-01-27 16:29:10 -05:00
google-labs-jules[bot]andPR0M3TH3AN f58c0a173b I'm fixing the CI lint and test failures.
- Refactoring `scripts/check-hex.js` to use git's native search instead of `ripgrep` for better portability and dependency reduction.
- Updating `tests/ui/uploadModal-integration.test.mjs` to ensure DOM isolation between tests using `beforeEach` cleanup, resolving state pollution issues.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 21:22:27 +00:00
google-labs-jules[bot]andPR0M3TH3AN 89bba44fee chore(ai): add smoke test script (agent)
Added scripts/agent/smoke-test.mjs to verify login, relay connection, video publishing, and DM decryption flows using a headless Node.js client.
The script polyfills the necessary browser environment for NostrClient and uses local relay/server resources.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 21:11:41 +00:00
google-labs-jules[bot]andPR0M3TH3AN d3a3097d1c feat: implement load and stress test script with relay monitoring
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 19:10:29 +00:00
thePR0M3TH3AN 8b9ef3858d Merge pull request #1831 from PR0M3TH3AN/ai/debug-frontend-20260127-16023647328364348853
Fix frontend console errors by removing redundant script tags
2026-01-27 13:28:58 -05:00
google-labs-jules[bot]andPR0M3TH3AN 9155fbe8aa fix(ai): frontend console error — remove redundant script tags (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 18:22:48 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0dddcb5e42 fix(ci): expose automated review report in CI logs
Currently, if the automated PR review script encounters failures (lint/test errors), it exits with code 1, but the failure details are only visible in the posted PR comment. In CI environments where the comment might not be immediately accessible or if posting fails, the logs are unhelpful.

This change unconditionally prints the generated review report (including failure details) to `stdout` at the end of the script execution. This ensures that failure reasons are always visible in the CI logs.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 17:51:23 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0bf3275b37 Fuzz tests and robustness fixes for nostrEventSchemas, dmDecryptor, and magnetUtils
Implemented fuzz testing harnesses and fixed a circular reference crash in nostrEventSchemas.js. Improved robustness of magnetUtils and dmDecryptor.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 17:02:49 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1726d27c77 feat: Automate Daily Design System Audit
- Added .github/workflows/daily-design-system-audit.yml
- Updated scripts/daily-design-system-audit.mjs with auto-fix support
- Implemented hex color and simple palette token replacements

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 16:05:53 +00:00
thePR0M3TH3AN 38984034a6 Merge pull request #1798 from PR0M3TH3AN/ai/interop-tests-20250226-10619676065325825636
Add Nostr protocol interop test script
2026-01-27 08:09:49 -05:00
thePR0M3TH3AN 759c9bc2cd Merge pull request #1797 from PR0M3TH3AN/telemetry-aggregation-privacy-2456468691969692999
Refactor telemetry aggregator for dynamic log collection and privacy
2026-01-27 08:09:29 -05:00
google-labs-jules[bot]andPR0M3TH3AN a307c87c64 Add interop test script for Nostr protocols
- Implements `scripts/agent/interop-test.mjs` to validate VIDEO_POST, VIEW_EVENT, and DM flows.
- Uses ephemeral keys generated via `nostr-tools`.
- Targets public relays `wss://relay.damus.io` and `wss://nos.lol` for verification.
- Includes retry logic for event propagation verification.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 07:34:23 +00:00
google-labs-jules[bot]andPR0M3TH3AN e681a70e95 Refactor telemetry aggregator to dynamically collect logs and verify PII redaction
- Updated `scripts/agent/telemetry-aggregator.mjs` to dynamically search for `test_unit*.log` and `test_output.log` files in both the root and `artifacts/` directories, instead of using a hardcoded list.
- Verified the aggregator script with a test log containing PII (email, IP, hex key) to ensure sensitive information is correctly redacted in the generated reports.
- Confirmed that the script operates only when `ENABLE_TELEMETRY=true` is set.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 06:37:26 +00:00
google-labs-jules[bot]andPR0M3TH3AN f5233a93f3 chore(ai): event schema validation tool + fixes
- Created `scripts/agent/validate-events.mjs` to validate event builders against schemas.
- Refactored `buildVideoPostEvent` in `js/nostrEventSchemas.js` to automatically generate the required `s` (storage pointer) tag if missing, using `infoHash`, `url`, or `videoRootId`.
- Verified that `js/utils/storagePointer.js` exists and is imported correctly.
- Updated `docs/nostr-event-schemas.md` to reflect the auto-generation behavior.
- Verified fixes with `scripts/agent/validate-events.mjs` and existing unit tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 05:47:05 +00:00
google-labs-jules[bot]andPR0M3TH3AN e29a9c1ee8 fix(ci): improve logging and error handling in automated-pr-review.mjs
- Wrap `main` execution in try-catch block to ensure process exits with code 1 on failure.
- Update `runCommand` to throw meaningful errors on spawn failure (e.g. command not found).
- Add explicit check for `gh` CLI availability in CI environment.
- Improve git command error logging in `getChangedFiles` to capture stderr (e.g. "no merge base").

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-27 03:11:30 +00:00
google-labs-jules[bot]andPR0M3TH3AN 63dec7551d feat(agent): add automated-pr-review script (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 23:38:15 +00:00
google-labs-jules[bot]andPR0M3TH3AN b7e69d3967 chore(ai): add smoke test script (agent)
- Added `scripts/agent/smoke-test.mjs` to verify key flows:
  - Infrastructure: Local Relay (ws://localhost:8899) and Web Server (http://localhost:3000).
  - Protocol: Login, Video Post, View Event, DM Send/Decrypt.
  - UI: Headless Browser (Playwright) screenshot.
- Utilizes `scripts/agent/simple-relay.mjs` for a lightweight relay.
- Uses `scripts/agent/setup-test-env.js` for Node.js polyfills.
- Generates artifacts in `artifacts/` (log, summary JSON, screenshot).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 21:29:46 +00:00
google-labs-jules[bot]andPR0M3TH3AN cec48811be feat(scripts): enhance load test script for multi-part events (agent)
- Updated `scripts/agent/load-test.mjs` to simulate realistic video publishing flows by generating Video Post (Kind 30078), Video Mirror (Kind 1063), and NIP-71 Metadata (Kind 21/22) events for "heavy" load scenarios.
- Refactored the load generation loop to strictly separate cryptographic signing time from network transmission time, ensuring accurate performance metrics.
- Generated a baseline `artifacts/load-report.json` demonstrating ~100 events/sec throughput and sub-10ms signing latency.
- Verified execution against a local relay to prevent public network stress.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 19:41:50 +00:00
google-labs-jules[bot] a1cb6377a6 feat(agent): add fuzz testing scripts for nostr schemas, DM decryptor, and magnet utils 2026-01-26 16:53:30 +00:00
thePR0M3TH3AN 7ce6bb09d0 Merge pull request #1714 from PR0M3TH3AN/ai/interop-tests-20241027-5660466127483466949
Add Nostr Protocol Interoperability Test Script
2026-01-26 06:26:13 -05:00
thePR0M3TH3AN 283d12534c Merge pull request #1713 from PR0M3TH3AN/telemetry-aggregation-3069571134947148674
feat: add privacy-preserving telemetry and error aggregation
2026-01-26 06:23:00 -05:00
google-labs-jules[bot] 1174b4b293 feat: add interoperability test script for Nostr protocol
Implements `scripts/agent/interop-test.mjs` to validate Nostr event schemas and client publishing against public relays.

- Uses ephemeral keys (generated via `nostr-tools`) for safety.
- Connects to `wss://relay.damus.io` and `wss://nos.lol` for testing.
- Verifies:
  - Video Post creation (via `buildVideoPostEvent`) and publishing.
  - View Event creation (via `buildViewEvent`) and publishing.
  - Direct Message sending and decryption (using client's encrypted DM logic).
- Includes necessary Node.js polyfills (`WebSocket`, `crypto`, `localStorage`, `window`) to run browser-targeted client code.
2026-01-26 07:24:00 +00:00
google-labs-jules[bot] edbd66df52 feat: add privacy-preserving telemetry and error aggregation
- Update smoke-test.mjs to output structured summary with logs
- Update telemetry-aggregator.mjs to collect from unit, smoke, and load tests
- Update run-unit-tests.mjs to log output to artifacts/test_unit.log
- Ensure PII sanitization in telemetry reports
2026-01-26 06:48:14 +00:00
google-labs-jules[bot] 3a1ffd3688 chore(ai): event schema validation tool + fixes
- Added `scripts/agent/validate-events.mjs` to validate event builders.
- Added `GENERIC_REPOST` (kind 16) to `js/nostrEventSchemas.js` and `docs/nostr-event-schemas.md`.
- Updated `buildRepostEvent` to validate against `GENERIC_REPOST` when producing kind 16 events.
2026-01-26 05:20:43 +00:00
google-labs-jules[bot] 1a66ad56ed feat(agent): implement automated PR review scripts
- Updated `scripts/automated-pr-review.mjs` to align with specific prompt requirements for formatting fixes and guardrails.
- Added `js/utils/storage.js` to sensitive paths for security review flagging.
- Created `scripts/agent/review-open-prs.mjs` to iterate over open PRs and run the review script using `gh` CLI.
2026-01-25 23:27:58 +00:00
google-labs-jules[bot] bd6b110c45 chore(ai): add smoke test script (agent)
Added `scripts/agent/smoke-test.mjs` to verify key application flows:
- Local Relay & Web Server availability.
- Protocol flows via `NostrClient` in Node.js (Video Publish, View Publish, DM Send & Decrypt).
- UI availability via Playwright (Headless Browser).

This script generates `artifacts/smoke-report.json` and logs for verification.
2026-01-25 21:31:08 +00:00
google-labs-jules[bot] f7aef64103 Add load testing script and initial report 2026-01-25 19:15:37 +00:00
thePR0M3TH3AN 02e078264b Merge pull request #1679 from PR0M3TH3AN/ai/fuzz-tests-20241121-5061817015810019596
Add fuzz testing scripts for Nostr schemas, DM decryptor, and magnet utils
2026-01-25 11:51:54 -05:00
google-labs-jules[bot] f2d3650873 Add fuzz robustness tests for nostr schemas, dm decryptor, and magnet utils
- Created `scripts/agent/fuzz-utils.mjs` with shared random data generators.
- Created `scripts/agent/fuzz-nostrEventSchemas.mjs` to fuzz event builders and validators, including `sanitizeAdditionalTags`.
- Created `scripts/agent/fuzz-dmDecryptor.mjs` to fuzz DM decryption with mocked decryptors and custom reproducer generation.
- Created `scripts/agent/fuzz-magnetUtils.mjs` to fuzz magnet URI normalization.
- Verified that all fuzz targets run without crashes.
- Saved execution reports to `artifacts/`.
2026-01-25 16:13:23 +00:00
google-labs-jules[bot] 099d218a33 Update README and storage docs with static client and S3 mode info
- Updated README.md to state bitvid is a static client.
- Added supported S3 upload modes to README.md and docs/storage-tab-design.md.
- Added security warnings about browser-held keys.
- Updated docs/storage-r2.md to contextually place R2 integration.
- Updated scripts/check-hex.js to ignore ai/** to fix lint failure.
2026-01-25 16:00:51 +00:00
thePR0M3TH3AN 3a599e3ad5 Merge pull request #1670 from PR0M3TH3AN/ai/onboarding-20231026-1317313232699865149
docs(ai): improve onboarding steps
2026-01-25 10:47:23 -05:00
thePR0M3TH3AN de470d7e43 Merge pull request #1669 from PR0M3TH3AN/ai/interop-tests-20250523-5080573414385366993
feat: Add Nostr interop test script with local relay
2026-01-25 10:46:50 -05:00
thePR0M3TH3AN e4a4216fae Merge pull request #1668 from PR0M3TH3AN/telemetry-aggregation-script-13541382405670106865
feat(ai): telemetry aggregation script
2026-01-25 10:46:10 -05:00
google-labs-jules[bot] 93b3434145 docs(ai): improve onboarding steps (agent)
- Audit onboarding process (`npm ci`, build, lint).
- Fix hex color lint failures by updating `scripts/check-hex.js` ignore list.
- Fix inline style lint failures by updating `scripts/check-inline-styles.mjs` allowlist.
- Fix raw tailwind colors in `js/ui/components/EmbedPlayerModal.js` by using semantic tokens.
- Add `ai/onboarding-report.md` detailing the audit.
2026-01-25 08:25:42 +00:00
google-labs-jules[bot] 70e63ca922 feat(test): add interop-test.mjs for Nostr integration testing
- Implements `scripts/agent/interop-test.mjs` to validate Nostr protocol interoperability.
- Uses `simple-relay.mjs` to spin up a local test relay (no public relay spam).
- Generates ephemeral keys for each run using `nostr-tools`.
- Verifies `VIDEO_POST` (Video Note) publishing and fetching.
- Verifies `VIEW_EVENT` publishing.
- Verifies Direct Message (DM) sending and listing (decryption).
- Polyfills browser globals (WebSocket, crypto, localStorage, IndexedDB) for Node.js execution.
2026-01-25 07:51:08 +00:00
google-labs-jules[bot] bfa333849a feat(ai): implement privacy-preserving telemetry aggregator script
- Enhance `scripts/agent/telemetry-aggregator.mjs` to parse TAP formatted unit test logs (e.g., `test_unit_debug.log`).
- Add logic to identify and group errors by stack trace fingerprint.
- Implement PII sanitization for IPs, emails, and keys.
- Generate a Markdown report in `ai/reports/` with prioritized issues.
- Generate a JSON artifact in `artifacts/` for machine consumption.
- Ensure telemetry is opt-in via `ENABLE_TELEMETRY` env var.
- Produce initial telemetry report `ai/reports/telemetry-20260125.md`.
2026-01-25 06:36:09 +00:00
google-labs-jules[bot] 5790b6e7c1 chore(ai): event schema validation tool + fixes
- Created `scripts/agent/validate-events.mjs` to validate all event builders.
- Fixed `buildViewEvent` to generate a fallback `d` tag for kind 30079 compliance.
- Relaxed `REPOST` schema validation to allow empty content (blind reposts), per NIP-18.
- Updated `docs/nostr-event-schemas.md` to reflect schema changes.
2026-01-25 05:29:32 +00:00
google-labs-jules[bot] d59cb45f8e refactor(agent): use runCommand helper for consistency and reliability
- Update `scripts/agent/review-pr.mjs` to use `runCommand` wrapper for all command executions.
- Increase `maxBuffer` to 10MB to prevent crashes during large test/lint outputs.
- Ensure consistent logging and option handling.
2026-01-24 23:40:20 +00:00
google-labs-jules[bot] 25b513b094 chore(ai): add smoke test script (agent)
This commit ensures the existence and correctness of `scripts/agent/smoke-test.mjs`, a Playwright-based regression test suite.

The script:
- Starts a local web server (npx serve) and a local relay (simple-relay.mjs).
- Launches a headless browser to interact with the application.
- Verifies key flows:
  - Ephemeral login.
  - Video publishing (Kind 30078).
  - Direct Message (DM) sending and decryption (Kind 4/1059).
- Generates execution logs and summaries in `artifacts/`.

Also ensures `scripts/agent/simple-relay.mjs` is present as a dependency.
2026-01-24 21:12:02 +00:00
google-labs-jules[bot] 4a0b81ad98 chore(ai): remove dead code (unused exports & deps) 2026-01-24 20:28:53 +00:00