Commit Graph
235 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 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
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
thePR0M3TH3AN 646de9014b Merge pull request #1960 from PR0M3TH3AN/ai/ci-health-20250221-16879002849481713
chore(ai): CI health fixes (flaky tests)
2026-01-30 09:16:57 -05:00
thePR0M3TH3AN 36e724a9de Merge pull request #1956 from PR0M3TH3AN/refactor-automated-pr-review-12750616021674214922
feat: enhance automated PR review script with batch processing
2026-01-30 09:15:04 -05:00
google-labs-jules[bot]andPR0M3TH3AN 3055c9c4fb chore(ai): fix unit tests and build script for reproducers
- Fixed `tests/app-batch-fetch-profiles.test.mjs` by mocking `readRelays`.
- Updated `scripts/build-dist.mjs` to exclude `examples/reproducers` from the build output.
- Added minimal reproducers for popover flip bug and VideoCard block action bug.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 12:41:28 +00:00
google-labs-jules[bot]andPR0M3TH3AN 044d5629be fix(ci): improve build script logging for deployment debugging
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 12:04:24 +00:00
google-labs-jules[bot]andPR0M3TH3AN 113b0a2b72 fix(ci): harden build script and update test mocks
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 11:59:18 +00: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 952dc58ade chore(ai): CI health fixes (flaky tests)
- Fix `tests/app-batch-fetch-profiles.test.mjs` by mocking `readRelays` to ensure deterministic query counts.
- Set `NODE_ENV=test` in `scripts/run-unit-tests.mjs` to prevent `nostr-tools` bootstrap failures in test environment.
- Run `npm ci` and `npm audit fix` to maintain lockfile health.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 02:28:50 +00:00
google-labs-jules[bot]andPR0M3TH3AN b594a87ef2 fix(build): fail build if critical files are missing in dist
- Updates `scripts/build-dist.mjs` to exit with error code 1 if source files like `_redirects` or `_headers` are missing.
- Prevents silent failures where `dist` directory is incomplete, potentially causing Netlify deployment checks to fail ambiguously.
- Ensures `build:css` failure also terminates the build process explicitly.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-30 00:05:09 +00:00
google-labs-jules[bot]andPR0M3TH3AN de7fceb8e2 feat: enhance automated PR review script with batch processing and refactoring
- Refactored `scripts/automated-pr-review.mjs` to separate review logic into `reviewPR` function.
- Added `--all` flag to support iterating over all open PRs using `gh` CLI.
- Updated commit message for micro-fixes to `fix(ai): formatting (agent) suggested`.
- Improved error handling and context management (e.g., passing `baseRef`).

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