Skip to content

pm-stack notifications Phase 2 step 3: edge answer intake + heartbeat drain (#8569) #13469

Open

Description

@dezren39

Phase 2 step 3 — edge answer intake (of #8569)

Parent: #8569. Design of record: doc/2026-11-17_design_pm8569_notifications_phase2.md §1 (heartbeat + answer drain), §2 (routes), §3 (answers while down). Steps 1 (relay skeleton + dead-man's switch) and 2 (event mirror) land first — the mirrored question state this step serves comes from step 2's mirror.

Scope

  • Edge: GET /answer/:ledgerId + POST /api/needs-drew/:ledgerId/answer on the pm-notify Worker, serving the question + full option list from DO state (parent design §5 answerable choices), authorized by the per-question answer token — the DO stores only the token's hash beside the mirrored question, expiring when the question is answered or withdrawn (design §4). Submitted answers are stored in the DO as pending, keyed by answer id: {ledgerId, optionId | freeText, answeredAt, answerTokenHash}.
  • Drain: the heartbeat response carries the pending-answer count (the field exists since step 1, always 0 until this step); the aggregator pulls pending answers (GET + ack by answer id) in the same contact, so a crash mid-drain re-offers the answer instead of losing it. The Phase-1 catcher remains the single writer to the pending-questions ledger — the edge path changes transport, never the place of record (invariant 1).
  • If the laptop is up, the Worker may also forward immediately through the existing tunnel ingress pattern (design §3 of the parent issue); the drain remains the correctness path.

Acceptance (Drew's terms, #8569)

  • Answer a needs-drew question from the push while the laptop is down → when the stack returns, the ledger shows it answered and the blocked task unblocks; nothing is lost or double-applied (answer ids dedupe the drain).
  • An answer submitted twice (double-tap, retry) is applied exactly once.
  • An expired/withdrawn question's answer page refuses the answer instead of storing it.

Tests name their oracles (repo testing doctrine) and run remotely per REMOTE BUILDS ONLY.

Out of scope

  • Cron narrowing (step 4); any change to the catcher's application of answers.

Filed by lane felix from #8569's step-1 pass, 2026-11-23. Filed without a pilot packet: the shortlist is operator-managed, and chained packets for #8569's steps are cut by the queue operator (same recorded pattern as #13342).

Activity

  1. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
  2. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    Contributor

    Triage verdict (ITEM-WORK-58, task 22321, 2026-11-24): not resolved — implementation not started; gated on step 2.

    Fresh state: this issue is open with no implementation PR. The chain state today: step 1 (edge relay + dead-man's switch) landed via #13518 (closed); step 2 (event mirror to the pm-notify DO, #13468) is still open with no PR yet — its own triage today routed it as a scoped follow-on. This step's scope serves the mirrored question state from step 2's mirror, so step 3 cannot start until #13468 lands.

    Routing: the step-3 implementation is filed as a scoped feature_slice queue packet, structurally dep-blocked on #13468 with dep-recheck enabled; its wake protocol routes the build (edge GET /answer/:ledgerId + POST /api/needs-drew/:ledgerId/answer on the pm-notify Worker, DO pending-answer store keyed by answer id, heartbeat drain with ack-by-id) once the mirror lands. Acceptance stays Drew's terms as written in the issue body (answer while the laptop is down applied exactly once on drain; double-submit deduped by answer id; expired/withdrawn questions refuse).

    Issue stays open. Tracking: #14158.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions