carlos / platform Public

spec: #1139 round 3 fixes (no round 4, per Paul)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 94857de17c3c5d932d8b5cef57f0cf4fd8398c80 parent 068d6e0
1 file changed, +49 −8
  • docs/superpowers/specs/2026-11-20-fleet-seeded-create-design.md +49 −8

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/specs/2026-11-20-fleet-seeded-create-design.md b/docs/superpowers/specs/2026-11-20-fleet-seeded-create-design.md
index cb0918658..2a15c234f 100644
--- a/docs/superpowers/specs/2026-11-20-fleet-seeded-create-design.md
+++ b/docs/superpowers/specs/2026-11-20-fleet-seeded-create-design.md
@@ -227,11 +227,17 @@ deadline sweep (a `file` seed in `reserving` for more than an hour, as
1. fences and stops the host, as the existing rollback does
(`provision/seedreconcile.go:315`);
2. purges the marker, temp files and any local database (§3.5 item 0);
-3. lists the host's replica prefix in the fleet's bucket, strictly
- (`hasOwnReplica`'s listing, still under the fence). A listing that
- fails proves nothing;
+3. lists, still under the fence, every object beneath the host's
+ restore-capable prefixes in the fleet's bucket: its own replica prefix
+ (`hibernatePrefix(host)` with a trailing slash) and its staging prefix
+ (`MovesPrefix(host)`, which `promoteStagedReplica` restores from,
+ `activator/backend_exec.go:4315`). The listing is exhaustive and
+ paginated, not `lease.HasReplica`, which only answers whether a head or
+ root-layout LTX files exist (`lease/check.go:412`) and so misses a
+ generation left behind after its head was removed (R3-1). Any listing
+ error, or any object found, proves nothing;
4. reports `rolledback` only if step 2 completed and step 3 found no
- replica object. Otherwise it reports nothing, logs why, and the seed
+ object under either prefix. Otherwise it reports nothing, logs why, and the seed
stays `aborted`. The next reconcile pass tries again.
The console then deletes the snapshot and finishes the record, freeing the
@@ -266,6 +272,16 @@ reason "a copy of data already exists for this hostname", the seed goes to
`aborted`, and the rule above holds the hostname until the fleet owner
removes the copy. Uncertainty refuses; it never restores.
+**Staging is never read for an unplaced fleet file seed (R3-2).** The
+retry restore (`restoreOwn` → `restorePlain`) promotes staged data over
+the host's replica before restoring it (`activator/backend_exec.go:1131`),
+so a matching marker alone would not bound what is restored. For a `file`
+seed on a fleet that is not yet `placed`, admission also lists
+`MovesPrefix(host)` exhaustively and refuses (reports `failed`, as above)
+if any object is there or the listing fails, and the retry restore runs
+with staging promotion off. Once the seed is `placed`, its wakes are
+ordinary restores and staging behaves as it does today.
+
### 3.7 What does not change
- Import, `--replaces`, the swap, the gate and commit, everywhere.
@@ -279,9 +295,11 @@ removes the copy. Uncertainty refuses; it never restores.
- Bytes pass through the console only; nothing a request supplies picks a
bucket or key (the seeds spec ruling 2).
- The deployment bucket holds the account's database for the time between
- upload and placement. The snapshot is deleted on `placed` or on
- `rolledback`. An abandoned fleet seed whose cleanup cannot be proved keeps
- its snapshot as well as its hostname until it can (§3.6). This matches what import already does for
+ upload and placement. The snapshot is deleted on `placed`, and the sweep
+ deletes an abandoned seed's snapshot as it does today
+ (`console/seedsweep.go:299`, `Abandoned()`), whether or not cleanup has
+ been proved. A held hostname keeps the record, never the snapshot: the
+ platform holds as little of the account's data as it can (R3-3). This matches what import already does for
region apps.
- The new door trusts only an authenticated fleet identity for the fleet
the record is placed on, and acts only on the seed `id` the record
@@ -318,7 +336,16 @@ removes the copy. Uncertainty refuses; it never restores.
- Admission: a fleet `file` seed whose host already has a replica and no
marker naming its `id` reports `failed` and restores nothing; with the
marker it restores and reports `placed`.
-- Listing failure: a rollback whose replica listing fails reports nothing.
+- Listing failure: a rollback whose listing fails, under either prefix,
+ reports nothing.
+- Orphaned generation (R3-1): `head.json` removed, generation objects left
+ under the replica prefix. Rollback reports nothing; the hostname stays
+ held.
+- Staging (R3-2): a matching-marker retry for an unplaced fleet file seed
+ with objects under `MovesPrefix(host)` reports `failed`, never promotes
+ or restores them; a rollback with staged objects reports nothing.
+- Sweep (R3-3): an aborted fleet file seed's snapshot is deleted by the
+ sweep while its record stays aborted and its hostname held.
- No owner: an aborted fleet `file` seed with no owning box is never
finished by the console or the sweep.
- Readiness: a fleet with one box missing the new heartbeat fields, or
@@ -374,3 +401,17 @@ cannot be proved.
| R2-1 P1 no-owner shortcut | Cut (a): shortcut removed; no console-side finish; seven-day claim corrected (a `ready` seed has no deadline), §3.6 |
| R2-2 P1 leftover replica replaces a new seed | Cut (a): `rolledback` only after a strict empty listing; a left replica holds the hostname for the fleet owner to remove; admission requires the marker naming this seed, §3.6; deterministic interrupt-and-recreate test, §5 |
| R2-3 P3 `refused` in §5 | Fixed |
+
+## 10. Round 3 dispositions
+
+Findings: `CODEX-FINDINGS-fleet-seeded-create-R3.md`. Round 3 was the last
+round without Paul's go. Paul chose (2026-11-20) to apply these fixes and
+go to implementation without a fourth round. The task that changes
+placement and rollback touches production storage, so it gets its own
+review (stopping rule 3), and its brief names R3-1 and R3-2.
+
+| Finding | Disposition |
+|---|---|
+| R3-1 P1 `HasReplica` is not an emptiness proof | Fixed: exhaustive paginated listing of both restore-capable prefixes, fail closed, §3.6 step 3; orphaned-generation test, §5 |
+| R3-2 P1 staging can restore unrelated data | Fixed: staging refused and promotion off for an unplaced fleet file seed; staging in the rollback listing, §3.6; staging tests, §5 |
+| R3-3 P2 snapshot retention vs the sweep | Fixed by matching the sweep: the snapshot goes on abandonment, the record holds the hostname, §4; sweep test, §5 |