backups: restore-in-place-replaces — deliberate REPLACES restore with a fallback snapshot #91
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#91
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: #20 (backups).
What to build
The deliberate in-place restore path (P7-S4 → S4x → S5, DDR 0084). Opening Restore for a dataset offers a moment picker of verified snapshots only — snapshots that passed their sampled restore test — so the operator never gambles current data on an unproven copy. Choosing to restore in place (replacing current data) promotes to a destructive confirm using the trigger word REPLACES (the third word beside ERASES and LOSES, ADR 0060 family): the confirm names what is destroyed in the community's own terms — e.g. "Replaces Files & documents on rimu with the snapshot from yesterday 02:00 — everything members added or changed since then will be gone" — with action
Replace & restore, and states headroom needs when space is tight.Confirming Replace & restore has the engine first take a pre-restore snapshot of the current data (outside the retention schedule, kept until the restore verifies), then quiesce the service on its port's terms (pause → replace → resume → verify) and run the restore, logged. A restore ends at verify, like a run: when the restored data passes the dataset's own verify-sample the restore is called done and the overview refreshes (P7-S5 → S1); a half-applied restore is never reported as success. If an in-place restore fails partway (P7-S5 → S5x) the service is restored from the pre-restore snapshot so it comes back on the data it had, the failure is named and retryable, and nothing half-applied is called done; retrying lets the operator restore from the same snapshot or pick another verified moment. Every restore, including the REPLACES path, is audit-logged, attributed to the operator, drillable from the overview (ADR 0027).
Notes: the REPLACES trigger and the pre-restore snapshot are agent-invented machinery Ben kept at sign-off. This restore machinery is invoked by rescue's ladder rung and Tier-3 data return — the running engine stays backups' while the control plane is up.
Acceptance criteria
Replace & restore, and states headroom needs when space is tight.Blocked by
Task manifest
Done in
1ab2728(onorigin/main).The deliberate in-place REPLACES restore (P7-S4x → S5 / S5x, DDR 0084):
internal/backup/restore_inplace.go):Orchestrator.RestoreConfirmcomposes the REPLACES confirm (trigger word beside ERASES and LOSES) naming what is destroyed in the community's terms + headroom line;Orchestrator.RestoreInPlacetakes a pre-restore snapshot (outside retention, never in the ledger, kept until verify), quiesces on the port's terms (pause → replace → resume → verify via newQuiesce/Resume/RestoreInPlace/Headroomport verbs), runs the restore and ends at verify; a fail-partway (in-place verb stops, or verify does not check out) rolls back to the pre-restore snapshot, names the failure, is retryable, and never calls a half-applied restore done. Every restore, verified or failed, is audited to the operator (ADR 0027). Tight headroom refuses withErrInsufficientHeadroombefore touching the service.dashboard/src/components/backups/BackupRestoreReplacesScreen.vue(S4x confirm → S5 running/verified → S5x failed-partway), composed underBackupsSurface; the S4 picker's in-place choice now carries the chosen verified moment through to the confirm.internal/backup/restore_inplace_test.go(9 seam tests — confirm/headroom, snapshot-first+quiesce+verify, fail-partway rollback, verify-fail rollback, retry, audit, guards);dashboard/tests/unit/backupRestoreReplaces.test.ts(7 component tests).go test ./...green; dashboard vitest 366 pass; vue-tsc + eslint clean.All acceptance clauses (stories 20/21/22/24/25/26/32) satisfied. Out of scope untouched: alternate-device restore (#92), the running Tier-3 rebuild engine (rescue's).
idss-broker-installis a hand-placed copy that nothing re-places or checks #872idss-rental-expires-tag on a LIVE rental once the broker actually deploys (#741's broker half is merged but not installed) #745scripts/tests/has ever run in ci — the seam does not reference a single one #873workflow_runevent here, and all 4 broker-deploy runs in history were manual #874workflow_runevent here, and all 4 broker-deploy runs in history were manual #874workflow_runevent here, and all 4 broker-deploy runs in history were manual #874idss-broker-installis a hand-placed copy that nothing re-places or checks #872