P1a whole-branch review round 1: findings, unedited
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+85
−0
docs/superpowers/notes/reviews/ASTRA-FINDINGS-region-ha-p1a-branch-r1.md+85 −0
CI failed — run details
diff --git a/docs/superpowers/notes/reviews/ASTRA-FINDINGS-region-ha-p1a-branch-r1.md b/docs/superpowers/notes/reviews/ASTRA-FINDINGS-region-ha-p1a-branch-r1.md| new file mode 100644 |
| index 000000000..a15d95321 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/reviews/ASTRA-FINDINGS-region-ha-p1a-branch-r1.md |
| @@ -0,0 +1,85 @@ |
| +Reviewed `f7644a9c..73c2a08286b597c0a654e10b63590f22957b5555`, round 1. Four P1 findings and one P2. |
| + |
| +No files edited or subagents used. The targeted test attempt failed before compilation because the sandbox could not create Go’s work directory. Runtime tests, cross-compilation and the binary-size ceiling remain unverified. |
| + |
| +1. **P1 — Failed-wake release can authorize another writer before the host is empty.** |
| + |
| + Normal sleep checks the whole host slice in [harelease.go:147](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/activator/harelease.go:147). Failed-wake cleanup instead proceeds from individual-process/generation proof to `rep.Close` at [maintenance.go:424](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/activator/maintenance.go:424); the reaper repeats this at `opset.go:892–907`. |
| + |
| + A concrete escape is a replacement invocation during stop: `unitproc.go:327–331` reports the old process exited when it observes a foreign invocation, without proving the slice empty. For generation zero, `genChildProof` succeeds and the nested-layout fallback performs no further check. Cleanup can then publish an unclean marker while the replacement still runs. Another box may acquire that marker immediately. |
| + |
| + **Fix:** require whole-host emptiness before every post-start HA release, including health-failure cleanup and the reaper; retain ownership while proof is unavailable. Add a failed-wake witness with the tracked invocation gone but the host slice populated. The simulation’s failed-wake path at `actions_test.go:647` also needs that case. |
| + |
| + **Fault family:** I1 — termination proof before transferring ownership. |
| + |
| +2. **P1 — Secret minting and launch use different reads from the HA checks.** |
| + |
| + [hasecrets.go:74–81](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/activator/hasecrets.go:74) permits mint producers without checking the manifest whenever its initial env read contains both secrets. [prepare.go:84–102](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/activator/prepare.go:84) subsequently calls producers that reread the tenant-writable file, then checks publication, then reads the launch environment again. |
| + |
| + During a staged start, the existing generation can replace the env after the gate’s read. `ensureAdminToken` then mints at `admintoken.go:223`; the instance-key producer can likewise mint at `instancekey.go:511` when its later reads and configuration check find no key. An existing manifest does not stop either producer. The new pair can replace the published pair, violating continuity. Separately, replacement after `haSecretsReady` can make the launch consume bytes that were never acknowledged. |
| + |
| + **Fix:** enforce the manifest-based no-mint decision inside both producers’ missing-secret branches. Capture the launch environment and publish/verify those exact bytes before passing that same captured environment to the process. Add mutation-between-reads tests. |
| + |
| + **Fault family:** I2 / §7.3 — secret continuity and acknowledged-before-launch authority. |
| + |
| +3. **P1 — Concurrent creation bypasses the HA placement refusal.** |
| + |
| + [fleets.go:615](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/console/fleets.go:615) checks for HA records before changing placement. It later lists records again and calls `SetRecordRegion` at line 697. [provision.go:1007](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/provision/provision.go:1007) checks seed restrictions but has no HA refusal. |
| + |
| + An instance-create request can read the old placement at `apiinstances.go:1370`, then create a fresh born-HA record after placement’s preflight. Placement’s later list finds that record and moves it. Creation’s app lock does not protect the placement operation. This requires no hostname reuse and can move an HA host into an unsupported fleet placement, stranding it. |
| + |
| + **Fix:** serialize placement with instance creation across placement selection, HA preflight and writes; reread placement under that admission. Also refuse HA region changes inside `SetRecordRegion`’s CAS mutation. Test creation between the two placement scans. |
| + |
| + **Fault family:** HA move admission — refusal must cover the records actually moved. |
| + |
| +4. **P1 — The pinned tip has an unsatisfied census gate.** |
| + |
| + [registry.go:217](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/registry/registry.go:217) adds `Route.HA`, but `testdata/census-base.tsv:5453` does not contain `HA`, and neither overlay in the pinned chain adds it. [plan14_root_reads_test.go:693](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/provision/plan14_root_reads_test.go:693) reports this mismatch as `changed registry schema`, and the test fails on discrepancies at line 713. |
| + |
| + This is a statically established gate failure, not a claimed test execution. The branch also changes source envelopes without its whole-branch overlay. The ledger schedules this work before merge; it is still outstanding at the requested commit. |
| + |
| + **Fix:** complete the census card, claims, proposal and independent approval against the final code, then run the census checks. Do not weaken the inventory comparison. |
| + |
| + **Fault family:** census coverage and approval of root-consumed source. |
| + |
| +5. **P2 — The restart witness leaves the supposedly dead agent running.** |
| + |
| + [hasamebox_test.go:207–208](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/activator/hasamebox_test.go:207) models death by changing lock expiry. [harelease_test.go:286–301](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-no-claims/internal/activator/harelease_test.go:286) constructs the replacement service without stopping/joining the original renewer, replication and publisher. Replacement services lack complete teardown; `hawake_test.go:68–71` also leaves lease globals changed. |
| + |
| + The old agent can continue touching the fixture and shared files during “recovery,” so the witness does not establish recovery after agent death and can contaminate subsequent tests. |
| + |
| + **Fix:** add an abandon-without-release test seam that stops and joins agent-owned background work while preserving the simulated surviving unit and lock. Tear down every replacement and restore globals. |
| + |
| + **Fault family:** crash-model fidelity and test isolation. |
| + |
| +Deferred-minor triage: |
| + |
| +| Deferred item | Disposition | |
| +|---|---| |
| +| T1–3: hosting latch has no setter; box HA switch produces 503 | **Follow-up:** P1b/P2; keep that box switch off for P1a. | |
| +| T1–3: join units retired only during live bootstrap | **Follow-up:** inert residual units. | |
| +| T1–3: orphan enrollment interfaces and Auto Scaling dependency | **Follow-up:** removal with its census update. | |
| +| T4: unused participation entry point/parameter and changed unarmed-floor behavior | **Follow-up:** intended P0 removal behavior. | |
| +| T5: untested identity retry closure and perpetual off-EC2 retries | **Follow-up:** test retry behavior and bound unnecessary probes. | |
| +| T6–7: landed acquire retried by SDK strands lock until expiry | **Follow-up:** conditional-write ambiguity; ownership remains exclusive. | |
| +| T6–7: unreadable obligation file blocks HA acquires | **Follow-up:** preserve refusal; the error is surfaced. | |
| +| T6–7: externally deleted lock leaves a perpetual 404 obligation | **Follow-up:** explicit repair/un-HA procedure. | |
| +| T8: tenant-writable release record | **Follow-up:** protect/authenticate the witness; no independent post-release tenant writer established once containment holds. | |
| +| T8: ctime granularity edge | **Follow-up:** filesystem precision validation under the approved metadata-proof design. | |
| +| T9: optional restored-class capability lost by other wrappers | **Follow-up:** no affected production wrapper found. | |
| +| T9: tests leave lease globals changed | **Fix before merge:** finding 5. | |
| +| T9: marked-only hosts incur a record GET until indexed | **Follow-up:** within the index-miss path. | |
| +| T10: failed-wake/reaper release lacks whole-slice proof | **Fix before merge:** finding 1. | |
| +| T10: absent host slice counts as empty | **Follow-up:** valid absence is consistent with proven containment; read errors must remain refusals. | |
| +| T10: two tests take approximately 20 seconds | **Follow-up:** bounded test-time improvement. | |
| +| T10: publisher mutex spans an app PUT | **Follow-up:** retain the explicit accepted cut. | |
| +| T11: awkward deferred-key log wording | **Follow-up:** P3 copy polish. | |
| +| T11: no lease TTL seam; witness rewrites expiry | **Follow-up:** expiry injection itself is adequate once finding 5 stops the old agent. | |
| +| T12: original background work survives “crash”; replacement lacks teardown | **Fix before merge:** finding 5. | |
| +| T12: no paging hook for same-box refusal | **Follow-up:** observability integration. | |
| +| T12: refusal-log throttle untested | **Follow-up:** focused throttle test. | |
| +| T12: every unit start assumes this process acquired ownership | **Follow-up:** make the contract explicit and retain start-path coverage. | |
| +| T13: planned fixture names differed from actual helpers | **Follow-up:** no corrective code required. | |
| +| T14: reused-hostname stale-negative-index gap | **Follow-up:** retain the #199 production gate and fresh-hostname dev restriction exactly as ruled. | |
| + |
| +**NOT READY** |
| \ No newline at end of file |