carlos / platform Public

review: Astra brief for the named-units branch and census

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev a7fa9aed610959a40b2d7a31528af5d42d39a71f parent 7b440f7
2 files changed, +71 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-named-units-param-114-branch.md +41 −0
  • docs/superpowers/reviews/named-units-param-114-deferred-and-rulings.md +30 −0

CI failed — run details

diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-named-units-param-114-branch.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-named-units-param-114-branch.md
new file mode 100644
index 000000000..d20facf87
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-named-units-param-114-branch.md
@@ -0,0 +1,41 @@
+# Review brief: branch named-units-param-114 (whole branch + census), round 1 of 3
+
+Repo carlos/platform, branch `named-units-param-114`, commit 7b440f71fd4b23d175524397652176ffbfac2e52.
+Under review: the diff `0acb2767..7b440f71fd4b23d175524397652176ffbfac2e52` (merge base with main), and the census card docs/superpowers/notes/census-proposal-named-units-param-114.md.
+Authorities: the spec docs/superpowers/specs/2026-11-19-named-units-from-parameters-design.md and plan docs/superpowers/plans/2026-11-19-named-units-from-parameters.md (both on this branch, approved by Paul 2026-11-19; the plan already passed two Astra rounds, findings in docs/superpowers/reviews/CODEX-FINDINGS-named-units-param-114-plan-R1.md and -R2.md). #114's merged design: docs/superpowers/specs/2026-09-07-named-unit-config-delivery-design.md on main.
+
+You are an independent reviewer. Read the diff, then the code it reaches, and check every claim against that code.
+
+## Fixed: do not re-argue
+
+- Paul's rulings: a root-owned declaration decides, the registry never authorises (2026-10-28, #114); approach A, an operator-written SSM parameter /carlos/host/named-units/<instance-id> read by root (2026-11-19); outcomes reach the operator through the heartbeat (2026-11-19).
+- Controller rulings during the build are listed in docs/superpowers/reviews/named-units-param-114-deferred-and-rulings.md. Report a ruling only if its mechanism is unsafe.
+- Copy was reviewed (Luna, delegated by Paul); do not review wording.
+
+## What to check
+
+1. Authority: can anything on a box (the agent as uid carlos with IMDS reach, a tenant, a registry or bucket row, a file the agent can write) make root install declarations an operator did not write, read a different parameter, or skip the gates? Is every branch of the fetch step fail-safe (absent, error, equal bytes, invalid, held, failed)?
+2. Release path: proofnamed.go now uses namedunits.Decode and guardNames. Is it behaviour-identical (errors, binding evidence, guard read)? Does declarationBindingInUse faithfully mirror when the recovery code would still compare the file identity? Can a new file identity strand a rollback or history completion?
+3. Locking and ordering in runAdoptUnderRootRelease and adoptConfigSync: the step after the restart-only return, outside the CARLOS_SECRETS_KEY branch, status written before ParsePublicKey; the config-sync flock taken by the step and then by SyncUnits; InstallNamedUnits guard check under the lock.
+4. SyncUnits outcomes: exactly once per declared host with the final state on every exit; no printed output changed; nil hook safe.
+5. Heartbeat and CLI: nothing reads the status record as authority; put never runs the box-local guard rule; console rows stay behind the system-operator gate.
+6. Census: give a verdict (approve or reject) for every unit and every re-pinned envelope on the card, per AGENTS.md "The census: the reviewer decides", citing the lines you read.
+7. Triage the deferred minors in named-units-param-114-deferred-and-rulings.md: say which, if any, must be fixed before merge (as P2), and leave the rest as P3.
+
+## Severity
+
+- **P1**: unsafe, would not compile, a test fails, or it would not work. Blocks merge.
+- **P2**: wrong or missing. Fixed without reopening this review.
+- **P3**: clarity or polish. Goes on a follow-up list; never a reason for another round.
+
+A P1 states its failure scenario and the evidence (file:line). Do not raise a P2 to P1 to keep the review open.
+
+## Output
+
+Findings ranked P1, P2, P3. Each gives the file, the problem, the evidence (file:line, verified), the failure scenario, a concrete fix and the invariant or trust boundary it breaks. Then the census verdicts, one line per unit and envelope. End with exactly one verdict:
+
+- **READY**: no P1 and no P2.
+- **READY AFTER FIXES**: no P1. The listed P2s are 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.
diff --git a/docs/superpowers/reviews/named-units-param-114-deferred-and-rulings.md b/docs/superpowers/reviews/named-units-param-114-deferred-and-rulings.md
new file mode 100644
index 000000000..68eca8ee2
--- /dev/null
+++ b/docs/superpowers/reviews/named-units-param-114-deferred-and-rulings.md
@@ -0,0 +1,30 @@
+| T4 -> T5 | status.NamedUnitsStatus.Units; writeNamedUnitsStatus | T4 says "keeps the result for Task 5 to complete and write" — T4 alone never writes the record. Ruling below. |
+| T5 self | "exactly once per declared host per pass that reaches planning" — declared host with no registry row? | Ruling below |
+Rulings:
+- Ruling: T4 wires the single writeNamedUnitsStatus(st) call in runAdoptUnderRootRelease right after the SyncUnits block (before the configOnly return), Units empty; T5 only fills st.Units via the Outcome hook and owns TestAdoptWritesNamedUnitsStatusOnce. run() itself never writes. — keeps "one write per pass" from the plan and makes T4 deliver a visible record on its own — if wrong, a moved line.
+- Ruling: T5 Outcome covers declared hosts that have a stamped registry row reaching planning; a declared host with no row gets no Outcome (the record's declaration list is the file itself). — matches "reaches planning" — if wrong, show lacks a line for undeployed hosts; cheap to add later.
+- Ruling: start Task 1 while R2 runs — Task 1 is untouched by R1 and R2 is scoped to the R1 fixes — if R2 changes Task 1, one fix round.
+- Astra plan R2: all R1 closed; 1 new P1 (guard helper) fixed as proposed in the plan. Ruling: no R3 — the fix is Astra's own smallest fix, mechanical; Task 2 review + final branch review verify it — if wrong, caught at branch review (round-limit memory: max three).
+- Ruling: Task 4 refactors consoleGuardHost to derive the host from the marker itself (marker bytes == <opt>/live/<host>, release.LiveLink; Dir must equal the live dir, base must be ValidHostShape, guardNames must hold) and drops the candidates param and InstallNamedUnits' unlocked current-file read; adds an oversized-marker test. — the hold (Astra R1 #2) needs the guarded host even when no file names it; candidate matching cannot find it — if wrong, one helper revert.
+- Ruling: Task 4's fetch path runs validateForInstall + checkGuardRule under the lock (reviewer note) since it calls installNamedUnitsLocked directly.
+- Ruling: accept 8th outcome "failed" (lock/write failure after all checks) — none of the seven fit; Tasks 6/7 must render it — cost if wrong: one string.
+- Ruling: unreadable current file → held (fail-safe); marker naming no valid live host refuses installs (fail-closed, ruling 1) — both prefer refusal over acting on untrusted state — cost: such a box needs a local fix before remote declarations work.
+- Ruling: accept implementer's reading of "history pending" from recovery code (failed/recovering-unverified and independent settled attempts not in use) — the code is the authority over the plan's paraphrase — branch review (Astra) to re-check.
+- Ruling (Task 4 Imp 1): follow the plan — skip only when resolveFleetIdentity returns nil error; an invalid CARLOS_FLEET proceeds and its AccessDenied/unreadable shows in the record — the spec prefers visible failure over a misleading skip — cost if wrong: a few denied SSM reads on a misconfigured box.
+- Task 4: minor (deferred): no test of production namedUnitsSkipReason
+- Task 4: minor (deferred): no test for unreadable-current-file → held, nor for `failed` outcomes
+- Task 4: minor (deferred): nothing pins guardHost read under the lock (fetch + InstallNamedUnits)
+- Task 4: minor (deferred): productionDeclarationBindingInUse wiring untested
+- Task 4: minor (deferred): legacy (non-census) boxes could hold forever on history-linked journals
+- Task 4: minor (deferred): installed log line prints DefaultNamedUnitsPath not f.dst
+- Task 4: minor (deferred): IMDS probe up to 2s per pass off EC2
+- Task 4: minor (deferred): local `named-units install` verb has no rollback hold (pre-existing behaviour)
+- Ruling (T5 concerns 1,2,4): non-success failures → refused; uncleared pending marker after a good restart → delivered; early stop → rows not yet refused get refused with the stop text, rowless stay no-route — all consistent with "final state" semantics — cost if wrong: a label.
+- Ruling (T5 concern 3): new reason "no config is set for <acct>/<app>…" goes to Task 8 copy review.
+- Ruling (T5 concern 5): source-order proof for restart-only accepted (precedent registryowner_test) — cost: a refactor could slip; final review watches.
+- Ruling (T5 ⚠️): never-configured app → refused with new reason (copy review in T8); declared host whose only row is unstamped → refused with the printed declared-host refusal, not no-route — the pass prints a refusal for it, so the record should match — cost: a label.
+- Task 5: minor (deferred): host-write error exit (sync.go:391) untested; apply-phase failure outcomes untested; no stdout-equality test with/without hook; commitHost test-only; second record can't say why Units is empty; source-order test end-of-func search brittle
+- Task 6: minor (deferred): rootstate-backed probe test skips as non-root; JSON null decodes to empty non-nil record (treat Outcome=="" as nil?); absent-store assertion in decode-named test
+- Ruling (T7 builder's calls 1-4): accepted — placement avoids an import cycle; heartbeat_at serves the spec's "heartbeat age" line.
+- Task 7: minor (deferred): unknown subverb message doesn't name the word; install -h exits 1 vs put/show 0; version reset (ahead) not detected; first row match only; route section of cli.md lacks pointer to parameter
+- Task 8 copy: Luna pass (delegated per Paul's standing rule), 8 of 61 changed, no flags. Ruling: NU-D02 Luna text "…on that path; root does not." reverses meaning (it says root lacks the permission); applied as "…on that path. You do not need root." — fact correction, not a style choice — told Paul.