provision: an interrupted deploy run is not persisted or resumed on control-plane restart (only fail-loud landed in #1348) #1350
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1350
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Split out of #1348. That ticket landed the ADR 0027 BLACK-BOX fix only:
pollToCompletionnow fails loud when a run it watched running 404s after a control-plane restart (GOTCHAS #208). It did NOT make the run survivable.The provisioning deploy run lives only in an in-memory
deployRunStore(internal/controlapi/provision.go), the worker is a detachedcontext.Background()goroutine, and there is no persistence, no startup reconcile that marks an interrupted run failed, and no heartbeat/timeout. Contrast the FOUNDING flow (internal/founding/store.goFileStore +privatepath.golazy resume), which persists to disk and resumes an interruptedStandupDeploying.Decide + build: should a provisioning deploy PERSIST its run and RESUME after a restart (the founding pattern), or is fail-loud + operator re-confirm the intended contract? Whichever, close the gap that a restart mid-deploy loses the run. A server-side persisted store also lets the poll endpoint distinguish never-deployed (404) from lost-run (a real failure) at the source, rather than only client-side.
Ruled by agent under ADR 0174 — veto anytime
The decision this ticket poses — should a provisioning deploy PERSIST its run and RESUME after a control-plane restart (the founding pattern), or is fail-loud + operator re-confirm the intended contract?
Ruling: PERSIST + RESUME, mirroring the founding flow. The provisioning deploy run should be persisted to a disk-backed store and reconciled/resumed on control-plane startup, following the
internal/foundingFileStore + lazy-resume precedent — not left as fail-loud only.Why this ruling:
internal/foundingpersists to disk (FileStore) and resumes an interruptedStandupDeployingvia lazy resume (privatepath.go). Adopting the same shape keeps the two deploy flows consistent rather than divergent.Why this is a two-way door: the contract is revertible by a later commit (the store and the reconcile step can be removed or swapped for a different contract), it is provable by a restart-resume test, and it is not on the one-way-door list — no personal credentials, no security-posture widening, no member-facing trust accept, no data destruction, no non-routine spend. Ben's veto is asynchronous; a veto reverts to the fail-loud + re-confirm contract.
What proves it: the acceptance criteria below — specifically a test that starts a deploy, simulates a control-plane restart mid-run, and asserts the run is either resumed to completion or reconciled to a terminal failed state (never silently lost), plus a poll-endpoint test distinguishing never-deployed from lost-run.
Agent Brief
Category: enhancement
Summary: Make an interrupted provisioning deploy run survivable — persist it to a disk-backed store and reconcile/resume on control-plane restart, mirroring the founding FileStore + lazy-resume pattern.
Current behavior:
A provisioning deploy run lives only in an in-memory store keyed per device (
deployRunStorein the control API), the worker runs in a detachedcontext.Background()goroutine, and there is no persistence, no startup reconcile, and no heartbeat/timeout. If the control plane restarts mid-deploy the run is lost with no record. #1348 landed only the ADR 0027 black-box fix: the poll now fails loud client-side when a run it watched running 404s after a restart (GOTCHAS #208). It did NOT make the run survivable.By contrast the FOUNDING flow persists its run to disk (
internal/foundingFileStore) and lazily resumes an interruptedStandupDeploying(internal/founding/privatepath.go).Desired behavior:
A provisioning deploy run is persisted to a disk-backed store as it progresses. On control-plane startup, a reconcile step inspects persisted runs and either resumes an interrupted run to completion or marks it terminally failed — never leaves it silently lost or wedged "running" forever. The poll endpoint reads the persisted store so it can distinguish never-deployed (no run record → 404) from lost-run (a persisted run that was interrupted → a real, reported failure) at the source.
Key interfaces:
deployRunStore) — should gain a disk-backed persistence layer modelled on the foundingFileStore(persist eachDeployRunframe / terminal state; survive process restart).never-deployedvslost-runis distinguishable server-side, rather than only via the client-side fail-loud from #1348.Acceptance criteria:
Out of scope:
swarm-claim host=matou-dev-server-01 run=20435
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #1350 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope