carlos / platform Public

docs: task 3 review brief, round 2; task review R1 findings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev c62204f50fba69a8e19721b83c3c1f4ea3c4168a parent 65e1bf2
1 file changed, +86 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-hub-console-socket-T3-R2.md +86 −0
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-hub-console-socket-T3-R2.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-hub-console-socket-T3-R2.md
new file mode 100644
index 000000000..299b3eabe
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-hub-console-socket-T3-R2.md
@@ -0,0 +1,86 @@
+# Review brief: Task 3: root's console fleet step (root code), round 2 of 3
+
+Repo carlos/platform, branch `console-addr-from-install`, commit 65e1bf21379b9904d3741666dd605cd42c3a8870.
+Under review: the diff `79075f0cae57a0e8354b3404ce1f6c044c78066f..65e1bf21379b9904d3741666dd605cd42c3a8870` in `internal/host/consolefleet.go`, `internal/host/consolefleet_owner_unix.go`, `internal/host/consolefleet_test.go`, the edge's use of the record (`internal/edge/replicaconsole.go`: `readConsoleFleetRecordIn`, `ready`), the call in `internal/host/agent.go` (`runAdoptUnderRootRelease`), `internal/consolefleet/consolefleet.go`.
+Authorities: `docs/superpowers/specs/2026-11-24-hub-console-address-from-install-design.md`
+(rev 3; design review closed, Paul's decisions in §12, §14, §15) and
+`docs/superpowers/plans/2026-11-24-hub-console-socket.md` (plan review
+closed), both on this branch, and the code on `main`. Do not review
+against other unmerged branches; if this work needs one, say so as a P1
+and stop.
+
+You are an independent reviewer. Read the spec section and the plan task,
+then the diff, and check every claim against the code.
+
+## Fixed: do not re-argue
+
+- The design and Paul's decisions (spec §12, §14): the `carlos-` runtime
+ directory prefix reserved in `internal/caps` with a guard test; a
+ root-written drop-in plus a console-owned socket; env > socket > the
+ route scan, the route scan deleted the release after. Report only code
+ that fails to implement them, or that is unsafe or would not work.
+- Design-review R1 P1-2 (version-path provenance) is declined (spec §11).
+
+## What to check
+
+1. Spec §4 steps 1-5: is each implemented exactly? The reload-pending marker ordering: can any failure (write, reload, crash between steps) leave a drop-in on disk that is not in effect while the record says `exclusive: true`?
+2. The `systemctl show` parse: strict enough? Does `systemd.Command(...).Output(ctx)` behave as assumed (exit status for a unit that does not exist, property formats for `RuntimeDirectory`, `RuntimeDirectoryMode`, `RuntimeDirectoryPreserve`)?
+3. Exclusivity: are the checks sufficient for the edge to trust the socket (spec §3, §4 step 5)? What could hold `/run/carlos-console` that the step would miss?
+4. Root safety: every path root reads or writes is fixed; nothing a tenant, app, agent or record can create or name steers it. The rootstate store use (`rootstate.Open(dir, true, true)`), `hostfloor.Durable`, `os.Remove` + directory sync.
+5. Placement in the pass: never fatal, full and config-only passes, not restart-only; the record write only on change.
+
+## Round 2
+
+Earlier rounds: `docs/superpowers/reviews/CODEX-FINDINGS-hub-console-socket-T3-R1.md`
+(NOT READY: P1 a legacy app-owned directory certified exclusive; P2-2 the
+marker does not invalidate an affirmative record; P2-3 the drop-in read
+skips the trust checks). The round number counts every earlier review of
+this task.
+
+What changed: root records the console's uid (`User=`, `DynamicUser` must
+be `no`) and refuses exclusivity when `/run/carlos-console` exists under any
+other owner, whatever the unit's state; the edge checks the directory's
+owner against that uid on every call; the edge refuses a record while
+root's `reload-pending` marker stands in the same trusted store; the
+drop-in is read through `rootstate.OpenTrustedFile`, an untrusted file is
+replaced, an untrusted directory chain is an error.
+
+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. If a new finding is in the same fault family as a
+round 1 P1 ("live socket ownership must follow the console's identity"),
+say so explicitly.
+
+## 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.
+
+In round 3, a NOT READY also says whether the P1s share one cause, and
+whether refusing the case up front or cutting the feature would remove
+them.
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents of
+your own. Do not run the full test suites.