| index d5f4e3f61..686f4abcc 100644 |
| --- a/docs/superpowers/specs/2026-11-24-hub-console-address-from-install-design.md |
| +++ b/docs/superpowers/specs/2026-11-24-hub-console-address-from-install-design.md |
| @@ -1,10 +1,16 @@ |
| -# The hub learns the console's address from root's install of it |
| +# The hub reaches the console through a socket root's install creates |
| |
| -Status: draft rev 1 for design review, 2026-11-24. Branch |
| +Status: draft rev 2 for design review, 2026-11-24. Branch |
| `console-addr-from-install`. Direction chosen by Paul on 2026-11-24: the |
| -console install writes the address, and the hub reads it. The earlier |
| -`/proc` listener discovery (branch `hub-operator-console`, 7a2569892) was |
| -rejected by Codex with two P1s and is not revived here. |
| +console install writes where the console is, and the hub reads it; trust |
| +comes from root, never from records. The earlier `/proc` listener discovery |
| +(branch `hub-operator-console`, 7a2569892) was rejected by Codex with two |
| +P1s and is not revived here. |
| + |
| +Review history: round 1 (`CODEX-FINDINGS-hub-console-address-from-install-R1.md`) |
| +was NOT READY with three P1s against rev 1, which derived a TCP address from |
| +the console unit's environment. Rev 2 drops the derivation. §11 maps every |
| +round-1 finding to this revision. |
| |
| ## 1. The problem |
| |
| @@ -16,259 +22,243 @@ the boxes' fleet bearer tokens. `serveReplicaConsole` |
| |
| 1. `CARLOS_REPLICA_CONSOLE_ADDR`, read once at edge start in |
| `enableTunnelsFromEnv` (`internal/edge/edge.go:5317-5324`) from the |
| - edge's `EnvironmentFile=-/etc/carlos/host.env` |
| - (`internal/host/units/carlos-edge.service`); |
| + edge's `EnvironmentFile=-/etc/carlos/host.env`; |
| 2. otherwise, a scan of the route table for the one accountless |
| `console`/`console.service` route on a loopback upstream or socket. |
| |
| On the flagship the console is app `console` in the ops account `bab`, so |
| (2) finds nothing and every call answers `503 replica-console-missing` |
| (`replicaconsole.go:128`). (1) would work, but the flagship hub's |
| -`host.env` is hand-managed: it is not built from parameters, so `carlos |
| -system host-env` does not reach it, and setting it means a session on the |
| -box. Paul does not want that to be how this is managed (AGENTS.md, |
| -"Operate via API and CLI"). |
| +`host.env` is hand-managed, `carlos system host-env` does not reach it, and |
| +setting it means a session on the box (AGENTS.md, "Operate via API and |
| +CLI"). |
| |
| Interim (2026-11-24, approved by Paul): the coordinator set |
| `CARLOS_REPLICA_CONSOLE_ADDR=127.0.0.1:8090` in the flagship hub's |
| -`host.env`, with a comment marking it temporary, and restarted |
| -`carlos-edge`. §9 removes it. |
| +`host.env`, marked temporary, and restarted `carlos-edge`. §9 removes it. |
| + |
| +## 2. The design in one paragraph |
| + |
| +On every box where `console.service` is installed, root's adopt pass keeps |
| +one drop-in on that unit giving it a systemd runtime directory, |
| +`/run/carlos-console`. systemd creates that directory when the console |
| +starts, owned by the console's user, and deletes it when the console stops. |
| +The console, when that directory exists and is its own, adds a second |
| +listener: a unix socket at the compiled-in path |
| +`/run/carlos-console/fleet.sock`, serving only the two box doors. The edge, |
| +with no `CARLOS_REPLICA_CONSOLE_ADDR`, forwards box calls to that socket when |
| +it exists. No address is derived, no file is parsed, and no record is read. |
| |
| -## 2. The trust argument |
| +## 3. The trust argument |
| |
| The rule (`replicaconsole.go:16-26`): route records are not a tenancy |
| boundary, since a legacy direct-S3 fleet box can write them, so no record |
| -field may choose, redirect or disable where the fleet tokens go. The new |
| -source must therefore be written by root from inputs only root and the |
| -operator control, and read by the edge in a way only root can satisfy. |
| - |
| -What makes `console.service` "the console" on a box, record-free: |
| - |
| -- **The unit is root's.** `console.service` is a root-owned unit under |
| - `/etc/systemd/system`, installed with the box (not by `internal/host/units`, |
| - and not by any record; console-as-an-app spec §4a). A tenant cannot create |
| - or name a system unit. |
| -- **Its binary comes from a release only the ops account can promote.** The |
| - ops account's builds stage to `<opt>/versions/<ver>/<app>`; every other |
| - account gets `<opt>/versions/<ver>/<acct>/<app>` (`VersionPath`, |
| - `internal/release/versions.go:53-61`). So a file at exactly |
| - `<opt>/versions/<ver>/console` was staged from `apps/bab/console`, whose |
| - channel pointers root verifies against the release key with account, app |
| - and channel bound in (`verifyPointer`, `internal/release/release.go:598`). |
| - The console refuses service-principal promotes of a control-plane app |
| - (console-as-an-app spec §6), so a person with ops membership, or the |
| - operator with the release key, is the only promoter. |
| -- **Its listen address comes from its unit configuration.** The console |
| - listens on `CONSOLE_ADDR`, default `127.0.0.1:8090` |
| - (`cmd/console/main.go:957`). Unit fragments and drop-ins are root-owned; |
| - environment files are trusted only if root-owned (§4). |
| - |
| -A record can still point adoption at a host or name `console.service` in |
| -`rt.Unit`, which decides which live link adoption repoints and which unit it |
| -restarts (`makeRestartRoute`, `internal/host/agent.go:5493`). It cannot change |
| -anything this design reads: the unit's `ExecStart`, the live link's target |
| -shape, or the unit's environment. If a record ever made `console.service` |
| -exec something other than an ops console build, the writer refuses (§4). |
| - |
| -**What the address proves, and what it does not.** The record says where |
| -root configured the console to listen. It does not prove who holds that port |
| -at the moment the edge dials: if the console is stopped, another process |
| -could bind `127.0.0.1:8090` and receive the next call's token (Codex's |
| -finding 1 on `hub-operator-console`). That residual is exactly today's |
| -`CARLOS_REPLICA_CONSOLE_ADDR`, which that review named the acceptable |
| -interim. On a platform hub the processes that can bind host loopback are |
| -root, the console's own user, `carlos` (the edge itself, which already |
| -handles every token in flight), and unit-backed tenants, which are |
| -operator-trusted by definition (`carlos-app@.service:5-14`: "never set it |
| -for a tenant you would not give a shell on the box"). Instances can bind, |
| -but their cgroup filter drops loopback traffic both ways |
| -(`IPAddressDeny=localhost`, `carlos-instance@.service:162`, |
| -`carlos-instance-rootfs@.service:237`), so the edge's connect never reaches |
| -them, and gVisor instances run `--network=none` |
| -(`internal/execsandbox/command.go:8`). Closing the residual entirely is a |
| -listener whose ownership survives a stop (a unix socket in the console |
| -unit's `RuntimeDirectory=`, or a systemd socket unit holding the port). That |
| -needs a console listener change and is §11's decision for Paul, not part of |
| -this fix. |
| +field may choose, redirect or disable where the fleet tokens go. |
| + |
| +- **Only root can create the directory.** `/run` is root's and mode 0755, |
| + so only root (here, systemd acting on root-owned unit configuration) |
| + creates `/run/carlos-console`. The one root writer that names it is the |
| + §4 drop-in, which root writes for the unit named `console.service` and no |
| + other. No root writer renders a unit directive from app or bucket data: |
| + config delivery writes values into environment files under fixed |
| + drop-in shapes, and capability drop-ins come from code. A record cannot |
| + create a unit, name a directive or change which unit is `console.service`. |
| +- **Only the console's user can place the socket.** systemd creates the |
| + directory owned by the unit's `User=` with `RuntimeDirectoryMode=0755`, so |
| + only that user or root can create, replace or remove `fleet.sock` in it. |
| +- **It disappears with the console.** systemd removes the directory when the |
| + unit stops (no `RuntimeDirectoryPreserve`). A stopped console leaves no |
| + path for anyone to bind, so the edge's dial fails with no token sent. |
| + This closes the stop/rebind residual that a TCP address (the env var, |
| + and rev 1) cannot close (Codex, `hub-operator-console` round 1, finding 1). |
| +- **No derivation.** The path is a constant compiled into both binaries. |
| + Nothing the console's environment, a config bundle, PAM or a manager |
| + default sets can move it (rev 1's P1-1 and P1-3). |
| + |
| +**What "the console" means here.** The trust anchor is the unit root runs as |
| +`console.service`: whatever it runs is the process that already serves the |
| +console's public routes and checks every box's token (`fleetIdentityOK`). |
| +How that binary got there is the release path's guarantee (release-key |
| +pointers bound to account, app and channel, `verifyPointer`, |
| +`internal/release/release.go:598`; pointer digests, #253; the console guard |
| +on guarded boxes, `internal/hostfloor/floor.go:150-173`), unchanged by this |
| +design. The hub cannot hold the console to a stricter standard than the |
| +console's own users are held to, and this design adds no reliance on the |
| +version store's pathnames (rev 1's P1-2, §11). |
| |
| **`host.env`'s ownership.** On the flagship hub `/etc/carlos/host.env` is |
| `carlos:carlos` 0600, not root's as the edge unit's comment says. systemd |
| -reads it as root, but `carlos` can write it, so the env var's trust today is |
| +reads it as root, but `carlos` can write it, so the env var's trust is |
| "root or the edge's own user". That does not widen who sees the tokens, |
| -because the `carlos` process is the edge that forwards them. It does mean |
| -`host.env` is not a root-only anchor, and the new record must not inherit |
| -that: it is root-written, and the edge refuses one that is not root-owned |
| -(§5). |
| +because the `carlos` process is the edge that forwards them, but `host.env` |
| +is not a root-only anchor. The socket path does not depend on it. |
| |
| -## 3. What writes it, when |
| +## 4. What root writes, when |
| |
| A new step in root's adopt pass, `runAdoptUnderRootRelease` |
| -(`internal/host/agent.go:5997`), placed beside the named-units step |
| -(`agent.go:6181`): never fatal, on full and `-config-only` passes alike, so |
| -it runs hourly (`carlos-adopt.timer`) and on every config-sync trigger. It |
| -reads only: |
| - |
| -1. `systemctl show console.service -p LoadState,FragmentPath,DropInPaths,ExecStart,Environment,EnvironmentFiles,UnsetEnvironment,PassEnvironment`; |
| -2. the target of the live link `ExecStart` names, through |
| - `rootstate.ReadTrustedLink`; |
| -3. on a guarded box, the console guard marker through `consoleGuardHost` |
| - (`internal/host/unitops.go:195`); |
| -4. each listed environment file, through `rootstate.OpenTrustedFile`. |
| - |
| -It never reads the registry, a record or the bucket. |
| - |
| -It writes one record, `endpoint.json`, in a public root store |
| -`/var/lib/carlos-console-endpoint` (`rootstate.Open(dir, true, true)`, root |
| -0644, replaced atomically), the convention of `/var/lib/carlos-named-units` |
| -(`internal/host/namedunitsfetch.go:37`). It rewrites only when the bytes |
| -change, so the record carries no timestamp. |
| - |
| -```json |
| -{"schema":1,"state":"ok","addr":"127.0.0.1:8090","source":"default", |
| - "exec":"/opt/carlos/live/platform.carlosframework.com","build":"v0.41.0"} |
| -{"schema":1,"state":"refused","reason":"console.service loads /etc/carlos/host.env, which is not root-owned"} |
| -{"schema":1,"state":"absent"} |
| -``` |
| - |
| -`source` is `default`, `environment` or `environment-file:<path>`; `build` is |
| -the `<ver>` of the staged path. Only `ok` carries an address. |
| - |
| -## 4. How root derives the address |
| - |
| -The step decides `absent`, `refused` or `ok`, in order: |
| - |
| -- **absent:** `LoadState` is `not-found`. No console on this box. |
| -- **refused, ExecStart:** the unit has exactly one `ExecStart`, and its argv |
| - is one of exactly two shapes: `[<opt>/live/<host>, "serve"]`, or the |
| - guard's `[<opt>/system/guard/carlos, "system", "guard-exec", "console", |
| - <opt>/live/<host>, "serve"]` (`hostfloor.ConsoleGuardDropIn`, |
| - `internal/hostfloor/report.go:101`) with the guard marker naming that live |
| - link. Anything else (a wrapper, `env`, extra arguments) is refused. |
| -- **refused, binary:** the live link must resolve to exactly |
| - `<opt>/versions/<ver>/console` with a valid version (`ValidVersion`), a |
| - regular file. A tenant path (`versions/<ver>/<acct>/console`), any other |
| - app or an unreadable link is refused. |
| -- **refused, environment:** `PassEnvironment` or `UnsetEnvironment` naming |
| - `CONSOLE_ADDR`; an environment file that exists but fails the trusted open |
| - (not root-owned, group- or other-writable, a symlink); or a |
| - `CONSOLE_ADDR` line the parser does not accept (anything but |
| - `CONSOLE_ADDR=<value>`, optionally in one pair of matching quotes). A |
| - missing optional file (`-` prefix) is skipped, as systemd skips it. |
| -- **the value:** systemd's precedence. The last assignment in the |
| - environment files (in listed order) wins over the inline `Environment=`, |
| - whose last assignment wins over the default. The default is a constant |
| - moved out of `cmd/console` into a small shared package both binaries |
| - import, so the console and root cannot drift. |
| -- **refused, address:** the value must pass the edge's own |
| - `parseReplicaConsoleAddr` (`replicaconsole.go:39-56`): a literal loopback |
| - IP and a port. A wildcard (`:8090`, `0.0.0.0:8090`) or a host name is |
| - refused, naming `CARLOS_REPLICA_CONSOLE_ADDR` as the way to configure it. |
| -- otherwise **ok**. |
| - |
| -Exactly one unit name is consulted, so "more than one console" cannot arise |
| -from this source. A second console unit on a box is invisible to the step and |
| -keeps today's behaviour. |
| - |
| -## 5. How the edge reads it, and what wins |
| - |
| -The order is **env > record > the old route scan**: |
| - |
| -1. `CARLOS_REPLICA_CONSOLE_ADDR` set: as today, read once at start; the |
| - record is never opened. Tito and self-hosters are unchanged. |
| -2. Otherwise, on every replica call, the edge opens `endpoint.json` with |
| - `rootstate.OpenTrustedFile` plus `rootstate.CheckPublicConfig` |
| - (root:root, 0644, regular, one link), reads at most 4 KB, decodes one |
| - document with unknown fields refused, and requires `schema` 1, |
| - `state` `ok` and an `addr` that passes `parseReplicaConsoleAddr`. Then it |
| - forwards to that address with `newReplicaConsoleProxy` |
| - (`replicaconsole.go:64`), one proxy cached per address. |
| -3. Any other outcome (missing, not root's, malformed, oversized, `refused`, |
| - `absent`) is treated as no record: the edge logs the reason at most once |
| - per distinct reason and falls through to today's route scan, which on the |
| - flagship answers 503 as it does now. |
| - |
| -Reading per call means a new record takes effect on the next call, with no |
| -edge restart and no watcher. Replica calls are a few per box per minute, and |
| -the read is one small file; a cache keyed on the file's identity is allowed |
| -later if profiling asks for it. |
| - |
| -## 6. Fail-closed cases |
| - |
| -| Case | Record | Edge | |
| -|---|---|---| |
| -| No `console.service` | `absent` | route scan (today) | |
| -| Unit runs something other than an ops console build | `refused` | route scan (today) | |
| -| Untrusted env file, unparsable `CONSOLE_ADDR`, wildcard or non-loopback | `refused` with the reason | route scan (today) | |
| -| Record missing, not root's, malformed | — | route scan (today), reason logged once | |
| -| Console stopped but still installed | `ok` | dials, gets 502 (§2 residual) | |
| -| Console uninstalled or moved to another address | `absent`, or `ok` with the new address, from the next pass | until then the old address: 502 or §2's residual | |
| - |
| -No failure yields an address the edge would not have used before this |
| -change; the record only adds one, and only in state `ok`. |
| - |
| -## 7. Staleness |
| - |
| -The record is current as of the last root pass: at most an hour, sooner on |
| -any config-sync trigger. A console moves address only by an operator |
| -changing its root-owned unit, which is already box work; the next pass |
| -follows. Uninstalling the unit gives `absent` on the next pass. The stale |
| -window carries the same risk as a stale `CARLOS_REPLICA_CONSOLE_ADDR`, which |
| -has no expiry at all. |
| +(`internal/host/agent.go:5997`), beside the named-units step |
| +(`agent.go:6181`): never fatal, on full and `-config-only` passes alike. |
| + |
| +1. `probeUnits` (`internal/host/unitops.go:302`) for `console.service`'s |
| + `LoadState`. |
| +2. `loaded`: ensure |
| + `/etc/systemd/system/console.service.d/70-carlos-fleet-socket.conf` holds |
| + exactly |
| + ``` |
| + [Service] |
| + RuntimeDirectory=carlos-console |
| + RuntimeDirectoryMode=0755 |
| + ``` |
| + root:root 0644, written with `hostfloor.Durable`; `systemctl |
| + daemon-reload` only when the bytes changed. Nothing is restarted: the |
| + directory appears at the console's next start, which is its next deploy |
| + (adoption's restart) or any operator restart. |
| +3. `not-found`: remove the drop-in if present, and daemon-reload. |
| +4. Any other state, or a failed write or reload: change nothing, and record |
| + the reason. |
| + |
| +It records its outcome (`installed`, `unchanged`, `removed`, `absent`, |
| +`failed: <reason>`) in a public root store, `/var/lib/carlos-console-fleet` |
| +(`rootstate.Open(dir, true, true)`, root 0644), the named-units status |
| +convention (`internal/host/namedunitsfetch.go:37`), for §8. |
| + |
| +`RuntimeDirectory=` accumulates across drop-ins, so a unit that already has |
| +its own runtime directory keeps it. The guard's `90-host-floor.conf` |
| +replaces only `ExecStart` and is unaffected. |
| + |
| +## 5. The console's listener |
| + |
| +In `cmd/console` serve (out of census scope), after the TCP listener: |
| + |
| +- if `/run/carlos-console` exists, is a directory (not a symlink), is owned |
| + by the console's effective uid and is not group- or other-writable, remove |
| + any stale `fleet.sock`, listen on it, and `chmod` it 0666 (connecting is |
| + not the threat; impersonating is, and only the owner can place it); |
| +- serve on it a handler that answers only `POST` on the two box doors |
| + (the same `boxConsolePath` rule the edge applies) and 404s everything else; |
| +- if the directory is absent, log once and serve TCP only, as today. |
| + |
| +The path is a constant in a small shared package both binaries import, so |
| +they cannot drift. |
| + |
| +## 6. How the edge forwards, and what wins |
| + |
| +The order is **env > socket > the old route scan**: |
| + |
| +1. `CARLOS_REPLICA_CONSOLE_ADDR` set: as today. Tito and self-hosters are |
| + unchanged. |
| +2. Otherwise, on each box call, `lstat` `/run/carlos-console` (a directory, |
| + not a symlink, not group- or other-writable) and `fleet.sock` (a socket). |
| + Present: forward through one cached reverse proxy whose transport dials |
| + that unix path, with the same rewrite, version header and 502 error |
| + handler as `newReplicaConsoleProxy` (`replicaconsole.go:64-89`). A failed |
| + dial (the console stopping between the check and the dial) is a 502 with |
| + no request written, which the box reads as the console unreachable. |
| +3. Absent or failing the checks: today's route scan, which on the flagship |
| + answers 503 as it does now. |
| + |
| +The checks are two `lstat`s per call, cheaper than rev 1's file read, and |
| +need no restart or watcher. The edge's sandbox allows it: |
| +`RestrictAddressFamilies` includes `AF_UNIX`, and connecting to a socket on |
| +the read-only view `ProtectSystem=strict` gives `/run` is permitted, since |
| +the kernel's read-only check covers regular files, directories and symlinks |
| +only (`sb_permission`, `fs/namei.c`). §9 step 2 confirms it on dev. |
| + |
| +## 7. Fail-closed cases |
| + |
| +| Case | Edge | |
| +|---|---| |
| +| No `console.service` on the box | no directory: route scan (today) | |
| +| Drop-in written, console not yet restarted | no directory: route scan (today) | |
| +| Console stopped, or mid-restart | directory gone: route scan, 503 on flagship | |
| +| Directory present, socket not yet bound | no socket: route scan | |
| +| Directory a symlink, writable by group or others, or socket not a socket | route scan, reason logged once | |
| +| Console stops between check and dial | 502, nothing sent | |
| +| Console moved to another box | directory gone on this box | |
| + |
| +No case forwards a token to a path anyone but root or the console's user |
| +could have placed, and no case produces a destination the edge would not |
| +have used before this change other than the socket itself. |
| |
| ## 8. Visibility |
| |
| -The agent reads the record into the box heartbeat beside `named_units` |
| -(`internal/status/snapshot.go:877-880`), as `console_endpoint`, with which |
| -source the edge is using (env, record or route scan). `carlos system status` |
| -prints one line for a box whose console endpoint is `refused`, and for a box |
| -whose env and record disagree. Nobody needs a shell to see why a hub |
| -answers 503. |
| +The agent adds `console_fleet` to the heartbeat beside `named_units` |
| +(`internal/status/snapshot.go:877-880`): root's drop-in outcome (§4), whether |
| +the socket is present, and which source the edge used for its last box call |
| +(`env`, `socket`, `route-scan` or `none`), taken from the edge's selection |
| +code, not recomputed. The system-status API projects it per box beside |
| +`named_units` (`internal/console/apisystemupdate.go:1093-1100`), and `carlos |
| +system status` prints it for every box that has `console.service`, healthy |
| +or not: one line with the drop-in state, socket presence and edge source. |
| +The new copy goes through the usual copy review. |
| |
| ## 9. Rollout |
| |
| -1. Merge; it ships in the next release (everyone is on edge). Roll dev boxes, |
| - then the dev console, then flagship, per the README recipe. |
| -2. Dev hub: confirm `console_endpoint` reads `ok` and replica calls still |
| - succeed. Dev's accountless console route keeps the route scan as a |
| - backstop meanwhile. |
| -3. Flagship hub: confirm `console_endpoint` is `ok`, `127.0.0.1:8090`, with |
| - the edge reporting `source: env` (the interim line still wins). |
| +1. Merge; it ships in the next release. Roll dev boxes, then the dev |
| + console, then flagship, per the README recipe. The box roll writes the |
| + drop-in; the console roll restarts the console, which creates the |
| + directory and binds the socket. |
| +2. Dev hub: `carlos system status` shows `drop-in installed`, `socket |
| + present`, and the edge source. Confirm box calls succeed. |
| +3. Flagship hub: the same, with the edge source still `env` (the interim |
| + line wins). |
| 4. Remove the interim `CARLOS_REPLICA_CONSOLE_ADDR` line from the flagship |
| hub's `host.env` and restart `carlos-edge`, by the same Paul-approved |
| - route the coordinator used to add it. Confirm the heartbeat shows |
| - `source: record` and the 503s stay gone. |
| + route that added it. Confirm the edge source reads `socket` and the 503s |
| + stay gone. |
| 5. Update the comment at `replicaconsole.go:16-26`, the self-host docs (the |
| env var stays the supported override) and the replica docs. |
| |
| ## 10. Tests and census |
| |
| -Tests (table-driven over a fake `systemctl show` and a temp opt tree): |
| -each `absent`/`refused`/`ok` row of §4, both `ExecStart` shapes, a tenant |
| -`versions/<ver>/<acct>/console` path, env precedence, an untrusted env file, |
| -a wildcard address, unchanged bytes not rewritten; the edge's precedence, |
| -every §6 row, a record change taking effect without a restart, a route row |
| -naming another `addr` having no effect while the record is `ok`; and a test |
| -that the console's default and root's are the one constant. |
| - |
| -Census: the writer (`internal/host`), the reader (`internal/edge`), the |
| -heartbeat field (`internal/status`) and the shared constant package are all |
| -in the root binary's scope. New root reads: `systemctl show`, a trusted link |
| -read under `<opt>/live`, the guard marker, and trusted opens of the unit's |
| -environment files. Card and Codex census review on the branch, per AGENTS.md. |
| - |
| -## 11. Decisions for Paul |
| - |
| -1. **The route scan.** Recommendation: keep it in this change as the |
| - fallback below the record, so a hub whose record is refused behaves as |
| - today; delete it in the next release once every platform hub reports |
| - `source: record` or `env`. It is the one remaining place route data |
| - chooses where tokens go. |
| -2. **Listener identity.** Accept §2's residual (identical to the env var |
| - today), or follow up with a console listener whose ownership survives a |
| - stop (a unit-owned unix socket, or a socket unit). |
| - |
| -## 12. Not in this spec |
| - |
| -Self-hosted consoles not staged by the root pass (the guide's downloaded |
| -binary) get `refused` and keep using the env var. A box with two console |
| -units. Any change to the console's listener. |
| +Root step: `loaded` writes once and reloads once; unchanged bytes neither |
| +write nor reload; `not-found` removes; a failed write or reload changes |
| +nothing and records why. Edge: the precedence; every §7 row, against a real |
| +unix listener in a temp directory; a route row naming another upstream has |
| +no effect while the socket is present; a dial failure answers 502 without |
| +the request reaching anything. Console: listens only when the directory is |
| +its own and safe, serves only the two doors on the socket, keeps TCP. The |
| +shared constant is one symbol. |
| + |
| +Census: the root step (`internal/host`), the edge (`internal/edge`), the |
| +heartbeat field (`internal/status`) and the shared constant package are in |
| +the root binary's scope. Root's new actions: a `systemctl show` of one fixed |
| +unit, a write and remove of one fixed drop-in path, daemon-reload. The edge's |
| +new reads: two `lstat`s of a fixed path. Card and Codex census review on the |
| +branch, per AGENTS.md. |
| + |
| +## 11. Round 1, finding by finding |
| + |
| +- **P1-1** (root-rendered env files carry bucket data): resolved by removal. |
| + Nothing reads the console's environment. |
| +- **P1-2** (version-store pathname is not provenance): declined as a finding |
| + against this design, which no longer reads the version store. The console |
| + binary's provenance is the release path's guarantee and is the same for |
| + the console's public routes (§3). The unguarded, no-digest staging path |
| + Codex cites is a release-path gap; it is recorded for the follow-up list, |
| + not fixed here. |
| +- **P1-3** (environment derivation misses inputs): resolved by removal. |
| +- **P2-4** (argv is not executable identity): no `ExecStart` check remains. |
| +- **P2-5** (record observed before config changes it; staleness): the edge |
| + observes the live socket per call; root's drop-in is idempotent per pass. |
| +- **P2-6** (remote verification incomplete): §8 specifies the heartbeat to |
| + API to CLI projection, shown for healthy boxes too, with the edge's actual |
| + source. |
| + |
| +## 12. Decisions for Paul |
| + |
| +1. **The shape.** Paul asked for "the console's address in a root-owned file |
| + the edge reads". Rev 2 delivers that as a root-owned drop-in on the |
| + console's unit, and the "address" is a socket path systemd creates from |
| + it, because a derived TCP address failed review and cannot survive the |
| + console stopping. Confirm this reading. |
| +2. **The route scan.** Recommendation: keep it below the socket in this |
| + change, so a hub without the socket behaves as today; delete it in the |
| + next release once every platform hub reports `socket` or `env`. It is the |
| + one remaining place route data chooses where tokens go. |
| + |
| +## 13. Not in this spec |
| + |
| +A console unit named anything but `console.service`. Self-hosted consoles |
| +keep the env var (they gain the socket only if they run root's adopt pass). |
| +Moving the console's public routes off TCP. |