carlos / platform Public

HA P1a #433: round 1 findings (unedited) and the scoped round 2 brief

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 3ffbf984a669778ea4fcb8e5d362e1f368787334 parent 961f1e1
2 files changed, +66 −0
  • docs/superpowers/notes/reviews/ASTRA-FINDINGS-ha-p1a-433-r1.md +36 −0
  • docs/superpowers/notes/reviews/CODEX-REVIEW-BRIEF-ha-p1a-433-R2.md +30 −0

CI passed — run details

diff --git a/docs/superpowers/notes/reviews/ASTRA-FINDINGS-ha-p1a-433-r1.md b/docs/superpowers/notes/reviews/ASTRA-FINDINGS-ha-p1a-433-r1.md
new file mode 100644
index 000000000..e9428b8ac
--- /dev/null
+++ b/docs/superpowers/notes/reviews/ASTRA-FINDINGS-ha-p1a-433-r1.md
@@ -0,0 +1,36 @@
+Reviewed `fc30b421..a3650c4c2eca917c2c2cce2c2ffc217114d37f32`, round 1.
+
+**P1: none found.**
+
+**P2 — Registry: fallback omits four migration-added columns.**
+`readCols` gets defaults only from `routeAddedColumns` ([registry.go:1135](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/ha-p1a-dev-pair-433/internal/registry/registry.go:1135)). That list excludes `claim_incarnation`, `claim_stamp`, `claim_owner`, and `claim_row_id`, added separately by [claimrows.go:39](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/ha-p1a-dev-pair-433/internal/registry/claimrows.go:39). All four remain in `routeCols`.
+
+A registry predating that migration still makes both `List` and `Get` fail with `no such column`, contrary to check 3’s requirement to tolerate every migration-added column. An in-memory SQLite probe using the source’s SQL reproduced this for each omitted column. The specific missing-`ha` case succeeds.
+
+Fix: include all four defaults through a shared migration definition and extend the compatibility test to remove each migration-added column independently. The current test checks the fallback list against itself, so it misses these omissions.
+
+**Fault family:** read-only registry compatibility before migration.
+
+**P3: none found.**
+
+Census decisions below approve the trust boundaries and dispositions at this commit; the P2 concerns compatibility completeness.
+
+| Unit or envelope | Class | Verdict | Lines read and basis |
+|---|---|---|---|
+| `provisionTickConfig` | body | APPROVE | `internal/host/agent.go:3490–3519`; same environment inputs, shared parser. |
+| `Registry.List` | body | APPROVE | `internal/registry/registry.go:1065–1102`; read-only connection retained; fixed select identifiers. |
+| `Registry.migrate` | body | APPROVE | `internal/registry/registry.go:646–830`; all 52 extracted statements retain their text and order. |
+| `Registry.Get` | sites | APPROVE | `internal/registry/registry.go:1153–1171`; same connection and parameterized host predicate. |
+| `systemdEdgeMainPID` | new, accepted-legacy | APPROVE | `internal/instancectl/peer_linux.go:74–85`; fixed command and arguments, three-second timeout; invalid answers refused by `readLocked`. |
+| `Registry.readCols` | new, accepted-legacy | APPROVE | `internal/registry/registry.go:703–715,1112–1150`; schema names only control membership checks; SQL comes from binary literals. |
+| `productionPeerOK` | quiet | APPROVE | `internal/instancectl/peer_linux.go:47–70`; scanned command read moved to the separately recorded unit; UID and PID checks remain. |
+| `internal/host` | envelope | APPROVE | `agent.go:635–725,3490–3519`; `layoutleg.go:355–469`; `rootfsplacement.go:149–169,309–321`. Retries precede recovery and startup; unswept fallback and ownership refusal remain. |
+| `internal/instancectl` | envelope | APPROVE | `peer_edge.go:27–115`; `peer_linux.go:22–85`; `server.go:315–365`. Fresh acceptance requires exact PID equality; forced reads are limited; production acceptance is serial. |
+| `internal/provision` | envelope | APPROVE | `reconcile.go:2894–2955`; `provision.go:875`. Only exact `@shared` maps to the shared pool; invalid nonempty tokens remain literal. |
+| `internal/registry` | envelope | APPROVE | `registry.go:607–624,646–830,1017–1171`; `readonly.go:11–25`; `claimrows.go:39–51`. Read-write migration behavior is unchanged; no database-supplied identifier enters generated SQL. |
+
+All four envelope hashes and six recorded function-body hashes match the proposal. `git diff --check` passed. Go tests could not start because the read-only sandbox denied build-directory creation; the SQLite probe is not a Go test result. Network restrictions prevented retrieving #433 or recording decisions on #280. No files changed.
+
+Apply the P2 without reopening the review, retaining the required census and changed-root-behavior checks within this round.
+
+**READY AFTER FIXES**
\ No newline at end of file
diff --git a/docs/superpowers/notes/reviews/CODEX-REVIEW-BRIEF-ha-p1a-433-R2.md b/docs/superpowers/notes/reviews/CODEX-REVIEW-BRIEF-ha-p1a-433-R2.md
new file mode 100644
index 000000000..bcb0d7ec4
--- /dev/null
+++ b/docs/superpowers/notes/reviews/CODEX-REVIEW-BRIEF-ha-p1a-433-R2.md
@@ -0,0 +1,30 @@
+# Review brief: HA P1a #433 fixes and the shared-pool token (code + census), round 2 of 3 (scoped)
+
+Repo carlos/platform, branch `ha-p1a-dev-pair-433`, the commit named in the reviewer's prompt.
+Under review (SCOPED): the P2 fix and census update only, `85db2687` and `961f1e14` (diff `a3650c4c..<that commit>`). Round 1 (READY AFTER FIXES, P2: read-only fallback omitted four claim columns) approved every other unit; do not re-review those. Census units changed: new `addedColumn.spec`, `addedRouteColumnDefaults`; changed `Registry.migrate`, `Registry.migrateClaimOwnership`; other: registry schema re-pin; envelope `internal/registry`.
+Authorities: main's code; the approved spec `docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md` (rev 6.1); AGENTS.md "The census: the reviewer decides". Problem statement: amadan discussion #433.
+
+You are the independent reviewer (Astra; the author is Claude) for both the code and the census. You decide every census class.
+
+## Fixed: do not re-argue
+- Paul's rulings: fix #433; add a reserved token so a box can serve the shared pool plus a named pool (dev HA pair "hapair" on two IE dev boxes, ordinary instances stay one-box).
+
+## What to check
+1. Root peer check (`internal/instancectl/peer_edge.go`, `peer_linux.go`): the re-read of systemd's MainPID on a mismatch accepts ONLY a peer whose pid equals the fresh MainPID; nothing wider; rate limit sound; no TOCTOU that lets another process in.
+2. Agent startup sweep retry (`internal/host/layoutleg.go` `startActivator`): bounded; strictly before recovery and any wake; never a sweep after wakes may start; unswept fallback unchanged.
+3. Registry read-only column tolerance (`Registry.readCols`, `List`, `Get`): root reads every migration-added column as its default when absent; the agent's read-write path unchanged; no SQL built from untrusted input.
+4. `provision.ParseBoxPools` and `@shared`: one parser for both call sites; `@shared` can never be a pool name; a typo can never widen a box to the shared pool; serves_shared_pool consistent.
+5. Census: for every unit and envelope on the card, a verdict citing the lines read; reject if root can now open, run, query or follow anything new from a path or input a tenant, an app or a box agent can create, write or name, or if a check root relies on is weakened.
+
+## Severity
+- **P1**: unsafe (for root, single writer, or tenancy), would not compile, a test fails, or it would not work. Blocks merge.
+- **P2**: wrong or missing. Fixed without reopening this review.
+- **P3**: clarity. Follow-up list only.
+
+## Output
+Findings ranked P1, P2, P3 (area, problem, evidence file:line, failure scenario, fix, fault family), then the census table (unit, class, APPROVE/REJECT, lines read). End with exactly one verdict:
+- **READY**: no P1 and no P2.
+- **READY AFTER FIXES**: no P1; listed P2s fixed without another round.
+- **NOT READY**: one or more P1s, listed.
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents of your own. Do not run the full test suites. Leave GOCACHE unset.