carlos / platform Public

Astra plan review round 3 (final) on P1a: findings, unedited

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 592fb92fedc4e9ee50cccede4cfd382f6ca87c00 parent 4e5679d
1 file changed, +115 −0
  • docs/superpowers/notes/reviews/ASTRA-FINDINGS-region-ha-p1a-plan-r3.md +115 −0

CI failed — run details

diff --git a/docs/superpowers/notes/reviews/ASTRA-FINDINGS-region-ha-p1a-plan-r3.md b/docs/superpowers/notes/reviews/ASTRA-FINDINGS-region-ha-p1a-plan-r3.md
new file mode 100644
index 000000000..aeaf7e90e
--- /dev/null
+++ b/docs/superpowers/notes/reviews/ASTRA-FINDINGS-region-ha-p1a-plan-r3.md
@@ -0,0 +1,115 @@
+- **r2.1 — Partly, P1:** HA deletion paths are covered; two release-obligation paths remain unhandled.
+- **r2.2 — Resolved:** cut by N-HA7.
+- **r2.3 — Resolved:** the mint gate now precedes the actual token producers.
+- **r2.4 — Partly, P1:** a surviving test still uses the deleted field.
+- **r2.5 — Resolved:** external lease tests avoid the import cycle.
+- **r2.6 — Partly, P1:** HA acquisition reclassifies conflicts, but cached legacy classification can bypass it.
+- **r2.7 — Resolved:** cut by N-HA7.
+- **r2.8 — Resolved:** completeness now includes `Retry` and `Torn`.
+- **r2.9 — Partly, P1:** the import rollback case is closed; the move refusal lacks its record input.
+- **r2.10 — Resolved:** the owner test exercises `agentEntry`.
+- **r2.11 — Resolved:** cut by N-HA7.
+- **r2.12 — Resolved:** the acquisition algorithm and stated request budget agree.
+
+Reviewed `4e5679d628619839f6d8e6b85f44b009cf5a98c4` on `design-region-ha-no-claims`. Static review against this checkout and the approved spec. No files changed, tests run, subagents spawned, or dev actions taken.
+
+1. **P1 — Tasks 6 and 9: a cached non-HA entry can bypass an HA lock.** Carries r2.6.
+
+ `isHA` reads the lock only when the record is non-HA **and the index missed**. An index hit containing `HA:false` therefore takes unchanged legacy acquisition, despite the global requirement to honour HA-format locks. See [plan:539–552](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/docs/superpowers/plans/2026-10-26-region-ha-p1a-first-slice.md:539) and [lease.go:193–195](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/lease/lease.go:193).
+
+ **Failure:** A caches an unwoken legacy host. That record is deleted and the hostname recreated born HA; its empty prefix permits creation. B acquires and runs it. Before A reconciles, B hangs past expiry. A’s cached negative classification enters legacy acquisition, which accepts B’s expired HA lock. Both boxes can run the host. This is hostname recreation, not migration. The existing create rail checks remote LTX data, not stale registrations on other boxes: [createleftovers.go:69–88](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/console/createleftovers.go:69).
+
+ **Fix:** make legacy acquisition’s existing-lock path recognize HA format and refuse or enter HA acquisition, with every write conditional on the classified ETag. Add a stale-negative-index/recreated-host interleaving witness.
+
+ **Fault family:** I1/I2, acquisition across the HA/legacy boundary.
+
+2. **P1 — Tasks 9, 10 and 12: an empty cgroup does not prove containment of the previous HA process.**
+
+ Task 12 accepts `EmptyHost(...) == nil`, but the plan leaves ordinary flat spawning unchanged. That spawning can run without a cgroup or fall back after placement fails. See [plan:732–736](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/docs/superpowers/plans/2026-10-26-region-ha-p1a-first-slice.md:732), [backend_exec.go:505–508](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/activator/backend_exec.go:505), and [cgroup.go:529–551](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/cgroup/cgroup.go:529). `EmptyHost` treats an absent host cgroup as empty; terminal-stop checking also accepts `ErrNoDelegation`: [genbackend.go:623–637](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/activator/genbackend.go:623), [opset.go:405–417](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/activator/opset.go:405).
+
+ **Failure:** an HA process or descendant starts outside the host cgroup. After restart, that cgroup can be empty while the process survives, so Task 12 permits recovery. Alternatively, leader-only stop proof permits a release marker while a descendant still writes; B then acquires.
+
+ **Fix:** require placement before execution for every HA process, with no uncontained fallback, and require complete process-tree proof before marker release. Refuse unsupported containment before launch. Test placement failure and a surviving descendant through production wake/stop paths.
+
+ **Fault family:** I1, process containment and ownership transfer.
+
+3. **P1 — Tasks 6, 7 and 10: owed markers can still be forgotten.** Carries r2.1.
+
+ Task 10 enumerates `giveBack`, `oweRelease`, `finishStop` and immediate failed-wake cleanup, but omits:
+
+ - An acquisition returning `ObligationError` without a handle. The caller returns that error without recording it: [activator.go:2269–2280](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/activator/activator.go:2269).
+ - Deferred failed-wake cleanup. `reapUnprovenWake` calls `u.rep.Close`, logs failure, then deletes the retained wake: [opset.go:875–906](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/activator/opset.go:875).
+
+ These paths are absent from [Task 10’s wiring list](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/docs/superpowers/plans/2026-10-26-region-ha-p1a-first-slice.md:602).
+
+ **Failure:** a late acquisition acknowledgement triggers cleanup, or a retained failed wake finally stops; its marker PUT fails once. The exact ETag/body is discarded instead of persisted. Other boxes remain refused indefinitely, and unsupported same-box recovery cannot rescue it.
+
+ **Fix:** route acquisition errors and deferred replicator-close errors through `noteReleaseErr` before returning or forgetting ownership. Add restart witnesses for both paths with the marker PUT failing.
+
+ **Fault family:** durable release obligations and recovery.
+
+4. **P1 — Task 9: instance-record lookup blocks excluded legacy sidecars.**
+
+ The index is populated by the instance scan, and every miss calls `provision.GetRecord`; a failed read fails the wake. See [plan:510–551](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/docs/superpowers/plans/2026-10-26-region-ha-p1a-first-slice.md:510). That scan lists only `instances/`: [reconcile.go:949–956](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/provision/reconcile.go:949). Native sidecars have separate `sidecars/<name>.json` records: [sidecar.go:64–71](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/provision/sidecar.go:64).
+
+ **Failure:** a legacy sidecar reaches the shared `ExecBackend.Acquire`, misses this index, then fails to find an instance record. Its wake fails despite P1a explicitly leaving sidecars legacy. Hand-added hibernating routes without instance records have the same problem.
+
+ **Fix:** explicitly classify excluded route families before instance-record lookup, preserving their existing acquisition path. Keep failed record reads fail-closed for eligible provisioned instances. Add real sidecar and unprovisioned-route wake witnesses.
+
+ **Fault family:** N-HA7 scope and legacy compatibility.
+
+5. **P1 — Tasks 12 and 15: the restart drill promises recovery that nested hosts cannot perform.**
+
+ Task 12 unconditionally refuses nested same-box recovery, while Task 15 expects A’s restarted agent to retake the test host after expiry: [plan:735](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/docs/superpowers/plans/2026-10-26-region-ha-p1a-first-slice.md:735), [plan:855–857](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/docs/superpowers/plans/2026-10-26-region-ha-p1a-first-slice.md:855).
+
+ **Failure:** the newly created test instance uses the normal nested default. After killing A’s agent, B is refused and A is also refused permanently. Nested is the default on ready boxes, and new hibernating routes receive nested paths: [layoutleg.go:70–79](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/host/layoutleg.go:70), [reconcile.go:505–513](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/provision/reconcile.go:505).
+
+ **Fix:** implement the nested unit-stop/cgroup-empty proof, or explicitly restrict admission and the dev fixture to a supported layout and prevent automatic conversion during the experiment. Test restart using the actual minted layout.
+
+ **Fault family:** recovery support and rollout acceptance.
+
+6. **P1 — Task 4: the deletion still leaves an uncompilable test.** Carries r2.4.
+
+ The enumerated updates omit `TestDecidePrevWritesTheSidecarAndVerdictBeforeTheJournal`, which assigns `f.a.regionHA = true` and relies on its deferral. See [plan:153–160](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/docs/superpowers/plans/2026-10-26-region-ha-p1a-first-slice.md:153) and [systemapply_test.go:1845–1872](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/host/systemapply_test.go:1845).
+
+ **Failure:** deleting the field leaves `internal/host` tests uncompilable. Removing just the assignment also removes the condition that makes its assertions meaningful.
+
+ **Fix:** preserve this ordering witness using a surviving participation-based deferral, and include it explicitly in Task 4’s test disposition and run list.
+
+ **Fault family:** build compatibility and deletion completeness.
+
+7. **P1 — Task 13: `offlineSelect` has no record on which to enforce the HA refusal.** Carries the unresolved move portion of r2.9.
+
+ The plan directs `offlineSelect` to check `d.rec.HA`, but its signature receives only fleet data and host/from/to strings. The proposed test retains that signature and passes only `d.rec.Host`: [plan:763](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/docs/superpowers/plans/2026-10-26-region-ha-p1a-first-slice.md:763), [plan:777–779](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/docs/superpowers/plans/2026-10-26-region-ha-p1a-first-slice.md:777), [apiinstancemove_offline.go:384](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/console/apiinstancemove_offline.go:384).
+
+ **Failure:** the specified expression cannot compile there; without an additional input or relocated check, this function cannot distinguish an HA host from a legacy one in the same fleet.
+
+ **Fix:** put the refusal in `offlineBeginChecks`, where the record exists, or change the interface and every caller/test to supply it. Verify the actual start/stage doors refuse before writes.
+
+ **Fault family:** interface completeness at the HA/move boundary.
+
+8. **P2 — Task 11: the crash witness does not prove reminting or valid recovery.**
+
+ `TestFirstWakeCrashBeforePublishRemints` only checks that another backend’s launch succeeds and publishes a nonempty env: [plan:712–715](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/docs/superpowers/plans/2026-10-26-region-ha-p1a-first-slice.md:712). It neither compares secrets nor exercises recovery through acquisition. Task 6 correctly refuses another box’s expired lease.
+
+ **Failure:** retaining unpublished local secrets, or bypassing acquisition in the helper, can leave this test passing.
+
+ **Fix:** crash and restart the same box through the service wake path, perform supported emptiness proof, and assert both unpublished secrets are replaced and acknowledged before execution. Separately assert another box remains refused.
+
+ **Fault family:** secret-recovery regression coverage.
+
+9. **P2 — Tasks 2–4, Census: the root-run row inventory is incomplete.**
+
+ The table names `runSystem` but omits the changed `systemVerb` authority row. It also names `enabledUnits`/`retireUnits` without identifying the changed `bootstrapWith` authority body. See [plan:867–876](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/docs/superpowers/plans/2026-10-26-region-ha-p1a-first-slice.md:867), [claims-cleanup-r2.tsv:5](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/provision/testdata/plan14-root-reads-claims-cleanup-r2.tsv:5), and [plan14-root-reads.tsv:1040](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/provision/testdata/plan14-root-reads.tsv:1040).
+
+ **Failure:** the stated approval inventory omits changed root authority units; the census will require additional dispositions.
+
+ **Fix:** enumerate those units explicitly and reconcile the complete table against the generated census card.
+
+ **Fault family:** root-authority review completeness.
+
+No P3 findings.
+
+The outstanding P1s **do not share one cause**: they cover HA classification, containment, obligation persistence, unsupported route/layout handling, and incomplete edits. Refusing unsupported containment/layouts up front would remove those cases; refusing hostname reuse would remove finding 1’s demonstrated interleaving. Neither resolves the lost obligations or build/interface defects. Cutting HA would remove its new runtime hazards, but the P0 deletion failure would remain.
+
+**NOT READY**
\ No newline at end of file