backups: restore-alternate-device — side-by-side restore that overwrites nothing #92

Closed
opened 2026-07-25 04:59:41 +00:00 by ben · 1 comment
Owner

Parent

Feature spec: #20 (backups).

What to build

The non-destructive restore path (P7-S4 → S5, DDR 0084): restoring a dataset side-by-side to an alternate device. This is the honest recommendation for "I'm not sure which moment I need" — restoring somewhere else to look first, so it stays a plain action and does not nag the operator with a destructive confirm. Choosing to restore to an alternate device overwrites nothing; the restore runs and is logged with the ordinary Restore action (no REPLACES confirm). Like every restore it ends at verify and is audit-logged, attributed to the operator and drillable from the overview (ADR 0027). It reuses the same restore picker and running screens as the in-place path (P7-S4, P7-S5) but branches to the alternate-device destination.

Acceptance criteria

  • (story 23) Given I choose to restore to an alternate device, when I proceed, then nothing is overwritten, the restore runs and is logged with the ordinary Restore action (no destructive confirm) — the honest recommendation for "I'm not sure which moment I need."
  • (story 32) Given an alternate-device restore, then a structured audit entry lands attributed to the operator, drillable from the overview.

Blocked by

  • #88 — verified snapshots are what restore offers

Task manifest

task: backups:restore-alternate-device
implements_flow: p7-backups
implements_edge: S4→S5 (alternate device), S5→S1
interface: backup orchestrator — restore to an alternate device (plain action, no destructive confirm, overwrites nothing), verify-before-done; audit entry per restore
wireframe:
  - docs/ux/wireframes/p7-backups/p7-s4-restore.html
  - docs/ux/wireframes/p7-backups/p7-s5-restore-running-verified.html
seam: backup orchestrator seam tests (control plane, Go) — fake port restore/verify-sample verbs, fake alternate-device target, in-memory coverage state, in-memory audit ledger
acceptance:
  - given: I choose to restore to an alternate device
    when: I proceed
    then: nothing is overwritten, the restore runs and is logged with the ordinary Restore action (no destructive confirm)
  - given: an alternate-device restore
    then: a structured audit entry lands attributed to the operator
depends_on: [scheduled-runs-and-verification]
out_of_scope:
  - stories 20–22, 24–26 in-place REPLACES restore — restore-in-place-replaces's
  - member self-service restore (out of scope — operator act in v1)
needs_human_decision: []
## Parent Feature spec: #20 (backups). ## What to build The non-destructive restore path (P7-S4 → S5, DDR 0084): restoring a dataset **side-by-side to an alternate device**. This is the honest recommendation for "I'm not sure which moment I need" — restoring somewhere else to look first, so it stays a **plain action** and does not nag the operator with a destructive confirm. Choosing to restore to an alternate device overwrites **nothing**; the restore runs and is logged with the ordinary Restore action (no REPLACES confirm). Like every restore it ends at verify and is audit-logged, attributed to the operator and drillable from the overview (ADR 0027). It reuses the same restore picker and running screens as the in-place path (P7-S4, P7-S5) but branches to the alternate-device destination. ## Acceptance criteria - [ ] (story 23) Given I choose to restore to an alternate device, when I proceed, then nothing is overwritten, the restore runs and is logged with the ordinary Restore action (no destructive confirm) — the honest recommendation for "I'm not sure which moment I need." - [ ] (story 32) Given an alternate-device restore, then a structured audit entry lands attributed to the operator, drillable from the overview. ## Blocked by - #88 — verified snapshots are what restore offers ## Task manifest ```yaml task: backups:restore-alternate-device implements_flow: p7-backups implements_edge: S4→S5 (alternate device), S5→S1 interface: backup orchestrator — restore to an alternate device (plain action, no destructive confirm, overwrites nothing), verify-before-done; audit entry per restore wireframe: - docs/ux/wireframes/p7-backups/p7-s4-restore.html - docs/ux/wireframes/p7-backups/p7-s5-restore-running-verified.html seam: backup orchestrator seam tests (control plane, Go) — fake port restore/verify-sample verbs, fake alternate-device target, in-memory coverage state, in-memory audit ledger acceptance: - given: I choose to restore to an alternate device when: I proceed then: nothing is overwritten, the restore runs and is logged with the ordinary Restore action (no destructive confirm) - given: an alternate-device restore then: a structured audit entry lands attributed to the operator depends_on: [scheduled-runs-and-verification] out_of_scope: - stories 20–22, 24–26 in-place REPLACES restore — restore-in-place-replaces's - member self-service restore (out of scope — operator act in v1) needs_human_decision: [] ```
Author
Owner

