spec: round 3 findings for #1139 (NOT READY; round 4 needs Paul)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+45
−0
docs/superpowers/specs/CODEX-FINDINGS-fleet-seeded-create-R3.md+45 −0
CI cancelled — superseded by a newer push — run details
diff --git a/docs/superpowers/specs/CODEX-FINDINGS-fleet-seeded-create-R3.md b/docs/superpowers/specs/CODEX-FINDINGS-fleet-seeded-create-R3.md| new file mode 100644 |
| index 000000000..bb367290b |
| --- /dev/null |
| +++ b/docs/superpowers/specs/CODEX-FINDINGS-fleet-seeded-create-R3.md |
| @@ -0,0 +1,45 @@ |
| +- **R2-1 — Resolved:** §3.6 removes the no-owner shortcut and correctly gives `ready` no deadline. |
| +- **R2-2 — Partly resolved:** holding the hostname is specified, but the proposed listing does not prove absence of all replica data, and marker admission still permits restoration from unrelated staging data. Carried below. |
| +- **R2-3 — Resolved:** §5 now expects `failed` → `aborted`. |
| + |
| +Reviewed against `2b535c92`; HEAD adds only the round 3 brief. The four authorities match `origin/main`. No files changed or tests run. |
| + |
| +1. **P1 — §3.6: `hasOwnReplica` does not prove the replica prefix is empty.** |
| + |
| + **Problem:** Design lines 230–234 equate `hasOwnReplica == false` with “no replica object.” Those are different predicates. |
| + |
| + **Evidence:** `internal/activator/seedplace.go:40` binds `hasOwnReplica` to `lease.HasReplica`. At `internal/lease/check.go:412`, that function resolves `head.json`, returns true if a head exists, otherwise checks only LTX files at the supported levels (`:428`). Without a head, resolution selects the root layout (`internal/lease/resolve.go:80–94`); it does not enumerate orphaned generation directories or every object beneath the host prefix. |
| + |
| + **Failure scenario:** During manual cleanup, the owner removes `head.json` while generation data remains. With no root-layout LTX files, `HasReplica` returns false. Rollback reports `rolledback`, and the console releases the hostname with replica data still present. This violates the chosen cut even without a concurrent upload. |
| + |
| + **Concrete fix:** Specify an exhaustive, paginated object listing beneath the exact host prefix, failing closed on any error or remaining object. Keep `HasReplica` for its existing restore-selection purpose. Add a deterministic test with generation objects remaining after head removal; the hostname must stay held. No fleet-side deletion is needed. |
| + |
| + **Fault family:** Hostname release requires complete cleanup. |
| + |
| +2. **P1 — §3.6 admission: the matching marker does not constrain the replica actually restored.** |
| + |
| + **Problem:** The proposed marker check admits `restoreOwn`, but that function calls the ordinary restore path, which can replace the checked replica with data from another prefix. |
| + |
| + **Evidence:** `internal/activator/seedplace.go:133–142` calls `restorePlain` before writing the marker. `internal/activator/backend_exec.go:1131–1143` promotes staging before restoring the ordinary replica. Promotion lists `moves/<host>/` at `:4315` and mirrors it over the host replica at `:4347`. The mirror is wired at `internal/host/agent.go:865–868`. Neither the proposed admission check nor rollback listing checks that staging prefix. |
| + |
| + **Failure scenario:** A file seed uploads its replica but loses the placement report. Its marker remains, while its local database is subsequently lost. An unrelated root-layout replica remains under `moves/<host>/`. On retry with staging fallback enabled, the marker passes admission, but `restoreOwn` promotes and restores the staged data, then reports this seed placed. The seed has restored data it did not make. |
| + |
| + **Concrete fix:** For an unplaced fleet file seed, refuse unrelated staging and prevent the retry restore from invoking staging promotion. Include every restore-capable prefix in the cleanup/admission rules. Extend §5 with a matching-marker retry containing conflicting staged data; it must never restore or promote that data. |
| + |
| + **Fault family:** A fresh seed must not inherit another incarnation’s replica. |
| + |
| +3. **P2 — §3.3 versus §4: snapshot retention contradicts the unchanged sweep.** |
| + |
| + **Problem:** §4 promises that an aborted fleet seed retains its snapshot until cleanup is proved, while §3.3 says the sweep’s cases apply unchanged. |
| + |
| + **Evidence:** `internal/console/seedsweep.go:295–302` deletes a matching snapshot whenever `rec.Seed.Abandoned()` is true, without requiring `rolled-back`. |
| + |
| + **Failure scenario:** A fleet seed remains aborted because its replica still exists, but the adapted sweep deletes its deployment-bucket snapshot before cleanup acknowledgement. |
| + |
| + **Concrete fix:** Explicitly retain the matching snapshot for an aborted fleet file seed until `rolled-back`, and add a sweep test for that state. Preserve existing region behavior. |
| + |
| + **Fault family:** Snapshot lifecycle must match the declared retention contract. |
| + |
| +The deterministic interrupt-and-recreate test covers the original sequence, but not the two P1 cases above. Both remain within R2-2’s fault family. Round 3 is exhausted; a fourth review requires Paul’s go. |
| + |
| +**NOT READY** |
| \ No newline at end of file |