carlos / platform Public

review: Astra findings Task 7 r2, Task 8 r1, Task 10 r1 (unedited)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 3e670a2c77fa6fc786354aa4f2a95283d116f830 parent 8199f60
3 files changed, +75 −0
  • docs/superpowers/notes/reviews/ASTRA-FINDINGS-nearest-region-b-task10-r1.md +23 −0
  • docs/superpowers/notes/reviews/ASTRA-FINDINGS-nearest-region-b-task7-r2.md +28 −0
  • docs/superpowers/notes/reviews/ASTRA-FINDINGS-nearest-region-b-task8-r1.md +24 −0

CI failed — run details

diff --git a/docs/superpowers/notes/reviews/ASTRA-FINDINGS-nearest-region-b-task10-r1.md b/docs/superpowers/notes/reviews/ASTRA-FINDINGS-nearest-region-b-task10-r1.md
new file mode 100644
index 000000000..08218a281
--- /dev/null
+++ b/docs/superpowers/notes/reviews/ASTRA-FINDINGS-nearest-region-b-task10-r1.md
@@ -0,0 +1,23 @@
+1. **P1 — Task 10, spec §2: deletion between the check and copy resurrects a record.**
+ [accounts_hostsused.go:117](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/accounts_hostsused.go:117) checks that the destination exists, then [accounts.go:439](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/accounts.go:439) calls `putMigrationObject`, which uses a create-only PUT with claims off. If a deletion completes between those operations, the PUT succeeds and recreates the deleted instance or sidecar over its retained data.
+ **Fix:** For data-kind records after the window opens, compare the existing destination bytes and return “already copied” or the existing different-content refusal without issuing a PUT. Add a test that deletes the destination immediately after its successful GET.
+ **Fault family:** Destination presence must remain authoritative through publication; no post-window resurrection.
+
+2. **P1 — Task 10, spec §§2–3a: a running migration retains permission to create across activation.**
+ [accounts.go:368](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/accounts.go:368) reads history once for the entire migration. [accounts_hostsused.go:114](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/accounts_hostsused.go:114) subsequently relies on that cached mode. A migration can read `incomplete`, pause while copying other objects, and resume after `begin` and `complete`. It then marks and creates an absent destination, even if the inventory already marked that hostname because old data remains. Existing marks deliberately pass. This CLI is absent from the console’s drain counts.
+ **Fix:** Serialize pre-window record publication with the transition to `activating—for example, through a console operation holding the same transition lock through the mode check and publication. A fresh GET alone still leaves a check/write race. Test a paused migration spanning activation.
+ **Fault family:** The activation boundary must exclude every outstanding data-kind publication.
+
+3. **P2 — Task 10, spec §4: the floor check follows registry writes.**
+ [accounts.go:341](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/accounts.go:341) opens the registry before checking the floor at line 368. [internal/registry/registry.go:610](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/internal/registry/registry.go:610) runs schema migrations on open, including table creation and account initialization. A below-floor invocation against a missing or older registry can therefore modify it before refusing, including with `--dry-run`.
+ **Fix:** Read and enforce the floor before opening the registry. Test that a below-floor invocation leaves a missing registry absent and an existing registry unchanged.
+ **Fault family:** Floor refusal must precede every write.
+
+4. **P2 — Task 10 tests: the witnesses do not protect the verb’s integration.**
+ [accounts_record_sequence_test.go:139](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/accounts_record_sequence_test.go:139) reconstructs the check/copy sequence in `migrateOne`; removing both new call sites from `runAccountsMigrate` would leave these tests intact. It also reloads history for each copy, unlike the verb. `TestMigrateIdenticalDestinationPasses` stops after `beforeRecord`, and `TestCLIRefusesBelowFloor` invokes only the reader, so neither verifies the complete promised behavior.
+ **Fix:** Exercise `runAccountsMigrate` through an isolated CLI subprocess, or extract its complete migration operation and test that shared implementation. Include identical-destination success, refusal before writes, and the two interleavings above.
+ **Fault family:** Regression witnesses must exercise the production enforcement path.
+
+The targeted test command could not start: the read-only sandbox denied creation of Go’s work directory. Findings are based on verified source inspection. `GOCACHE` remained unset; no files were edited.
+
+**NOT READY**
\ No newline at end of file
diff --git a/docs/superpowers/notes/reviews/ASTRA-FINDINGS-nearest-region-b-task7-r2.md b/docs/superpowers/notes/reviews/ASTRA-FINDINGS-nearest-region-b-task7-r2.md
new file mode 100644
index 000000000..ea3eeb03b
--- /dev/null
+++ b/docs/superpowers/notes/reviews/ASTRA-FINDINGS-nearest-region-b-task7-r2.md
@@ -0,0 +1,28 @@
+Round 1 P1 — **partly resolved**: failed writes eventually latch invalidation, but concurrent creates can still proceed before that latch is set.
+Round 1 P2 — **partly resolved**: region, sidecar, closed-fleet and automatic-placement witnesses were added; seed/import S4 witnesses remain missing.
+
+1. **P1 — Failed invalidation leaves creates enabled while paging.** Task 7, spec §4, brief check 5.
+
+ A failed mode write clears cached state and releases the mutex at [hostsused.go:333](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/internal/console/hostsused.go:333). `invalidateHosts` then calls `alerting.Page` **before** setting the latch at [hostsused.go:214](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/internal/console/hostsused.go:214). Paging synchronously invokes network sinks at [alerting.go:126](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/internal/alerting/alerting.go:126).
+
+ **Failure scenario:** recovery detects an absent mark; the invalidation PUT fails without landing; paging stalls. A concurrent request for another app and hostname reloads the store’s unchanged `active` mode, passes admission and marking, and publishes despite the detected breach.
+
+ **Concrete fix:** establish the invalidated state and latch under the same mutex that protects admission, before releasing it on persistence failure. Page afterward. Verify with a blocked alert sink and a concurrent real create request. The existing test waits for recovery to return before creating at [hostsused_active_test.go:291](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/internal/console/hostsused_active_test.go:291), so it misses this interval.
+
+ **Fault family:** a detected history breach must keep data-kind creates refused until re-inventory—the same family as round 1’s P1.
+
+2. **P2 — Seed/import S4 enforcement still lacks door-level witnesses.** Task 7, brief checks 4 and 6.
+
+ `TestUnexaminedTargetRefusedAtEveryDoor` explicitly skips every fixture except region and sidecar at [hostsused_active_test.go:319](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/internal/console/hostsused_active_test.go:319). Its additional fleet case exercises an ordinary instance.
+
+ **Failure scenario:** a seed/import dispatch regression that bypasses S4 can pass these tests.
+
+ **Concrete fix:** exercise seed and import requests with an explicit unexamined region, lifetimes off and on; assert S4 and absence of marks and published records.
+
+ **Fault family:** enforcement must be witnessed at the publishing doors.
+
+Stopping rule 2 applies; review stopped at the repeated P1 family. The recommended choice is one atomic enforcement point with a concurrency guard test. The alternatives are refusing the case before work starts or cutting the feature.
+
+No files changed. Targeted tests were attempted with `GOCACHE` unset, but the read-only sandbox prevented Go from creating its work directory; no tests ran.
+
+**NOT READY**
\ No newline at end of file
diff --git a/docs/superpowers/notes/reviews/ASTRA-FINDINGS-nearest-region-b-task8-r1.md b/docs/superpowers/notes/reviews/ASTRA-FINDINGS-nearest-region-b-task8-r1.md
new file mode 100644
index 000000000..6973df85c
--- /dev/null
+++ b/docs/superpowers/notes/reviews/ASTRA-FINDINGS-nearest-region-b-task8-r1.md
@@ -0,0 +1,24 @@
+1. **P1 — An initial mode-read failure permanently skips the startup tripwire.** Task 8, spec §4.
+ [hostsused.go:139](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/internal/console/hostsused.go:139) schedules the tripwire only when the initial read returns `active`. If that read fails, a later request reloads the mode through [hostsused.go:361](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/internal/console/hostsused.go:361), but never runs the scan.
+
+ **Failure scenario:** a restore leaves an uncovered record; the startup mode GET fails transiently; the next request reads `active` successfully and creates resume without any tripwire or retry.
+ **Fix:** retry the complete startup check, including failed mode reads, until it finishes. Add a failure-injection witness through `LoadHostsMode` and a real create request.
+ **Fault family:** startup verification must finish before the console trusts an active history.
+
+2. **P1 — Creates remain enabled while an incomplete tripwire retries.** Task 8, brief check 4.
+ [hostsused.go:147](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/internal/console/hostsused.go:147) starts a background retry after a scan error but retains cached `active`. Admission at [hostsused.go:365](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/internal/console/hostsused.go:365) has no pending-check gate. Startup itself has a 20-second deadline at [main.go:563](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/cmd/console/main.go:563).
+
+ **Failure scenario:** listing or reading restored records times out before reaching an uncovered data record. The console serves creates and enables nearest-region while the retry remains unfinished, although completing the scan would invalidate the history and refuse those creates.
+ **Fix:** track startup verification separately from persisted mode; temporarily refuse data-kind creates and disable nearest-region until verification finishes. Store errors should remain retryable without themselves invalidating history. Test requests while a retry is blocked.
+ **Fault family:** startup verification must finish before the console trusts an active history.
+
+3. **P1 — Operator invalidation acknowledges success before it is durable.** Task 8, spec §4 restores and brief check 2.
+ On a failed mode write, [hostsused.go:217](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/internal/console/hostsused.go:217) latches invalidation only in memory, schedules persistence, and returns nil. The operator handler consequently returns HTTP 200 at [hostsused_tripwire.go:150](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/nearest-region-b-review/internal/console/hostsused_tripwire.go:150).
+
+ **Failure scenario:** after a restore drops marks for deleted records whose data remains, the operator invalidates successfully, but the PUT failed. A restart before persistence reloads `active`. No surviving uncovered record exists for the tripwire to detect, so creates resume without re-inventory.
+ **Fix:** preserve the immediate refusal latch, but acknowledge operator success only after invalidation is durable. Return a retryable failure otherwise and permit retrying persistence. Test with a failed PUT and a genuinely new server instance.
+ **Fault family:** acknowledged invalidation must survive restart until re-inventory completes.
+
+No files changed; GOCACHE remained unset. Targeted tests were attempted but could not start because the read-only sandbox prevented Go from creating its temporary build directory.
+
+**NOT READY**
\ No newline at end of file