Commit Graph
47 Commits
Author SHA1 Message Date
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
google-labs-jules[bot] f9412140fd feat: add automated PR review script
- Adds `scripts/agent/review-pr.mjs` to automate PR checks.
- Supports iterating open PRs via `gh` CLI.
- Runs `npm ci`, `format`, `lint`, and `test:unit`.
- Reports results to PR comments.
- Offers auto-fix for formatting changes.
- Adds guardrails for sensitive files (Nostr, crypto).
2026-01-19 23:38:23 +00:00
google-labs-jules[bot] f96d15b40e chore(ai): add smoke test script (agent)
- Created scripts/agent/smoke-test.mjs to verify key flows (login, relay connect, publish, DM decrypt).
- The script uses Playwright to run a headless browser test against a local HTTP server and a local relay.
- Outputs logs to artifacts/smoke-YYYYMMDD.log and a JSON report.
- Verified local execution passes.
2026-01-19 21:13:29 +00:00
google-labs-jules[bot] da64e308af feat(agent): add load testing script and report 2026-01-19 19:26:49 +00:00
google-labs-jules[bot] f9ce5b44db feat(test): add fuzzing harnesses for schemas, DM decryptor, and magnet utils
- Implemented deterministic fuzzers in `scripts/agent/`:
  - `fuzz-nostrEventSchemas.mjs`: Tests event builder functions and schema overrides.
  - `fuzz-dmDecryptor.mjs`: Tests DM decryption orchestration with mock decryptors.
  - `fuzz-magnetUtils.mjs`: Tests magnet link normalization.
- Fuzzers generate reports in `artifacts/` (gitignored).
- Reproducers for crashes are saved to `examples/reproducers/` (none found yet).
- Fuzzers use input-derived seeding for deterministic execution.
2026-01-19 16:23:46 +00:00
thePR0M3TH3AN dc4d501a6b Merge pull request #1374 from PR0M3TH3AN/ai/interop-tests-20260119-1042596527916415444
Add interop-test.mjs for Nostr protocol verification
2026-01-19 09:21:42 -05:00
thePR0M3TH3AN e96a8ff5c6 Merge pull request #1373 from PR0M3TH3AN/telemetry-and-aggregation-5517299699870716397
Add privacy-preserving telemetry and error aggregation script
2026-01-19 09:21:17 -05:00
google-labs-jules[bot] 9d97d8dcf8 feat(agent): add interop-test.mjs for Nostr protocol verification
- Implements `scripts/agent/interop-test.mjs` using Playwright to run integration tests in a browser context.
- Tests include:
  - Publishing `VIDEO_POST` (Kind 30078) events using schema builders.
  - Verifying event roundtrip (fetch by ID).
  - Publishing `VIEW_EVENT` (Watch History).
  - Sending and decrypting Encrypted DMs (NIP-04/NIP-44) using ephemeral keys.
