- 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]>
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]>
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]>
- 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]>
- 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]>
- 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]>
- 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]>
- 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]>
- 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]>
- 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]>
- 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]>
- Add `audit` script to `package.json` to run `scripts/daily-design-system-audit.mjs`.
- Update `lint:css` to include `css/docs.css` for better coverage.
- Improve `scripts/daily-design-system-audit.mjs` parsing logic for Hex and CSS violations to better handle output formats.
- Generate `REMEDIATION_REPORT.md` with current audit results (No violations).
Co-authored-by: PR0M3TH3AN <[email protected]>
- 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]>
- 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]>
- 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]>
- 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]>
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]>
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]>
- 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]>
- 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]>