4 Commits
Author SHA1 Message Date
thePR0M3TH3ANandClaude Opus 4.8 3d4b07d78d chore(lint): track commentThreadService in pool-access allowlist
commentThreadService.js uses direct pool.list/ensurePool and was never added to
the migration allowlist, so lint:pool-access (part of `npm run lint`) had been
red on it since before this branch's refactors. Add it as a tracked migration
target — route through subscriptionManager when next touched.

With this, `npm run lint` is fully green (all sub-checks pass).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-19 17:03:00 -04:00
thePR0M3TH3ANandClaude Opus 4.8 a48d79fcad chore(lint): track relocated signer handshake in pool-access allowlist
js/nostr/signerRemoteHandshake.js inherited SignerManager's existing pool.sub
usage during the file-size decomposition (commit 56d04cd6). Add it to the
direct-pool-access migration allowlist so the relocation is net-neutral — this
takes lint:pool-access from 2 ungrandfathered violations down to 1.

Pre-existing (NOT from this work): js/services/commentThreadService.js still uses
direct pool access and was never allowlisted; lint:pool-access has been red on it
since before this branch's refactors. Route it (and this file) through
subscriptionManager when next touched.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-19 16:57:42 -04:00
thePR0M3TH3ANandClaude Opus 4.8 b0c00ebc99 fix(lint): catch bare pool.sub/list calls in chokepoint guard (KNOWN_BUG #3)
The guard only matched member access (.pool.sub); bare local-variable calls
(pool.sub/pool.list) slipped through. Broadened the regex and re-baselined the
allowlist — true scope is 22 files (10 were hidden), e.g. viewEvents.js,
relayBatchFetcher.js, watchHistory.js, commentEvents.js. The L1 chokepoint is
now actually enforced; the allowlist only shrinks as P4 migrates subsystems.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-14 15:57:34 -04:00
thePR0M3TH3ANandClaude Opus 4.8 1fb6b86b7f feat(relay): add SubscriptionManager (L1) + direct-pool-access lint guard
P1 foundation of the data-flow refactor (docs/architecture-refactor.md):

- js/nostr/subscriptionManager.js: the single chokepoint for relay reads.
  Builds on relaySubscriptionService (dedup by key) and adds: health-gated
  default relays, deduped one-shot list() with timeout, and a reconnect
  registry that re-issues active subs centrally (instead of every subsystem
  re-subscribing on reconnect — the storm amplifier). Callers pass batched
  filters (one REQ for many ids), never per-item.
- Export RelaySubscriptionService class for test isolation.
- scripts/check-direct-pool-access.mjs + lint:pool-access: fail on NEW direct
  pool.sub/list usage; 12 grandfathered files listed as migration targets
  (allowlist may only shrink).

Nothing rewired yet — additive. Pilot (video feed) and per-subsystem
migration follow. Cheat-resistant tests included.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-14 10:11:43 -04:00