Commit Graph
68 Commits
Author SHA1 Message Date
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
google-labs-jules[bot] 6ce9e9b8a8 feat: implement load testing script
- Adds scripts/agent/load-test.mjs to simulate N clients connecting to a relay.
- Publishes video and view events at a configurable rate.
- Measures write latency (Client -> Relay -> OK).
- Monitors local relay process (CPU/Mem) if applicable.
- Generates JSON report in artifacts/load-report-YYYYMMDD.json.
- Includes guardrails against public relays.

Test Run Summary (20 clients, 10s):
- Total Requests: 377
- Successful: 377
- Throughput: 37.7 req/s
- Avg Latency: 34.5ms
- P95 Latency: 61.0ms
2026-01-21 19:14:04 +00:00
google-labs-jules[bot] e2b05314e2 fix(ai): frontend console error — remove broken trackers (agent) 2026-01-21 18:38:53 +00:00
thePR0M3TH3AN c0f9c35f17 Merge pull request #1466 from PR0M3TH3AN/ai/fuzz-suite-20241022-10922521380267773837
feat(fuzz): add fuzzing suite for schemas, dms, and magnets
2026-01-21 12:02:00 -05:00
thePR0M3TH3AN a4162bd028 Merge pull request #1459 from PR0M3TH3AN/ai/interop-tests-20260121-16965720185426536661
feat: implement protocol & interop tests with ephemeral keys
2026-01-21 11:59:08 -05:00
thePR0M3TH3AN 528c6500ee Merge pull request #1458 from PR0M3TH3AN/telemetry-aggregation-privacy-12055566479602134867
Telemetry Aggregation with Privacy Preservation
2026-01-21 11:58:40 -05:00
google-labs-jules[bot] 3e38916f35 feat(fuzz): add fuzzing suite for schemas, dms, and magnets
- Add `scripts/agent/fuzz-nostr-schemas.mjs` to fuzz event builders and validation
- Add `scripts/agent/fuzz-dm-decryptor.mjs` to fuzz DM unwrapping
- Add `scripts/agent/fuzz-magnet-utils.mjs` to fuzz magnet normalization
- Utilize `scripts/agent/fuzz-lib.mjs` for randomization and reporting
- Verify that `scripts/agent/setup-test-env.js` is imported to polyfill globals
- Output reports to `artifacts/`

No crashes were found during the initial fuzzing run (5000 iterations per target).
2026-01-21 16:34:50 +00:00
google-labs-jules[bot] 8dc1d0e791 feat(tests): implement interop-test.mjs with ephemeral keys and protocol checks
- Implements `scripts/agent/interop-test.mjs` to verify Nostr protocol compatibility.
- Uses `NostrClient` programmatically with ephemeral keys (no persistence).
- Defines a strict test relay list (`relay.damus.io`, `nos.lol`) to avoid spam.
- Validates Video Post publishing (Kind 30078) using `js/nostrEventSchemas.js` builders.
- Validates View Event publishing (Kind 30079).
- Validates DM encryption and decryption (Kind 4) using `js/dmDecryptor.js`.
- Adheres to AGENTS.md guardrails (no session actor comments).
- Outputs clear pass/fail logs for verification.
2026-01-21 07:14:32 +00:00
google-labs-jules[bot] c59c6149a2 feat(scripts): consolidate telemetry aggregation with PII sanitization 2026-01-21 06:19:17 +00:00
google-labs-jules[bot] 0458f354de chore(ai): event schema validation tool + fixes
- Created scripts/agent/validate-events.mjs to validate event builders against schemas.
- Added schemas and builders for Kind 5 (Deletion) and Kind 4 (Legacy DM) to js/nostrEventSchemas.js.
- Updated js/nostr/client.js to use new builders for Kind 5 and Kind 4 events.
- Updated js/nostr/client.js to use buildVideoPostEvent for video reverts.
- Verified all builders produce valid events.
2026-01-21 05:14:17 +00:00
google-labs-jules[bot] 6a4ac5120e chore(ai): remove stale TODO and optimize JSON parsing in validation script
- Removed a TODO comment in `scripts/agent/validate-events.mjs` as the functionality was already implemented.
- Optimized the code to avoid redundant `JSON.parse` calls.
- Verified the script passes all validation tests.
- Created `artifacts/issue_telemetry_json.md` to track the larger task of handling JSON logs in telemetry aggregation.
2026-01-21 01:37:04 +00:00
google-labs-jules[bot] c2b0f713e5 feat: add automated PR review script
- Adds `scripts/agent/review-pr.mjs` to automate PR checks (lint, format, test).
- Implements micro-fix logic to auto-commit formatting changes.
- Adds guardrails for sensitive files (security/protocol review).
- Generates a Markdown report with test failure analysis.
2026-01-20 23:29:02 +00:00
google-labs-jules[bot] 4daa41a91b chore(ai): add smoke test script (agent) 2026-01-20 21:32:55 +00:00
google-labs-jules[bot] 04b26aa040 Add load testing script and report 2026-01-20 19:40:19 +00:00
google-labs-jules[bot] 5c2e9cd7f8 feat: add fuzz testing harness and fix repost builder
- Created generic fuzzing library `scripts/agent/fuzz-lib.mjs`.
- Implemented fuzz targets for `nostrEventSchemas.js`, `dmDecryptor.js`, and `magnetUtils.js`.
- Fixed `buildRepostEvent` to allow missing relay URLs for robustness.
- Added crash reproducers to `examples/reproducers/`.
2026-01-20 16:42:46 +00:00
thePR0M3TH3AN 4ee15c8686 Merge pull request #1432 from PR0M3TH3AN/ai/interop-tests-20250125-3541604759718709232
Add Protocol Interop Test Script
2026-01-20 07:30:17 -05:00
google-labs-jules[bot] b52396b6f7 feat: add protocol interop tests script
- Added `scripts/agent/interop-test.mjs` to verify Nostr protocol compatibility (Video Post, View Event, DM) using ephemeral keys.
- Added `scripts/agent/setup-test-env.js` to polyfill browser globals for Node.js execution.
- Ensures events are constructed via schema builders and published to test relays.
2026-01-20 07:16:20 +00:00
google-labs-jules[bot] 463b2a9e53 Add telemetry aggregation script
Introduces `scripts/agent/telemetry-aggregate.mjs` to parse, sanitize, and aggregate error logs from the `artifacts/` directory.

- Scans logs for errors and stack traces.
- Sanitizes PII (IPs, emails, keys) using regex.
- Groups errors by stack trace fingerprint (SHA256).
- Outputs a JSON summary (`artifacts/error-aggregates.json`) and a Markdown report (`ai/reports/telemetry-YYYYMMDD.md`).
- Suggests owners based on stack trace paths.
2026-01-20 06:30:20 +00:00
google-labs-jules[bot] 3b80692eb0 chore(ai): event schema validation tool + fixes
- Created `scripts/agent/validate-events.mjs` to validate all event builders against schemas.
- Updated `docs/nostr-event-schemas.md` to match codebase (fixed `WATCH_HISTORY` key, removed unused `STORAGE_CHALLENGE`).
- Added `validateEventAgainstSchema` to `js/nostrEventSchemas.js` for runtime validation in dev mode.
- Instrumented `buildVideoPostEvent` to use runtime validation.
- Verified that all 22 builders produce conformant events.
2026-01-20 05:21:18 +00:00