186 Commits
Author SHA1 Message Date
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 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
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
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] 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
thePR0M3TH3AN 3bfe8d664f Merge pull request #1640 from PR0M3TH3AN/ai/load-test-20260124-3194345285315307704
Add Load Testing Scripts
2026-01-24 14:37:08 -05:00
thePR0M3TH3AN 37f5083947 Merge branch 'unstable' into ai/debug-frontend-20260124-13275558127831455913 2026-01-24 14:36:28 -05:00
thePR0M3TH3AN a639887a2d Merge pull request #1636 from PR0M3TH3AN/ai/fuzz-nostrEventSchemas-20241026-8251034504942230718
Fuzz Testing Infrastructure & Crash Fix
2026-01-24 14:35:59 -05:00
google-labs-jules[bot] 02fd8a54c0 Add load testing scripts for relay stress testing 2026-01-24 19:33:48 +00:00
thePR0M3TH3AN ca05082889 Merge pull request #1626 from PR0M3TH3AN/ai/interop-tests-20250222-11826880254938891668
Add Nostr Protocol Interoperability Tests
2026-01-24 14:31:34 -05:00
thePR0M3TH3AN 3e76b6f5a5 Merge pull request #1625 from PR0M3TH3AN/telemetry-aggregation-script-7372436822110581639
Add privacy-preserving telemetry aggregation script
2026-01-24 14:31:01 -05:00
thePR0M3TH3AN 934a1d7a41 Merge pull request #1624 from PR0M3TH3AN/ai/schema-validate-latest-5595774537431140337
chore(ai): event schema validation tool + fixes
2026-01-24 14:29:07 -05:00
google-labs-jules[bot] f2ab7302ab fix(ai): frontend console error — double load and lint fixes (agent) 2026-01-24 18:29:26 +00:00
google-labs-jules[bot] 241ad32dc4 feat: add fuzz testing infrastructure and fix nostrEventSchemas crash
- Added `scripts/agent/fuzz-schemas.mjs`, `fuzz-dm.mjs`, `fuzz-magnet.mjs` and `fuzz-setup.mjs`.
- Fixed crash in `js/nostrEventSchemas.js` (buildAdminListEvent log and getNostrEventSchema type check).
- Added crash reproducers in `examples/reproducers/`.
- Fuzzers output reports to `artifacts/`.
- Updated fuzzers to deduplicate crashes and safely stringify inputs.
2026-01-24 16:46:46 +00:00
google-labs-jules[bot] 4c235b4ace feat: add interoperability test script for Nostr protocol verification
- Adds `scripts/agent/interop-test.mjs` to verify Video Post, View Event, and DM publishing/retrieval.
- Uses public relays (damus, nos.lol, snort) and ephemeral keys.
- Polyfills WebSocket and mocks localStorage for Node.js environment.
2026-01-24 07:38:35 +00:00
google-labs-jules[bot] c9201c777e Add privacy-preserving telemetry aggregation script
Moves and enhances the telemetry aggregator script to `scripts/agent/telemetry-aggregator.mjs`.
Updates `package.json` to point to the new location.
Implements robust parsing for smoke test summaries and fuzz reports.
Adds PII sanitization (IPs, emails, keys, paths).
Enforces opt-in via `ENABLE_TELEMETRY` environment variable.
Adds `ai/reports/` to `.gitignore`.
2026-01-24 06:29:10 +00:00
google-labs-jules[bot] 6884d06192 chore(ai): event schema validation tool + fixes
- Added `scripts/agent/validate-events.mjs` for builder validation.
- Enhanced `js/nostrEventSchemas.js` with `validateEventStructure`.
- Fixed `safeStringify` to handle objects correctly.
- Added `NOTE_TYPES.HTTP_AUTH` and `NOTE_TYPES.REPORT` with builders.
- Refactored `js/userBlocks.js`, `js/auth/signingAdapter.js`, `js/services/moderationService.js` to use builders.
- Updated `tests/user-blocks.test.mjs` mocks and assertions.
- Updated documentation.
2026-01-24 05:36:40 +00:00
google-labs-jules[bot] e3ef3253dc chore(ai): add smoke test script (agent) 2026-01-23 21:34:07 +00:00
google-labs-jules[bot] bc7c50d278 feat(infra): add load testing script (agent) 2026-01-23 19:19:16 +00:00
google-labs-jules[bot] a731ef6887 fix(ai): frontend console error — fix missing build artifact and admin list fetch warning (agent)
- Added `start` script to `package.json` to ensure `npm run build` is executed before serving, preventing 404 errors for `css/tailwind.generated.css`.
- Updated `js/adminListStore.js` to include the super admin pubkey (decoded from `ADMIN_SUPER_NPUB`) in the filter when fetching admin lists. This resolves the warning: `[adminListStore] Cannot use incremental fetch for editors without author.`
- Added `scripts/agent/debug_frontend.py` to diagnose frontend errors using Playwright.
- Verified fixes by running the debug script and confirming warnings are gone.
2026-01-23 18:45:36 +00:00
google-labs-jules[bot]andPR0M3TH3AN 932e57c724 Fuzz testing and hardening for nostrEventSchemas and magnetUtils
- Added fuzzing scripts for nostrEventSchemas, dmDecryptor, and magnetUtils.
- Fixed crashes in nostrEventSchemas related to unsafe stringification of content.
- Fixed crash in magnetUtils when options argument is null.
- Added safeStringify helper in nostrEventSchemas.js.
- Included fuzzing reports and reproducers.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-23 16:12:42 +00:00
google-labs-jules[bot] e88efec6c5 Add interoperability test script
This commit adds `scripts/agent/interop-test.mjs` to verify protocol interoperability using `NostrClient` and `nostrEventSchemas` against a local test relay. Covers Video Post (kind 30078), View Event (kind 30079), and Encrypted DM.

