Commit Graph
250 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 6f3d5b5fbb Fix CI linting failure in check-hex.js
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-10 02:24:33 +00:00
google-labs-jules[bot]andPR0M3TH3AN efdc4f3f50 feat(agent): Update load test script to use robust local relay
Updates `scripts/agent/load-test.mjs` to import `startRelay` from `./load-test-relay.mjs` which implements event eviction logic, preventing memory issues during extended load tests.
Includes a generated load report in the description (since artifacts are gitignored).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-09 19:30:43 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1569ce074f feat(perf): accelerate load test signing with WASM
Replaces pure JS `finalizeEvent` with `nostr-tools/wasm` implementation in `scripts/agent/load-test.mjs`.
This reduces signing time from ~6ms to ~1ms per event (5x-6x speedup), significantly increasing the event generation throughput capacity of the load test agent.

- Adds `nostr-wasm` to devDependencies.
- Updates `scripts/agent/load-test.mjs` to initialize and use WASM crypto.
- Adds `benchmarks/signing_benchmark.mjs` to verify performance gains.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-09 18:35:26 +00:00
google-labs-jules[bot]andPR0M3TH3AN 35f95434f7 feat: implement load test script and generate report
- Refined scripts/agent/load-test.mjs to generate detailed JSON reports including topHotFunctions and error details.
- Added pnpm-lock.yaml to lock dependencies for reproducible runs.
- Generated artifacts/load-report-20260208.json from a 60s load test run.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-08 19:18:51 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0f04245440 chore(ai): event schema validation tool + fixes
- Created `scripts/agent/validate-events.mjs` to validate event builders against schemas, covering standard and specific usage patterns.
- Updated `js/nostrEventSchemas.js` to include NIP-17 event types (`GIFT_WRAP`, `SEAL`, `CHAT_MESSAGE`) and their builders.
- Refactored `js/nostr/client.js` to use NIP-17 builders in `sendDirectMessage`, enabling runtime schema validation.
- Updated `docs/nostr-event-schemas.md` to document the new event types.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-08 05:09:54 +00:00
google-labs-jules[bot]andPR0M3TH3AN 67aa8ad2aa Optimize channel profile event lookup with author index
- Replaced `NostrClient.rawEvents` standard Map with `EventsMap`
- Implemented `EventsMap` to maintain an author-based index
- Updated `js/channelProfile.js` to use `getEventsByAuthor` for efficient lookup
- Added unit tests for `EventsMap`
- Added benchmark script verifying ~15x performance improvement (637ms -> 41ms for 1M events)

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-08 00:38:42 +00:00
thePR0M3TH3AN 22fcc97672 Merge pull request #2174 from PR0M3TH3AN/ai/smoke-tests-20260207-2355643236623905980
chore(ai): add smoke test script (agent)
2026-02-07 16:34:40 -05:00
thePR0M3TH3AN 5a3256afef Merge pull request #2173 from PR0M3TH3AN/ai/load-test-20260207-17226311979336768263
feat(agent): implement nostr relay load test script
2026-02-07 16:34:21 -05:00
thePR0M3TH3AN 446443167e Merge pull request #2157 from PR0M3TH3AN/ai/interop-tests-15938759699659615005
Add Nostr Protocol Interop Tests
2026-02-07 16:20:31 -05:00
google-labs-jules[bot]andPR0M3TH3AN 0f626c8ce7 chore(ai): add smoke test script (agent)
- Adds `scripts/agent/smoke-test.mjs` to verify key flows:
  - Local relay setup
  - Local HTTP server (npx serve)
  - `NostrClient` integration (Node.js)
  - Frontend UI verification (Playwright)
  - Login, Video Publish, DM Decryption
- Adds `test:smoke` script to `package.json`
- Generates reports in `artifacts/`

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-07 21:20:00 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5fa40e3750 feat(agent): implement nostr relay load test script
Implements a load testing script for Nostr relays that simulates multiple clients, generates mixed event traffic (View/Video), and measures performance metrics including latency, throughput, and CPU usage. It also includes strict safety guardrails to prevent accidental load testing against public relays.

Signed-off-by: Jules <[email protected]>

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-07 19:38:41 +00:00
thePR0M3TH3AN 4f13d49f66 Merge pull request #2156 from PR0M3TH3AN/telemetry-aggregator-update-15409738198546473637
Update telemetry aggregator to parse test_output.txt
2026-02-07 09:27:28 -05:00
google-labs-jules[bot]andPR0M3TH3AN e3d9ea7e3a feat: add interoperability test script for Nostr protocol verification
- Implements `scripts/agent/interop-test.mjs` to verify Video Post, View Event, and DM flows.
- Uses `NostrClient` with ephemeral keys and a local relay.
- Ensures correct event construction via `nostrEventSchemas.js`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-07 07:10:56 +00:00
google-labs-jules[bot]andPR0M3TH3AN c0251965da Update telemetry aggregator to include test_output.txt
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-07 06:06:59 +00:00
google-labs-jules[bot]andPR0M3TH3AN da7fc65e94 chore(ai): event schema validation tool + fixes
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-07 05:09:50 +00:00
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 eb4bc255d5 feat: add load-test script and fix lint exclusions
This adds `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/`.

