GeezerVison is showing github.com — pm-aggregator: subscription class backfill from #8568 gap 1 never landed (audit of PR #8597) · Issue #13940 · developing-today/code
pm-aggregator: subscription class backfill from #8568 gap 1 never landed (audit of PR #8597) #13940DescriptionGap found by AUDIT-7 Lane 4 (batch 5/14, tracking #13879)
Issue #8568 (pm-stack notifications Phase 1) lists four gaps that kept Drew from receiving pushes. Gap 1: Drew's subscription (2026-11-01) predates the notification classes, so NOTIFICATION_CLASS_DEFAULTS turns needs-drew / quota-wall / quota-near-wall / stack-health / blocked-age ON for new rows, but classEnabled() preserves old rows — for his only subscription every class except incident is effectively OFF, and candidates are filtered out every tick.
Phase 1 landed in two halves: PR #8597 (aggregator half: needs-drew store, stack sentinel, answer endpoint/page) and PR #8598 (fleet-queue half: block-path emission into the throat). Neither half implements the subscription class backfill, and no later merged PR references #8568 for it (checked via search: only #8597, #8598, #11289, #8767, #11241 mention #8568).
Work (from #8568)
- Subscription class backfill: subscriptions created before a class existed get the reviewed defaults for that class (or a one-tap "apply reviewed defaults" on
/alerts/preferences). Drew's existing phone subscription must end with needs-drew + quota-wall + stack-health ON without re-subscribing.
Why it matters
Without this, the Phase 1 acceptance (a needs-drew / stack-health / quota-wall push reaching Drew's phone) cannot hold for his existing subscription even though the producers now exist.
Links
Activitydeveloping-today commented on Nov 24, 2026 dezren39 commented on Nov 24, 2026 Triage verdict (coverage reconciliation pass 2, tracking #14158; task 22465, lane code-f):
State (fresh pull 2026-11-24): OPEN, bot comment only, no linked PRs. Spawner #8568 CLOSED with the backfill still missing from both Phase-1 halves; audited PR #8597 MERGED (labelled audit:gap-filed).
Code check: gap 1 is live in main. classEnabled() (pm-stack/aggregator/src/alerts.ts) preserves old rows (sub.classes?.[cls] ?? cls === 'incident'); mergeClasses applies the 8 reviewed defaults from NOTIFICATION_CLASS_DEFAULTS (notifications.ts) only at creation. No backfill migration and no apply-defaults affordance exist — the /alerts/preferences route (server.ts ~5157) only reads stored subscriptions. Pre-class rows, including Drew's 2026-11-01 subscription, have every class except incident OFF.
Routed: follow-on small_fix packet enqueued as task 23266 (queue repo-health-code-pilot): backfill reviewed defaults onto pre-class subscriptions and/or one-tap apply-reviewed-defaults on /alerts/preferences, with a regression test on a pre-class-shaped row ending needs-drew + quota-wall + stack-health ON without re-subscribing. Fix location and existing tests (alerts.test.ts, notification-preferences-3318.test.ts) pinned in the packet. developing-today-fleet commented on Nov 24, 2026 Fix record (queue task 23266, lane ITEM-WORK-157):
PR: #14385 — open against main, head 81470cabcd2, no closing keywords (the merge will not close this issue; it closes from this record).
The change — classEnabled in pm-stack/aggregator/src/alerts.ts: a stored choice always wins, including an explicit opt-out; a class with no stored choice now takes its reviewed default from NOTIFICATION_CLASS_DEFAULTS instead of reading as off-unless-incident; a class with no reviewed default stays off. Because upserts touch only the keys the caller sent (#7193), an absent key means the class is newer than the row, so the fallback is exactly the backfill: pre-class subscriptions — including the 2026-11-01 subscription — end with needs-drew + quota-wall + stack-health ON on deploy, with no migration and no re-subscribing. New-row behavior is unchanged (mergeClasses at creation). The prompt-notify.ts header comment and the PM book tutorial trace-a-push.md both stated the old rule and are updated in the same PR.
Tests
- Failing-first regression (
test/alerts.test.ts): a pre-class-shaped row ({ incident: true }) ends needs-drew + quota-wall + stack-health ON; explicit opt-outs preserved; unknown class stays off. Against the old code the targeted run was 78 pass / 1 fail (this test); post-fix the three affected files' key tests all pass, including inside the full run.
- Full suite (
bun test, pm-stack/aggregator): 3353 pass / 22 fail / 2 errors, 3375 tests across 293 files. Every named failure was reproduced identically on a pristine origin/main control worktree in the same environment (board-cache-5082 ×5, source-gate-1195 ×1, collect-fleet-feed-args-3509 ×2 — server-booting tests colliding with the live aggregator's ports, and collector subprocess tests exceeding their 60 s budget while the host runs a Nix garbage collection). None touches the alerts engine.
- Typecheck (
bunx tsc --noEmit): no errors in the touched files.
Test route: the suite ran with bun in the laptop worktree — a fleet Actions exec session cannot clone this repo (no cross-repo credentials in the runner) and this repo's CI runs on main only, so the laptop run plus the pristine-main control is the verification of record.
Ready for merge from this record. developing-today-fleet commented on Nov 26, 2026 Triage verdict (oc-code-01, 2026-11-26): resolved in substance. Fresh evidence: PR #14385 is MERGED (2026-11-24, merge commit 1e80e51) and implements the exact backfill gap: absent stored choices now use reviewed NOTIFICATION_CLASS_DEFAULTS, preserving explicit opt-outs and leaving unknown classes off; regression coverage includes a pre-class subscription row. Closing this tracking issue as implemented. developing-today-fleet commented on Nov 26, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|