Hub reaches the console from root's install (design stopped at review round 2: cut needed) open
claude agent, operated by paul@keymail.devoperated by paul@keymail.devsession 215ea19e · claude-code/2.1.330 · MacBookPro.localdomain
Branch console-addr-from-install, spec docs/superpowers/specs/2026-11-24-hub-console-address-from-install-design.md (tip f9c46ab58). Design only; no code, no box touched.
Problem. The flagship hub answers 503 replica-console-missing to fleet boxes' console calls: its console is in the ops account bab, so the accountless route scan finds nothing, and CARLOS_REPLICA_CONSOLE_ADDR lives in a hand-managed host.env. (Interim: that line is set by hand, Paul-approved, to be removed once this ships.)
Design (rev 2). Root's adopt pass gives console.service a drop-in RuntimeDirectory=carlos-console. The console adds a unix-socket listener at /run/carlos-console/fleet.sock serving only the two box doors. The edge (env unset) forwards to that socket when it exists; precedence env > socket > old route scan. The directory disappears when the console stops, which also closes the stop/rebind residual a TCP address has.
Review.
R1 (rev 1, a TCP address derived from the console unit's environment): NOT READY, 3 P1s: root-rendered env files carry bucket data; version-path is not provenance (declined in rev 2); env derivation misses inputs.
R2 (rev 2): NOT READY, 1 P1: the capability renderer writes RuntimeDirectory= from an app's runtime_dir, and carlos-console isn't reserved (internal/caps/caps.go:87-95), so an app could claim the directory while the console's is absent. Same fault family as R1 P1-1 (app data becomes endpoint authority via root), so stopping rule 2 applies: no third fix.
Choice for Paul (spec §14):
Refuse up front: the edge uses the socket only when root reports console.service holds the claim alone.
Cut: drop the socket; manage the flagship hub's host.env from parameters via carlos system host-env instead.
Enforce in one place: reserve the carlos- runtime-dir prefix in caps validation, refuse existing claims at converge, guard-test that every RuntimeDirectory= render goes through it. Recommended (Codex agrees); small.
Three R2 P2s are listed in §14 to apply with the chosen cut. Also for Paul (§12): confirm a root-owned drop-in plus systemd-created socket satisfies "the console install writes it", and keep the route scan for one release, then delete.
claude agent, operated by paul@keymail.devoperated by paul@keymail.devsession 215ea19e · claude-code/2.1.330 · MacBookPro.localdomain
Implementation stopped under stopping rule 2 (Task 3, root's console step). Branch console-addr-from-install, tip 4eff1d82f. Nothing merged.
Done: spec rev 3 with Paul's 2026-11-24 decisions; plan (docs/superpowers/plans/2026-11-24-hub-console-socket.md, review closed at R2, READY AFTER FIXES); all tasks built with tests. Task reviews: T1 caps prefix, T4 edge, T5 console listener all READY AFTER FIXES at R1, fixes applied.
Task 3 (root step) review: R1 P1, a legacy app holding /run/carlos-console could be certified exclusive; fixed by recording the console's uid and checking the directory's owner. R2 P1, same family ("live socket ownership must follow the console's identity"): systemd re-chowns an existing runtime directory to the console's user on start without closing a listener another process already bound in it, so directory ownership does not prove who holds fleet.sock. No third fix written.
Cut options for Paul:
Refuse up front: root certifies exclusive only for a directory that did not exist when it installed the drop-in and that appeared with a console start after that install (InvocationID recorded); anything else is refused and reported in carlos system status.
Cut: drop automatic socket selection; keep the env var, and bring the flagship hub's host.env under carlos system host-env instead.
Enforce in one place (recommended, Codex agrees): the edge checks the unix peer's credentials (SO_PEERCRED: the uid that created the listening socket) against root's recorded console uid before writing a byte, in one dial function, with a regression test of a foreign listener surviving a chown. Small, and it makes ownership of the directory irrelevant.
Outstanding R2 P2s to apply with the cut: repair a symlinked or hard-linked drop-in instead of failing; restore the "directory exists while the console is inactive" refusal; resolve a numeric User=.
claude agent, operated by paul@keymail.devoperated by paul@keymail.devsession 215ea19e · claude-code/2.1.330 · MacBookPro.localdomain
Stopped again: Task 3 review round 3 is NOT READY; a fourth round needs Paul. Tip 15-char: see branch console-addr-from-install. Not merged; census and Fable review not run.
Cut 3 is built: one dial function (dialConsoleFleet) proves the listener's uid with SO_PEERCRED before writing a byte, no connection reuse, and a root-run regression with a foreign listener under a re-chowned directory. Round 2's three P2s are resolved.
Round 3 found:
P1 (same family): the kept route scan can reach /run/carlos-console/fleet.sock through its own unchecked unix proxy if an accountless console route names that socket, so the peer check is bypassed when readiness fails.
P1 (same family):SO_PEERCRED is fixed at listen(). A process that listened as root and then dropped privileges still reads as uid 0, so a console recorded as root (no User=) cannot be told apart from it.
P1 (independent): the socket tests assume Linux and fail on macOS, where the stub correctly refuses.
Proposed round-4 fix, all small: the route scan never uses a socket under /run/carlos-console (or delete the route scan now instead of next release); root refuses exclusive for a console running as uid 0, since only root can drop from root, a non-root listener's uid cannot change; Linux build constraints on the success tests, plus refusal assertions elsewhere. Needs Paul's go for a fourth round.
claude agent, operated by paul@keymail.devoperated by paul@keymail.devsession 215ea19e · claude-code/2.1.330 · MacBookPro.localdomain
Stopped: Task 3 review round 4 is NOT READY (one P1). There is no fifth round. Branch console-addr-from-install; nothing merged; census and Fable review not run.
Round 4 resolved round 3's P1-2 (root console refused) and P1-3 (Linux-only success tests). P1-1 is partly resolved. The route scan's socket proxy refuses a listener whose kernel-reported name is under /run/carlos-console, but Linux reports the name exactly as bound, so a foreign process that cds into the directory and binds the relative name fleet.sock reads as fleet.sock. Reached through an outside symlink, it gets the box's token without the peer check. Same family: every path to the reserved listener must prove its uid.
Cuts for Paul (Codex agrees either removes it):
Refuse socket routes in the route scan (TCP loopback console routes only, as the flagship and dev consoles use) for the scan's last release. One condition.
Delete the route scan now instead of next release: env, then socket, else 503.
Put every route-scan socket dial through the same uid proof. This needs a uid the scan does not have, so it is not recommended.
Recommend 1.
claude agent, operated by paul@keymail.devoperated by paul@keymail.devsession 215ea19e · claude-code/2.1.330 · MacBookPro.localdomain
Merged as e241f1e (CI green). Paul's cut after round 4 (route scan: loopback TCP console routes only) is in, census READY twice (#280), whole-branch review (Fable) READY AFTER FIXES with fixes applied; P3-1 (the edge refusing uid 0 itself) is on the follow-up list.
After the release: roll boxes, then the console (its restart creates /run/carlos-console). When carlos system status shows no "socket not ready" line under carlos-flagship-ie, remove the interim CARLOS_REPLICA_CONSOLE_ADDR line from its host.env and restart carlos-edge; the line should then read ok · socket. Dev's console routes could not be checked through the API (dev's console has no app row, so carlos routes cannot list it); if dev's console route is a socket route, its route scan now refuses it until dev's socket is live. Delete the route scan the release after.
claude agent, operated by paul@keymail.devoperated by paul@keymail.devsession 215ea19e · claude-code/2.1.330 · MacBookPro.localdomain
Released in v0.43.4 and rolled 2026-11-24: dev and flagship fixed boxes current; dev console via roll-console.sh dev (platform-infrastructure #139 adds the dev target); flagship console via roll-console.sh flagship. On carlos-flagship-ie /run/carlos-console/fleet.sock exists (carlos:carlos, console runs as carlos); system status showed the socket ready, then the interim CARLOSREPLICACONSOLE_ADDR line was removed and carlos-edge restarted. Status now: console 404 · socket (the 404 is an unauthenticated probe; the route is the socket). HA group members on both deployments still on v0.43.3 (operator machine, #1321). Next release: delete the route scan.