Also updates linting scripts (`scripts/check-hex.js`, `scripts/check-design-tokens.mjs`, `scripts/check-inline-styles.mjs`, `scripts/check-tailwind-colors.mjs`) to correctly ignore working directories (`bitvid-working-webtorrent`, `scripts/agent`), preventing CI failures.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 19:16:13 +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
thePR0M3TH3AN 5a67774011 Merge pull request #2023 from PR0M3TH3AN/fix-webtorrent-webseed-regression-10274894627332192935
Fix WebTorrent webseed stream health check regression
2026-02-01 09:14:43 -05: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
thePR0M3TH3AN 31d1775d90 Merge pull request #2035 from PR0M3TH3AN/ai/ci-health-20241028-10335292326695405989
chore(ai): CI health fixes (flaky tests)
2026-02-01 08:01:04 -05:00
thePR0M3TH3AN 0d61f70e29 Merge pull request #2032 from PR0M3TH3AN/update-automated-pr-review-9225685126346343238
feat: improve automated PR review script reporting
2026-02-01 07:59:59 -05:00
google-labs-jules[bot]andPR0M3TH3AN 3511877ebe chore(ai): CI health fixes (flaky tests)
- Fix flaky test in `tests/hashtag-preferences.test.mjs` by defining missing `fetchCalls` variable.
- Fix `webtorrent` initialization error in `tests/unit/services/r2Service.storage-config.test.mjs` by ensuring `window.crypto` is available and `File` mock extends `Blob`.
- Update `tests/test-helpers/setup-localstorage.mjs` to polyfill `window.crypto` using `globalThis.crypto`.
- Update `scripts/run-unit-tests.mjs` to support test file filtering via command line arguments.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 02:10:21 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3a47b9123d fix(ci): optimize review script regex and add security guardrails
- Optimizes regex parsing for test failures by caching the output string.
- Adds explicit security guardrails to the PR review comment when sensitive files (Nostr, crypto, storage) are modified.
- Cleans up temporary debug files.
- Addresses previous code review feedback regarding completeness and safety.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-01 01:52:28 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3718e9a690 fix(ci): optimize regex parsing in PR review script
- Optimize regex execution loop by caching the test output string.
- Ensure `debug_regex.js` is removed.
- Verified local build and lint pass.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 23:24:56 +00:00
google-labs-jules[bot]andPR0M3TH3AN cb680737ef feat: improve automated PR review script reporting
- Parse `npm run test:unit` output to identify and list failing test files in the review comment.
- Add a suggestion to run `npm run lint:css -- --fix` if stylelint errors are detected.
- Maintain existing guardrails and micro-fix logic.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 23:14:44 +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
thePR0M3TH3AN 4fc101f7ce Merge branch 'unstable' into ai/changelog-20260131-14640726990701590988 2026-01-31 13:44:21 -05:00
google-labs-jules[bot]andPR0M3TH3AN 1243d45ebb fix(ai): ignore issues/ and scripts/agent/ in all linters
- Explicitly ignore `issues/` and `scripts/agent/` in `scripts/check-design-tokens.mjs` and `scripts/check-inline-styles.mjs`.
- This ensures CI passes even if documentation or diagnostic scripts contain elements that resemble lint violations (e.g. hex-like strings or bracket-like patterns), addressing persistent CI failures.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 18:44:10 +00:00
thePR0M3TH3AN 47fde8dd84 Merge branch 'unstable' into ai/schema-validate-20250226-13203498180481473459 2026-01-31 13:40:52 -05:00
google-labs-jules[bot]andPR0M3TH3AN 2b9dd59398 fix(ai): allow hex-like strings in security review issue
- Add issues/** and scripts/agent/** to check-hex.js ignore list
- This prevents CI lint failures when documentation or scripts contain hex-like strings (e.g. in URLs or comments) that are not CSS colors.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 18:35:30 +00: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 5fe938ef9f fix(ci): address failures in lint, login permissions, and unit tests
- Update `scripts/check-hex.js` to ignore `releases/` directory to prevent false positives from PR numbers.
- Update `js/nostr/client.js` to request full NIP-07 permissions (including encryption) during login, fixing `tests/nostr-login-permissions.test.mjs`.
- Update `tests/hashtag-preferences.test.mjs` to make the mock fetch function consistently return the event, allowing retry logic to be tested correctly.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 10:34:19 +00:00
google-labs-jules[bot]andPR0M3TH3AN be43c266e0 fix(test): resolve hangs in multiple unit tests and harden runner
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-31 10:33:50 +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
thePR0M3TH3AN 8a3e337e97 Merge pull request #1985 from PR0M3TH3AN/ai/fuzz-suite-20260130-14030343412094288093
Add fuzz testing suite for Nostr schemas, DM decryptor, and Magnet utils
2026-01-30 11:14:31 -05: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 93f78e60ee Merge pull request #1968 from PR0M3TH3AN/ai/reproducers-popover-video-20260129-656412173162674175
chore(ai): add minimal reproducers for known bugs
2026-01-30 11:07:07 -05:00
thePR0M3TH3AN 9392e08cbd Merge branch 'unstable' into ai/tests-improve-coverage-20250220-10675377090391221934 2026-01-30 09:27:07 -05:00