carlos / platform Public

review: Astra round 1 findings (unedited) and round 2 brief

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 9c677629e5f68dd54b6c9841831f7cca9dc657bd parent 6748f4b
2 files changed, +105 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-named-unit-delivery-114-r1.md +65 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-named-unit-delivery-114-R2.md +40 −0

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-named-unit-delivery-114-r1.md b/docs/superpowers/reviews/CODEX-FINDINGS-named-unit-delivery-114-r1.md
new file mode 100644
index 000000000..5c15321fb
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-named-unit-delivery-114-r1.md
@@ -0,0 +1,65 @@
+Reviewed `17c0b24c5711e03f4737a6436296b4c415759f8f` against `origin/main` at `9bcbab0f`, following the brief at `bec654da`. Round 1 of 3. No files changed or subagents used.
+
+1. **P1 — Brief §2: an agent-writable registry row authorizes root config delivery to an unrelated unit.**
+
+ [planStamped, unitsync.go:118](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/appconfig/unitsync.go:118) checks that the unit is loaded and canonical, but never verifies that it belongs to the route’s account, app or host. The registry belongs to the service user ([registryowner.go:42](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/host/registryowner.go:42)), and [SetUnit, registry.go:2247](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/registry/registry.go:2247) checks only name syntax.
+
+ A box agent can create or alter a ready, addr-backed row to name another loaded service. With no duplicate stamp or unmanaged environment file, root writes that app’s bundle into the service’s environment and restarts it. Main’s release path independently resolves the binding; this new path bypasses that protection.
+
+ **Fix:** verify the complete route-to-unit binding against trusted provisioning evidence or root-owned named-unit declarations before preparing files or restarting. Add a witness that changes only the registry and proves refusal. **Fault family:** agent-controlled registry data granting root authority over systemd units.
+
+2. **P1 — §4.1: carriage returns bypass the base-variable overlap rail.**
+
+ [overlappingNames, baseenv.go:84](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/appconfig/baseenv.go:84) splits rendered bytes only on `\n`. Existing [ValidVarValue, materialize.go:23](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/appconfig/materialize.go:23) permits `\r`, and rendering writes it verbatim.
+
+ With `CONSOLE_DB` in the base file, a bundle variable `EXTRA` whose value is `ok\rCONSOLE_DB=/data/other.db` passes the new overlap check. Systemd reads a second assignment and lets the bundle override the base-owned setting. I verified this using the installed systemd 257 parser entirely in memory; its parsing logic is also visible at [https://github.com/systemd/systemd/blob/main/src/basic/env-file.c](https://github.com/systemd/systemd/blob/main/src/basic/env-file.c).
+
+ **Fix:** reject carriage returns at input and rendering boundaries, and parse base-file names with systemd-compatible handling of quoted multiline values. The current base parser also mistakes assignment-shaped text inside a multiline value for a name. Add real `SyncUnits` witnesses for both cases. **Fault family:** one owner per variable, with identical assignment interpretation by the guard and systemd.
+
+3. **P1 — Census gate: the target changes root-source fingerprints without a census overlay.**
+
+ The effective appconfig envelope remains `bc5c8fa09ab9…` in [plan14-root-reads-team-scoped-credentials.tsv:12](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/provision/testdata/plan14-root-reads-team-scoped-credentials.tsv:12). Recomputing the envelope using the census algorithm reproduces that hash on main, but gives `6b901d4c9efd…` for the target. The chain is unchanged, and the new root-read units have no entries.
+
+ Consequently, [TestPlan14RootReadCensus, plan14_root_reads_test.go:700](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/provision/plan14_root_reads_test.go:700) cannot pass this commit. This is a verified source/inventory mismatch, not a reported test execution.
+
+ **Fix:** prepare the claims, proposal overlay and card for the final diff, obtain the required independent verdicts, and run the census checks. **Fault family:** independently approved root-source inventory.
+
+4. **P2 — Brief §6: blocked notices disagree with the unit-backed compatibility path.**
+
+ [stampedForDelivery, stamped.go:48](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/appconfig/stamped.go:48) deliberately excludes `Backing=unit` rows, preserving main’s delivery path. [BlockedStamps, syncexec.go:1103](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/appconfig/syncexec.go:1103) instead uses `Stamped`.
+
+ A unit-backed socket route carrying its derived unit stamp is therefore reported as blocked by the socket/name rails even though `SyncUnits` delivers through the existing path. Such rows can also affect duplicate-unit notices despite being excluded from `planStamped`.
+
+ **Fix:** use one shared classification for actual stamped delivery and its notices; test both unit backing plus stamp and duplicate combinations. **Fault family:** delivery eligibility and reporting must agree.
+
+5. **P2 — Merge correctness / #449: blocked notices ignore owned-environment isolation.**
+
+ [AwaitingRestart, syncexec.go:1159](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/appconfig/syncexec.go:1159) populates `Blocked` before checking bundle ownership. Blocked rows then skip the loop, so they never reach the owned-environment exclusion at line 1233.
+
+ A default-bundle write reports a blocked stamped route bound to a standalone team environment, although that write cannot reach it. The revised #449 test remains valid, but exercises an unstamped route and misses this regression.
+
+ **Fix:** apply owned-environment reachability before emitting blocked notices, while retaining full-box duplicate detection. **Fault family:** a write’s notice must respect standalone environment boundaries.
+
+6. **P2 — Merge correctness / instance overlays: stamped routes hide known resolution failures.**
+
+ The stamped-route return at [syncexec.go:1249](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/appconfig/syncexec.go:1249) precedes the instance-overlay load at line 1274. The root pass does load that overlay and refuses delivery on failure ([sync.go:263](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/appconfig/sync.go:263)).
+
+ With readable default/environment bundles and an unreadable or corrupt instance overlay, the set-time notice is empty while root cannot deliver.
+
+ **Fix:** resolve the stamped route’s instance layer before treating it as healthy, reporting failures in `Unresolved`. This needs no deferred config-ack change. **Fault family:** notices must account for every config layer the delivery pass requires.
+
+7. **P2 — §3.3 / §4.1: the stale-file warning claims migration succeeded without evidence.**
+
+ [syncexec.go:743](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/appconfig/syncexec.go:743) says nothing reads the old file once a stamp exists. But a unit still loading `/data/<host>.config.env` is precisely a case the unmanaged-file guard blocks at [unitsync.go:143](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/appconfig/unitsync.go:143).
+
+ The warning can therefore recommend deleting a file the unit still needs on its next restart.
+
+ **Fix:** report that exec delivery has stopped updating the file and require verification that its consumers have migrated before deletion; do not infer successful migration from the stamp. **Fault family:** cleanup advice must reflect established ownership and consumption.
+
+The §4.1 tests use real `SyncUnits` filesystem operations with fake `UnitOps`; they do not exercise the production probe parser. The normal production path already takes the whole-adopt-pass lock, so I found no separate concurrency blocker warranting reversal of the stated deferral.
+
+The change-index polling gate remains intact. Root sweeps now load instance overlays for stamped routes—one listing per app and a read per present overlay—even on unchanged sweeps; newly eligible service/platform apps also join generation polling.
+
+Targeted Go tests could not start because the sandbox refused Go’s work-directory creation. `GOCACHE` remained unset; no full suites ran.
+
+**NOT READY**
\ No newline at end of file
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-named-unit-delivery-114-R2.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-named-unit-delivery-114-R2.md
new file mode 100644
index 000000000..8bb2f5997
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-named-unit-delivery-114-R2.md
@@ -0,0 +1,40 @@
+# Review brief: named-unit config delivery (#114) on current main, plus #453 §4.1, round 2 of 3
+
+Repo carlos/platform, branch `named-unit-delivery-114`, commit 6748f4b816d890504de98697665c62602fedeac8.
+Under review: the diff `origin/main...6748f4b8` (main at 9bcbab0f).
+Authorities, fixed rulings and deferrals: exactly as in round 1's brief, `docs/superpowers/reviews/CODEX-REVIEW-BRIEF-named-unit-delivery-114.md`. Read its "Fixed: do not re-argue" section; it still binds.
+
+You are an independent reviewer. Read the code and check every claim against it.
+
+## Round 2
+
+Earlier rounds: round 1, `docs/superpowers/reviews/CODEX-FINDINGS-named-unit-delivery-114-r1.md` (NOT READY: three P1, four P2).
+
+First give one line per P1 and P2 from round 1: resolved, partly, or not. Carry every unresolved or partly resolved finding forward at its current severity, then add new findings. The verdict covers everything outstanding, earlier rounds included.
+
+The fixes, by commit: f3118c6a (P1-1 unit binding via `UnitOps.Bind` = the release pass's `proofBindingSource.resolve`; P1-2 carriage returns refused at render for stamped routes, systemd-grammar name parser `envFileNamesFrom`), 6e69c2fe (P2-4 to P2-7), 96956417 and 6748f4b8 (census overlay; the census verdict is a separate review and NOT yours here).
+
+Hunt specifically for defects these fixes INTRODUCED, since a fix round reliably adds some:
+1. `Bind`: can the evidence `resolve` accepts (instance record, guard marker, `/etc/carlos/named-units.json`) be written or influenced by the box agent, an app credential or a tenant? Does a nil or erroring `Bind` refuse everywhere it should, including the reap path and re-stamps? Does sharing `resolve` change anything for the release pass itself?
+2. `envFileNamesFrom` against systemd's real grammar (`src/basic/env-file.c`): any input where the guard and systemd disagree about which names a file assigns, in either direction (a missed name is a bypass; an invented name is a false block). Include `export` prefixes, whitespace around `=`, a trailing backslash at EOF, NUL, invalid UTF-8, and very long lines.
+3. Is the `\r` refusal applied on every path that writes a stamped unit's env file, including instance overlays and owned environments?
+4. The notice reclassification (P2-4/5/6): does any eligibility set still disagree with delivery?
+5. Request budget: the builder reports the hourly floor sweep now lists one prefix per app with a stamped route plus a Get per present overlay, the same cost unit-backed apps already pay, and that the triggered pass still rides the change index. Verify; P2 if a pass with nothing changed reads more than main's equivalent for the same routes.
+
+## 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. (The census, and review of any newly changed security, root, termination or production-storage behaviour, still check the fix; see AGENTS.md, "Stopping rules".)
+- **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 section or task, the problem, the evidence (file:line, verified), the failure scenario, a concrete fix and the invariant or trust boundary it breaks (that is its fault family). 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; targeted `go test ./internal/appconfig/ -run <X>` is fine. Leave GOCACHE unset.