36 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 852bf51b0a refactor: extract CommentTargetNormalizer to fix file size violation
- Extracted `CommentTargetNormalizer` and related helpers to `js/nostr/commentTargetNormalizer.js`.
- Refactored `js/nostr/commentEvents.js` to import from the new module.
- Compacted helper functions in `js/nostr/commentTargetNormalizer.js` to ensure it stays under the 1000-line limit for new files.
- Verified with `npm run lint:file-size` and `tests/nostr/comment-events.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-12 13:49:47 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4d73092613 perf: bound comment relay concurrency and fix docs port
- Replace `Promise.all` with `pMap` in `js/nostr/commentEvents.js` to limit concurrent relay requests to `RELAY_BACKGROUND_CONCURRENCY` (3).
- Update `content/docs/guides/upload-content.md` to use port 3000 for CORS, matching `npm start` default.
- Update agent artifacts (`CONTEXT.md`, `TODO.md`, `DECISIONS.md`, `TEST_LOG.md`, `INITIAL_BASELINE.md`).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-12 13:39:52 +00:00
google-labs-jules[bot]andPR0M3TH3AN 78e53a8a1d refactor: simplify comment target normalization logic
Introduces `CommentTargetNormalizer` class to decompose the complex `normalizeCommentTarget` function into smaller, state-managed methods. This improves readability and maintainability without changing the external API or behavior.

- Extracted logic into `extractPointers`, `resolveEventsAndTags`, `extractInitialValues`, `enrichFromTags`, and `applyDefaults`.
- Preserved all fallback logic and tag parsing rules.
- Ensured strict string normalization in `extractInitialValues` to match original behavior.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-11 15:23:45 +00:00
thePR0M3TH3AN c3e986c9d3 Improve relay hygiene and count status 2026-01-29 09:58:35 -05: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
thePR0M3TH3AN cf9082b83f Add shared NIP-07 permission gate 2026-01-28 13:57:40 -05:00
google-labs-jules[bot] cf92269468 fix(tests): resolve unit test failures in comment-events.test.mjs
- Update `publishComment` to return standardized string error codes (e.g., `session-actor-publish-blocked`, `auth-required`) instead of raw Error objects, ensuring consistency with test expectations.
- Introduce `resolveActiveSigner` dependency injection in `publishComment` to allow tests to supply mock signers, resolving failures where `getActiveSigner()` returned null.
- Expose `commentCache` via `__testExports` in `js/nostr/commentEvents.js` and clear it in `tests/nostr/comment-events.test.mjs` via `afterEach` to prevent test state pollution.
- Update test assertions to match the standardized error codes.

This resolves CI failures related to mismatched error messages and shared state in comment event tests.
2026-01-23 17:05:02 +00:00
google-labs-jules[bot] 903f63c88f chore(ai): CI health fixes (flaky tests)
- Fix `tests/moderation-service.test.mjs` failing with `nostr-extension-missing` by injecting dependency.
- Fix circular dependency in `js/nostr/commentEvents.js` causing `tests/nip71-base-event-tags.test.mjs` to fail.
- Update `package-lock.json` via `npm audit fix`.
2026-01-19 03:02:23 +00:00
thePR0M3TH3AN 6aa64c4002 Require active signer for comment publishing 2026-01-18 11:17:29 -05:00
thePR0M3TH3AN 95bb462508 Serialize nostr signEvent requests 2026-01-18 10:58:19 -05:00
google-labs-jules[bot] 7743572a22 chore(ai): CI health fixes (flaky tests) 2026-01-18 02:39:42 +00:00
google-labs-jules[bot] b49a294dc0 feat: isolate view telemetry and restrict session actor publishing
- Add `isSessionActor` helper to `js/nostr/sessionActor.js` to identify ephemeral keys.
- Update `js/nostr/viewEvents.js` to namespace view deduplication caches by `actorPubkey` to prevent data leakage between sessions.
- Block comment publishing for session actors in `js/nostr/commentEvents.js`.
- Block watch history list publishing for session actors in `js/nostr/client.js`.
- Block user block list publishing for session actors in `js/userBlocks.js`.
- Block hashtag preference publishing for session actors in `js/services/hashtagPreferencesService.js`.
- Add inline documentation clarifying variable sources.
2026-01-17 22:48:31 +00:00
google-labs-jules[bot] 083f0c9ecc feat: implement shared LRU cache for video comments and reactions
- Added `js/utils/lruCache.js` with hit/miss tracking.
- Updated `js/nostr/cachePolicies.js` to set 5-minute TTL for comments/reactions.
- Integrated caching and incremental fetching in `js/nostr/commentEvents.js`.
- Implemented `listVideoReactions` in `js/nostr/reactionEvents.js` with caching logic.
2026-01-17 22:15:46 +00:00
google-labs-jules[bot] f3075b8929 Fix unit tests for comment events and improve target normalization logic
- Updated `subscribeVideoComments` test to expect `#A` filter keys (uppercase), matching the implementation and other tests.
- Improved `normalizeCommentTarget` in `js/nostr/commentEvents.js` to correctly derive `parentKind` and `parentAuthorPubkey` from the `parentCommentEvent` object if available.
- Enhanced `parentAuthorRelay` resolution to look up the specific `p` tag for the author pubkey instead of defaulting to the first found `p` tag.
- Updated `publishComment` test expectations to remove duplicate tags (implementation correctly deduplicates) and reflect improved metadata derivation (correct `K` tag and `P` relay).
- Added async wait to `subscribeVideoComments` test to prevent race condition in unsubscribe assertion.
2026-01-14 03:22:25 +00:00
thePR0M3TH3AN 5979d4e25f Use uppercase tags for comment events 2026-01-06 16:22:49 -05:00
thePR0M3TH3AN 8a111d8ee8 Handle lowercase root identifiers when fetching comments 2025-11-12 20:56:15 -05:00
thePR0M3TH3AN 6331896f6a Sanitize additional Nostr tags 2025-11-12 09:54:34 -05:00
thePR0M3TH3AN f60aae282b update 2025-11-06 15:37:17 -05:00
thePR0M3TH3AN 0c011f14b3 update 2025-11-06 13:57:38 -05:00
thePR0M3TH3AN 48de1a3c4e update 2025-11-05 16:41:16 -05:00
thePR0M3TH3AN cdb82e6e72 update 2025-11-05 16:17:56 -05:00
thePR0M3TH3AN 5aa1f8687b update 2025-11-05 15:20:14 -05:00
thePR0M3TH3AN e90f3770ef update 2025-11-05 11:12:38 -05:00
thePR0M3TH3AN c882139e90 Fix comment event matching for uppercase addresses 2025-11-04 16:52:12 -05:00
thePR0M3TH3AN 71df75a8d1 update 2025-11-04 15:19:34 -05:00
thePR0M3TH3AN a52e1e2a17 update 2025-11-03 22:07:49 -05:00
thePR0M3TH3AN 8ad7d82a70 update 2025-11-03 21:49:10 -05:00
thePR0M3TH3AN 86526bbe02 Fix top-level comment detection and add coverage 2025-10-30 21:00:38 -04:00
thePR0M3TH3AN 59161df063 Require active signer for comment publishing 2025-10-30 11:39:09 -04:00
thePR0M3TH3AN 28acf98cda Add uppercase comment filters and update validation logic 2025-10-29 15:38:08 -04:00
thePR0M3TH3AN 56b31f324e Improve comment metadata propagation 2025-10-29 15:24:10 -04:00
thePR0M3TH3AN eeee978134 Add NIP-22 metadata to video comment events 2025-10-29 14:38:59 -04:00
thePR0M3TH3AN 7dc59af49b Handle video-only comment targets 2025-10-29 12:09:04 -04:00
thePR0M3TH3AN 9908caafa8 Allow legacy comment targets without definition pointers 2025-10-29 11:36:52 -04:00
thePR0M3TH3AN d1d4fa150c Use kind 1111 comments with address-first tags 2025-10-29 07:45:34 -04:00
thePR0M3TH3AN 9717342bfe Add Nostr video comment helpers 2025-10-24 14:36:19 -04:00