carlos / platform Public

review: Astra branch R1 (1 P1 code-health, 1 P2; census approved)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 0272e82ace3cbe6d7a81d89f9f713045ef01f430 parent a7fa9ae
1 file changed, +62 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-named-units-param-114-branch-R1.md +62 −0
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-named-units-param-114-branch-R1.md b/docs/superpowers/reviews/CODEX-FINDINGS-named-units-param-114-branch-R1.md
new file mode 100644
index 000000000..8e9f8aba1
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-named-units-param-114-branch-R1.md
@@ -0,0 +1,62 @@
+Reviewed `0acb2767..7b440f71fd4b23d175524397652176ffbfac2e52`, branch round 1 of 3. No files changed or subagents spawned. The sandbox blocked Go’s work-directory creation and access to amadan CI, so the findings below are verified by source inspection, not a completed test run.
+
+1. **P1 — The branch exceeds the mandatory code-health limits.**
+
+ **Evidence:** [system_namedunits.go:81](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/system_namedunits.go:81) and line 87 introduce two exit sites; [line 103](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/system_namedunits.go:103), 105 and 107 introduce three more. Neither enclosing function has a `fatal` allowance. The new [namedunits.go:18](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/namedunits/namedunits.go:18) import increases release-importing packages from 65 to 66. Adding the probe at [agent.go:5307](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/agent.go:5307) increases that file from 3,214 to 3,215 code lines. The [record:2234](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/.amadan/code-health.tsv:2234) remains unchanged.
+
+ **Failure scenario:** CI’s `TestCodeHealth` rejects these increases through its [comparison and failure path](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/codehealth/codehealth_test.go:117). This prevents the branch landing.
+
+ **Fix:** Return command errors through `clireg.RawArgsErr` and the existing dispatch error handling. Use `controlname.ValidApp` and `controlname.ValidAccount` directly; the release functions merely wrap them. Extract a coherent concern from `agent.go`, preserving the required ordering. Run `make code-health` and regenerate affected census fingerprints.
+
+ **Invariant:** New work must remain within the repository’s code-health ratchet.
+
+2. **P2 — A reload failure can leave a known drifted unit reported as delivered.**
+
+ **Evidence:** [prepareStamped:421](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/appconfig/unitsync.go:421) records `delivered` when the files are unchanged. On reload failure, [applyStamped:518](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/appconfig/unitsync.go:518) refuses only pending units and returns. That bypasses the drift check at [line 609](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/appconfig/unitsync.go:609).
+
+ **Failure scenario:** Unit A needs a reload. Unit B’s files are unchanged, but the planning probe shows that another drop-in has replaced B’s environment-file list. If A’s reload fails, B retains its provisional `delivered` outcome despite that known mismatch.
+
+ **Fix:** Finalize unmarked units against their planning probes even on the reload-failure exit. Preserve existing printed output. Add a two-unit regression test asserting exactly one `refused` outcome for B.
+
+ **Invariant:** Each declared host’s reported outcome must describe its final delivery state, including failures elsewhere in the pass.
+
+The deferred apply-phase test gap therefore needs the P2 regression above before merge. The other open minors remain **P3 follow-ups**, without another review round: fetch failure and lock-order coverage; production hold wiring; investigating legacy-journal holds; local-install rollback protection; stdout-equivalence coverage; empty delivery-result diagnostics; probe-test portability and `null` handling; and CLI version-reset, duplicate-row and help consistency. Their evidence and scope remain in [the deferred list:15](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/docs/superpowers/reviews/named-units-param-114-deferred-and-rulings.md:15). Add focused tests or reporting improvements when addressing them; none demonstrated another new authority failure here. The “missing skip-reason test” item is already addressed by [TestNamedUnitsSkipReason:528](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/namedunitsfetch_test.go:528).
+
+The census verdicts below concern authority and trusted reads; they do not waive the findings above.
+
+| Unit | Verdict and verified evidence |
+|---|---|
+| `applyStamped` | **Approve** — mutation gates remain intact; added reporting has P2 above. [unitsync.go:512](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/appconfig/unitsync.go:512) |
+| `runAdoptUnderRootRelease` | **Approve** — fetch follows restart-only return; status precedes key parsing; config sync remains separately locked. [agent.go:6151](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/agent.go:6151) |
+| `statusLoop` | **Approve** — copies root’s record into reporting only. [agent.go:5307](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/agent.go:5307) |
+| `proofBindingSource.record` | **Approve** — decoder behavior, permission errors, marker read and binding evidence are preserved. [proofnamed.go:64](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/proofnamed.go:64) |
+| `CollectBox` | **Approve** — additive private metrics field; no authority consumer. [snapshot.go:1302](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/status/snapshot.go:1302) |
+| `SyncWithCallbacks` | **Approve** — added host accesses track outcomes; declaration gates and writers retain their order. [sync.go:230](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/appconfig/sync.go:230) |
+| `prepareHost` | **Approve** — delegates the existing reads and checks to the reviewed replacement. [sync.go:678](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/appconfig/sync.go:678) |
+| `planStamped` | **Approve** — passes already-listed rows to reporting; declaration authority unchanged. [unitsync.go:235](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/appconfig/unitsync.go:235) |
+| `prepareStamped` | **Approve** — binding, rendering, overlap and trusted-file checks remain before mutation. [unitsync.go:366](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/appconfig/unitsync.go:366) |
+| Removed `RunSystemNamedUnits` | **Approve** — accounted-for rename; root check and operator-selected file read remain in its replacement. [unitops.go:215](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/unitops.go:215) |
+| New `prepareHostSaying` | **Approve** — transferred reads retain hostname and key-loss protections. [sync.go:686](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/appconfig/sync.go:686) |
+| New `newUnitOutcomes` | **Approve** — uses existing snapshots solely for reporting. [unitsync.go:132](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/appconfig/unitsync.go:132) |
+| New `namedUnitsFetch.readDst` | **Approve** — capped trusted read of the fixed destination; unlocked digest reads are report-only. [namedunitsfetch.go:202](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/namedunitsfetch.go:202) |
+| New `productionDeclarationBindingInUse` | **Approve** — fixed trusted stores; errors hold installation; pending-history checks preserve source-bound completion. [namedunitsfetch.go:266](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/namedunitsfetch.go:266), [rootrollback.go:95](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/rootrollback.go:95) |
+| New `writeNamedUnitsStatus` | **Approve** — fixed public root store; output grants no authority. [namedunitsfetch.go:294](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/namedunitsfetch.go:294) |
+| New `readNamedUnitsStatus` | **Approve** — trusted status read with bounded decoding; reporting only. [namedunitsprobe.go:20](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/namedunitsprobe.go:20) |
+| New `RunSystemNamedUnitsInstall` | **Approve** — root-only operator-selected read followed by shared validation and locking. [unitops.go:215](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/unitops.go:215) |
+| New `consoleGuardHost` | **Approve** — trusted, capped marker read; malformed or untrusted markers refuse installation. [unitops.go:172](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/unitops.go:172) |
+| New `installNamedUnitsLocked` | **Approve** — transferred exclusive-temp/rename writer; both callers validate and hold the config lock. [unitops.go:106](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/unitops.go:106) |
+| New `runNamedUnitsPut` | **Approve** — operator-selected input; validation precedes AWS; no box-local guard read. [system_namedunits.go:157](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/system_namedunits.go:157) |
+| Quiet `InstallNamedUnits` | **Approve** — reads moved to accounted-for helpers; guard check remains under lock. [unitops.go:56](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/unitops.go:56) |
+
+| Re-pinned envelope | Verdict and verified evidence |
+|---|---|
+| `.` | **Approve** — operator commands and status rendering add no box-derived authority. [system_namedunits.go:64](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/system_namedunits.go:64), [system.go:341](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/system.go:341) |
+| `internal/appconfig` | **Approve** — outcome tracking does not authorize writes or weaken declaration checks. [sync.go:69](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/appconfig/sync.go:69), [unitsync.go:132](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/appconfig/unitsync.go:132) |
+| `internal/host` | **Approve** — root-read IMDS identity selects the fixed parameter; validation, trusted reads, locking and rollback holds precede replacement. [namedunitsfetch.go:79](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/namedunitsfetch.go:79), [rootrollback.go:95](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/host/rootrollback.go:95) |
+| `internal/hostenv` | **Approve** — validated instance ID, fixed prefix, String-only reads and bounded rootaws client. [namedunits.go:22](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/hostenv/namedunits.go:22), [awsssm.go:174](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/hostenv/awsssm.go:174) |
+| `internal/namedunits` | **Approve** — extraction preserves release decoding; strict installation adds size, uniqueness and required-field checks. [namedunits.go:36](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/namedunits/namedunits.go:36) |
+| `internal/status` | **Approve** — additive optional report types and private metrics propagation. [snapshot.go:411](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/status/snapshot.go:411) |
+
+The console additions remain behind `apiSystemRoller` at [apisystemupdate.go:1058](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-units-param-114/internal/console/apisystemupdate.go:1058). I found no new path through which registry, bucket or agent-writable data authorizes declarations.
+
+**NOT READY**
\ No newline at end of file