carlos / platform Public

review: Astra census verdict (ESCALATED 10, unedited)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 39f74dc9371c0626ed148738200756db82b984d3 parent 7d30482
1 file changed, +80 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-census-named-unit-delivery-114.md +80 −0

CI passed — run details

diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-census-named-unit-delivery-114.md b/docs/superpowers/reviews/CODEX-FINDINGS-census-named-unit-delivery-114.md
new file mode 100644
index 000000000..471e84865
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-census-named-unit-delivery-114.md
@@ -0,0 +1,80 @@
+Reviewed `6748f4b816d890504de98697665c62602fedeac8` using `origin/main...6748f4b8`; merge base `9bcbab0f5646c11c7d05c9346dcfcea8c84f0751`. **10 escalated rows, covering three findings.**
+
+| Unit or envelope | Verdict | Reason |
+|---|---|---|
+| `cli.go:runRouteUnit` | approve | At line 1802, validates the proposed stamp before the existing write. |
+| `internal/host/agent.go:runAdoptUnderRootRelease` | escalate | Line 5275 activates the delivery and reaping paths affected by E1–E3. |
+| `cli.go:runRouteHibernate` | approve | Line 1635 adds a refusal before the existing daemon check. |
+| `internal/appconfig/sync.go:UnitConfigApps` | approve | Line 513 extends discovery through the shared eligibility predicate; grants no write authority itself. |
+| `internal/appconfig/sync.go:syncHostClaimed` | approve | Line 564 retains guarded writes, restart and acknowledgement after extracting preparation. |
+| `internal/appconfig/syncexec.go:AwaitingRestart` | approve | Line 1163 preserves account/environment narrowing and owned-environment isolation; additions report delivery status. |
+| `internal/appconfig/syncexec.go:SyncExecWithCallbacks` | approve | The added stamped-route `Stat` remains behind the route filter and only produces a notice. |
+| `cli.go:hibernateRail` | approve | Line 1857 only refuses hibernation when a unit is named. |
+| `internal/appconfig/baseenv.go:envFileNames` | escalate | Line 49 follows symlinks without establishing the claimed root-owned provenance; E3. |
+| `internal/appconfig/dropin.go:dirIsPlain` | approve | Line 72 uses `Lstat` and rejects a symlink or non-directory without entering it. |
+| `internal/appconfig/dropin.go:ensureDropInDir` | approve | Lines 53–64 reject symlink/non-directory destinations and create missing directories with mode 0755. |
+| `internal/appconfig/dropin.go:hasPending` | approve | Line 124 checks the fixed marker with `Lstat`, without reading its target. |
+| `internal/appconfig/dropin.go:readDropIn` | escalate | Line 77 follows directory and file symlinks; planning reaches it before the directory refusal; E3. |
+| `internal/appconfig/dropin.go:unitDirs` | approve | Lines 132–146 enumerate the fixed system directory and exclude symlinked child directories. |
+| `internal/appconfig/stamped.go:StampShape` | approve | Line 57 wraps the shared refusal predicate; no external access. |
+| `internal/appconfig/stamped.go:Stamped` | approve | Line 25 classifies existing route fields; performs no privileged operation. |
+| `internal/appconfig/stamped.go:stampShapeReason` | approve | Lines 70–79 refuse sockets, missing addresses and hibernation. |
+| `internal/appconfig/stamped.go:stampedForDelivery` | approve | Line 48 keeps unit-backed rows outside the new delivery path. |
+| `internal/appconfig/stamped.go:unitDelivered` | approve | Line 34 unifies eligibility without itself authorizing a unit operation. |
+| `internal/appconfig/sync.go:finishHost` | approve | Lines 726–773 preserve the extracted restart, claim and acknowledgement checks. |
+| `internal/appconfig/sync.go:prepareHost` | approve | Lines 605–701 retain the existing basename, key-loss, read and rendering checks. |
+| `internal/appconfig/syncexec.go:BlockedStamps` | approve | Line 1106 computes notices from registry data, with account/environment filtering and no foreign-host disclosure. |
+| `internal/appconfig/unitsync.go:planStamped` | escalate | Its binding check does not establish the config identity, and its drop-in read precedes directory validation; E1/E3. |
+| `internal/appconfig/unitsync.go:prepareStamped` | escalate | Renders the unverified registry identity and trusts unchecked base-file provenance; E1/E3. |
+| `internal/appconfig/unitsync.go:reapDropIns` | escalate | Lines 279–309 grant removal authority from registry absence without trusted retirement evidence; E2. |
+| `internal/host/unitops.go:daemonReload` | approve | Line 140 executes fixed arguments with no tenant-supplied command text. |
+| `internal/host/unitops.go:lockConfigSync` | approve | Production supplies the fixed `/etc/carlos/apps/.sync.lock` path; no registry-derived pathname. |
+| `internal/host/unitops.go:probeUnits` | approve | Lines 89–94 pass validated unit names as separate arguments; malformed batch attribution fails closed. |
+| `internal/host/unitops.go:systemctlRestartUnit` | approve | Line 151 passes the validated planned unit as one argument; E1 concerns config identity upstream. |
+| `internal/host/unitops.go:unitOpsBind` | escalate | Lines 51–58 compare only the unit after a resolver that can skip candidate comparison; E1. |
+| `cli.go:runAdd` | approve | Validates the resulting stamped shape, including preserved existing stamps, before writing. |
+| `cli.go:unitRail` | approve | Line 1838 permits clearing and otherwise adds shape refusals. |
+| `internal/appconfig/routefingerprint.go:ConfigRouteFingerprints` | approve | Line 66 adds unit identity to change detection; no new privileged access. |
+| `internal/appconfig/sync.go:SyncWithCallbacks` | escalate | Loads config from the registry identity and invokes unchecked reaping; E1/E2. |
+| `internal/appconfig/syncexec.go:execRouteBase` | approve | Line 875 narrows exec eligibility by excluding stamped routes. |
+| Envelope `.` | approve | Changed CLI functions strengthen refusals; API decoding and notice rendering add no privileged operation. |
+| Envelope `internal/appconfig` | escalate | New delivery, removal and file-reading behavior contains E1–E3. |
+| Envelope `internal/host` | escalate | Production wiring exposes the incomplete binding adapter described in E1. |
+
+1. **E1 — A trusted unit binding does not bind the config being delivered.**
+
+ **Controlled input:** the box agent can change the registry row’s `Account`, `App` and `Environment` while retaining a legitimately declared host and unit. Registry ownership is explicitly assigned to the service user in [registryowner.go:42](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/host/registryowner.go:42).
+
+ [proofBindingSource.resolve, proofbinding.go:144](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/host/proofbinding.go:144) skips `sameProofCandidate` when `b.Local` is true. Root-owned named-unit declarations and the console guard produce exactly that local evidence (`proofnamed.go:153–154`). The new [unitOpsBind, unitops.go:55](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/host/unitops.go:55) checks only that the unit matches.
+
+ Config selection nevertheless uses the original registry account, app and environment (`sync.go:171,194`), and passes that row into preparation (`sync.go:331`). **Root can therefore render another app’s bundle into the trusted unit’s environment, install its drop-in and restart it.** The executable proof does not prevent this substitution. For record-backed bindings, `sameProofCandidate` also omits `Environment` (`rootroute.go:47`).
+
+ The required invariant is that trusted evidence binds both the destination unit and every identity field selecting its config. The adapter’s current tests cover missing evidence and a different unit, but not a matching unit with a different config identity.
+
+2. **E2 — Refusing a new stamp does not protect the old unit’s drop-in.**
+
+ **Controlled input:** the box agent can clear or change `Route.Unit`, or remove its row while leaving another row present.
+
+ [reapDropIns, unitsync.go:279](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/appconfig/unitsync.go:279) builds its retained-unit set solely from registry rows. It then writes a pending marker and removes a marked drop-in when that unit is absent (`unitsync.go:301–309`). There is no binding or trusted retirement check.
+
+ After a valid delivery to `a.service`, change only the registry stamp to unproven `b.service`. Planning refuses `b.service`, but reaping still removes `a.service`’s drop-in. **Root then reloads systemd, removing the trusted service’s managed environment configuration for its next start.**
+
+ The comment at [unitsync_test.go:600](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/appconfig/unitsync_test.go:600) says the old drop-in remains until the new stamp is proven, but the following assertion checks only that the new drop-in is absent.
+
+ The invariant is that agent-controlled registry changes cannot independently authorize removal of a trusted unit’s configuration.
+
+3. **E3 — The new file readers do not establish their claimed provenance.**
+
+ This is an **unsettled provenance finding**, under the card’s “diff cannot settle” rule—not evidence that an agent can create arbitrary entries directly beneath `/etc`.
+
+ [envFileNames, baseenv.go:49](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/appconfig/baseenv.go:49) uses ordinary `os.ReadFile`. Neither it nor its caller validates ownership, writable modes, regular-file type or symlink components. An existing base-file symlink into agent-writable `/data`, or an agent-writable base file, makes the new root read consume agent-controlled contents. The reviewed diff does not establish a provisioning check excluding those layouts.
+
+ [readDropIn, dropin.go:77](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/named-unit-delivery-114/internal/appconfig/dropin.go:77) likewise follows symlinks. `planStamped` calls it at `unitsync.go:161`, before `ensureDropInDir` runs at line 227. Enumeration checks the directory, but not a symlink at `zz-carlos-env.conf`. The release resolver validates loaded unit-definition files; that does not establish provenance for every newly discovered file this code reads.
+
+ **Root can follow these paths before proving their targets are protected from agent writes.** Approval needs trusted descriptor-based reads, or equivalent evidence covering the directories and final files, before consuming either file.
+
+E1 and E2 concern the same authority invariant as round 1’s P1-1. This is its second consecutive round; the repository’s stopping rule applies before another patch wave. I recommend enforcing config delivery and retirement authorization in one place, with witnesses covering identity substitution and refused re-stamps.
+
+No files changed, no subagents used, and no tests run. `GOCACHE` was untouched. Network restrictions prevented recording these verdicts on #280.
+
+ESCALATED (10)
\ No newline at end of file