GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — aggregator(alerts): runAlertTick marks incidents delivered when every push send failed — critical incidents are silently lost, never retried · Issue #3685 · developing-today/code

aggregator(alerts): runAlertTick marks incidents delivered when every push send failed — critical incidents are silently lost, never retried #3685

New issue
Copy link
New issue
Copy link
Closed
#3690
Closed
aggregator(alerts): runAlertTick marks incidents delivered when every push send failed — critical incidents are silently lost, never retried#3685
#3690
Copy link
Labels
app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitivesource/creatorFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Nov 1, 2026
Issue body actions

Problem

pm-stack/aggregator/src/alerts.ts — the alert throat engine from #3676 — marks a critical incident delivered even when every push send failed. runAlertTick (alerts.ts:490-503) discards the delivery outcome:

const summary = await deliverToAll(store, targets, incident, cfg.publicOrigin, false);
await store.markDelivered(incident.id, { ...summary });

It calls markDelivered unconditionally. deliverToAll (alerts.ts:439-471) counts per-subscription outcomes in the summary (sent / gone / errors), but nothing checks them. markDelivered sets delivered_at, and pendingDeliveries only selects delivered_at is null — so an incident whose sends all errored is never retried. Worse, pendingEscalations keys off delivered_at is not null, so after the ack window the same incident gets "escalated" — and markEscalated is called just as unconditionally (alerts.ts:499-502), burning the one escalation on sends that may also all fail. The ledger then records a delivered (and escalated) event for a notification nobody ever received.

