provisioning: updates-rollback-quarantine — scope-matched auto rollback, retry budget, quarantine #74
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.
Blocks
Depends on
Reference
Matou/idss#74
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?
Parent
Feature spec: #17 (provisioning).
What to build
The failure side of the P4b rollout, driven by the
updateorchestrator seam.When a health check fails during a rollout, the update is rolled back
automatically at the matching scope — a NixOS generation at the host, an earlier
exact revision at the runner, a rolling container bump for a service — and the
fleet returns to its previous revision, healthy (P4b-U4x). A rolled-back update is
retried once at the next maintenance window with the same exact closure. On a
second consecutive failure it is quarantined (ADR 0067): no further automatic
attempts, surfaced at the top of Updates with the failing node and its logs.
Quarantine overrides auto-apply for that release, yet never blocks later releases —
a newer release on the channel is not held back by it. And a rolled-back update
offers the operator manual control: end the attempts early, or retry it by hand
without waiting for the second failure.
Notes: rollback is scope-matched — host generation, runner exact-revision, service
container bump — never a
git revertof a non-tip. Attempt state is durable andsurvives a control-plane restart. This slice was split from the former
updates-rollout-rollback at the U4/U4x line (to-tickets granularity gate,
2026-07-25). Flow:
docs/ux/flows/p4b-updates.mermaid.Acceptance criteria
Blocked by
Task manifest
Done — committed as
be81c09.Built the failure side of the P4b rollout on the
updateorchestrator seam (P4b-U3 → U4x, ADRs 0067/0017/0061).What shipped
clan.Clan.Rollback(RollbackRequest{Node, Scope, ToRevision})verb with the three ADR 0017RollbackScopes —RollbackGeneration(host, instant NixOS generation),RollbackRevision(runner, earlier exact revision),RollbackContainer(service, rolling container bump); never a git revert of a non-tip. On a health-check failurerolloutreturns every touched node to the fleet's previous revision, each at the mechanic matching how it is deployed (FleetNode.Scope), leaving the fleet healthy on its previous revision (store.currentnever moved off it).recordin theStore(survives a control-plane restart — not in memory). A first rollback stays applying so the next window retries the same exact closure once; a second consecutive failure →StateQuarantined, surfaced at the top of Updates with the failing node + check + attempts + logs (the see-stateQuarantineViewnow written by the transition).rollablerefuses a quarantined revision (ErrNotRollable),Poll.knowsnever re-arms it, and a newer release rolls out cleanly over it.EndEarly(rev)quarantines a rolled-back release now (the "Don't try again" button) without waiting for the second failure;RetryByHand(ctx, rev)retries immediately, bypassing only the window gate, still counting against the budget.Tests (the manifest seam): 7 new
updateseam tests over a realclan.Fake(its newRollbacks()recorder proving the scope-matched calls) +FakeFleet+ fake clock — scope-matched rollback across all three touched-node scopes + fleet-returns-healthy, fail→retry→succeed, fail→retry→fail→quarantine + surfaced + overriding-auto-apply + later-release-applies-over-it, end-early, retry-by-hand-bypasses-window, by-hand-still-budget-bound — plus 2clanfake tests (scope-matched recording, scripted fault).Files:
internal/clan/clan.go,internal/clan/fake.go,internal/clan/rollback_test.go(new),internal/update/rollback.go(new),internal/update/rollout.go,internal/update/rollback_test.go(new),docs/seams/clan.md,STATUS.md.Note: the happy-path rollout (#70) is unchanged bar the failure hand-off;
WithRolloutuntouched. gofmt-aligned; logic self-verified by reading — this sandbox has no Go toolchain, sogo test/vetrun in CI'snix develop.