Commit Graph
138 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 6caf650d52 feat(scripts): add load test script for relay stress testing
- Implements `scripts/agent/load-test.mjs` to simulate N clients publishing mixed events.
- Adds `test:load` script to `package.json`.
- Measures roundtrip latency and client-side signing time.
- Generates JSON report in `artifacts/`.
- Includes `--mock` mode for verification without external relay.
- Enforces guardrails against public relay usage.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-06 19:31:00 +00:00
google-labs-jules[bot]andPR0M3TH3AN 8f83cff04e Implement load test script with rate configuration and multipart event simulation.
- Update `scripts/agent/load-test.mjs` to support `--rate` arg.
- Add multipart video event simulation (Post + Mirror).
- Generate performance report with bottleneck analysis.
- Include `artifacts/load-report.json`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 19:38:01 +00:00
google-labs-jules[bot]andPR0M3TH3AN 50f97ef964 Add load test script and report
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-03 19:17:54 +00:00
google-labs-jules[bot]andPR0M3TH3AN 95b7c6df47 feat: add load test script and report
- Implement CPU usage tracking in load-test.mjs
- Run load test with 1000 clients for 60s
- Generate load-report.json with identified bottlenecks (crypto)

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-02 19:25:56 +00:00
google-labs-jules[bot]andPR0M3TH3AN 7f848aa810 feat: add load-test script for relay interactions
This introduces `scripts/agent/load-test.mjs`, a stress testing tool that:
- Spawns a local relay server in a separate process.
- Simulates N concurrent WebSocket clients.
- Publishes a configurable mix of large (Video Post) and small (View) events.
- Measures and reports on latency, throughput, memory usage, and cryptographic signing time.
- Identifies potential bottlenecks (error rate > 5%, latency > 500ms, sign time > 5ms).

Includes a sample run report in `artifacts/`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 19:09:29 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2f33992192 Fix dependencies (jsdom/nostr-tools conflict) and WebTorrent regression
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 13:32:00 +00:00
google-labs-jules[bot]andPR0M3TH3AN 062f79b181 chore(ai): move smoke test to tests/smoke/smoke-test.mjs
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 21:27:57 +00:00
google-labs-jules[bot]andPR0M3TH3AN ac19e4d8a1 chore(ai): add smoke test script (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 21:12:24 +00:00
thePR0M3TH3AN 2da157a06d Merge branch 'unstable' into ai/interop-tests-20260131-17192017166205222144 2026-01-31 14:06:13 -05:00
thePR0M3TH3AN dab5f66fd0 Merge branch 'unstable' into ai/debug-frontend-13808877327263676633 2026-01-31 14:05:39 -05:00
google-labs-jules[bot]andPR0M3TH3AN e922d01da7 fix(ai): frontend console error — report nostr-tools version mismatch (agent)
- Add scripts/agent/debug_frontend.py for diagnosing console errors
- Add issues/requires-security-review-nostr-tools-upgrade.md documenting version mismatch
- Mismatch between package.json (^2.19.4) and runtime (2.17.0) causes protocol errors

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 18:25:46 +00:00
google-labs-jules[bot]andPR0M3TH3AN 041fb241fe Add Nostr protocol interoperability test script using ephemeral keys and public relays
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 07:33:26 +00:00
google-labs-jules[bot]andPR0M3TH3AN 05a3aa2b1f chore(ai): event schema validation tool + fixes
- Created `scripts/agent/validate-events.mjs` to verify event builders against schemas.
- Enhanced validation script with test cases for Relay List (object format), Hashtag Preferences (encrypted), and Video Post (additional tags).
- Updated `docs/nostr-event-schemas.md` to document the validation workflow.
- Verified runtime event construction by instrumenting tests with dev mode (reverted clean).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 05:36:48 +00:00
thePR0M3TH3AN ceccd34681 Revert "Dead Code Cleanup" 2026-01-30 16:51:01 -05:00
google-labs-jules[bot]andPR0M3TH3AN 3f9dd916a8 chore(ai): add smoke test script (agent)
- Adds `scripts/agent/smoke-test.mjs` for end-to-end regression testing.
- Verifies key flows: login, relay connect, publish video, publish DM, and DM decryption.
- Uses local relay (port 8899) and local HTTP server (port 8000).
- Generates JSON summary and logs in `artifacts/`.
- Includes Playwright frontend verification.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 21:29:19 +00:00
google-labs-jules[bot]andPR0M3TH3AN 60fa6c4282 chore(ai): remove dead code (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 20:54:52 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4f40025b9d fix(ai): frontend console error — strip xs on localhost (agent)
Diagnosed a CORS error on local development environment caused by WebTorrent fetching `.torrent` files from R2 buckets (via `xs` parameter) that do not allow localhost origin.

Modified `js/webtorrent.js` to strip the `xs` parameter from magnet links when running on `localhost` or `127.0.0.1`. This prevents the browser from attempting the blocked fetch request, resolving the console error while maintaining functionality (falling back to DHT/peers).

Verified using `scripts/agent/debug_frontend.py` which captures frontend console logs via Playwright.

Tests run:
- `npm run lint`
- `npm run test:unit:shard1`
- `python3 scripts/agent/debug_frontend.py` (verified error is gone)

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 18:53:25 +00:00
google-labs-jules[bot]andPR0M3TH3AN dc2dc70b69 test(fuzz): add fuzzing harnesses for schemas, dm, and magnet utils
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 16:14:02 +00:00
thePR0M3TH3AN b71346c06a Merge branch 'unstable' into ai/interop-tests-20250228-12917398042927663384 2026-01-30 09:19:49 -05:00
thePR0M3TH3AN 667b48c301 Merge branch 'unstable' into telemetry-aggregation-fix-6349074633801704985 2026-01-30 09:19:03 -05:00
thePR0M3TH3AN 55b338ee5a Merge pull request #1962 from PR0M3TH3AN/ai/schema-validate-20250130-4578214465880061430
Event Schema Validation Tool & NIP-71 Instrumentation
2026-01-30 09:17:42 -05:00
google-labs-jules[bot]andPR0M3TH3AN 7ac4d4eee7 feat: add Nostr interop test script
This script validates protocol interoperability by publishing Video Post and View events, and sending Encrypted DMs using ephemeral keys against public relays. It ensures the NostrClient facade and event builders function correctly in a Node.js environment.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 07:34:26 +00:00
google-labs-jules[bot]andPR0M3TH3AN 782ecf3cea Refactor telemetry aggregator regex for stricter error detection
- Update `scripts/agent/telemetry-aggregator.mjs` to use a stricter regex for parsing generic logs.
- Require brackets (e.g., `[ERROR]`, `[WARN]`) or trailing colons/word boundaries (e.g., `Error:`, `FAIL`) to match errors.
- Prevent false positives from status messages like "0 errors" or "0 failures".
- Support `[WARN]` as Medium severity.
- Ensure PII sanitization and `ENABLE_TELEMETRY` guardrails are preserved.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 06:33:52 +00:00
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 505d8dfc3c fix(deploy): update netlify config and smoke test
- Update `netlify.toml` to explicitly include redirect and header rules, ensuring they are picked up even if file copying fails or is inconsistent.
- Fix `scripts/agent/smoke-test.mjs` to ensure process cleanup on failure (avoiding zombie processes) and use polling for server startup (improving reliability).
- Verified smoke test passes locally.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 22:44:57 +00:00
google-labs-jules[bot]andPR0M3TH3AN 06dfe6278a chore(ai): add smoke test script (agent)
- Add scripts/agent/smoke-test.mjs for E2E verification
- Fix js/app.js to expose activeProfilePubkey and savedProfiles
- Fix tests/app-batch-fetch-profiles.test.mjs mocking (CI fix)
- Ensure smoke test uses Node.js compatible imports

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 22:00:17 +00:00
google-labs-jules[bot]andPR0M3TH3AN 624dabc576 chore(ai): add smoke test script (agent)
- Added `scripts/agent/smoke-test.mjs` which performs an end-to-e2e smoke test using a local relay, Node.js client, and headless Playwright browser.
- Fixed a bug in `js/app.js` where `activeProfilePubkey` and `savedProfiles` getters were missing, preventing auto-login and session restoration.
- The smoke test verifies:
    - Login flow (using ephemeral keys and localStorage injection).
    - Relay connection (using a local test relay).
    - Publish and Receive flow (Video Post).
    - DM Encryption/Decryption flow (Node.js client).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 21:45:32 +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