Four findings closed:
CRITICAL: inactive rail — remove seven-day horizon and forcedUnreadMap
fallback from fetchCommunityUnread. Override state is exempt from finite-
horizon fetching. Authoritative sources are now (a) readStoredReadState
overrideRegisters (persisted full-state projection) and (b) coordinate-
deduped fetched events merged via max() per field. The stale-cache fallback
that produced false positives and false negatives on old/tombstoned registers
is removed; the observer test is updated to match the new authoritative model.
IMPORTANT: restore divider suppression — markChannelUnread returns boolean;
applyMarkUnreadDividerOverlay (extracted pure helper in useChannelUnreadState)
gates forcedUnreadRef.add() on success. handleMarkUnread calls this helper
instead of the old unconditional/void path. AppShellContext default updated.
IMPORTANT: explicit read always attempts C-bump (NIP-RS:537-539) —
applyOverrideRead step logic reordered: !isReadStateReady fails closed;
liveness===null (ready, no register) = known absence, cleared; register
exists → always call markChannelRead regardless of active/inactive, then
inspect resulting liveness. isReadStateReady in OverrideAPIs distinguishes
manager-unavailable (fail closed) from known-no-register (cleared).
IMPORTANT: hook witnesses drive production code — applyOverrideRead tests
replaced with seven new tests using makeApis() reflecting the new semantics;
two new applyMarkUnreadDividerOverlay tests exercise the extracted production
transition (success adds to overlay, refusal does not).
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>