Verified locally with Node.js and `simple-relay.mjs`.
2026-01-23 07:40:57 +00:00
google-labs-jules[bot] 653f1925f8 chore(ai): event schema validation tool + fixes
- Created `scripts/agent/validate-events.mjs` to validate event builders against schemas.
- Instrumented all event builders in `js/nostrEventSchemas.js` to run validation in dev mode.
- Added `tests/event-schemas.test.mjs` to CI suite.
- Updated `docs/nostr-event-schemas.md` with validation instructions.
2026-01-23 05:33:57 +00:00
google-labs-jules[bot] c8b594feeb chore(ai): add smoke test script (agent)
- Updated scripts/agent/smoke-test.mjs with header and verification
- Updated package-lock.json (dependencies)
2026-01-22 21:38:27 +00:00
google-labs-jules[bot] d1d448faf6 feat: add load testing script
- Implement `scripts/agent/load-test.mjs` for stress testing local relays.
- Simulate N clients publishing Video Post and View Events.
- Measure latency (Build, Sign, RTT), throughput, and system resources.
- Update `scripts/agent/simple-relay.mjs` to support configurable `PORT`.
- Include `artifacts/load-report-20260122.json` from a 1000-client run.
2026-01-22 19:42:13 +00:00
google-labs-jules[bot] c076cd9684 fix(ai): frontend console error — remove broken tracker (agent)
- Remove `wss://open.video.lukewarlow.uk:443/announce` from `DEFAULT_WSS_TRACKERS` in `js/constants.js`.
- This tracker was returning `net::ERR_SSL_PROTOCOL_ERROR`, causing console noise and connection failures.
- Added `scripts/agent/debug_frontend.py` to help diagnose frontend initialization errors.

Verified with `scripts/agent/debug_frontend.py` that the error is resolved.
Ran `npm run format`, `npm run lint`, and `npm run test:unit`.
2026-01-22 18:23:20 +00:00
google-labs-jules[bot] 0060f1f593 Fix: guard pointerTags iteration in buildWatchHistoryEvent
Fuzzer discovered a crash when `pointerTags` is passed as null.
Added array check to prevent TypeError.

Also added fuzz harnesses for schemas, dm decryptor and magnet utils.
2026-01-22 16:54:01 +00:00
google-labs-jules[bot] f75531d2db chore(ai): format sources and fix moderation bugs (agent)
- Format `css/tailwind.source.css` with Prettier.
- Add allowlist entry for `VideoCard.js` media query pixel value in `scripts/check-design-tokens.mjs`.
- Remove accidental artifact `js/ui/dm/jules_session_4520373547615093905.zip`.
- Fix bug in `js/app.js` and `js/services/moderationActionController.js` where blocked users' videos were not correctly hidden in the UI immediately after blocking.
- Fix bug in `tests/app/moderation-overrides.test.mjs` where `userBlocks` mocks were insufficient to reflect state changes.
2026-01-22 14:58:35 +00:00
thePR0M3TH3AN 39c47fecea Merge pull request #1493 from PR0M3TH3AN/ai/interop-tests-20250222-7461951037331976125
Add Nostr Protocol Interoperability Tests
2026-01-22 09:17:32 -05:00
google-labs-jules[bot] e0757f581f feat: add interoperability test script
- Adds `scripts/agent/interop-test.mjs` to verify protocol compliance.
- Tests Video Post, View Event, and encrypted Direct Message publishing/decryption.
- Uses ephemeral keys and a local relay (`simple-relay.mjs`).
- Polyfills browser environment for `NostrClient` execution in Node.js.
2026-01-22 07:19:21 +00:00
google-labs-jules[bot] e282cf5a29 chore(ai): event schema validation tool + fixes
- Added `scripts/agent/validate-events.mjs` to verify builder output against schemas.
- Updated `js/nostrEventSchemas.js` to enforce relay hints in `buildRepostEvent` (fixes `tests/nostr-boost-actions.test.mjs`).
- Documented usage in `docs/nostr-event-schemas.md`.
- Verified 25 event builder scenarios pass validation.
2026-01-22 05:31:40 +00:00
google-labs-jules[bot] 553c03e312 feat: update review-pr.mjs with release channel guidance
Updates scripts/agent/review-pr.mjs to fetch the base branch of PRs and
include specific release channel guidance (Main vs Unstable) in the
automated review report, as per AGENTS.md instructions.
2026-01-21 23:07:47 +00:00
google-labs-jules[bot] 429c1c168d chore(ai): add smoke test script (agent)
Added `scripts/agent/smoke-test.mjs`, a Playwright-based smoke test that:
- Spins up a local web server (`python -m http.server`) and local relay (`scripts/agent/simple-relay.mjs`).
- Launches a headless browser to interact with the served app.
- Verifies key flows: Login, Video Publish, Verification, and DM Decryption.
- Reports status to `artifacts/smoke-summary-YYYYMMDD.json` and logs.

This fulfills the requirement for a regression smoke test covering key user flows.
2026-01-21 21:23:27 +00:00
thePR0M3TH3AN 34d57c2072 Merge pull request #1472 from PR0M3TH3AN/ai/load-test-20260121-11214410427964689271
feat: implement load testing script
2026-01-21 14:29:28 -05:00