carlos / platform Public

design-instance-restore-658

Restore a deleted instance with its own data (#658).

What: the instance create door accepts "restore": true (CLI flag --restore requested from the CLI repo). The owner of a deleted plain instance creates it again on the same hostname and wakes with whatever data it kept. Every create without restore behaves exactly as before, never-reuse rule included.

How:

  • Provenance recorded at create: host_allocations.restore_origin is set only by a plain instance-door create that wrote its hostname mark fresh, with the history active and lifetimes on. A restore's allocation carries restore_of.
  • Delete keeps proven evidence: record_retirements.record_body plus restorable, set only when the tombstone over exactly that body is proven (N1 landed, or record_seq + 1 observed before deletion).
  • One function, restoreProof, decides every restore by the plan's admission table: R1, then S1, then pending R1, then duplicate, then R2, R8, R4, R8, R8, R7, R5, R6. Another owner only ever sees S1 or R1. It runs early at the door, before any holder check, and again inside the create hold before admit and planCreateLocked.
  • Limits (Paul's rulings): own region only, plain instances only, instances created and deleted after this release only.

Docs: docs/site/cli.md "Bringing back a deleted instance" (copy approved by Paul, twice).

Tests: proof table (69 cases, 66 generated precedence pairs), 20 door witnesses, origin and retirement-evidence tests, a guard simulation with an independent oracle, and the fixed unmarked-predecessor trace. The trace discriminates the rejected rev 3 timestamp rule. The simulation runs niced in CI, about 36 s.

Review: spec rev 5 (Astra R1-R3, approved by Paul), plan rev 4 (Astra R1-R3, Paul's cuts). Tasks 3-6 Astra READY. Whole-branch Astra READY AFTER FIXES, fixes applied and re-reviewed. Findings under docs/superpowers/notes/reviews/instance-restore-658/. Record-write census layer instancerestore658 (3 units, classes approved by Astra). Root-read census clean (make census-card).

Filed alongside, not fixed here: #661 (leftover move staging can overwrite a newer replica), #664 (non-HA instance in a multi-box region can wake on an older local copy).

Commits 35
Discussions 0 0 open
Tasks 0/0 done

Discussions

  • No discussions on this branch yet.

Tasks

  • No tasks yet.

Activity