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]>
- Updated playwright and @playwright/test to 1.58.2.
- Updated dependency tracking issues for nostr-tools, stylelint, and esbuild.
- Included dependency scan artifacts in description.
Co-authored-by: PR0M3TH3AN <[email protected]>
- 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]>
- Added `scripts/agent/telemetry-aggregator.mjs` to aggregate error logs while stripping PII.
- Updated `AGENTS.md` with telemetry policy.
- Cleaned up `package.json` dev dependencies.
- Fixed `tests/nostr-login-permissions.test.mjs` by updating `js/nostr/client.js` to request all encryption permissions during login.
- Fixed `tests/hashtag-preferences.test.mjs` by clearing `nostrClient.extensionPermissionCache` in test setup to prevent state leakage.
Co-authored-by: PR0M3TH3AN <[email protected]>
Updated `loginWithExtension` to request `DEFAULT_NIP07_PERMISSION_METHODS` instead of `DEFAULT_NIP07_CORE_METHODS`. This ensures encryption permissions (NIP-04/44) are requested upfront and cached, preventing permission errors or unexpected popups during subsequent operations like DM decryption or preference loading.
Also includes artifacts from TODO triage:
- `artifacts/todos.txt`: Scanned TODOs list.
- `artifacts/issue_moderation_tests.md`: Issue report for moderation test TODOs.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Excluded `*.map` and `*.min.js` files from the `todos.txt` generation command to prevent massive minified lines from crashing CI scripts.
- Mocked `nostrClient.readRelays` in `tests/app-batch-fetch-profiles.test.mjs` to fix assertion errors caused by duplicate network calls.
- Regenerated `artifacts/todos.txt` with the clean output.
Co-authored-by: PR0M3TH3AN <[email protected]>
Scanned the codebase for TODO/FIXME markers.
Generated artifacts/todos.txt.
Verified that identified TODOs in tests/visual/moderation.spec.ts are tracked in issues/todo-moderation-tests.md.
No new issues or PRs required as no other actionable TODOs were found.
Co-authored-by: PR0M3TH3AN <[email protected]>
Removed unused exports and functions identified as dead code.
- Removed unused exports from `js/utils/storage.js`, `js/utils/storagePointer.js`, `js/utils/videoTags.js`, `js/ui/moderationCopy.js`.
- Removed unused function `updateTagPillStrip` from `js/ui/components/tagPillList.js` and associated tests.
- Updated `tests/utils/video-tags.test.mjs` to remove test for private function.
- Added `artifacts/depcheck.json` showing dependency analysis.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Generate `artifacts/npm-audit.json` and `artifacts/npm-outdated.json`.
- Document required major upgrades in `issues/upgrade-*.md`.
- Fix ReferenceError in `tests/nostr-login-permissions.test.mjs` exposed during verification.
- Note: `cross-env` upgrade reverted as it is a major version bump requiring separate review.
- Note: `nostr-tools` upgrade skipped per security policy.
Co-authored-by: PR0M3TH3AN <[email protected]>
Scanned the repository for TODO/FIXME/XXX comments.
Identified known flaky test TODOs in tests/visual/moderation.spec.ts, which are already tracked in issues/todo-moderation-tests.md.
No other actionable TODOs found in JS/TS sources.
Generated artifacts/todos.txt as a triage report.
Co-authored-by: PR0M3TH3AN <[email protected]>
- executed scripts/agent/telemetry-aggregator.mjs with ENABLE_TELEMETRY=true
- collected failure logs from unit tests (test_unit_*.log)
- generated privacy-preserving report ai/reports/telemetry-20260128.md
- generated aggregated artifacts/error-aggregates.json
- force-added reports as they are gitignored by default
This report identifies 6 unique issues primarily owned by the QA Team based on unit test failures.
Co-authored-by: PR0M3TH3AN <[email protected]>
Scanned the repository for TODO/FIXME/XXX comments.
Found no trivial fixes in source code.
Identified flaky tests in `tests/visual/moderation.spec.ts` requiring investigation.
Generated `artifacts/todos.txt` and `artifacts/issues_to_create.md`.
Co-authored-by: PR0M3TH3AN <[email protected]>
- 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]>
- Scanned repo for TODO/FIXME/XXX.
- Found no trivial TODOs in JS sources.
- Found non-trivial TODOs in `tests/visual/moderation.spec.ts` related to headless test environment issues.
- Generated `artifacts/todos.txt` with the findings (filtering out false positives).
- Generated `artifacts/issues.md` with issue drafts for the identified non-trivial TODOs.
- Upgraded @playwright/test and playwright to ^1.58.0
- Generated dependency scan artifacts (npm-audit, npm-outdated)
- Documented issues for nostr-tools version mismatch and webtorrent upgrade
- Generated `artifacts/todos.txt` with relevant TODOs found in the codebase.
- Verified that no trivial JS source TODOs exist (one false positive in `profileModalController.js`).
- Identified flaky test TODOs in `tests/visual/moderation.spec.ts`.
- 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.
- 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.
- Perform `npm audit` and `npm outdated` (artifacts included).
- Update `prettier` to 3.8.1 (safe devDependency upgrade).
- Remove accidentally committed/leftover session file `js/ui/dm/jules_session_4520373547615093905.zip` which caused lint errors.
- Pre-existing lint error in `js/ui/components/VideoCard.js` and test failure in `tests/app/moderation-overrides.test.mjs` were identified and verified as unrelated.
- generated `artifacts/npm-audit.json`
- generated `artifacts/npm-outdated.json`
- no safe minor/patch upgrades available (all outdated deps are major or risky)