GeezerVison is showing github.com — impl(pm-stack): move stateful services off the laptop and prove host failover · Issue #3989 · developing-today/code
impl(pm-stack): move stateful services off the laptop and prove host failover #3989DescriptionWhy
The PM stack still depends on the laptop as the only runtime/data host. Backups reduce data-loss risk but do not make the dashboard available when that host is off. Implement the host-independent deployment and verified cold-failover shape from #1258. Preserve each service's canonical store and the one-writer rule; this is not a big-bang shared-database rewrite.
Scope
Acceptance criteria
- A documented deployment target and ownership map exists for aggregator, Kaneo, Grist, and Pad; each service has one named canonical data home and one active writer.
- The production runtime and persistent data are usable with the laptop powered off; no PM service depends on laptop-only local state to serve or accept durable writes.
- Moving the public route to the active host keeps the existing Cloudflare Access hostname and policy; the old writer is fenced before failover promotion.
- A cold restore from an off-machine verified backup succeeds for each service-owned store, and an isolated full-stack laptop-off drill exercises real reads and a safe test write.
- Measured RTO/RPO are recorded in
doc/pm-stack/restore-drills/YYYY-MM.md and meet or explicitly revise the design(pm-stack): durability & host independence — stack state in backed-up durable storage, stack survives the laptop being off #1258 proposals (4h core RTO; 15m aggregator mutable state; 1h Kaneo/usage/link state; 24h Grist/Pad).
- Backup age, active host, restore point, and failed/empty generations are visible in the existing health/watchdog path; no empty directory is reported as a successful backup.
- Configuration keeps the development/test path working, and the deployment can be rolled back without losing writes or creating two active writers.
Boundaries
Parent: #1184. Design: #1258. Activitydezren39 commented on Nov 1, 2026 🤖 Agent note · filed
- Agent: OpenChamber scheduled lane (repo-worker-code)
- Session / ID: queue task 4958; session ses_e5e6716809bffe95LeQ55HH6dQ
- Found via: queue claim
- Task: Implement the host-independence cutover and prove laptop-off recovery for the PM stack.
- Expectation: effort l; finish with service-owned durable homes, single-writer failover, stable Access routing, and a measured restore drill.
- Links: design design(pm-stack): durability & host independence — stack state in backed-up durable storage, stack survives the laptop being off #1258; epic epic(dashboard): PM stack coherence - single-URL, fresh data, triage-able, hierarchical #1184; native parent design(pm-stack): durability & host independence — stack state in backed-up durable storage, stack survives the laptop being off #1258 (nested under epic(dashboard): PM stack coherence - single-URL, fresh data, triage-able, hierarchical #1184 because epic(dashboard): PM stack coherence - single-URL, fresh data, triage-able, hierarchical #1184 already has 100 direct children)
dezren39 commented on Nov 3, 2026 agent-note:v1
state: reviewed (coverage loop-back)
Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 7423 (triage, queued, priority 50) in repo-health-code-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
Found via: coverage loop-back 2026-11-03 developing-today-fleet commented on Nov 27, 2026 code-h: fence slice landed as PR #15986 — fence-check.sh stores all/kaneo now also require pm-kaneo.service and pm-kaneo.timer inactive (the compose manager revives stopped containers otherwise). Before: containers-stopped + manager active reported FENCED (exit 0); after: UNFENCED naming the unit (exit 1) until fully fenced. Suites green in fixture mode: fence-check (13+3 new), kaneo-cutover, grist-pad-sync, ownership-map. Criterion 3 moves forward (fencing gate hardened + runbook step 1 updated); the public-route move and real second-host drill remain open. Next slice for a following worker: pick from the 2026-11-24 reconciliation gaps (route move, true laptop-off drill, or Kaneo/Aggregator RPO closure via #6816 re-plan). developing-today-fleet commented on Nov 27, 2026 code-g slice: Grist/Pad finals now require a fresh verified backup restore point (PR #16240, branch code-g/3989-grist-pad-backup-gate).
Advances the fencing/runbook line (criterion 3 + criterion 4 pre-condition): grist-pad-sync.sh --mode final refuses (exit 3, copies nothing) unless the writer is fenced, the latest backup record is a complete generation with verified local/R2/Drive copies finished within 36h, and (pad) the WAL is clean — mirroring the Kaneo promotion gate from #14034. Evidence: failing-first on base (7 checks failed), then grist-pad-sync.test.sh 12/12 green plus fence-check and kaneo-cutover suites green.
Next slice: wire the same backup-record requirement through the runbook's step-5 promotion checklist with a drill receipt, or pick up the per-store preflight identity check (#6816 plan §4 presync gate) — whichever the lane prioritizes on the next claim. developing-today-fleet commented on Nov 27, 2026 **Agent note — priority-rung draw (lane code-i, 2026-11-27 ~18:15Z): verdict STAND DOWN, no slice taken.** Fifth consecutive stand-down on this tracker, re-verified fresh on current origin/main ( 256f744):- **New since the last note:** #16240 MERGED today (Grist/Pad final now carries the fresh-verified-backup consumer gate) and #15986 MERGED today (pm host-portability). No open PR references #3989/ #6816/ #15008 — nothing to shepherd.- **Suites green on current main:** grist-pad-sync.test.sh, fence-check.test.sh, kaneo-cutover.test.sh all pass (fixture oracles; live-host LIMITATIONs unchanged).- ** #6816 criteria:** 2 (fencing) and 4 (rollback shape) hold in merged code; runbook + rehearsal driver exist for 3; criterion 1 is unmet because the canonical target (Supabase muse-dev2) is deleted — replacement provisioning + cutover window + laptop-off drill are owned by #15008 (OPEN, status/blocked). Not startable from a code lane.- ** #3989 stays OPEN** as the acceptance tracker. No repo edits, no services/routes/data touched. developing-today-fleet commented on Nov 27, 2026 **Agent note — slice landed as PR #16316 (lane oc-code-01, 2026-11-27):** wired the fail-closed restore-point gate into the rehearsal driver.
Gap closed: restore-rehearsal.sh only checked [ -f "$BK" ] and could report success against an empty/failed/stale generation. It now requires --backup-record-file (+ optional --max-backup-age-hours, default 36) and refuses (exit 3, REFUSED, before any extraction or container start) unless restore-point-check.py verifies a complete generation with archive identity and verified local+R2+Drive copies within max age — the same consumer gate kaneo-cutover.sh promote and grist-pad-sync.sh --mode final enforce.
Evidence: restore-rehearsal.test.sh 0 failing (36 scenarios incl. 8 new gate cases), restore-rehearsal-args.test.py OK (7 tests, real gate not stubs), shellcheck -S warning clean; failing-first verified on base. Revertable: driver + its two suites only. Live-host work (provisioning, laptop-off drill) stays out of scope on #15008. developing-today-fleet commented on Nov 27, 2026
#3989 verified park — no startable code slice (lane oc-code-05, priority draw 2026-11-27 ~22:15Z).
Fresh premise check against origin/main, clean worktree (worker-preflight clean), no live services touched, no code written:
- 0 open PRs reference impl(pm-stack): move stateful services off the laptop and prove host failover #3989; no live claim on a new slice.
- Combined promotion gates already merged in the drivers: kaneo-cutover promote requires fence FENCED plus exact table/row parity plus complete verified backup record plus source-bound Kaneo recovery evidence; grist-pad-sync final self-gates on fenced writer plus fresh verified restore point (plus clean WAL for pad). A standalone fence plus restore-point composer would duplicate them.
- Landed code slices verified on main: fence-check (pm-stack: add old-writer fence check for failover promotion (#3989) #13410), health restore-point visibility (pm-stack: expose backup restore point in health #13350), ownership reconciliation (docs: reconcile PM-stack ownership status #12989, docs(pm-stack): reconcile ownership map to Turso reality + doc-rot guard (#3989) #14157), backup gates (pm-stack: require a fresh verified backup before Kaneo promotion #14034, pm-stack: require a fresh verified backup before Grist/Pad final #16240), restore-rehearsal gate (pm-stack: gate restore-rehearsal on verified restore point (#3989) #16316), Kaneo gates (feat(pm-stack): gate the Kaneo cutover on fence + exact parity (#6816) #13676, feat(pm-stack): gate the Kaneo rollback on fence + replay parity (#6816) #14079, feat(pm-stack): fail closed on Kaneo target identity #14684, fix(pm-stack): enforce one-hour Kaneo recovery evidence before promotion #14787), Grist/Pad sync plus fencing (feat(pm-stack): gate Grist/Pad file-store sync on per-store fencing (#6816) #14590), host portability (fence(kaneo): pin pm-kaneo.service+timer in the failover fence (#3989) #15986).
- Remainder is live execution only, owned by OPEN status/blocked ops(pm-stack): provision replacement canonical-store target + execute #6816 live cutover and first laptop-off drill #15008 (replacement canonical-store target provisioning plus coordinated ops window plus first laptop-off drill). The Cloudflare route-move half of criterion 3 is live infra config, not a code slice.
Wake: #15008 unblocks (target provisioned / window agreed) or #3989 scope changes. #3989 stays open. developing-today-fleet commented on Nov 28, 2026
#3989 re-verified park — no startable code slice (lane oc-code-05, priority draw ~2026-11-28T00:15Z).
Recheck since the 22:22Z disposition note: #3989 still OPEN, no new comments; #15008 still OPEN with status/blocked (no comments since 22:00Z, no release). 0 open PRs on this issue. Remainder stays live-window work owned by #15008; no duplicate promotion-readiness script written. Standing by on #15008 release. developing-today-fleet commented on Nov 28, 2026
#3989 verified stand-down — no startable code slice (lane code-j, priority draw).
Fresh premise check on current origin/main (b3bfbc1df81):
- impl(pm-stack): move stateful services off the laptop and prove host failover #3989 still OPEN; ops(pm-stack): provision replacement canonical-store target + execute #6816 live cutover and first laptop-off drill #15008 still OPEN with
status/blocked (replacement canonical-store target provisioning + cutover window + first laptop-off drill — live ops, not a code slice). No live host/service/route/data change is authorized by this tracker task.
- 0 open PRs reference impl(pm-stack): move stateful services off the laptop and prove host failover #3989; nothing to shepherd (open pm-stack-path PRs feat(pm-stack): certified charges-side sources for the #4825 cost-anomaly producer #16395/code-f: configure pm-aggregator DNS snapshot D1 publication (#14968) #16139 belong to impl(pm-stack): cost-anomaly detection to Needs-you via the alert throat (#1259 slice 4) #4825/CF-5b (#14945): M4 ledger surfaces hosted — /alerts, /notifications, /dns, /comments #14968).
- All code-shaped gates verified present in merged code and green on this SHA (fixture oracles, clean detached worktree, worktree removed after):
fence-check pass, kaneo-cutover pass, grist-pad-sync 12/12 pass, restore-rehearsal 0 failing, ownership-map pass, restore-rehearsal-args 7 OK, kaneo-recovery-point-check 2 OK. No TODO/stub markers in pm-stack/scripts/ gates.
- The two "next slice" candidates from earlier notes are now landed (
kaneo-target-preflight.py identity check in the cutover driver; restore-point consumer gate wired into restore-rehearsal.sh by pm-stack: gate restore-rehearsal on verified restore point (#3989) #16316). The remainder — target provisioning, Cloudflare route move, true second-host laptop-off drill, Kaneo/Aggregator RPO closure via impl(pm-stack): Kaneo/Grist/Pad canonical stores to Supabase-backed homes + cold-restore runbook and first laptop-off drill (#3989 slice) #6816 criterion 1 — is live execution owned by ops(pm-stack): provision replacement canonical-store target + execute #6816 live cutover and first laptop-off drill #15008.
Wake: #15008 unblocks (target provisioned / window agreed) or #3989 scope changes. #3989 stays open as the acceptance tracker. No branch, no PR, no services touched; production containers observed running, never restarted or mounted. developing-today-fleet commented on Nov 28, 2026
#3989 verified stand-down — no startable code slice (lane code-f, priority draw).
Fresh premise check on current origin/main (058f3689):
developing-today-fleet commented on Nov 28, 2026
#3989 re-verified park — no startable code slice (lane oc-code-05, priority draw ~2026-11-28T08:10Z).
Recheck since the 04:44Z code-f stand-down note: #3989 still OPEN, no new comments; #15008 still OPEN with status/blocked + status/in-progress + queue/claimed (no release). 0 open PRs on this issue. Remainder stays live-window ops owned by #15008 (replacement canonical-store target + cutover window); no stand-alone promotion-readiness script exists. Standing down, no edits. dezren39 commented on Nov 28, 2026
#3989 verified stand-down — no startable code slice (lane 0937-E, alpha DRIVE shortlist draw, 2026-11-28).
Fresh premise + ownership check by this lane: issue + recent comments read (latest 7236627870, oc-code-05 re-verified park at 08:30Z); #15008 re-checked firsthand just now — still OPEN with status/blocked + status/in-progress (updated 2026-11-28T13:59:46Z); open PRs referencing #3989 = 0 (search API). Concurs with today's code-f / code-j / oc-code-05 stand-downs: all code-shaped gates already merged; the remainder (replacement canonical-store provisioning, cutover window, Cloudflare route move, first laptop-off drill) is live ops owned by #15008, not a Git-API code slice, and no live host/service/route change is authorized by this draw.
Wake: #15008 unblocks (target provisioned / cutover window agreed) or #3989 scope changes. No branch, no PR, no services touched.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|