Commit Graph
112 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 39c4e2249d chore(ai): event schema validation tool + fixes
- Created `scripts/agent/validate-events.mjs` to verify all event builders produce valid events against the schema.
- Instrumented `js/nostr/nip71.js` to validate NIP-71 events during construction (other builders in `js/nostrEventSchemas.js` were already instrumented).
- Validated all 25 event types using the new tool.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 05:34:50 +00:00
google-labs-jules[bot]andPR0M3TH3AN 28da9e1642 Add fuzzing harnesses for Nostr schemas, DM decryptor, and magnet utils
- Created `scripts/agent/fuzz-nostrEventSchemas.mjs`, `scripts/agent/fuzz-dmDecryptor.mjs`, and `scripts/agent/fuzz-magnetUtils.mjs`.
- Utilized `scripts/agent/fuzz-lib.mjs` for standardized random input generation and reporting.
- Removed legacy/duplicate fuzz scripts (`fuzz-nostr-schemas.mjs`, etc.) in favor of the new standardized ones.
- Verified all fuzzers run successfully with no crashes using 5000 iterations.
- Added huge string injection (1MB+) to stress test inputs.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 16:31:38 +00:00
thePR0M3TH3AN 0114310f23 Merge pull request #1916 from PR0M3TH3AN/ai/interop-tests-20250222-17895204114495764290
Add Nostr interoperability test script
2026-01-29 08:18:41 -05:00
google-labs-jules[bot]andPR0M3TH3AN 5dd9cb542c fix(ci): add _redirects for netlify and clean up interop test
- Create `_redirects` file with catch-all rule (`/* /index.html 200`) to fix Netlify "Redirect rules" check failure and support SPA routing.
- Remove unused `NOTE_TYPES` import from `scripts/agent/interop-test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 07:54:39 +00:00
google-labs-jules[bot]andPR0M3TH3AN 200acf0785 feat(test): add scripts/agent/interop-test.mjs
- Implements an interoperability test suite for Nostr events (Video Post, View Event, Encrypted DM).
- Uses `scripts/agent/load-test-relay.mjs` as a local test relay.
- Uses ephemeral keys for signing.
- Verifies roundtrip publishing and fetching.
- Validates schema compliance using `js/nostrEventSchemas.js`.
- Verifies encryption/decryption using `js/dmDecryptor.js`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 07:31:35 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0caa31eab0 chore(ai): event schema validation tool + fixes
- Created `scripts/agent/validate-events.mjs` to validate Nostr event builders and ensure test coverage for used builders.
- Updated `docs/nostr-event-schemas.md` to reference the new validation tool.
- Verified that all centralized builders in `js/nostrEventSchemas.js` produce valid events.
- Identified and ignored non-builder functions in the validation script to prevent false positives.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 05:33:04 +00:00
google-labs-jules[bot]andPR0M3TH3AN cfbbf78941 chore(ai): add automated PR review report
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-28 23:49:33 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0c8f0f3ca7 chore(ai): add smoke test script (agent)
- Created scripts/agent/smoke-test.mjs using Playwright for UI tests and Node for DM verification.
- Updated scripts/agent/load-test-relay.mjs to support NIP-45 COUNT frames (dummy).
- Included artifacts generation (logs, screenshots).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-28 21:24:50 +00:00
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
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
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 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
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 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