carlos / platform Public

notes #658: per-task and whole-branch Astra findings, SDD ledger

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev f0946139636d026b892f61427b7824f96f37ca74 parent d8d3ec5
9 files changed, +417 −0
  • docs/superpowers/notes/reviews/instance-restore-658/astra-final-r1.md +58 −0
  • docs/superpowers/notes/reviews/instance-restore-658/astra-task-3-r1.md +33 −0
  • docs/superpowers/notes/reviews/instance-restore-658/astra-task-4-r1.md +31 −0
  • docs/superpowers/notes/reviews/instance-restore-658/astra-task-4-r2.md +36 −0
  • docs/superpowers/notes/reviews/instance-restore-658/astra-task-5-r1.md +44 −0
  • docs/superpowers/notes/reviews/instance-restore-658/astra-task-5-r2.md +27 −0
  • docs/superpowers/notes/reviews/instance-restore-658/astra-task-6-r1.md +35 −0
  • docs/superpowers/notes/reviews/instance-restore-658/astra-task-6-r2.md +57 −0
  • docs/superpowers/notes/reviews/instance-restore-658/sdd-ledger.md +96 −0

CI passed — run details

diff --git a/docs/superpowers/notes/reviews/instance-restore-658/astra-final-r1.md b/docs/superpowers/notes/reviews/instance-restore-658/astra-final-r1.md
new file mode 100644
index 000000000..33912305b
--- /dev/null
+++ b/docs/superpowers/notes/reviews/instance-restore-658/astra-final-r1.md
@@ -0,0 +1,58 @@
+# Whole-branch review, round 1 of 3
+
+Reviewed `ce7576a640d201360772b9b0a885dcac8bb16d02..e99738ce7c2ba0cd11db7c16c894b7f4815b2ce0` against spec rev 5, plan rev 4, the approved copy and the ledger's rulings. No subagents or implementation changes. Discussions #661 and #664 remain out of scope.
+
+## P1
+
+None found.
+
+## P2
+
+### 1. The docs promise a restore hint in a case that still recommends choosing another address or purging data
+
+- **Problem:** `docs/site/cli.md:1260` says that if a restore would work, the ordinary-create refusal says so. C2 is reached only at the mark conflict; the unchanged leftover rail can refuse first.
+- **Verified evidence:** `internal/console/apiinstances.go:2359` retains the leftover check for ordinary creates, including the choose-another-address/purge message at line 2377. The paired cases in `internal/console/restore_door_test.go:479` prove that restore succeeds over the owner's replica while ordinary create over the same eligible state gets that old refusal at line 491. This test passed in this review. The spec limits C2 to creates that reach S1 (`docs/superpowers/specs/2026-11-07-instance-restore-658-design.md:50`).
+- **Failure scenario:** An eligible owner deletes an instance with replica data, tries an ordinary create, and receives no restore hint. Following the documented promise, they may conclude restore is unavailable and follow the purge advice instead.
+- **Concrete fix:** Qualify the documentation: some hostname-history refusals suggest restore, but the existing leftover-data refusal can still appear for an eligible instance. Apply the same correction to the blanket hint claim in `docs/superpowers/notes/instance-restore-658-cli-request.md:21`. Keep the ordinary-create rail and its ordering unchanged, as required by the approved design.
+- **Fault family:** Documentation must describe the actual refusal contract.
+
+### 2. The docs and CLI request describe data recovery more strongly than the accepted-restore response guarantees
+
+- **Problem:** `docs/site/cli.md:1256` promises that the instance wakes with the data it had at deletion. The CLI request also describes `restore: true` as reporting that the instance was restored (`docs/superpowers/notes/instance-restore-658-cli-request.md:18`). The approved design explicitly permits an accepted restore to wake empty when the data is absent.
+- **Verified evidence:** Spec `docs/superpowers/specs/2026-11-07-instance-restore-658-design.md:48` distinguishes acceptance from recovered data. The implementation follows that rule: `internal/console/restore_proof.go:239` checks move staging and then returns eligibility at line 248; it does not verify the retained database. `internal/console/apiinstances.go:2675` sets the response field from restore intent. The field's own comment at line 1464 correctly describes acceptance only.
+- **Failure scenario:** The provenance and retirement evidence remain valid but no database remains. Create returns 201 with `restore: true`, and the subsequent wake starts empty. The new docs lead the caller to interpret that response as confirmation of recovered data.
+- **Concrete fix:** Describe reuse of whatever retained data remains, and state that `restore: true` confirms acceptance, not that a wake or data recovery has completed. Align the CLI request's response guidance with that meaning. Do not add a new data-existence gate or change the approved hibernation guarantee.
+- **Fault family:** Documentation must distinguish restore admission from data recovery.
+
+## P3
+
+No additional findings beyond the deferred items triaged below.
+
+## Deferred-minor triage
+
+| Ledger item | Disposition | Evidence and reason |
+| --- | --- | --- |
+| Task 2: cleanup/orphan evidence check uses a raw count | Follow-up | `internal/console/lifetimes_store_test.go:732` already requires marking each forbidden kind to fail; line 750 additionally checks that no forbidden row was marked. Per-row assertions would improve diagnostics, not coverage of the invariant. |
+| Task 2: recovery scans load every pending record body | Follow-up | `internal/console/lifetimes_store.go:332` loads the body needed to prove a lost N1 response. Profile pending-backlog memory if record sizes grow; no demonstrated regression requires changing the recovery interface before merge. |
+| Task 7: foreign-data tally is not split by refusal class | Follow-up | `internal/console/restore_sim_test.go:488` checks every foreign writer against a successful restore, and line 498 checks the exact modeled answer independently. Split the tally for coverage reporting. |
+| Task 7: `createClass` accepts any host-containing 409 as `held` | Follow-up | `internal/console/restore_sim_test.go:521` is broader than necessary. Match the expected holder message to strengthen ordinary-create agreement. This does not bypass the restore answer or foreign-data assertions. |
+| Task 7: failed deterministic traces do not stop the seeds | Follow-up | `internal/console/restore_sim_test.go:1043` ignores the deterministic subtest results before entering the seed loop. The parent still fails; checking those results would save work after failure. |
+| Task 7: oracle method shares the production verdict name | Follow-up | `internal/console/restore_sim_test.go:647` implements the table from model state, without invoking the production proof. Rename for clarity if desired. |
+| Task 7: parent and child both print PASS; weight missing | Weight resolved; output cleanup is follow-up | `.amadan/test-weights.tsv:79` now assigns 36.00 seconds. `internal/console/restore_sim_test.go:1016` streams the child output and line 1017 propagates failure. Duplicate PASS output does not turn a failed child into a pass. |
+| Task 7: claims, unreadable sources, shape, region and foreign-account lineage do not vary in the simulation | Follow-up | The simulation explicitly limits those dimensions (`internal/console/restore_sim_test.go:643`). `TestRestoreProof`, the generated precedence test and the door tests cover them separately. The generator exercises the required provenance histories, foreign starting data, app-lifetime changes, retirement failures and recovery; its safety assertion and independent agreement check remain intact. |
+
+None of these deferred minors requires a pre-merge code change.
+
+## Verification and review disposition
+
+- Passed the focused console run covering restore proofs and doors, all five Review Focus witnesses, origin recording, retirement evidence, migration of the new columns, ordinary-create comparison tests, the fixed unmarked-predecessor trace and the short simulation (50 seeds × 30 steps): 158.944 seconds.
+- Passed the separate console regression selection `HostsUsed|Leftover|LifetimeCreate|InstanceCreate|LockOrder|WholeAdmission`: 51.029 seconds.
+- Passed `TestPlan9B8RecordWriteCensus`, `TestPlan14RootReadCensus` and `TestCensusScopeIsTheRootBinary`: 7.494 seconds. The final record-write census entries retain the appropriate classes for the three changed units.
+- Passed the docsite checks. These check document structure and command references, not the behavioral claims identified above.
+- All Go runs used `nice -n 10` and the default build cache. No repository-wide suite or live infrastructure test ran. The simulation's full 200-seed runtime was not remeasured; the ledger's accepted disk-runtime ruling remains unchanged.
+
+The early call, deciding call and C2 consistently bind the account sqid, app lifetime, requested region and effective record shape. Origin and retirement evidence feed the proof's required rows, and a restore records `RestoreOf` so the next restore remains eligible. No new P1 was found in these seams or the ordinary-create gates.
+
+This round has no P1. Under stopping rule 1, apply the P2 documentation corrections without reopening review; keep the deferred items as follow-ups. Earlier task and design review histories are unchanged.
+
+READY AFTER FIXES
diff --git a/docs/superpowers/notes/reviews/instance-restore-658/astra-task-3-r1.md b/docs/superpowers/notes/reviews/instance-restore-658/astra-task-3-r1.md
new file mode 100644
index 000000000..dfb10c6ea
--- /dev/null
+++ b/docs/superpowers/notes/reviews/instance-restore-658/astra-task-3-r1.md
@@ -0,0 +1,33 @@
+# Task 3 review, round 1 of 3
+
+Reviewed `39266bed..25eab9396d6d6d11942d177e5f7f1908f4607059` against the task brief, spec rev 5, plan rev 4 (including its admission table and Global Constraints), and the controller's rulings in `progress.md`. The implementer's report was treated as unverified. This verdict covers Task 3; the later restore proof and door are outside this diff.
+
+## Findings
+
+- P1: none.
+- P2: none.
+- P3: none.
+
+## Risks checked
+
+- **Origin authority leaking to another create path.** The only production call to `withOriginEligible` is at `internal/console/apiinstances.go:2517`, guarded by absent `From` and `Import`. Those requests already leave through their own handlers at `internal/console/apiinstances.go:2359` and `internal/console/apiinstances.go:2364`. The derived context is passed to one call at `internal/console/apiinstances.go:2519`; the handler's original context is unchanged. Inspected the other production callers: seed/import (`internal/console/apiinstanceseed.go:84`), attach (`internal/console/domainattach.go:698`), demo publication (`internal/console/demo_publish.go:216`), and demo claim (`internal/console/demo_claim_seed.go:187`). None sets the flag. The core requires it alongside data kind, fresh mark, active mode, lifetimes on, and nil Seed/Demo/DemoClaim at `internal/console/lifetimes_create.go:153`, before `BeginAllocation` at line 155.
+
+- **Mistaking an existing or failed mark for a fresh origin.** `internal/console/hostsused.go:613` derives both observations from the same mode read and mark write used by the existing decision. `internal/provision/hostsused.go:73` returns fresh only when this call's create-only PUT succeeds; a CAS conflict returns false, and other errors propagate. Mode-read and mark-write errors still return S2, invalidation still returns S5, and an active conflicting mark still returns S1 (`internal/console/hostsused.go:614`, `internal/console/hostsused.go:642`). No new read failure is interpreted as absence.
+
+- **Changing ordinary create answers or lock order.** Compared the mark helpers with the base: the pass condition remains `fresh || mode != active`; `markBeforeCreate` retains its duplicate, absent-record and read-error branches (`internal/console/hostsused.go:659`). The lifetime core retains its checks and mark position. The leftover rail at `internal/console/apiinstances.go:2295` is unchanged. App then hostname locking remains at `internal/console/lifetimes_create.go:47`. The added `lifetimesOn` check reads the cutover mutex briefly (`internal/console/lifetimes_cutover.go:271`, `internal/console/lifetimes_cutover.go:309`); its holders do not acquire app or hostname locks, and the on state is latched (`internal/console/lifetimes_cutover.go:188`).
+
+- **Recovery manufacturing provenance.** `BeginAllocation` persists the flag in the original INSERT (`internal/console/lifetimes_store.go:114`). Recovery reuses the persisted allocation and calls `allocRecordLocked` directly (`internal/console/lifetimes_recovery.go:231`); it does not rerun the origin calculation. Committing the allocation updates only its state (`internal/console/lifetimes_store.go:130`).
+
+- **Tests bypassing the changed wiring.** `TestOriginOnFreshActiveCreate` (`internal/console/restore_origin_test.go:43`) posts through the real handler using `ltOn.create` (`internal/console/lifetimes_create_test.go:283`), then reads the persisted lineage. Its assertion at line 50 fails without this change because the allocation's origin remains false. The seed and import cases use the real HTTP fixture builders (`internal/console/hostsused_writers_test.go:116`). The new tests cover all six cases named in the task brief, plus the door flag and mark-observation matrix. The context helper and allocation comment correction support this task; no later restore behavior was implemented.
+
+## Verification
+
+One focused invocation passed with the default GOCACHE:
+
+```sh
+nice go test ./internal/console -count=1 -run '^(TestOriginOnFreshActiveCreate|TestNoOrigin.*|TestMarkStepUnchangedForCreates|TestMarkHostObservations|TestMarkErrorRefusesInIncomplete|TestModeReadErrorRefuses|TestUsedHostRefusedEverywhereWhenActive|TestUnexaminedTargetRefusedAtEveryDoor|TestFailedInvalidationStillRefuses|TestCreateRefusesLeftoverReplica|TestCreateRefusesLeftoverMoveStaging|TestLockOrderIsRespected|TestEveryCreateWriterMarksFirst)$'
+```
+
+Result: PASS, `53.581s`. `git diff --check 39266bed 25eab939` also passed. No full suite or mutation runs were performed during this review.
+
+**READY**
diff --git a/docs/superpowers/notes/reviews/instance-restore-658/astra-task-4-r1.md b/docs/superpowers/notes/reviews/instance-restore-658/astra-task-4-r1.md
new file mode 100644
index 000000000..38d14ee07
--- /dev/null
+++ b/docs/superpowers/notes/reviews/instance-restore-658/astra-task-4-r1.md
@@ -0,0 +1,31 @@
+# Task 4 review — round 1 of 3
+
+Reviewed `25eab939..5e78782ec897a6f7a834882f21698d4f5545d9ca` against the task brief, spec rev 5, plan rev 4 (including the admission table), Task 1 inventory and controller rulings. This is Task 4's first review round; the approved design and plan rulings are unchanged.
+
+## P1 — The changed retirement functions fail the record-write census
+
+**Problem and evidence:** Task 4 changes `Server.retireRecordWithLifetimeLocked` (`internal/console/lifetimes_retire.go:144`, `:175`) and `Server.retirementStepsLocked` (`internal/console/lifetimes_retire.go:266`, `:291`, `:331`, `:360`) without updating their reviewed record-write fingerprints. The existing entries are in `internal/provision/operator_pages_census_test.go:51` and `internal/provision/retire_window_415_census_test.go:31`. This census hashes complete function source (`internal/provision/plan9_b8_census_test.go:189`) and rejects changed digests (`:269`). Console code being outside the root-read census does not exempt it from this separate gate.
+
+**Verified failure scenario:** The focused test invocation below failed at `internal/provision/plan9_b8_census_test.go:372`, reporting both retirement functions as “source differs from the reviewed digest”. CI therefore cannot pass with this task as submitted. It also reported `Server.createRecordWithLifetimeLocked`; that function was changed by Task 3, outside this review's diff, and is not counted as another Task 4 finding.
+
+**Concrete fix:** Add reviewed replacement entries for the two retirement functions to the effective record-write census inventory and wire that inventory into `TestPlan9B8RecordWriteCensus`. Retain their existing classifications: `key-site` / `key:RecordKey` for `retireRecordWithLifetimeLocked`, and `record-writer` / `key:RecordKey,key:WriteRecord` for `retirementStepsLocked`. I approve those classifications for the reviewed tip: the former still constructs the same record key; the latter still writes the same tombstone through `WriteRecord`, with the same captured-ETag condition. The new SQL evidence updates add no bucket write authority. Coordinate the separate Task 3 fingerprint update so the complete census passes. Do not weaken or bypass the census.
+
+**Fault family / invariant:** Every record-write census unit must match independently reviewed source; the required test gate must pass.
+
+## P2
+
+None.
+
+## P3
+
+None.
+
+## Checks and verification
+
+- **Evidence provenance and ordering:** The candidate is `obs.Raw`; same-call migration clears it (`lifetimes_retire.go:144`, `:162`). The mark requires a normal row and non-nil body (`:267`). N1 success is checked against the captured ETag and equal bytes (`:350`, `:360`). Recovery proof requires the row's incarnation, a tombstone and an exact sequence increment, refusing parse errors and overflow (`:390`). All three mark sites precede N2/N3 and return pending on a failed update. Conversion clears both columns in one conditional SQL update (`lifetimes_store.go:287`) and clears the in-memory body (`lifetimes_retire.go:329`).
+- **Risks checked outside the diff:** `WriteRecord` and `TombstoneBody` preserve then advance the counter exactly once (`internal/provision/record_sequence.go:125`, `internal/provision/lifetime.go:151`). `classifyLocked` propagates unreadable observations (`lifetimes.go:238`); `deleteUnderRetiredSlot` rereads and checks slot ownership before deletion (`lifetimes_create.go:609`). Pending-row loading carries the body and propagates scan errors (`lifetimes_store.go:331`). Recovery holds app then hostname locks (`lifetimes_recovery.go:63`, `lifetimes.go:206`); the added SQL calls acquire neither lock. The diff changes no ordinary-create gate or lock order and adds no retirement timer. Existing delete outcomes remain, with the explicitly required pending outcome when evidence persistence fails.
+- **Fixed rulings respected:** A void/refused row may retain its flag; eligibility must also require normal and committed. N1's successful response remains proof if a delayed delete removes its tombstone. The added byte-equality guard is consistent with the captured-ETag contract.
+- **Tests inspected:** `TestDeleteLeavesRestorableEvidence` uses the real delete door and checks both the durable mark before N2 and exact captured bytes (`restore_retire_test.go:109`). Its assertions fail without this change because the base never captures or marks that evidence. Recovery tests reopen SQLite through `recoveredTo` / `restart` (`lifetimes_retire_test.go:743`, `lifetimes_create_test.go:237`). The named failure, conversion, foreign-tombstone, migration, old-row and extra retirement-outcome cases are covered.
+- **Executed:** One focused `nice go test ./internal/console ./internal/provision -run '<anchored names of all 19 tests in restore_retire_test.go, plus TestPlan9B8RecordWriteCensus>' -count=1`. All selected console tests passed (7.698s); the census failed (0.721s) as described above. Default GOCACHE retained; no full suites run. `git diff --check 25eab939 5e78782e` passed.
+
+**NOT READY**
diff --git a/docs/superpowers/notes/reviews/instance-restore-658/astra-task-4-r2.md b/docs/superpowers/notes/reviews/instance-restore-658/astra-task-4-r2.md
new file mode 100644
index 000000000..ef9d67de9
--- /dev/null
+++ b/docs/superpowers/notes/reviews/instance-restore-658/astra-task-4-r2.md
@@ -0,0 +1,36 @@
+# Task 4 review — round 2 of 3 (scoped)
+
+Reviewed fix diff `5e78782e..6fdc6b1991a22019c4918a9dc017aecd2a712446` and the current source of all three replaced census units. Round 1 found one P1: the record-write census rejected changed retirement functions; Task 3's create function also failed the same gate. This review covers that finding, the three replacement classifications, and new breakage in the fix diff only.
+
+## Round 1 P1 — RESOLVED
+
+The new inventory replaces all three stale fingerprints (`internal/provision/instance_restore_658_census_test.go:25–27`), and the required test now uses it (`internal/provision/plan9_b8_census_test.go:369`). Independently executed at the fix head, with the default GOCACHE:
+
+```text
+$ nice go test ./internal/provision -run 'TestPlan9B8RecordWriteCensus' -count=1
+ok github.com/carlosframework/platform/internal/provision 0.710s
+```
+
+This verifies the current source digests and exact site-kind lists against the effective inventory, including the previously failing Task 3 unit.
+
+**Fault family / invariant:** Every record-write census unit must match independently reviewed source; the required test gate must pass. The fix satisfies that invariant.
+
+## Independent census verdicts
+
+- **Server.createRecordWithLifetimeLocked — APPROVED:** `key-site`, `key:RecordKey`. Its record-key constructor remains the previous-owner key at `internal/console/lifetimes_create.go:132`. Task 3 captures the existing mark step's observation at lines 138–146 and assigns `a.RestoreOrigin` at lines 153–154 before `BeginAllocation` at line 155. It adds no bucket write or key. The existing `MarkHostUsed` call remains in `internal/console/hostsused.go:625`; `markForCreate` returns that observation at lines 642–650. `BeginAllocation` persists the flag through SQL (`internal/console/lifetimes_store.go:119–122`). The record body is marshalled before the observation (`lifetimes_create.go:124–130`), and the existing allocation steps remain at lines 160–166. Compared Task 3's actual diff (`39266bed..25eab939`) to confirm this distinction.
+- **Server.retireRecordWithLifetimeLocked — APPROVED:** `key-site`, `key:RecordKey`. It constructs the same key at `internal/console/lifetimes_retire.go:108`. The new evidence is the observed body at line 146, cleared on same-call migration at line 162, then passed to `BeginRetirement` at lines 176–178. That helper inserts SQL state (`internal/console/lifetimes_store.go:239–240`). The function still delegates retirement to `retirementStepsLocked` at line 182; it adds no bucket write or key.
+- **Server.retirementStepsLocked — APPROVED:** `record-writer`, `key:RecordKey,key:WriteRecord`. It constructs the key at `internal/console/lifetimes_retire.go:247` and writes the N1 tombstone through `WriteRecord` at line 356, using the observed bytes and ETag after the captured-ETag check at line 350. The new mark calls at lines 292, 332 and 362 use the closure at lines 266–275, which calls the SQL-only `MarkRetirementRestorable` (`internal/console/lifetimes_store.go:296–298`). They add no bucket write or key and preserve the existing write classification.
+
+## Fix integrity and new findings
+
+No new P1, P2 or P3 findings.
+
+The overlay copies the complete prior effective inventory, replaces exactly the three named units, and panics if a replacement is absent (`internal/provision/instance_restore_658_census_test.go:22–40`). It neither drops entries nor appends unreviewed units. Duplicate entries still fail `censusDiff` (`internal/provision/plan9_b8_census_test.go:255–259`). The source walk, kind and digest comparisons, stale-entry checks, and classification policy are unchanged. The test still runs both `censusDiff` and `censusPolicy` and fails on any problem (lines 360–373). No check is weakened or bypassed.
+
+`git diff --check 5e78782e 6fdc6b19` passed. No full suites were run.
+
+## Out of scope
+
+None raised. This is not a fresh review of the whole instance-restore branch. Round 2 has no P1; the review stops under the stated round budget.
+
+READY
diff --git a/docs/superpowers/notes/reviews/instance-restore-658/astra-task-5-r1.md b/docs/superpowers/notes/reviews/instance-restore-658/astra-task-5-r1.md
new file mode 100644
index 000000000..bb4a64c1e
--- /dev/null
+++ b/docs/superpowers/notes/reviews/instance-restore-658/astra-task-5-r1.md
@@ -0,0 +1,44 @@
+Task 5 review, round 1 of 3. Reviewed `6fdc6b19..f2dbba608eb17e51c239b9d35c48aa22d87dd970` against the task brief, approved spec rev 5, plan rev 4 and the controller's recorded rulings. The design decisions are not reopened.
+
+1. **P1 — A corrupt current record can produce an eligible verdict.**
+
+ Evidence: `internal/console/restore_proof.go:171-178` handles `LifetimeUnreadable` and a valid duplicate, but lets `LifetimeCorrupt` continue. `internal/provision/lifetime_judge.go:67-72` assigns that verdict on a decode error and returns it at lines 87-88. This includes malformed JSON and a body naming a different account, app or host (`internal/provision/lifetime.go:182-188`). The existing reader explicitly treats corruption as an error, not absence (`internal/console/lifetimes_read.go:20-24`).
+
+ Failure scenario: start with the otherwise eligible create/delete fixture, then put `{` under its instance-record key while leaving its retired slot, origin and committed retirement intact. The judge reports a present corrupt record with an error. The proof ignores that error, passes the remaining rows and returns `Owner: true, Refusal: nil` at `restore_proof.go:239`. Thus the admission authority grants a restore despite being unable to read the current record. This is not protected by the later create planner: `internal/console/lifetimes_create.go:274-276` accepts a present corrupt body under a retired slot as a predecessor to replace. No cross-account data disclosure is claimed; the demonstrated defect is an affirmative admission on an unreadable record.
+
+ Fix: return `unchecked(true, "read the record", obs.Err)` for `LifetimeCorrupt` as well as `LifetimeUnreadable`. Add cases for malformed JSON and a body whose identity disagrees with its key, on an otherwise eligible fixture, requiring R1/503 and no eligible payload. Also pair corruption with a later refusal to pin row 1's precedence.
+
+ Fault family: **fail-closed source reads / admission row 1**. The plan's Global Constraints and row 1 require a source that cannot be read to refuse with R1, never pass.
+
+2. **P2 — An explicit home-region request passes on a non-home console.**
+
+ Evidence: `internal/console/restore_proof.go:66-67` defines `ask.Region` as already normalized. `internal/console/apiinstancemove.go:324-329` maps the configured home name to `""`. At `restore_proof.go:224`, the request comparison is skipped whenever that normalized value is empty. Non-home console placement is supported by `internal/console/server.go:664-668`; the feature's approved scope is the console's own region, not exclusively the home console.
+
+ Failure scenario: `HomeRegion = "ie"`, console `Region = "uk"`, and an otherwise eligible stored body in `"uk"`. A request explicitly naming `"ie"` becomes `ask.Region == ""` and passes, just like an omitted region. The verdict chooses `"uk"` despite the caller naming a different region. The existing home-name test (`internal/console/restore_proof_test.go:438-440`) only exercises a home console.
+
+ Fix: preserve whether the request supplied a region, alongside the normalized value (for example, `RegionSpecified bool`). When supplied, compare the normalized value with the stored/console region even when it is empty. Test a non-home console with omitted region, its own region, and the explicit home name: eligible, eligible, R5 respectively. Carry the presence bit through Task 6's two calls.
+
+ Fault family: **explicit region selection / admission row 11**. A request naming any region other than the stored body's region must receive R5; omission alone allows the stored region to be chosen.
+
+3. **P2 — An undecodable retained body gets R8 instead of R1.**
+
+ Evidence: `internal/console/restore_proof.go:314-316` converts `provision.DecodeRecord` failure into an ordinary eligibility reason; lines 213-215 then answer R8/409. This differs from the treatment of malformed marks and slots and from admission row 1.
+
+ Failure scenario: an otherwise eligible, normal, committed, restorable retirement has nonempty malformed `record_body` bytes. The proof cannot read its stored record, but tells the owner that the instance predates restore support. It correctly refuses, so this is P2 rather than P1.
+
+ Fix: distinguish a decoding error from missing or disqualifying evidence in `retiredBody`'s result and route the decoding error to R1/503. Keep a genuinely absent body or retirement as R8. Add separate malformed-body and absent-body assertions.
+
+ Fault family: **fail-closed source reads / admission row 1**, shared with finding 1; this instance returns the wrong refusal rather than admitting.
+
+No P3 findings.
+
+Verification and scope:
+
+- Ran only `nice go test ./internal/console -run 'TestRestoreProof|TestRestoreCopyApproved' -count=1`: PASS, 54.900 s, default GOCACHE. The findings above are verified by source tracing; I did not add reproduction files or modify the implementation.
+- The diff adds three files and changes no existing create path. Call-site inspection found no production caller of the new proof yet; Task 6 owns that wiring. Existing ordinary-create answers, checks and lock order are therefore unchanged by this task.
+- For deadlock risk, inspected the proof's callees: `PendingForHost`, `HostLineage` and `NewestRetirement` query the store directly; the judge reads records/slots; `hostsMode` uses only the history mutex. No app or hostname lock is acquired. The test holding both locks passed.
+- For provenance and newest-row selection, inspected `internal/console/lifetimes_store.go:174-193`, `:303-324` and `:402-410`. Query/scan errors propagate; lineage excludes void rows and orders by incarnation; retirement selection uses descending incarnation, creation time and rowid. The proof rejects empty/foreign lineage, missing slot-incarnation evidence and a newest retirement that is not normal, committed and restorable. The controller's R4 restriction is respected.
+- For staging coverage, checked the production data-store wiring in `cmd/console/main.go:463-469`, bounded S3 listing in `internal/release/store.go:1074`, and promotion in `internal/activator/backend_exec.go:3849`. The new check lists the same whole `MovesPrefix(host)` with its trailing slash, without an LTX filter, and propagates list errors. Ownership precedes these detailed checks.
+- `TestRestoreProofPrecedence` generates all 66 pairs of the 12 refusal-row builders (`internal/console/restore_proof_test.go:576-631`), rather than hand-listing pairs. The fixtures create and delete through real handlers. One discriminating witness checked by reading is `TestRestoreProofPendingRetirement`: it verifies a valid record before N1, requires R1 at begin/N1/N2, then requires eligibility after recovery. Removing pending detection or putting duplicate detection first fails that witness. The generated table's read-error builder covers a failed mark read, which does not expose the corrupt-record fallthrough in finding 1.
+
+**NOT READY**
diff --git a/docs/superpowers/notes/reviews/instance-restore-658/astra-task-5-r2.md b/docs/superpowers/notes/reviews/instance-restore-658/astra-task-5-r2.md
new file mode 100644
index 000000000..a1a93fbbe
--- /dev/null
+++ b/docs/superpowers/notes/reviews/instance-restore-658/astra-task-5-r2.md
@@ -0,0 +1,27 @@
+Task 5 review, round 2 of 3, scoped to `f2dbba60..55229427ea209bac47033d8bdf19436450a3a265` and the three round 1 findings. Checked against the plan's admission table and the controller's recorded rulings. Round 1 found one P1 and two P2s; all three are resolved. No new P1, P2 or P3 findings in the fix diff.
+
+1. **P1 — Corrupt current record: RESOLVED.**
+
+ `internal/console/restore_proof.go:175-179` now maps both `LifetimeCorrupt` and `LifetimeUnreadable` to R1/503 before duplicate detection or eligibility. The judge reports malformed bodies and key/body identity mismatches as corrupt (`internal/provision/lifetime_judge.go:67-72`) and preserves that result (`internal/provision/lifetime_judge.go:87-88`). Tests cover malformed JSON and mismatched account, app and host at `internal/console/restore_proof_test.go:340-349`. `TestRestoreProofCorruptRecordPrecedence` pairs corruption with every later refusal row at `internal/console/restore_proof_test.go:534-542`. Refusal assertions reject any body, region or retirement payload at `internal/console/restore_proof_test.go:266-267`.
+
+ Fault family: **fail-closed source reads / admission row 1**.
+
+2. **P2 — Explicit home region on a non-home console: RESOLVED.**
+
+ `RegionSpecified` preserves request presence separately from the normalized region (`internal/console/restore_proof.go:66-75`). The comparison at `internal/console/restore_proof.go:233-236` now rejects an explicitly named home region when this console's region differs, including when normalization produces an empty string. It also retains the previous check for nonempty region values. `TestRestoreProofNonHomeConsole` verifies omitted region and explicit `uk` are eligible, while explicit home `ie` receives R5 on the `uk` console (`internal/console/restore_proof_test.go:549-568`).
+
+ Fault family: **explicit region selection / admission row 11**.
+
+3. **P2 — Undecodable retained body: RESOLVED.**
+
+ `retiredBody` now propagates `DecodeRecord` errors separately from eligibility refusals (`internal/console/restore_proof.go:325-327`), and its caller maps them to R1/503 (`internal/console/restore_proof.go:219-224`). Missing retirement and missing body remain R8 (`internal/console/restore_proof.go:314-323`). Separate tests assert malformed body → R1, absent retirement → R8, and absent body → R8 (`internal/console/restore_proof_test.go:418-426`).
+
+ Fault family: **fail-closed source reads / admission row 1**.
+
+The remaining read paths were traced for swallowed errors: mark and slot (`internal/console/restore_proof.go:152-158`), pending count (`:166-168`), history mode (`:187-189`), lineage (`:201-203`), newest retirement (`:215-217`), and staging (`:240-242`). Each propagates read errors to R1. The store accessors propagate query, scan and iteration errors (`internal/console/lifetimes_store.go:174-192`, `:303-318`, `:402-409`); malformed slots and history modes also propagate errors. No additional swallowed failure or decode error was found in the scoped changes.
+
+Out of scope: Task 6 must carry `RegionSpecified` from the raw request through both proof calls, as the fix report states. This task has no production callers yet; this review does not certify that future wiring.
+
+Verification: `nice go test ./internal/console -run 'TestRestoreProof' -count=1` passed in 67.610 s with the default GOCACHE. `git diff --check f2dbba60..55229427` passed. No full suites, implementation edits or subagents. This round has no P1, so the review stops under stopping rule 1.
+
+READY
diff --git a/docs/superpowers/notes/reviews/instance-restore-658/astra-task-6-r1.md b/docs/superpowers/notes/reviews/instance-restore-658/astra-task-6-r1.md
new file mode 100644
index 000000000..3fac4a7a5
--- /dev/null
+++ b/docs/superpowers/notes/reviews/instance-restore-658/astra-task-6-r1.md
@@ -0,0 +1,35 @@
+# Task 6 review, round 1
+
+Reviewed `55229427..b908ffb953a85477b91d8694b98c44cc5f8ce4f2` against the task brief, spec rev 5, plan rev 4 and the ledger's rulings. The findings below are from code inspection; the focused tests passed.
+
+## P1 — The early proof runs after checks that disclose another owner's use
+
+**Evidence:** The new restore branch starts at `internal/console/apiinstances.go:1825`, but `hostHolder` has already run at `apiinstances.go:1769` and its answer has already been returned at `apiinstances.go:1778`. `internal/console/apex.go:117` reads the route, and `apex.go:121` returns its app and account when they differ from the caller's. `apex.go:287` includes both identifiers in the resulting response. The sibling-record path also returns the other app at `apex.go:177`. These paths precede the ownership check at `internal/console/restore_proof.go:160`.
+
+**Failure scenario:** Account A creates and deletes a restorable instance. Its mark and retired slot still name A, and its route remains visible until reconciliation removes it. Account B, with a manifest allowing the same hostname, sends `restore: true`. Instead of S1, B receives the existing holder response naming A and its app. The same bypass occurs for another app while the owner's record is live. Ownership should fail before any such detail is returned. The new foreign-owner tests at `internal/console/restore_door_test.go:553` exercise retired fixtures without a remaining route or live sibling record, so they do not cover this case.
+
+**Fix:** For restores, run the early proof immediately after host validation and the placement/pool reads it requires, before the sibling, holder and claim refusals. Preserve the current order for ordinary creates, and retain those validations after a restore has passed ownership. Add foreign-account and foreign-app cases with a remaining registry route and a live sibling record; compare the restore response to the exact S1 body and verify no allocation is written.
+
+**Fault family:** Ownership-before-disclosure / restore refusal precedence. Spec §3 item 1 and admission-table row 2 require another owner to receive only S1, or R1 for an unreadable source. Task 6 step 3 explicitly places the early proof after host validation and its placement inputs.
+
+## P2 — A non-I/O refusal remains between the deciding proof and the mark
+
+**Evidence:** The deciding proof is correctly placed at `internal/console/lifetimes_create.go:109`, before admission and planning and outside the data-kind block. However, the unconditional `gateDataCreate` at `lifetimes_create.go:159` can still return a separate verdict before `markForCreate` at line 163. `internal/console/hostsused.go:326` calls the target gate, then line 329 calls the coverage gate. At `hostsused.go:267`, a newly observed target absent from the activation inventory produces a 409 S4 refusal. This requires no store or bucket error. `restoreProof` does not examine that inventory: its platform check at `internal/console/restore_proof.go:187` reads only the history mode, lifetimes and claims settings.
+
+**Failure scenario:** A plain home-region instance has a valid origin and retirement, no pending work and no staging. After its deletion, an ordinary platform box joins the home region without being in `RegionTargets`; the mode remains active. Both restore proofs return eligible. The door's target check passes for the home region, but the core's later coverage check answers S4. Thus the saved deciding verdict is not the only non-I/O decision in the interval specified by Task 6. The existing coverage witness at `internal/console/hostsused_coverage_test.go:160` demonstrates how such a target is represented; the new restore tests do not combine that state with an eligible restore.
+
+**Fix:** Keep the coverage safety check, but resolve the required S4/S5 preconditions outside the deciding-proof-to-mark interval for restores and avoid evaluating them again inside that interval. Preserve ordinary-create ordering and the table's pending/duplicate precedence. Add a restore witness with an unexamined home-region target, and a controlled history change around the deciding call, so the required ordering is checked rather than inferred from passing eligible fixtures.
+
+**Fault family:** Single deciding admission boundary / restore refusal precedence. Plan Task 6's interface at `docs/superpowers/plans/2026-11-08-instance-restore-658.md:181` permits only store or bucket errors between the deciding evaluation and the mark. This finding concerns that missing ordering guarantee; S4 must remain fail-closed.
+
+## Verification and census
+
+- Ran one focused, niced `go test` invocation over `internal/console` and `internal/provision`, with an anchored expression selecting the 19 new door tests and `TestPlan9B8RecordWriteCensus`, with `-count=1`. Both packages passed: console 26.288s, provision 1.005s. GOCACHE was left at its default. No full suite or mutation test was run.
+- Read `TestRestorePendingAppearsBetweenEvaluations` at `restore_door_test.go:260`: both traces use the real handler and leave real pending operations. Without the deciding proof, `s.admit` returns `errLifetimeSettling`, mapped to a different status/body by `lifetimes.go:143`; its R1 assertions therefore discriminate. The round-trip test also requires the replica-rail bypass and `RestoreOf` on the persisted allocation.
+- Checked lock re-entry risk through `withAppHost`, `lockAppHost`, `restoreProof`, and `restoreHint`: the app/hostname lock order remains unchanged, and the proof uses the non-locking pending query. Checked `markHost`/`markForCreate`: exact status-and-message matching in `restore_door.go:37` identifies their sole S1 branch without accepting the 503 refusals.
+- Checked the region block and dispatch: stored-region selection bypasses the app default while retaining normalization, replica validation, allow-list and placement checks. Restores bypass the leftover rail, carry `RestoreOf`, and do not receive the origin context flag. C2 retains S1 for every ineligible or foreign-owner proof result. No other ordinary-create response change was found in the diff.
+- Approve the census classification at `internal/provision/instance_restore_658_census_test.go:33`: `Server.createRecordWithLifetimeLocked` remains `key-site / key:RecordKey`. Its direct key site remains `lifetimes_create.go:151`; publication still goes through the existing allocation path and `allocRecordLocked`'s `WriteRecord` at line 479. The new proof and hint add reads, and `RestoreOf` adds SQL allocation metadata; neither adds a record-write site. The updated fingerprint passed the census test. This classification approval does not approve the two integration defects above.
+
+No P3 findings.
+
+**NOT READY**
diff --git a/docs/superpowers/notes/reviews/instance-restore-658/astra-task-6-r2.md b/docs/superpowers/notes/reviews/instance-restore-658/astra-task-6-r2.md
new file mode 100644
index 000000000..7fbbd0312
--- /dev/null
+++ b/docs/superpowers/notes/reviews/instance-restore-658/astra-task-6-r2.md
@@ -0,0 +1,57 @@
+# Task 6 review, round 2
+
+Reviewed `b908ffb9..e2a33b0a1077021740466735c2c5e1d6054a3735`, limited to the two round-one findings and new breakage in that fix diff. Applied the plan's admission table and Task 6 interfaces, including the controller's ruling at `progress.md:72` that restore admission runs before the deciding proof. Round 1 found one P1 and one P2; this round resolves both. No new P1, P2 or P3 findings. Stop review here under the repository's first-round-with-no-P1 rule.
+
+## P1: ownership before disclosure — RESOLVED
+
+**Fault family:** Ownership-before-disclosure / restore refusal precedence.
+
+The early proof now runs at `internal/console/apiinstances.go:1718`, immediately after host validation and the placement read. It precedes demo reservation (`:1732`), temporary-app policy (`:1739`), sibling-apex lookup (`:1777`), both holder reads (`:1822`), their responses (`:1826`, `:1837`), and demo-fleet policy (`:1859`). `restoreProof` returns S1 for a foreign mark or slot before reading pending work, the live record or eligibility (`internal/console/restore_proof.go:152–170`). The moved checks remain present after that proof.
+
+Every refusal reachable from `handleAPIInstanceCreate` before this early proof is listed below. This includes refusals inside its helper calls, but not middleware that runs before the handler.
+
+| Check | Possible refusal | Identity disclosed |
+|---|---|---|
+| `instanceGate`: principal/account resolution (`apicli.go:228–295`) | 404 for absent/unsupported principal, invalid service binding, wrong account or no matching membership; 500 loading memberships; 409 ambiguous account | The ambiguity response lists only accounts returned by `AccountsFor` for this caller. It can name the caller's other accounts, but does not identify the requested hostname's owner. Other responses are generic. |
+| `instanceGate`: app binding/existence (`apicli.go:81–95`) | 404 for wrong app binding, missing app or lookup failure | No owner identity. |
+| `instanceGate`: demo mutation policy (`demo_domains.go:20–30`, `demo_claim_target.go:269–286`) | 503 for an unreadable demo-claim/app state; 409 for a pending claim or demo app | Constant messages concerning the already-authorized target app; no other owner identity. |
+| `instanceGate`: rate limit/deployment readiness (`apiinstances.go:128–136`) | 429 rate limit; 503 no deployment bucket | No owner identity. |
+| Service control-plane guard (`apiinstances.go:1550`, `controlplane.go:110–125`) | 503 unreadable app flags; 403 service cannot create the control plane's records | May name the authorized target app, never the hostname's holder. |
+| `doorLifetime` (`apiinstances.go:1556`, `lifetimes.go:300–308`) | 502 unreadable app lifetime | Generic; no owner identity. |
+| Manifest read (`apiinstances.go:1568`, `:155–169`) | 409 instances not enabled; 502 unreadable settings | The 409 names only the authorized account/app and its manifest key. |
+| JSON decoding (`apiinstances.go:1633`, `authcli.go:1313–1336`) | 415 content type; 413 size; 400 malformed body | No owner identity. Strict unknown-field handling is not enabled here. |
+| Activity message (`apiinstances.go:1636`, `activity.go:39–42`) | 400 invalid message | Constant request-validation text. |
+| Team request shape (`apiinstances.go:1644–1654`) | 400 seed/import; replica role/placements; non-socket kind or addrs | Each answer depends only on the submitted shape, with no owner identity. |
+| Seed request shape (`apiinstances.go:1658–1665`) | 400 simultaneous from/import; 400 non-ordinary seeded shape | Constant request-validation text. |
+| Host validation (`apiinstances.go:1673–1676`) | 400 invalid host | Names the authorized app's manifest domain, not a discovered holder. |
+| Placement read (`apiinstances.go:1684–1694`, called at `:1711`) | 502 opening the registry or reading placement | Both return the same generic placement message. `appPlacement` reads this account/app's placement and filters its route fallback accordingly (`fleets.go:723–737`). |
+
+The live-edge prefetch at `apiinstances.go:1567` sends no refusal (`reqmemo.go:258–276`). There is no remaining pre-proof response that discovers and names another hostname owner's account or app. The post-proof legacy-unit R2 guard remains after ownership (`apiinstances.go:1725`), consistent with the controller's earlier ruling.
+
+**Regression coverage and the foreign-account live-record concern:** `TestRestoreForeignOwnerSeesS1BeforeHolders` covers both foreign-account and foreign-app remaining routes, a foreign app with the owner's live sibling record, and a foreign account with the owner's live record plus its route (`restore_door_test.go:823–830`). Each fixture first requires an ordinary-create holder refusal, then compares the restore's status and complete response body to S1, and checks the allocation count (`:837–847`).
+
+The implementer's concern about representing a foreign-account live record is valid. `hostHolder` searches sibling records only within the requesting account (`apex.go:132–178`); a different account's live record is not one of those siblings. Its registry route is the disclosure path: the global route lookup returns both the foreign account and app (`apex.go:117–126`). The live-record-plus-route case exercises that path, while the same-account/different-app case exercises the sibling-record disclosure without a route. These tests cover the disclosure that matters. They do not separately exercise an alias claim or every sibling-apex refusal; the proof's position before those reads establishes their ordering by inspection.
+
+## P2: admission before the deciding proof — RESOLVED
+
+**Fault family:** Single deciding admission boundary / restore refusal precedence.
+
+For a restore of a data kind, `gateDataCreate` now runs under the existing hold at `lifetimes_create.go:109–112`, before `restoreProof` at `:117`. The mark block calls it only for ordinary creates (`:166–171`). The deciding proof remains outside the data-kind condition, so static/service inputs cannot bypass it. S5, target S4 and coverage S4 remain in the gate in their original order (`hostsused.go:322–329`). This implements the controller's P2 ruling exactly.
+
+`TestRestoreAdmissionBeforeDecidingCall` checks an unexamined home target, then combines that target with staging introduced after the early proof (`restore_door_test.go:866–887`). The second case discriminates the order: coverage S4 must precede the deciding proof's R6. The incomplete-history case reaches R2 (`:889–899`); invalidation retains S5 (`:901–912`). Each checks no record and no new allocation. The invalidation case may be refused by the earlier door gate at `apiinstances.go:2306`, so it is a fail-closed witness, not independent proof of core ordering. The absence of a second gate call after the deciding proof is established directly by the `!restoring` condition.
+
+## Fix-diff checks and census
+
+- Ordinary creates retain the same order and response text. Defining `readPlacement` performs no read; for `restore == nil`, its only invocation is at the original position after the claim check (`apiinstances.go:1856`). The closure preserves both original calls, log messages and 502 responses. In the core, the added early admission branch is restore-only; ordinary admission remains after planning and before marking. The other response-producing code is unchanged in this diff. The focused ordinary-create witnesses passed; this is not a claim to have exhaustively exercised every ordinary-create response.
+- No existing validation was removed or bypassed by this fix. After the early proof admits a restore, the demo, temporary-app, sibling, holder, claim and demo-fleet checks still run. Region normalization, replica checks, the manifest allow-list and placement checks remain at `apiinstances.go:1894`, `:1966`, `:1984`, `:2014` and `:2071`; later shape, authorization, admission and core checks are unchanged. The app-default-region and leftover-rail exceptions predate this fix and remain as specified by Task 6.
+- **Census classification approved:** `Server.createRecordWithLifetimeLocked` remains `key-site / key:RecordKey`. Moving a read-only admission check adds no record-write site. Its direct key construction remains at `lifetimes_create.go:159`, and allocation publication still reaches the existing `WriteRecord` in `allocRecordLocked` at `:489`. Approve the replacement at `internal/provision/instance_restore_658_census_test.go:35`, fingerprint `e338351f788f6cded8733a1abaa02e1c87befcd04e54594d62f4e2f22a4928dc`. The census test passed.
+
+## Verification
+
+Ran one niced `go test` invocation over `./internal/console` and `./internal/provision`, with an anchored expression selecting all 20 tests declared in `restore_door_test.go`, all 10 tests declared in `restore_proof_test.go` (including `TestRestoreCopyApproved`), and `TestPlan9B8RecordWriteCensus`, with `-count=1`. Console passed in 90.230s; provision passed in 0.780s. GOCACHE was left at its default; the existing disk-backed TMPDIR was retained. `git diff b908ffb9..e2a33b0a --check` passed. No full suite, mutation run or production operation was performed.
+
+## Out of scope
+
+The request-shape and authorized-app preconditions listed above already preceded the proof before this fix. They can return answers other than S1 for malformed or unauthorized requests; they do not expose another hostname holder. This scoped review does not reopen those existing preconditions or certify the entire branch's deciding-proof-to-mark interval beyond the reported `gateDataCreate` defect.
+
+READY
diff --git a/docs/superpowers/notes/reviews/instance-restore-658/sdd-ledger.md b/docs/superpowers/notes/reviews/instance-restore-658/sdd-ledger.md
new file mode 100644
index 000000000..ccdaac904
--- /dev/null
+++ b/docs/superpowers/notes/reviews/instance-restore-658/sdd-ledger.md
@@ -0,0 +1,96 @@
+# SDD ledger — plan: docs/superpowers/plans/2026-11-08-instance-restore-658.md
+
+Spec: docs/superpowers/specs/2026-11-07-instance-restore-658-design.md (rev 5, approved by Paul 2026-11-08).
+Branch design-instance-restore-658, worktree /home/paulca/.cache/design-instance-restore-658. Start tip e6930bae.
+Reviews: Tasks 3-6 by Astra (codex -m gpt-6-astra, effort high; AGENTS.md rule 3, cross-family); Tasks 1, 2, 7, 8 by a Claude task reviewer; whole-branch by Astra.
+
+## Pre-flight scan
+
+| Pair / task | Produces vs consumes | Finding |
+|---|---|---|
+| T2 -> T3 | Allocation.RestoreOrigin / RestoreOf, BeginAllocation writes them | consistent |
+| T2 -> T4 | Retirement.RecordBody, MarkRetirementRestorable; T4 also edits ConvertRetirementKind (store) | consistent; T4 owns the ConvertRetirementKind change |
+| T2 -> T5 | HostLineage, NewestRetirement (incarnation, created_at, rowid desc), RetirementEvidence | consistent |
+| T1 -> T3 | import marker for the origin exclusion | T3 waits on T1's note |
+| T1 -> T4 | extra retirement paths become T4 tests | consistent |
+| T1 -> T5 | identifier comparison for stage 1 / row 2 | consistent |
+| T3 -> T6 | markForCreate returns (markObservation, *doorRefusal); core sets origin | T6 edits the same core block; consistent |
+| T5 -> T6 | restoreProof, restoreAsk (incl. Kind, Role, Placement, Pool, Addrs), restoreVerdict (Owner, Duplicate) | consistent |
+| T5/T6 -> T7 | real paths for the simulation; oracle must not call restoreProof | consistent |
+| T0 -> T5/T6/T8 | approved strings in docs/superpowers/notes/instance-restore-658-copy.json | ids restore.R1..R8, restore.C2, docs.restore.* |
+| T6 self | test name TestRestoreSkipsLeftoverRailOnlyForOwnReplica vs rev 4 "restore does not call the rail" | wording only: the test asserts restore passes over leftovers and ordinary create still refused |
+| T1 self | Step 2 may "draft a discussion" | Ruling: the implementer writes the draft into the note; the controller posts it — posting is outside the worktree |
+| T7 self | Step 2b child re-exec + niceValue | consistent after rev 4 |
+
+Ruling: Task 0 is complete (copy deck approved by Paul with no edits, commit 769a26fa) — already done in-session — none.
+Task 0: complete (commit 769a26fa, Paul approved)
+Task 1: dispatched (opus, agent acc33794da8baaac7, BASE e6930bae)
+Task 1: report DONE_WITH_CONCERNS (commit bbfacc81). Warm-file draft posted as discussion #664 (Issue).
+Ruling: table row 9 requires the newest retirement to be kind normal AND state committed AND restorable — a row flagged at N1 can still end cleanup/void/refused — carried into Task 5 — cost if wrong: an eligible restore refused (R8), visible in tests.
+Ruling: restore_origin is set only for a create entering through handleAPIInstanceCreate without from/import (a ctx flag the door sets), and only when rec.Seed, rec.Demo and rec.DemoClaim are nil — the core is shared with attach, seed, import and demo writers — carried into Task 3 — cost if wrong: some legitimate creates are never restorable (R8), never a safety loss.
+Ruling: the claims on -> off cross-mode gap is accepted under the R2 non-goal (restore refuses with claims on; claims are shelved and never re-enabled) plus row 9's slot-incarnation match — cost if wrong: after a claims round trip, a restore could read stale evidence; revisit if claims ever return.
+Task 1: fix round 1/5 dispatched (resume acc33794): :351 void row + 4 minors
+Task 1: fix round 1/5 (5 addressed, 0 open; commits bbfacc81..b361f4e1)
+Task 1: complete (commits e6930bae..b361f4e1, review clean)
+Task 2: dispatched (sonnet, BASE b361f4e1)
+Ruling: RetirementEvidence = Retirement (which now carries RecordBody) + Restorable; no shadowing RecordBody field — the plan listed RecordBody on both — none (naming only).
+Ruling: MarkRetirementRestorable does not judge state; restoreProof requires normal+committed+restorable — consistent with the Task 1 ruling — none.
+Task 2: complete (commits b361f4e1..39266bed, review clean)
+Task 2: minor (deferred): TestRetirementEvidence's cleanup/orphan check is a raw count (error assertions already cover it)
+Task 2: minor (deferred): pendingRetirements now loads record_body on every recovery scan; watch if bodies grow
+Task 3: dispatched (opus, BASE 39266bed)
+Task 3: report DONE (commit 25eab939); Astra review r1 launched
+Task 3: complete (commits 39266bed..25eab939, Astra READY round 1)
+Task 4: dispatched (opus, BASE 25eab939)
+Task 4: report DONE (commit 5e78782e); Astra review r1 launched
+Task 4: Astra r1 NOT READY: P1 record-write census (TestPlan9B8RecordWriteCensus) fails for retireRecordWithLifetimeLocked, retirementStepsLocked, and Task 3's createRecordWithLifetimeLocked.
+Ruling: Task 3's census entry is fixed in Task 4's fix round (same gate, one layered inventory file) rather than reopening Task 3 — Task 3's Astra review missed it; the Task 4 re-review by Astra approves all three classifications — cost if wrong: none beyond review scope.
+Task 4: fix round 1/5 dispatched (resume a5e546fb)
+Task 4: fix round 1 committed 6fdc6b19; Astra re-review r2 launched
+Task 4: fix round 1/5 (1 addressed, 0 open — record-write census layer; commits 5e78782e..6fdc6b19)
+Task 4: complete (commits 25eab939..6fdc6b19, Astra READY round 2; census entries for 3 units approved by Astra)
+Ruling: restoreAsk gains AccountID int64 (AppLife is keyed by acct.ID, Task 1 Step 3) alongside Account (sqid) — the plan's struct lacked it — none.
+Ruling: row 7's "current app lifetime" L is the lifetime the door already resolves (doorLifetime / AppLife(acct.ID, app)); the proof compares lineage rows' AppLifetime to it — none.
+Task 5: dispatched (opus, BASE 6fdc6b19)
+Task 5: report DONE (commit f2dbba60); files restore_proof.go, restore_staging.go, restore_proof_test.go (restore.go already holds app trash restore).
+Ruling: R4 only for lineage rows naming this account and app on another app lifetime; a row naming anyone else is R8 — R4's text would otherwise be false and reveal another owner — carried into Task 7's oracle — cost if wrong: an owner sees R8 instead of R4 in a cross-owner lineage that stage 1 already makes unlikely.
+Ruling: the staging list uses the leftover rail's bounded raw listing on the data bucket (not hostHoldsReplicaData, which sees LTX only); no data bucket configured answers R1 — matches promotion's whole-prefix boundary — cost if wrong: R1 on a console without a data bucket, where restore cannot work anyway.
+Ruling: R7 answers 409 (the door's shape refusals are 400; the plan allowed 409 or the door's code; 409 keeps every restore refusal one class) — cost if wrong: a client keyed on 400 for shape errors.
+Task 5: Astra review r1 launched
+Task 5: Astra r1 NOT READY: P1 LifetimeCorrupt falls through to eligible; P2 explicit home region on non-home console; P2 undecodable record_body answers R8 not R1.
+Task 5: fix round 1/5 dispatched (resume a4082831)
+Task 5: fix round 1 committed 55229427; Astra re-review r2 launched
+Task 5: fix round 1/5 (3 addressed, 0 open — corrupt record R1, RegionSpecified, body decode R1; commits f2dbba60..55229427)
+Task 5: complete (commits 6fdc6b19..55229427, Astra READY round 2)
+Ruling: C2 probe in the core builds restoreAsk from the record with RegionSpecified true and Region rec.Region; only an eligible verdict swaps S1 for C2 — the plan left the probe's region inputs open — cost if wrong: C2 shown or hidden in an edge case; S1 otherwise unchanged.
+Task 6: dispatched (opus, agent ac0390d0, BASE 55229427)
+Task 6: report DONE (commit b908ffb9); re-fingerprinted createRecordWithLifetimeLocked only.
+Ruling: the door's extra R2 for a restore admitted as legacy (before the cutover) is row 5 ("lifetimes off") as admitted — without it a restore would fall into the legacy create path — cost if wrong: none; owner-only answer.
+Ruling: C2 only on the instance door's plain create (originEligible), never on seed/import/attach — matches the origin rule — cost if wrong: those doors never hint restore.
+Task 6: Astra review r1 launched
+Task 6: Astra r1 NOT READY: P1 hostHolder/sibling/claim refusals precede the early proof and can name another owner; P2 gateDataCreate (S4/S5) can answer between the deciding proof and the mark.
+Ruling: for a restore, the core runs gateDataCreate before the deciding restoreProof (inside the same hold) and not again after it; ordinary creates keep today's order — S4/S5 are history-safety answers about the region, not the host's owner, so answering them before ownership discloses nothing tenant-specific, and the deciding proof stays the last non-I/O decision before the mark — cost if wrong: an owner sees S4/S5 where the table would have said R1 (pending) or duplicate, both retryable.
+Task 6: fix round 1/5 dispatched (resume ac0390d0)
+Task 6: fix round 1 committed e2a33b0a; Astra re-review r2 launched
+Task 6: fix round 1/5 (2 addressed, 0 open — early proof before holder checks; admission before deciding proof; commits b908ffb9..e2a33b0a)
+Task 6: complete (commits 55229427..e2a33b0a, Astra READY round 2; census entry e338351f approved)
+Task 7: dispatched (opus, BASE e2a33b0a)
+Task 7: report DONE (commit 85f425ec); full run 35.7 s on tmpfs, 2m21s on disk-backed TMPDIR (fsync); rows 1, 10, 11 and claims not varied (covered by TestRestoreProof and door tests).
+Ruling: accept the on-disk time — CI jobs run with a tmpfs /tmp, and an in-memory store would bypass the store's witnesses — cost if wrong: a slow local full run; CI time measured at merge.
+Ruling: add a test-weights.tsv entry for TestRestoreProvenanceSimulation in Task 8 so the shard balancer weighs it — cost if wrong: one unbalanced shard.
+Task 7: complete (commits e2a33b0a..85f425ec, review clean)
+Task 7: minor (deferred): foreign-data restore tally not split by answer class (S1 vs R4/R8)
+Task 7: minor (deferred): createClass "held" matches any 409 containing the host; match the exact holder string
+Task 7: minor (deferred): a failed deterministic trace does not stop the seeds
+Task 7: minor (deferred): simOracle.restoreVerdict shares a name with the production type; rename modelRow
+Task 7: minor (deferred): parent+child both print PASS under -json; test-weights.tsv row missing (Task 8 adds the weight)
+Task 7: minor (deferred): claims, rows 1/10/11 and a foreign account's lineage never vary in the simulation (unit tests cover them)
+Task 8: dispatched (sonnet, BASE 85f425ec)
+Task 8: report DONE (commit e99738ce); census-card clean
+Task 8: complete (commits 85f425ec..e99738ce, review clean)
+Final: Astra whole-branch review r1 launched (ce7576a640d201360772b9b0a885dcac8bb16d02..e99738ce7c2ba0cd11db7c16c894b7f4815b2ce0)
+Final: Astra whole-branch r1 READY AFTER FIXES: P2 docs promise the restore hint on every refusal (leftover rail answers first); P2 docs/CLI request say data comes back (restore: true is acceptance only). All 8 deferred minors triaged follow-up.
+Ruling: the two P2s change approved copy, so the corrected docs.restore.service and docs.restore.without go back through copy review before the fix dispatch; the CLI request note is an amadan post draft, not copy, and is fixed directly in the same dispatch — cost if wrong: none.
+Final: copy corrections approved by Paul unedited (review 67scetqm); CI passed on e99738ce; final fix dispatched (sonnet, FIX_BASE e99738ce)
+Final: fix wave d8d3ec53 re-review: 2 addressed, 0 open. Final review complete (Astra READY AFTER FIXES round 1, fixes applied).
+Final: out-of-scope (follow-up): CLI request draft's "print that the instance was restored" could read as completion; reword when posting.