- Uses local `simple-relay.mjs` (port 8008) and Python HTTP server (port 8001) to ensure environment isolation.
- Generates artifacts in `artifacts/` folder including logs and reports.
2026-01-19 07:30:44 +00:00
google-labs-jules[bot] 980075981a feat: add privacy-preserving telemetry and error aggregation script
- Added `scripts/agent/telemetry.mjs` to aggregate errors from log files (test_output.log, etc.).
- Implemented robust PII sanitization (IPv4, emails, hex keys, Bech32 keys, and file paths).
- Script generates a JSON artifact (`artifacts/error-aggregates.json`) and a Markdown report (`ai/reports/telemetry-YYYYMMDD.md`).
- Aggregation groups errors by sanitized message/stack trace fingerprint.
2026-01-19 06:20:13 +00:00
google-labs-jules[bot] 4d2bb8bf3d chore(ai): event schema validation tool + fixes
- Added `scripts/agent/validate-events.mjs` to validate event builders against schemas.
- Fixed `NOTE_TYPES.REPOST` schema content format (json instead of empty).
- Added `NOTE_TYPES.MUTE_LIST` and `buildMuteListEvent`.
- Added `buildProfileMetadataEvent` to standardise Kind 0 creation.
- Updated `js/ui/profileModalController.js` to use `buildProfileMetadataEvent`.
- Updated `js/userBlocks.js` to use `buildMuteListEvent` for publishing mute list snapshots.
- Updated `docs/nostr-event-schemas.md` with new schemas and builders.
2026-01-19 05:47:37 +00:00
thePR0M3TH3AN f443d9e37b Merge pull request #1342 from PR0M3TH3AN/ai/pr-review-script-8211622282214649456
Add automated PR review script
2026-01-18 20:45:54 -05:00
google-labs-jules[bot] d279963d2f feat(agent): add automated PR review script 2026-01-18 23:35:53 +00:00
google-labs-jules[bot] 74c5bac4e0 chore(ai): add smoke test script (agent) 2026-01-18 21:35:07 +00:00
google-labs-jules[bot] 7bc85f1b99 feat: add load test script with safety guardrails
Implements `scripts/agent/load-test.mjs` to simulate N clients publishing
video and view events to a relay. Includes:
- Latency and throughput metrics.
- Signing time profiling.
- Safety guardrails to prevent accidental stress testing of public relays.
- A lightweight local relay (`scripts/agent/simple-relay.mjs`) for testing.

Outputs a report to `artifacts/load-report-YYYYMMDD.json`.
2026-01-18 19:24:01 +00:00
google-labs-jules[bot] 69e5a45af1 fix(ai): prevent race condition in login modal initialization (agent)
Removes a premature call to `initializeLoginModalController` in `ApplicationBootstrap` which was attempting to initialize the login modal before the DOM was fully hydrated, causing a "modal container not found" warning during startup. The modal is already correctly initialized later in `js/index.js` after markup loading completes.
2026-01-18 18:21:41 +00:00
google-labs-jules[bot] ec5fc23164 feat(fuzz): add input robustness testing harnesses and fixes
- Add fuzz testing scripts for `nostrEventSchemas.js`, `dmDecryptor.js`, and `magnetUtils.js` in `scripts/agent/`.
- Fix `build...` functions in `nostrEventSchemas.js` to handle `null`/`undefined` inputs.
- Fix `buildVideoPostEvent` to gracefully handle circular references in content serialization.
- Fix `normalizeAndAugmentMagnet` in `magnetUtils.js` to handle non-iterable `extraTrackers`.
- Include minimal reproducers for discovered crashes in `examples/reproducers/`.
2026-01-18 16:09:48 +00:00
google-labs-jules[bot] 82f92d420f feat(ai): add interop-test.mjs for Nostr protocol validation
Implements `scripts/agent/interop-test.mjs` to validate core Nostr operations
(Video Post, View Event, Encrypted DM) against a small set of public relays.
Ensures ephemeral keys are used and no private data is persisted.

Features:
- Ephemeral sender/receiver key generation.
- Polyfills for WebSocket, localStorage, and Crypto for Node.js environment.
- Verification of event signatures, IDs, and content shape.
- DM encryption/decryption roundtrip verification.
- Safe relay list usage (only 2 known relays).
2026-01-18 07:11:08 +00:00
google-labs-jules[bot] a8647c109f chore(ai): add smoke test script (agent)
Added `scripts/agent/smoke-test.mjs` to verify key application flows in a headless environment.

Features:
- Verifies Relay Connection
- Verifies NSEC Login (Ephemeral)
- Verifies Video Publishing (Sign & Send)
- Verifies Event Retrieval
- Verifies DM Encryption/Decryption

Usage:
```bash
npm install
node scripts/agent/smoke-test.mjs
```

Artifacts (logs/reports) are generated in `artifacts/` and are ignored by git.
Utilizes `scripts/agent/simple-relay.mjs` for a local relay.
Uses `jsdom` to polyfill browser environment for `NostrClient`.
2026-01-17 21:10:02 +00:00
google-labs-jules[bot] 898f3056a8 Add load testing scripts and report 2026-01-17 19:56:27 +00:00