The systemic case is not exotic: sendPush (src/push.ts:44-47) returns { ok: false, gone: false, error: "VAPID private key unavailable (bws)" } for every subscription when the VAPID key cannot be resolved (bws outage, rotation, sandbox env). One bad tick during such a window permanently swallows every pending critical incident — for the breakthrough class whose entire design premise (#3676, design #3450) is that it "delivers immediately, quiet hours or not, because the sentinels are external to the thing that might be down."

Evidence (verified this run)

Probe on the laptop with the real alerts.ts + push.ts at main 9be9c229 (sha256-matched in both clones: alerts.ts 868f4c78…, push.ts 34745ee0…; probe dir ~/git/fleet/probe-2026-11-01-laneB-alerttick/, log probe.log). A fake in-memory store (recorders only — the SQL layer is not under test) returns one incident-class subscription with an unreachable endpoint and one open critical incident; the real sendPush chain runs:

  • logSend outcomes: ["error"] — the only send failed (not gone, not sent)
  • store calls: markDelivered {"subscriptions":1,"sent":0,"gone":0,"errors":1} — markDelivered was still called with sent: 0
  • Result line: sent=false markDeliveredCalled=true

Coverage gap that let this ship: test/alerts.test.ts pins only the pure helpers (its header says so); runAlertTick / deliverToAll have no tests at all.

Why it matters

  • A transient push-path failure (VAPID/bws blip, push-service 5xx, network) converts a retryable delivery into a permanent, silent loss of a critical incident notification — the exact failure the alert throat exists to prevent.
  • The ledger lies: delivered / escalated events and delivered_at / escalated_at timestamps assert delivery that never happened, so the /alerts page and any later audit show the incident as notified.
  • Duplicate posts of the same incident are then treated as duplicate_suppressed (because delivered_at is set) even though no delivery ever succeeded.

Acceptance criteria

  • An incident is marked delivered only when at least one subscription send succeeded (sent >= 1); when every send errors, delivered_at stays null and the next tick retries it. (Sends that return gone prune/mark the subscription per the existing §4 rule and do not count as success.)
  • The symmetric rule for escalation: markEscalated only after at least one successful escalation send; otherwise the escalation stays pending and is retried.
  • The delivered / escalated event detail records the summary as today, and a tick where all sends fail leaves an observable trace (event or log) naming the failed delivery attempt and its error count.
  • Regression tests drive runAlertTick with a stub store and a failing push path: all-error tick → no markDelivered; a later all-error→success sequence → delivered exactly once. (This needs the push sender injectable or an equivalent seam — the pure-helper-only test pattern in test/alerts.test.ts cannot reach the engine today.)
  • Existing alerts.test.ts tests still pass; behaviour with zero subscriptions is unchanged (incident stays undelivered, per the current documented design).

Distinct from: #3681 (chargesAttention validation in the confirm-charges script — different module, different path), #3676 (the feature build this bug ships in), #3450 (design).

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    source/creatorFiled by the new-issue-creator job
    priority/highImportant and time-sensitive
    queue/queuedHas a queued queue task
    effort/sSmall: expected under 2 hours of work
    on Nov 1, 2026
  2. developing-today commented on Nov 1, 2026

    @developing-today
    developing-todayBot
    on Nov 1, 2026 – with developing.today
    Contributor
    More actions

    CODE-1501

  3. dezren39
    added
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 1, 2026
  4. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator-code-b
    • Session / ID: new-issue-creator-code-b cron run 2026-11-01 06:50 CST
    • Found via: filed this run
    • Task: Filed this issue: aggregator(alerts) runAlertTick marks incidents delivered when every push send failed — critical incidents are silently lost, never retried
    • Expectation: s; done when the acceptance criteria in the issue body are met and pinned by tests where the criteria require them.
    • Links: Issue aggregator(alerts): runAlertTick marks incidents delivered when every push send failed — critical incidents are silently lost, never retried #3685 aggregator(alerts): runAlertTick marks incidents delivered when every push send failed — critical incidents are silently lost, never retried #3685
  5. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · triage verdict — CONFIRMED on current main

    • Agent: queue worker (repo-worker-code), Lane E shift
    • Session / ID: queue task 5583 (triage)
    • Verdict: CONFIRMED at main 9be9c2298c51368f8eacaacd2f50bfe2b627ba99, independently of the creator's probe. In pm-stack/aggregator/src/alerts.ts, runAlertTick (lines ~490-503) calls store.markDelivered(incident.id, {...summary}) and store.markEscalated(...) unconditionally after deliverToAll — the DeliverySummary ({subscriptions, sent, gone, errors}, alerts.ts:432) is recorded but never consulted, so an all-error tick (sent=0, errors>0) still sets delivered_at/escalated_at, pendingDeliveries never retries the incident, and a later escalation burns off the fake delivered_at. The all-error path is reachable today: push.ts sendPush returns {ok:false, gone:false, error:"VAPID private key unavailable (bws)"} for every subscription when the VAPID key cannot be resolved. The tick's own doc comment says the guards are "set only after the sends complete" — the intent was completion of the sends, and success was never checked. markEscalated has the identical flaw. No existing test covers runAlertTick/markDelivered (no matches in test/alerts.test.ts).
    • Routing: fix enqueued as a small_fix packet under dedupe repo-health:v1:fix:developing-today/code:issue:3685 with the issue's acceptance criteria (mark delivered/escalated only when sent>=1; all-error ticks leave an observable trace and stay pending for retry; engine tests driving runAlertTick with a stub store + failing push seam; zero-subscription behaviour unchanged).
  6. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), OpenChamber scheduled lane
    • Session / ID: queue task 5590 (small_fix)
    • Found via: queue claim
    • Task: Fix aggregator(alerts): runAlertTick marks incidents delivered when every push send failed — critical incidents are silently lost, never retried #3685 so delivery/escalation marks are gated on at least one successful push, with runAlertTick retry tests.
    • Links: aggregator(alerts): runAlertTick marks incidents delivered when every push send failed — critical incidents are silently lost, never retried #3685
  7. dezren39
    added
    work/assignedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 1, 2026
  8. 7 remaining items

  9. dezren39
    added
    status/parkedDeliberately paused with a recorded resume condition
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    status:in-review
    on Nov 1, 2026
  10. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane B shift
    • Session / ID: queue task 5590 (resumed — PR already open from prior work on this task)
    • Found via: queue claim
    • Task: Verify PR fix(aggregator): retry failed incident pushes (#3685) #3690 (gates markDelivered/markEscalated on sent>=1 for aggregator(alerts): runAlertTick marks incidents delivered when every push send failed — critical incidents are silently lost, never retried #3685), disposition Codex findings, merge when verified
    • Expectation: effort s; done = PR merged, issue closed, task completed
    • Links: PR fix(aggregator): retry failed incident pushes (#3685) #3690 · branch queue/5590-3685-alert-delivery-success-gate
  11. dezren39
    added a commit that references this issue on Nov 1, 2026

    Merge pull request #3690 from developing-today/queue/5590-3685-alert-…

    a3acf3b
  12. dezren39
    closed this as completedin #3690on Nov 1, 2026
  13. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane B shift
    • Session / ID: queue task 5590
    • Found via: queue claim (resumed at awaiting_ci)
    • Task: PR fix(aggregator): retry failed incident pushes (#3685) #3690 merged (merge commit a3acf3b); this issue closed by the merge. Fresh verification: laptop bun test test/alerts.test.ts 16/16 pass; Codex P2 dispositioned on its PR thread and filed as follow-up aggregator(alerts): persistently failing incidents can monopolize the oldest-20 pending delivery/escalation batch #3701 (AlertsStore SQL was out of this packet's scope).
    • Expectation: done
    • Links: PR fix(aggregator): retry failed incident pushes (#3685) #3690 · follow-up aggregator(alerts): persistently failing incidents can monopolize the oldest-20 pending delivery/escalation batch #3701
  14. dezren39
    removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    on Nov 1, 2026
  15. developing-today
    added
    status:done
    on Nov 1, 2026
  16. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · cited as the landed embodiment of Rule 1 of design #3702

    • Agent: design architect (repo-design-architect-code), pass 32
    • Task: Design Design: delivered means delivered — one truth contract for the aggregator alert throat #3702 (alert-throat truth contract, filed today) records this issue's rule — delivered/escalated only when at least one send succeeded — as Rule 1 of the contract. This issue landed via PR fix(aggregator): retry failed incident pushes (#3685) #3690 during the design's audit, so it is cited as the embodiment, not adopted as a phase (the id(web): detectLanguage returns Object.prototype members as languages — plain-object lookups on EXT_TO_LANG/FILENAME_TO_LANG trust arbitrary filenames ('notes.constructor' returns the Object constructor, '__proto__' returns a prototype object) #2787/meta-exporter: parseSubscriptionQuota's num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' used value exports as a measured 0% window #2789 precedent). No action needed here.
    • Outcome: Design: delivered means delivered — one truth contract for the aggregator alert throat #3702's Phase 3 audit (Phase 3 (audit) of #3702 — alert-throat contract statement, seam check + dispositions #3703) will verify Rule 1 as-built (sent>=1 gate, PushSender seam, all-failed warning) as part of its closing evidence.
    • Links: Design: delivered means delivered — one truth contract for the aggregator alert throat #3702, Phase 3 (audit) of #3702 — alert-throat contract statement, seam check + dispositions #3703, aggregator(alerts): GET /api/push/subscriptions returns every subscription's p256dh + auth secret — unauthenticated, unused by any client, and the /alerts page for the same data redacts them #3693, aggregator(alerts): mergeQuiet accepts out-of-range times (99:99, 24:60) — a malformed quiet window is silently reinterpreted instead of falling back to the default #3686
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitivesource/creatorFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.