GeezerVison is showing github.com — impl(pm-stack): break-glass — outage queueing + local owner token CLI (#1253 split 6) · Issue #9608 · developing-today/code
impl(pm-stack): break-glass — outage queueing + local owner token CLI (#1253 split 6) #9608DescriptionImplementation split 6 of 6 from the #1253 design record (doc/2026-11-10T23-58-00Z_design_pm_stack_identity, section 6, merged in PR #8351).
Scope: Break-glass: outage queueing + the local owner token CLI.
Acceptance: during an entry/IdP outage, reads keep working from last-known state; eligible writes queue stamped provenance: outage-queued and are held out of verified-authorship surfaces until identity is confirmed by a fresh login; the owner can issue a single-use, at-most-1-hour admin stack token from the laptop via the aggregator's local CLI, with the issuance itself written as an audit event before the token works. Asserted authorship as a fallback mode does not exist; anything else fails closed.
Gate: the comment-surface part is gated on Drew's answer to design question 4 (queue-and-confirm for comments vs fail closed) — see #1253.
Parent: #1253 · Epic: #1184 Activitydezren39 commented on Nov 14, 2026
Picked up by repo-worker-code-a — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-a posts progress markers; after 30 minutes of silence any other worker may pick this up.) dezren39 commented on Nov 14, 2026
Released by repo-worker-code-a (outcome: free). Revalidated open, no hard-stop labels; design merged in PR #8351 (section 6). Released free untouched: implementation (break-glass outage queueing + local owner token CLI) is laptop worktree work; laptop transport down tonight (agent proxy closed; queue health fallback:true). First laptop-up lane implements per acceptance on #9608. dezren39 commented on Nov 14, 2026
Picked up by repo-worker-code-b — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-b posts progress markers; after 30 minutes of silence any other worker may pick this up.) dezren39 commented on Nov 23, 2026 Lane felix starting the remaining #9608 slice: outage queueing for eligible non-comment writes (design #1253 §6). The owner token CLI (PR #12941) and its server-side consumption wiring (PR #13009) are already merged; the comment surface stays untouched per the #1253 question-4 gate. Working in a fresh worktree off origin/main; tests will run via remote dispatch. dezren39 commented on Nov 23, 2026 🤖 Agent note · picked up — lane felix, outage-queueing slice
Done check against origin/main (cafdfdc): the owner token CLI (PR #12941) and the server-side consumption wiring (PR #13009) are merged and verified present. The remaining slice is outage queueing; the comment surface stays untouched per the #1253 question-4 gate. Reads-from-last-known-state already holds by the stack's local-first construction (the aggregator serves its local stores; an entry outage does not stop local reads) — no code needed for that leg.
Design for this slice, following design §6 exactly (oracle: doc/2026-11-10T23-58-00Z_design_pm_stack_identity §6):
- New
src/outage-queue.ts: a file-backed OutageQueueStore (fresh disk reads, serialized mutations, atomic persist — the break-glass store pattern). Queued writes live ONLY here; they never enter the actions store, so consumer polls (GET /api/actions.json?state=new) and every verified-authorship surface never see them.
- Queueing engages in
POST /api/actions (and per-item in /api/actions/batch) only when ALL hold: Access is configured and verification failed with 401 (a 403 contradictory-claim denial is a verified identity contradicting the claim — not an outage — and never queues); the request arrived from a stack-local address (loopback / tailnet CGNAT / private — the aggregator's only listeners; anything else fails closed with today's 401); and the write is eligible.
- Eligible = dashboard action writes whose author kind a fresh Access login can derive (
drew or agent) — except the four preference view verbs the aggregator applies synchronously itself (save-view / rename-view / delete-view / set-default-view), which fail closed: a queue cannot honour their applied-in-request contract. Comments are NOT queued (question-4 gate). A queued write is stamped provenance: outage-queued with the claimed author kept as a claim, an outage-write-queued audit event is written before the record persists (audit failure ⇒ nothing queues), and the response is 202 {queued: true, provenance: "outage-queued", queue: <record>}. clientToken dedupe mirrors the actions store.
- Confirmation:
POST /api/actions/outage-queue/confirm {id} requires a fresh verified login (the enforcer must succeed with verified=true) whose derived author matches the claim in kind+id; the triage item checks re-run, the action is added to the actions store under the VERIFIED author (the re-stamp), an outage-write-confirmed audit event lands, and only then is the record marked confirmed with the released action id. POST /api/actions/outage-queue/reject {id} is the same gate, marking the record rejected with an outage-write-rejected audit event. One judgment call, recorded: a verified owner may reject a queued write they did not claim (rejection can never create authorship; without it a forged claim could never be cleared from the owner's own queue). Confirmation stays claimant-only, strictly. Nothing is ever auto-promoted.
GET /api/actions/outage-queue.json lists the queue records (claims, visibly outage-queued). Config: PM_AGG_OUTAGE_QUEUE_FILE, default ~/.local/state/pm-aggregator/outage-queue.json (the break-glass state-dir precedent).
Tests (oracle = §6): unit suite for the store/eligibility/locality/matching/confirm/reject core, plus a boot-based route suite (queue over HTTP from loopback with Access configured and no JWT ⇒ 202 and the write is in the queue file and NOT in the actions file; ineligible view verb ⇒ 401; confirm without a fresh login ⇒ refused, record stays queued). No new dependencies; no schedules touched. dezren39 commented on Nov 23, 2026 🤖 Agent note · done (this slice) — lane felix
The outage-queueing remainder is landed: PR #13292 (branch felix/9608-outage-queueing, head e8d2a00; left unmerged for Felix's review).
What shipped, per the design recorded earlier on this issue (oracle: design #1253 §6):
src/outage-queue.ts — file-backed OutageQueueStore (fresh disk reads, serialized mutations, atomic persist), eligibility + stack-local-address checks, claim matching, and the queue/confirm/reject core with audit-first state changes.
src/server.ts — peer address threaded from Bun.serve; queue fallback on the Access enforcer's 401 in POST /api/actions and per-item in /api/actions/batch (triple gate: 401 + stack-local + eligible; a 403 verified-contradiction never queues); GET /api/actions/outage-queue.json; POST /api/actions/outage-queue/confirm and .../reject behind a fresh-verified-login gate whose derived author must match the claim (owner may reject others' claims; confirmation is claimant-only).
src/config.ts — outageQueueFile (PM_AGG_OUTAGE_QUEUE_FILE, state-dir default).
- Queued writes are stamped
provenance: outage-queued, audited before they persist, deduped by clientToken, and never enter the actions store until confirmed — so no consumer poll or verified-authorship surface ever sees an unconfirmed claim, and nothing is auto-promoted. Comments untouched (question-4 gate).
Verification (remote dispatch only): fleet-command run 45178731428 — 55 pass / 0 fail across the new unit suite (11), the new boot-based route suite (4), break-glass, access-identity, and config suites; bunx tsc --noEmit exit 0. The earlier run 45177942229 caught one real test bug (fixed) and a pre-existing venue gap — every boot suite, including pre-existing ones this PR doesn't touch, crashes in the clean runner because the server's default metadata-DB directory doesn't exist there; my route suite points PM_METADATA_DB_PATH at its temp dir and boots in both venues. No new dependencies; no schedules touched.
Acceptance state for #9608: owner token CLI ✅ (PR #12941) · server-side token consumption ✅ (PR #13009) · outage queueing ✅ (PR #13292) · reads from last-known state ✅ (local-first construction, verified by inspection) · comment surface ⬜ still gated on Drew's answer to #1253 question 4 — the issue stays open for that part only. dezren39 commented on Nov 23, 2026
Released by felix (outcome: done). Outage-queueing slice landed as PR #13292 (unmerged, for Felix's review): 55 pass / 0 fail + tsc clean via remote dispatch run 45178731428. #9608 stays open only for the #1253 question-4-gated comment surface. dezren39 commented on Nov 23, 2026 Merged note — Felix, 2026-11-23: PR #13292 merged after my review of the gate logic. The outage-queueing slice of #9608 is landed (the owner token CLI half already landed via PRs #12941/#13009). I verified the triple gate in server.ts: queueing engages only on the enforcer 401 (a 403 verified contradiction never queues), only from a stack-local peer, only for eligible writes, and queued writes never enter the actions store until a fresh verified login matching the claim confirms them. Remote suite 55/0 + tsc clean (run 45178731428). #9608 stays open for exactly one remainder: the comment surface, gated on Drew's unanswered design question 4 on #1253. Follow-up #13293 tracks the clean-environment boot crash the lane found. dezren39 commented on Nov 23, 2026 🤖 Agent note — triage, lane any-n (task 19055)
dezren39 commented on Nov 23, 2026 Triage verdict (lane code-g, 2026-11-23, task 21339): fresh state unchanged since the 15:25Z verdict on task 19055. #9608 is OPEN with no labels. Owner-token CLI (#12941, #13009) and outage queueing (#13292) are landed. The remaining slice is the comment surface, which the outage-queueing design excludes ("Comments are NOT queued").
Decision recorded here so the slice is not gated on a person (FDR-0013): comments stay out of the outage queue. Queueing them would widen the break-glass path past what #1253 specifies, and a later design can revisit that. The comment surface therefore needs no outage-queue work. It is a normal write path that uses the verified identity, and it follows the #1253 identity design, not this issue.
No new follow-on packet: the open work is already tracked by #1253 and #1184. I am not filing a duplicate. Issue stays open only for the comment-surface slice. dezren39 commented on Nov 26, 2026 Triage verdict (lane 5, queue task 24702, 2026-11-26): done; closing as completed.
Every acceptance line is met on main:
Generated by Claude Code
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|