Done in e9510cb (on origin/main).

The non-destructive restore (P7-S4 → S5, DDR 0084): Orchestrator.RestoreToAlternateDevice(actor, datasetID, momentRef, device) restores a verified snapshot side-by-side to an alternate device — a plain action, no destructive confirm, overwriting nothing (no pre-restore snapshot, no quiesce, no REPLACES; the live service is untouched), ending at verify (story 23). The moment picker offers verified snapshots only (RestoreMoments filters the ledger; ErrUnverifiedMoment refuses an unproven copy). It lands a structured audit entry with the ordinary restore action attributed to the operator, drillable from the overview (story 32); attribution is mandatory (ErrRestoreUnattributed).

Overwrites nothing — the seam proves Overview(), the fault ledger and the snapshot ledger are byte-identical before/after.

Evidence:

  • internal/backup/restore.go + internal/backup/restore_test.go (6 Go seam tests); Restore port verb added in internal/backup/backup.go, fake in coverage_test.go.
  • dashboard/src/components/backups/BackupRestoreScreen.vue (P7-S4 picker → P7-S5 running/verified) composed under BackupsSurface.vue (edge S1→S4, back S5→S1); contract + fake in dashboard/src/lib/backups.ts; 5 Vue tests in dashboard/tests/unit/backupRestore.test.ts.
  • STATUS.md header + milestone log.

The in-place radio routes out to the REPLACES confirm (#91). Note: the Go/vitest toolchain is absent in the Sandcastle sandbox, so the suites were verified by close review against existing seams and are left for CI. In-place REPLACES restore (stories 20–22, 24–26) stays #91's.

Done in e9510cb (on origin/main). The non-destructive restore (P7-S4 → S5, DDR 0084): `Orchestrator.RestoreToAlternateDevice(actor, datasetID, momentRef, device)` restores a verified snapshot side-by-side to an alternate device — a **plain action, no destructive confirm**, overwriting nothing (no pre-restore snapshot, no quiesce, no REPLACES; the live service is untouched), **ending at verify** (story 23). The moment picker offers **verified snapshots only** (`RestoreMoments` filters the ledger; `ErrUnverifiedMoment` refuses an unproven copy). It lands a structured audit entry with the ordinary `restore` action **attributed to the operator**, drillable from the overview (story 32); attribution is mandatory (`ErrRestoreUnattributed`). **Overwrites nothing** — the seam proves `Overview()`, the fault ledger and the snapshot ledger are byte-identical before/after. Evidence: - `internal/backup/restore.go` + `internal/backup/restore_test.go` (6 Go seam tests); `Restore` port verb added in `internal/backup/backup.go`, fake in `coverage_test.go`. - `dashboard/src/components/backups/BackupRestoreScreen.vue` (P7-S4 picker → P7-S5 running/verified) composed under `BackupsSurface.vue` (edge S1→S4, back S5→S1); contract + fake in `dashboard/src/lib/backups.ts`; 5 Vue tests in `dashboard/tests/unit/backupRestore.test.ts`. - `STATUS.md` header + milestone log. The in-place radio routes out to the REPLACES confirm (#91). Note: the Go/vitest toolchain is absent in the Sandcastle sandbox, so the suites were verified by close review against existing seams and are left for CI. In-place REPLACES restore (stories 20–22, 24–26) stays #91's.
ben closed this issue 2026-07-26 01:38:41 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#92
No description provided.