`; an unresolved line (stub one) prints the em dash with the resolution sentence; a resolved line with no socket prints `0`.
+- [ ] Reading five lines' `aria-label`s aloud (or dumping them) yields three distinct claims and no invented number.
+- [ ] Typing `10.1.2.64` (or any address from the live `resolver` section) into `#gate-filter` reveals exactly the route(s) that resolve to it, with zero network requests.
+- [ ] `grep -c "`, `DASH_BASE`/`DASH_PW`, sign in with `DASH_ADMIN_PASSWORD`, exit non-zero on FAIL, print every measured number):
+ - **motion where the complaint said there was none**: count the animating elements on load (`getComputedStyle(path).animationName === 'pipe-flow'`) and assert the set is non-empty **and** that at least one of them is a **name** endpoint (a `connections[]` row whose `out.address` is `false`); record the counts per panel;
+ - **provenance**: for 5 sampled rows, `title` contains `address from libc` and an age fragment, and `aria-label` states a number where the payload has one and the resolution sentence where it does not;
+ - **no invented zero**: with a stubbed `resolver: {available: null}` and with `sockets.available: null`, no line prints `0` that the payload did not measure, and the trunk prints `n/a`;
+ - **the filter still costs nothing**: query by an IP from the `resolver` section and by a domain, asserting zero network requests and unchanged tallies;
+ - **colour is still existence**: every drawn route — spine, tick, run, switch — computes to `--gate-on` in both themes, and a row given `off` in devtools turns all four together (phase 31's contract, re-asserted after this phase's DOM/provenance changes);
+ - **reduced motion**: nothing animates under emulated `prefers-reduced-motion: reduce`;
+ - **degradation arms**: `unreachable`, `supported: false`, `sections {nginx: false}`, `resolver {available: null}`, `404 {configured:false}` — each in the payload's own words, none red;
+ - **no sideways scroll** at 1440 px and 360 px with the widest fan-out expanded and both charts open;
+ - screenshots `data/logs/32-gateway-{1440,360,counted,light,unresolved,filtered,reduced,phone}.png`, transcript `data/logs/32-counted-routes.out`.
+2. Re-run `data/logs/27-task02-mobile-audit.cjs` (nine pages, both widths) — exit 0, **0 FAIL / 0 FINDING**, tally recorded in the transcript.
+3. `AGENTS.md` — update every passage this phase made stale, in full:
+ - the agent bullet: the `resolver` section (its `available` three-way and one-line-per-arm rule, `via: "libc"`, `config_directive`, `RESOLVE_MAX_NAMES`/`RESOLVE_CACHE_SECONDS`/pass budget, the single-flight background pass and *why* it is off the request path, `--no-resolve` removing the key in silence, and the never-resolve-anything-but-config-targets rule), `AGENT_VERSION` **1.3.0**, and the `/schema` addition;
+ - `sources/gateway.py`'s join paragraph: two address sources (written-as-address and resolved), `out.resolved`/`via`/`resolved_ts`, normalised-not-string matching, the shared rule's now-real case, and the sentence that the dashboard **still** never resolves with the vantage reason;
+ - the metric-naming passage: replace "no name-keyed `gateway.out_conns@…` name is ever inserted" with the widened rule and the reason it changed, keeping the note that an old name-keyed series stops growing rather than being rewritten;
+ - `collectors.py`'s `ADDON_ERROR_PREFIXES` list gains `resolver`, beside the "a new add-on section adds its prefix here in the same commit" rule;
+ - the `/gateway` UI-conventions paragraph: the dash now has two meanings and one glyph, provenance lives on `title`, the filter matches resolved addresses;
+ - the **fleet record**: `gateway` runs **1.3.0**, `deskwork`/`driveripper` remain **1.1.0**, what the spread costs (nothing, with the additivity control named), the ten sources `ok` re-verified, and a pointer to `data/logs/NOTES-32-rollout.md`;
+ - **gap list**: add the two follow-on lines (name-route switching = phase 33, amends invariant 1 and needs `PLAN.md` sign-off) and re-check gap 13's clip counts against this phase's measurements.
+4. `README.md` — the `/gateway` table row (name routes are counted through the gateway's own libc resolution), the gateway prose (the resolver section, its bounds, `--no-resolve`, what a dash means now), the capture-script section (its new output and its scrub rule), and the agent-version references wherever the page's minimum and the fleet's actual are named — kept as two different facts, not one number.
+5. Freshness and the whole gate:
+ `uv sync --python 3.14 && uv pip list --outdated` → empty (this phase adds **no** dependency; if `cryptography` or anything else moved, that is a separate decision);
+ `uv run pytest`, `uv run pytest --cov`, `uv run pytest -m live --live`, `uv run ruff check src tests agent`, `uv run pyright`, `bash .agents/validate.sh`.
+
+## Testing & Quality
+- Integration: this task **is** the live proof of the phase's headline claim; every number in the Completion Criteria is printed by `32-counted-routes.out` or a probe transcript, never asserted in prose.
+- Coverage: the floor is met on the phase's modified Python (`sources/gateway.py`, `collectors.py`, `agent/host_agent.py`); the run is recorded.
+
+## Completion Criteria
+- [ ] `data/logs/32-counted-routes.out` exits 0 and prints: animating-element counts per panel with at least one **name** endpoint among them, the five provenance `title`s, the zero-invention arms, the filter's zero-request proof, the both-themes colour equality, the reduced-motion pass, and 0 px sideways scroll at both widths.
+- [ ] The eight `data/logs/32-gateway-*.png` screenshots exist, including `counted` (name routes with numbers) and `phone`.
+- [ ] `data/logs/27-task02-mobile-audit.cjs` exits 0 with 0 FAIL / 0 FINDING, tally recorded.
+- [ ] `uv pip list --outdated` is empty; `uv run pytest` and `uv run pytest --cov` green above the floor; `uv run pytest -m live --live` green; `ruff` + `pyright` clean; `bash .agents/validate.sh` green.
+- [ ] `grep -n "1.3.0" AGENTS.md` shows the agent bullet **and** the fleet record; `grep -n "no name-keyed" AGENTS.md README.md` finds nothing (the retired sentence is gone, not contradicted); `resolver` appears in `ADDON_ERROR_PREFIXES`' documented list.
+- [ ] A full read of `README.md` and `AGENTS.md` finds no inconsistency anywhere in either file, including pre-existing ones — fixed in this phase's commits.
+- [ ] No behaviour change in completed work: `/`, `/system`, `/disks`, `/llm`, `/ups`, `/settings`, `/certs`, `/login` render as before and the unwired switch stays unwired (phase 33 wires it).
diff --git a/.agents/phases/todo/33_gateway_route_switching/00_phase.md b/.agents/phases/todo/33_gateway_route_switching/00_phase.md
new file mode 100644
index 0000000..1c16eef
--- /dev/null
+++ b/.agents/phases/todo/33_gateway_route_switching/00_phase.md
@@ -0,0 +1,79 @@
+# Phase 33 — The switch is wired: turning one route off, and back on, without ever weakening the box
+
+**Source:** operator request, 2026-10-23 — "Also write the phase to disable and enable services. I want to be able to turn off and on connections as needed in the event of security concerns or upgrades." + the two decisions taken with them in that conversation: **enforcement is a config edit, validated and reloaded, by a narrow root helper on the gateway** (so a disabled route stays disabled across a reload *and* a reboot), and **one switch per connection line, as already drawn**.
+**Story:** n/a
+**Context:** `deploy/install-agent.sh` (the unit template, whose `NoNewPrivileges=true` / `ProtectSystem=strict` / `SystemCallFilter=@system-service` / empty `CapabilityBoundingSet` this phase **does not touch**, the `--force` re-run guard, `deploy/agent-sudoers` as the precedent for a path-pinned grant), `agent/host_agent.py` (1.3.0 → **1.4.0**: `do_GET`-only `Handler`, `_certificate_allows`, the `haproxy`/`nginx` parsers that must learn the disabled marker), `src/dashboards/sources/gateway.py` (`connections[]`, `config_connections`, `warnings()`' seven kinds), `src/dashboards/api.py` (`/api/ups/command`'s four-gate shape and the `certs_router()`'s audit-event rule), `src/dashboards/collectors.py` (`AgentTls`, `fetch_gateway_snapshot`, the revoke-before-dial rule), `src/dashboards/config.py` (`GATEWAY_*` block), `src/dashboards/web/static/page-gateway.js` (`buildSwitch`, `routeInConfig`, `renderLeaf`), `tests/test_api.py` (the verb-enumeration pins), `tests/test_auth_api.py` (the served-route walk), `tests/test_deploy_scripts.py` (the fake-root sandbox the helper's tests extend).
+
+## Objective
+
+`/gateway`'s switch becomes a control: **disable** `brain.reeseapps.com` and the nginx `stream` map entry stops routing it, persistently, with the config validated and the proxy reloaded and the page showing that exact route **red** until it is re-enabled. One new write route, `POST /api/gateway/route`, gated seven times, with the write itself performed off-box by a **root helper on the gateway that the agent reaches over a systemd-activated unix socket** — because the agent's own unit forbids privilege (`NoNewPrivileges=true`) and this phase is not going to weaken the sandbox of a read-only collector to give it a root shell.
+
+This amends AGENTS.md invariant 1 from *one* exception to **two**, and that is the phase's real risk: a bug here is an outage on the fleet's only ingress. Everything below exists to make the blast radius one line of one file, and to make the app refuse rather than improvise whenever it cannot see what it is doing.
+
+## Scope decisions taken with the operator (binding for this phase)
+
+| # | Decision | Consequence |
+|---|----------|-------------|
+| 1 | **Invariant 1 becomes "two exceptions".** | `POST /api/ups/command` and `POST /api/gateway/route`. Both: session, CSRF/origin on a cookie write, an env gate (`NUT_ALLOW_ACTIONS` / `GATEWAY_ALLOW_WRITES`, default **off**), a typed `DANGER`, and every gate re-checked server-side on every request. `PLAN.md`'s anchor table records a read-only app, so this phase's overview carries the sign-off request; the phase never edits `PLAN.md`. |
+| 2 | **`DANGER` is required for both verbs.** | Enabling is not the safe direction: applying either change re-validates the file and **reloads the proxy**, and a reload touches every route on the box. A word that means "I know this affects the ingress" has to mean it both ways. |
+| 3 | **The agent keeps its sandbox; the privilege lives outside it.** | No sudo from the agent, no setuid, no change to `NoNewPrivileges`/`ProtectSystem`/`SystemCallFilter`. The write peer is `dashboards-routectl.socket` + `dashboards-routectl@.service` (systemd socket activation, `Accept=yes`, `User=root`, `SocketUser=dashboards-agent`, `SocketGroup=dashboards-agent`, `SocketMode=0600`): the agent connects to a socket it is *filemode-permitted* to connect to, and no other uid on the box can even open it, and the helper proves the peer uid with `SO_PEERCRED`. Access control is a file mode plus the mTLS client certificate that already authorises the agent's other paths — not a capability the agent process can be tricked into. |
+| 4 | **Only an id crosses a wire. Never a path, never a line, never text.** | The body is `{id, action, danger?, dry_run?}` where `id` is the payload's own `connections[].id`. The helper re-parses the configs itself, maps that id to the one line it declared, and refuses anything it cannot map. There is no `file`, no `line`, no `pattern`, no `command` anywhere in the contract, and the argv to the helper is fixed with no shell. |
+| 5 | **A route is off in the way that actually stops traffic for its proxy.** | haproxy: the `server` line is commented with a `# dashboards:off … was: ` marker. nginx vhost: the `proxy_pass` line is commented the same way. nginx **stream `map` entry**: commenting it would fall through to the map's `default` (`127.0.0.1:4443`) and **mis-route** the domain instead of blocking it, so the helper rewrites that entry's value to a sink (`127.0.0.1:44450`) and keeps the original in the marker; the sink is a `server` block the helper maintains in `/etc/nginx/stream.d/00-dashboards-sink.conf`, which the existing `stream { include /etc/nginx/stream.d/*.conf; }` glob already loads — so **no hand edit of the main config is ever required**. The map's `default` entry is **refused**: it is the fallback for every unmapped name, not a service. |
+| 6 | **Validate, restore on failure, reload — never restart.** | Write the new bytes, run `nginx -t` / `haproxy -c -f …`; on failure put the previous bytes back, do **not** reload, and answer `applied: false, validated: false, restored: true`. On success `systemctl reload ` — reload, because a restart cuts every Minecraft session and every in-flight upload on an ingress that is doing its job. A `reload` failure is reported with the unit's own status and the file is left in the applied state (the config is correct; the reload is the operator's next action, said out loud). |
+| 7 | **Self-describing marker + drift refusal, not silent trust.** | The disabled line carries the original verbatim after `was:`, so a human can restore it by eye and the helper can restore it mechanically. A sidecar `/var/lib/dashboards-routectl/state.json` (`0600`, root) records actor, timestamp and the sha256 of what was written. Enabling restores only if the current line still matches what the helper wrote; otherwise it **refuses** and reports `drift` — a file an operator hand-edited is theirs to fix, not the app's to guess at. |
+| 8 | **Refuse rather than act blind.** | The write is refused when: writes are not enabled; the id is not in the **current** payload; the route is already in that state (`changed: false`, no reload); either config section is not `available: true`; the `gateway` job is `ok: false` or stale beyond 3× its interval; the `host:` system job is not `ok`; the agent is revoked (refused before any socket, the existing rule); the throttle is tripped. That is the UPS "refused while on battery" rule, translated: do not rewrite a config you cannot currently read end to end. |
+| 9 | **`off` finally means something the payload said.** | The agent's parsers learn the marker and report the marked `server`/`proxy_pass`/`map` entry with `disabled: true`, so the route stays in the graph as a declaration and `connections[].enabled` becomes **`false`**. `routeInConfig()` stops being a literal, the `off` styling phase 30 built becomes reachable, and `warnings()` learns the marker: a backend emptied by a marker is not `haproxy_backend_empty` (the operator chose that; the page shows it red), while a backend with no `server` line at all still is. |
+| 10 | **A live route's count is never stamped.** | Disabling does not write `0` into the payload. The sockets drain on the reload and the next poll reports what `/proc` says. Invariant: no code path in this phase writes a count. |
+| 11 | **The audit is one event, fixed in shape, with no config text in it.** | `gateway`-source events `route-disabled` / `route-enabled` / `route-denied`: verb, id, the session's actor name, `applied`/`validated`/`reloaded`/`drift`, and the proxy's own one-line error when there was one. The unified diff is returned to **the caller's response** (it is what the confirm dialog shows) and never stored — events are served to a browser and `/api/events` is a feed, not a config archive. |
+| 12 | **The overview is told, because "something is switched off" is not a page-only fact.** | `/api/summary`'s `gateway` block gains **one** field, `disabled` (an int count of `enabled is false` rows, `null` in the arms that did not measure) — the thirteenth key, restated in the pinned key set with its reason. A notifier has to learn about a deliberate outage without scraping a page, and it prints nothing at `0` (the `warnings` rule: a permanent `0 switched off` is ink that trains the eye). |
+| 13 | **One route, one file, one reload per request.** | A request touches exactly one config file and reloads exactly one proxy. There is no batch verb, no "disable all to this host", no `dry_run` that writes. If a security incident needs five routes off, that is five reviewed requests, each with its own event. |
+
+**Out of scope:** editing anything a marker cannot express (adding/removing vhosts, certificates, `bind` lines, the map's `default`), haproxy runtime `disable server` via a stats socket (a runtime-only state that a reload silently undoes — decision 5 is persistent instead), disabling an entire **host** or **port**, per-user authorisation (one admin, gap 6), a scheduler ("off at 02:00"), and any change to the agent's unit security directives or to another host's agent (`gateway` alone runs 1.4.0; `deskwork`/`driveripper`'s 1.1.0 agents have no routes and are unaffected).
+
+## Dependencies
+
+- `32_gateway_resolved_target_liveness` (todo, **must complete first**) — agent 1.3.0's resolver section and the counted name routes are what a switched-off line reads against: `off` + a draining count to `0` is the proof the switch worked, and without resolution a disabled route and a never-counted route look identical.
+- `31_gateway_route_readability` (todo) — the row that names the inbound domain, the green end-to-end route, and the `off` styling this phase finally reaches.
+- `30_gateway_connection_map` (complete) — `connections[].id` as the vocabulary, the switch markup and its a11y contract, `routeInConfig()` as the named seam.
+- `15_agent_mtls` / `24_dev_mtls_rollout` (complete) — the verified-client-certificate gate the new POST path inherits, and the revoke-before-dial rule this phase's collector reuses.
+- `11_admin_login` (complete) — session, CSRF, origin checks, `LoginThrottle` (the `route:` bucket is its third key shape).
+- **Operator actions, not repo work:** the `dashboards-agent`-to-helper socket grant lands through the units (no sudoers line needed), but installing units on a host and running the first live drill are the operator's — and the drill **stops** unless they are present. `PLAN.md`'s anchor sign-off for invariant 1 is theirs too.
+
+## Tasks
+
+1. `01_the_root_helper_edits_exactly_one_route.md` — `deploy/dashboards-routectl.py`: `show`/`list`/`diff`/`disable`/`enable`/`verify`, the marker with `was:`, the sink file it manages, validate-restore-reload, drift refusal, `--serve` over a systemd-passed socket, `--root` for tests.
+2. `02_the_privileged_peer_is_a_socket_not_a_sudo_line.md` — the two systemd units + `install-agent.sh --with-routectl`; the proof that the agent's `NoNewPrivileges=true`/`ProtectSystem=strict` unit is unchanged and can still reach the socket.
+3. `03_the_agent_accepts_one_write.md` — agent **1.4.0**: `POST /route` behind the verified client certificate **and** `--allow-writes`, body validation, one fixed peer call, plus the parsers reporting `disabled` for a marked line; `/schema` and the additivity control.
+4. `04_the_source_publishes_enabled_and_the_warnings_learn_the_marker.md` — `connections[].enabled`, `off` reachable in the payload, `warnings()` marker-aware, stub/skeleton parity, the one new `/api/summary` field (`gateway.disabled`), and no count ever written.
+5. `05_the_api_gates_the_write_ten_times.md` — `GATEWAY_ALLOW_WRITES`, `DASH_READ_ONLY`, `collectors.post_route`, `POST /api/gateway/route`, the ten-gate order, the throttle, the events, `/api/config.gateway.writes_enabled`, and the verb-enumeration + served-route pins restated (this is where invariant 1 is amended in `AGENTS.md`).
+6. `06_the_switch_obeys.md` — `page-gateway.js` + `gateway.html` + `dash.css`: `DANGER` confirm with the diff from a `dry_run` first, patch from the response, `routeInConfig()` reading `enabled`, the writes-disabled arm that keeps the switch honest, footer paragraph 3.
+7. `07_rehearse_then_drill_on_the_live_ingress.md` — the fake-tree rehearsal, then the live install on `gateway` and a drill on the one named-safe route, restore, verify, `data/logs/NOTES-33-switching.md`. Stops, correctly, without the operator present.
+8. `08_docs_and_live_verify.md` — `AGENTS.md` (invariant 1, the agent bullet, `sources/gateway.py`, `api.py`, `collectors.py`, `config.py`'s block, the `/gateway` UI paragraph, the fleet record, gap list) + `README.md` (including the operator's sudo/units steps), the browser pass, the mobile audit, the full gate.
+
+## Testing & Quality
+
+- **The helper is tested unprivileged, against a fake tree, with the proxy commands stubbed.** `tests/test_routectl.py` runs the real helper in a `tmp_path` tree (`--root`) with `nginx`/`haproxy`/`systemctl` faked on `PATH`, and pins: one line changed and nothing else in the file (byte-diff assertion); `was:` restores verbatim; a failing validator restores the exact previous bytes and reloads nothing; `default` refused; an unknown id refused; a second disable `changed: false`; the sink file created on first use, left alone if an operator's file is there, removed only when it wrote it and nothing is disabled; drift refused rather than restored; `SO_PEERCRED` refused for a non-`dashboards-agent` uid in the fake-peer test; no `shell=True` anywhere (`grep` pin, the installer's precedent).
+- **The agent's write path is proven against a fake peer, not a real one.** `tests/test_agent.py` runs the real handler over a TLS loopback port (the phase-15 harness) plus a unix-socket stub: `POST /route` without a client certificate is 403 `client certificate required`; with `--allow-writes` absent it is 403 `writes are not enabled on this agent`; a body with an unexpected key, a bad id, or a missing `danger` is refused **before** the peer is touched (asserted by the stub logging nothing); `GET` behaviour is byte-identical to 1.3.0 (the additivity control re-run).
+- **The API gates are proven twice, as the UPS ones are.** `tests/test_api.py` walks every gate with spies: writes-disabled refuses without dialling; a stale `gateway` job refuses; a revoked agent refuses without a socket; `DANGER` is required for `disable` **and** `enable`; a right request produces one peer call, one event, and the response's `applied`/`validated`/`reloaded` triple. `tests/test_auth_api.py`'s served-route walk demands a session for `/api/gateway/route`, and the CSRF pin is extended to it on the **wire** (a scripted helper records nothing without the header, once with it) — a 403 after the write is an outage with an error message attached.
+- **Live, opt-in, and reversible:** `-m live --live` gains `test_the_switch_round_trip_on_one_named_route` which is **skipped unless `--allow-live-writes` is passed as well**, names the route in the skip reason, and always restores in a `finally`. The default live suite stays read-only (AGENTS.md's rule survives this phase; the drill belongs to task 07 with the operator watching).
+- Coverage **>90%** on `deploy/dashboards-routectl.py`, `agent/host_agent.py`, `sources/gateway.py`, `collectors.py`, `api.py`; the whole suite 100%; `bash .agents/validate.sh` green.
+
+## Documentation & Consistency
+
+- The final pass reviews `README.md` and `AGENTS.md` in full against the project as it will stand after this phase and fixes every inconsistency found, **including pre-existing ones**. This phase's specific list: **invariant 1** rewritten to two exceptions with the seven gates named (and the sentence "hiding a button is not a safety control" kept, because it is the reason the switches are gated server-side rather than greyed in JS); the agent bullet's `POST /route` and the `disabled` marker; the `sources/gateway.py` bullet's `enabled`/`off` rules and the marker-aware `warnings()`; the `api.py` bullet's write lists (fleet writes are now two); the `collectors.py` bullet (`post_route`, the revocation check it shares); `config.py`'s `GATEWAY_ALLOW_WRITES` row and README's configuration table; the `/gateway` UI-conventions paragraph (the switch is wired, what `off` looks like, what the writes-disabled arm says); the fleet record (gateway **1.4.0**, its unit's security directives unchanged, the two new systemd units, `NOTES-33-switching.md`); and the gap list (name-route switching **closed**, plus the honest limits: one admin, no scheduler, no per-host kill).
+- `README.md` gains the operator's install steps for the helper units and the exact `--with-routectl` invocation, plus the recovery command for the state file (`systemctl status dashboards-routectl.socket`, `routectl list`, `routectl verify`).
+- Tasks update both files immediately when their own changes are user-visible.
+
+## Completion Criteria
+
+- [ ] With `GATEWAY_ALLOW_WRITES=1`, `/gateway` disables `brain.reeseapps.com`: the confirm dialog shows the **diff from a `dry_run`**, asks for `DANGER`, and the row turns **red** (`off`) on the poll after the reload while its live count drains to `0` on its own — no code wrote that zero.
+- [ ] `ssh gateway-ops 'sudo /usr/local/sbin/dashboards-routectl.py list'` names exactly that route; `verify` reports no drift; the marked line contains the original verbatim after `was:`; the map entry points at the sink and `stream.d/00-dashboards-sink.conf` exists and is owned by the helper's header.
+- [ ] Enabling restores the original bytes exactly (byte-compare against a pre-drill copy), the row turns green, and `list` is empty afterwards. **The live ingress ends the phase in the state it started in.**
+- [ ] Every gate refuses with its own sentence and **without** touching a peer: writes disabled, no session, no CSRF, wrong `Origin`, missing `DANGER`, unknown id, already-in-state, section unreadable, `gateway` job stale, `host:gateway` not `ok`, agent revoked. Each is a test, and each test asserts the stub peer logged nothing.
+- [ ] The agent's unit is unchanged: `systemctl cat dashboards-agent` still shows `NoNewPrivileges=true`, `ProtectSystem=strict`, `SystemCallFilter=@system-service`, and the same sha256 the phase recorded before installing the units — the sandbox was not traded for the feature.
+- [ ] A failing validator (`nginx -t` stubbed to exit 1) restores the previous bytes, reloads nothing, answers `applied: false, validated: false, restored: true`, and the page's line never turned `off`.
+- [ ] `POST` inventory: the app now has exactly two upstream writes (`/api/ups/command`, `/api/gateway/route`) and the enumeration pin lists them as such; `AGENTS.md` invariant 1 says **two** and names both gates; `/api/health` gained nothing.
+- [ ] `uv run pytest` (with `--cov` ≥ 94), `uv run ruff check src tests agent deploy`, `uv run pyright`, `node --check`, `bash .agents/validate.sh` all green; `uv run pytest -m live --live` green **without** `--allow-live-writes` (the round-trip test skipped by default, its reason naming the route it would touch).
+- [ ] `data/logs/33-*.png` (switch off in both themes, the `DANGER` dialog with its diff, the writes-disabled arm, 360 px) and `data/logs/33-*.out`; `data/logs/27-task02-mobile-audit.cjs` exits 0 with 0 FAIL / 0 FINDING; `data/logs/NOTES-33-switching.md` records the drill, the hashes and the restore.
+- [ ] README.md and AGENTS.md are accurate and consistent with the whole project (verified in the final pass), including the operator's steps for undoing all of this (`--without-routectl`, remove the units, re-enable every route).
+- [ ] No behaviour change in completed work: the other five dashboards, `/settings`, `/certs`, `/login`, the UPS command path and its four gates, and every non-gateway source behave exactly as phase 32 left them.
diff --git a/.agents/phases/todo/33_gateway_route_switching/01_the_root_helper_edits_exactly_one_route.md b/.agents/phases/todo/33_gateway_route_switching/01_the_root_helper_edits_exactly_one_route.md
new file mode 100644
index 0000000..a80bda8
--- /dev/null
+++ b/.agents/phases/todo/33_gateway_route_switching/01_the_root_helper_edits_exactly_one_route.md
@@ -0,0 +1,71 @@
+# Task 01 — The root helper edits exactly one line, proves it validates, and reloads or gives up
+
+**Phase:** `33_gateway_route_switching` · **Source:** operator decision 2026-10-23 — "Edit the config + validate + reload, via a narrow root helper on the gateway"
+**Story:** n/a
+
+## Objective
+
+`deploy/dashboards-routectl.py` — a stdlib-only root program that turns one `connections[].id` off or back on in one of the two proxy configs, validates the file with the proxy's own checker, reloads that one proxy, and refuses everything else. It is the phase's only writer, it has no network listener of its own (task 02 hands it a systemd-activated socket), and it can be run by hand on the gateway by the operator to see exactly what the dashboard would do.
+
+The helper **imports the agent's config parser by file path** and never re-implements a rule: two parsers reading one config is two opinions about the same file, which is the failure mode this repo has pinned against since phase 28. `agent/host_agent.py` is world-readable at `/usr/local/lib/dashboards-agent/host_agent.py`, so the helper imports it with `importlib` and refuses to run at all if it cannot.
+
+## Work
+
+1. `agent/host_agent.py` — the shared grammar only (no version bump here; `AGENT_VERSION` moves in task 03):
+ ```python
+ ROUTE_MARKER = "# dashboards:off" # the only marker this app writes into a proxy config
+ ROUTE_WAS = "was:" # ` was: `
+ def marker_for(route_id: str, original: str) -> str: ...
+ def split_marker(line: str) -> tuple[str, str] | None: # (route_id, original) or None
+ def config_line_index(haproxy_text, haproxy_path, nginx_docs) -> dict[str, dict[str, Any]]:
+ """route id -> {"file", "line", "original", "kind", "disabled"} for every declared target."""
+ ```
+ `config_line_index` walks the parsed declarations **with their source lines**, so the id → (file, line, verbatim text) map is derived by the same parser that produced the graph, and a marked line is reported as the same id with `disabled: true`. It is pure over text; the file reading stays in the callers (`Collector` for the agent, the helper for the writes), both resolved under `--root`.
+2. `deploy/dashboards-routectl.py` (new, `0755`, stdlib, no third-party import, no `shell=True`)
+ - **Arguments** (all default to the deployed paths, all overridable for the fake tree):
+ `--root /` · `--haproxy-config /etc/haproxy/haproxy.cfg` · `--nginx-config /etc/nginx/nginx.conf` · `--state /var/lib/dashboards-routectl/state.json` · `--sink-conf /etc/nginx/stream.d/00-dashboards-sink.conf` · `--sink-address 127.0.0.1:44450` · `--agent-module /usr/local/lib/dashboards-agent/host_agent.py` · `--nginx-unit nginx` · `--haproxy-unit haproxy` · `--apply` (without it every write verb is a dry run).
+ - **Verbs**, one JSON object to stdout, non-zero exit on refusal:
+ `list` · `show --id ID` · `diff --id ID --action disable|enable` · `disable|enable --id ID [--apply]` · `verify` (marker/hash vs file → drift report) · `--serve` (read one JSON request from the systemd-passed socket, answer one JSON line).
+ - **Per-kind edit, exactly as decision 5** (the three arms and the `default` refusal are this file's core; a fourth arm is a new decision, not a fall-through):
+ | id kind | action | why |
+ |---|---|---|
+ | haproxy `server` | comment the line with `ROUTE_MARKER` + `was:` | the backend stops receiving; the marker keeps the original restorable by eye and by machine |
+ | nginx vhost `proxy_pass` | comment the line the same way | the vhost keeps `listen` + `server_name` and gains no target — a shape `warnings()` already treats as quiet (the `:80 return 301` arm), so "off" does not read as "broken" |
+ | nginx stream `map` entry | **rewrite the value** to the sink address, marker + `was:` on the line, ensure the sink file exists | commenting would fall through to the map's `default` (`127.0.0.1:4443`) and **mis-route the domain instead of blocking it** |
+ | nginx `map` `default` | **refuse** — `{"applied": false, "refused": "map-default"}` | it is the fallback for every unmapped SNI, not a service |
+ - **The sink file**: created on first need with a `# managed by dashboards-routectl — do not edit` header and a stream `server` block that listens on `127.0.0.1:44450` and returns a short refusal string; loaded by the existing `stream { include /etc/nginx/stream.d/*.conf; }` glob, so **the main config is never edited**. If a file already exists at that path without the header, the helper refuses (an operator's file is not its own to overwrite). It deletes the file only when it wrote it **and** nothing is disabled, and never removes it while any map entry still points at the sink.
+ - **Write protocol** (order is the safety property, so it is written as numbered steps in the file):
+ 1. re-read the file; index it; map `id` → line (unknown id → refuse, nothing written);
+ 2. already in the requested state → `{"applied": false, "changed": false}` and **no reload**;
+ 3. `--apply` absent → answer with the unified `diff` only;
+ 4. write to `mkstemp` in the same directory, `fsync`, `os.replace`;
+ 5. run `nginx -t` or `haproxy -c -f `; on failure `os.replace` the previous bytes back and answer `{"applied": false, "validated": false, "restored": true}` with the checker's own first line — **and reload nothing**;
+ 6. `systemctl reload `; a failure is reported as `reloaded: false` with the unit's status line, leaving the applied file in place (the config is right; the reload is the operator's next action and the answer says so);
+ 7. re-read and re-index to prove the marker is live; record state.
+ - **Never `restart`** — the docstring says why in one sentence: a restart cuts every live connection through the fleet's only ingress, and a reload does not.
+ - **State sidecar**: `0600`, root, `{id: {"actor", "at", "file", "sha256", "action"}}`, written with `os.open(..., O_CREAT, 0o600)` so the mode is its birth mode (the `dev-certs-export.py` idiom). `enable` restores **only** when the current line hashes to what the helper wrote; otherwise `{"applied": false, "drift": true, "hint": "…"}` and no byte changes.
+ - **`--serve`**: `socket.fromfd(3, AF_UNIX, SOCK_STREAM)` (or the `LISTEN_FDS`/stdin idioms, chosen once and documented), read one newline-delimited JSON request, `getsockopt(SO_PEERCRED)` and **refuse any uid that is not the agent's** (`--allow-uid`, default `dashboards-agent`, resolved with `pwd.getpwnam`), dispatch one verb, write one JSON line, exit. One request per activation: systemd spawns the instance per connection (`Accept=yes`), so there is no accept loop, no thread, no timeout policy to invent.
+ - **Nothing in this file takes a path, a line number, a pattern or a command from the wire.** `--serve`'s accepted keys are exactly `{id, action, dry_run}` and every other key is a refusal. Assert it structurally in the tests.
+ - Every subprocess call is a fixed argv list (`subprocess.run([...])`, no `shell=True`), and the checker/unit names come from **flags the operator installed**, never from the request.
+3. `tests/test_routectl.py` (new) — real helper, fake tree (`--root`), fake `nginx`/`haproxy`/`systemctl` scripts on `PATH` that record their argv and answer to order:
+ - `test_disabling_one_route_changes_exactly_one_line` — unified diff of the whole file is one hunk, one line; every other byte identical (assert on the bytes, not on a count).
+ - `test_a_disabled_map_entry_points_at_the_sink_and_keeps_its_original` — the sink file exists with its header, the marked line carries `was: `, and re-enabling restores the file byte-identical to the pre-drill capture.
+ - `test_the_map_default_is_refused_and_nothing_is_written`, `test_an_unknown_id_is_refused`, `test_disabling_a_disabled_route_changes_nothing_and_reloads_nothing` (the fake `systemctl` log stays empty).
+ - `test_a_failing_validator_restores_the_previous_bytes` — byte-identical restore, `validated: false`, `restored: true`, zero reload calls, non-zero exit.
+ - `test_a_failing_reload_says_so_and_leaves_the_file_applied`, and `test_reload_is_never_a_restart` (grep the source for `restart` in a call position, the installer's `--status` style pin).
+ - `test_the_helper_imports_the_agents_parser_and_refuses_without_it` — point `--agent-module` at a non-file: exit non-zero, no write, and the message names the path (a helper that silently skipped the parser would be a second opinion about the config).
+ - `test_state_is_0600_and_drift_is_refused` — mode at birth; hand-edit the marked line and `enable` refuses with `drift: true` and no byte change.
+ - `test_serve_refuses_a_peer_that_is_not_the_agent_uid`, `test_serve_accepts_exactly_id_action_dry_run`, `test_no_shell_and_no_path_from_the_wire` (structural greps over the file, the `certs.py`/`auth.py` precedent).
+ - `test_the_sink_file_is_left_alone_when_someone_elses_wrote_it`, `test_the_sink_is_removed_only_when_it_is_empty_of_our_routes`.
+
+## Testing & Quality
+- Unit: the whole matrix above, hermetic and unprivileged, over the **captured** `gateway_haproxy.cfg` / nginx tree so the edits are pinned against real config bytes rather than a toy file.
+- Coverage **>90%** on `deploy/dashboards-routectl.py` and the new `agent/host_agent.py` functions; `uv run ruff check agent deploy` + `uv run pyright` clean; `python3 -m py_compile` on the helper (it must run on a host's Python 3.10, so no 3.14-only syntax — pin that with a `# requires: python >=3.10` header and a test that greps for `match `/`typing.Self`-style 3.11+ syntax if the repo has such a pin; otherwise assert `ast` parses with `feature_version=(3,10)`).
+
+## Completion Criteria
+- [ ] `uv run python deploy/dashboards-routectl.py --root … diff --id nginx:443->reeseapps-brain-of-reese.reeselink.com:443` prints a one-hunk diff and writes nothing; with `--apply` it edits, validates, reloads (against the fakes) and answers `{"applied": true, "validated": true, "reloaded": true}`.
+- [ ] Re-enabling leaves the tree byte-identical to its pre-drill `sha256sum` for **both** config files.
+- [ ] `grep -n "shell=True\|restart" deploy/dashboards-routectl.py` finds neither in a call position; `grep -n "def \|argparse" ` shows no `--file`/`--line`/`--pattern` option anywhere.
+- [ ] `uv run pytest tests/test_routectl.py -q` 100% passing; whole suite green; coverage not down.
+- [ ] README.md/AGENTS.md note the helper's existence and its verbs (this task's user-visible surface — the operator can run it by hand) — the phase's final pass re-checks both project-wide.
+- [ ] No behaviour change in completed work: `/snapshot`'s document is unchanged by this task (the `AGENT_VERSION` bump and the `disabled` field are task 03's, with the additivity control).
diff --git a/.agents/phases/todo/33_gateway_route_switching/02_the_privileged_peer_is_a_socket_not_a_sudo_line.md b/.agents/phases/todo/33_gateway_route_switching/02_the_privileged_peer_is_a_socket_not_a_sudo_line.md
new file mode 100644
index 0000000..c204927
--- /dev/null
+++ b/.agents/phases/todo/33_gateway_route_switching/02_the_privileged_peer_is_a_socket_not_a_sudo_line.md
@@ -0,0 +1,67 @@
+# Task 02 — The privileged peer is a socket systemd activates, not a privilege the agent is given
+
+**Phase:** `33_gateway_route_switching` · **Source:** the agent unit's `NoNewPrivileges=true` + `ProtectSystem=strict` (read from `deploy/install-agent.sh`), which this phase must not weaken to get a write
+**Story:** n/a
+
+## Objective
+
+Install the helper on the gateway as a **socket-activated root service** the agent may connect to and nothing else: `dashboards-routectl.socket` owned by the agent user at `0660`, `dashboards-routectl@.service` running as root with `Accept=yes`. The agent's own unit keeps every one of its security directives — the phase's central safety claim is that a read-only collector stayed read-only in its sandbox and talked to a peer outside it.
+
+## Work
+
+1. `deploy/dashboards-routectl.socket` (new)
+ ```ini
+ [Socket]
+ ListenStream=/run/dashboards-routectl.sock
+ SocketUser=dashboards-agent
+ SocketGroup=dashboards-agent
+ SocketMode=0600
+ NoDelay=yes
+ [Install]
+ WantedBy=sockets.target
+ ```
+ `0600` + `SocketUser=dashboards-agent` is the whole access control at the file layer: only that uid can connect, everyone else gets `EACCES` before any code of ours runs. The peer check in task 01's `--serve` is the **second** look, not the first.
+2. `deploy/dashboards-routectl@.service` (new)
+ ```ini
+ [Service]
+ Type=simple
+ ExecStart=/usr/local/sbin/dashboards-routectl.py --serve \
+ --allow-uid dashboards-agent --state /var/lib/dashboards-routectl/state.json
+ User=root
+ StandardInput=socket
+ StandardOutput=socket
+ StateDirectory=dashboards-routectl
+ ProtectSystem=read-only # it writes two config files by absolute path; see ReadWritePaths
+ ReadWritePaths=/etc/haproxy /etc/nginx/stream.d
+ ProtectHome=read-only
+ PrivateTmp=yes
+ NoNewPrivileges=true
+ SystemCallFilter=@system-service
+ ```
+ Three notes the file must carry as comments: the helper needs `/etc/haproxy` and `/etc/nginx/stream.d` writable and **nothing else** (`/etc/nginx/conf.d` is deliberately absent — vhost edits land there, so the *vhost* arm is listed in `ReadWritePaths` too and that addition is a decision recorded in the file, not smuggled in); `NoNewPrivileges=true` here as well, because it gets its privilege from being started by systemd as root, not from escalation; and `Accept=yes` on the template means systemd spawns one instance per connection with the socket on stdin, which is why the helper handles exactly one request and exits.
+ - **`ReadWritePaths` must list every directory whose file the helper replaces** (`os.replace` needs write on the directory): `/etc/haproxy`, `/etc/nginx/conf.d`, `/etc/nginx/stream.d`. Getting this wrong is a `EROFS` in production, so the live drill in task 07 is the test that matters and the units file names it.
+3. `deploy/install-agent.sh` — one new flag, `--with-routectl`, off by default, and its inverse `--without-routectl`:
+ - installs `dashboards-routectl.py` to `/usr/local/sbin/` (`0755`, root) and the two units to `/etc/systemd/system/`, `daemon-reload`, `systemctl enable --now dashboards-routectl.socket`;
+ - **changes nothing about the agent's own unit** — assert that structurally: the rendered `dashboards-agent.service` bytes are identical with and without the flag (`tests/test_deploy_scripts.py`), because the temptation to "help" the agent reach the socket by relaxing it is exactly what this task exists to close;
+ - verifies reachability from the agent's own uid before reporting success: `sudo -u dashboards-agent python3 -c 'import socket; s=socket.socket(socket.AF_UNIX); s.connect("/run/dashboards-routectl.sock")'` — a socket the agent cannot connect to is a feature that fails at 03:00 during an incident, so this check is part of the install, and its output is printed;
+ - `--without-routectl` disables and removes the units and the helper, leaves `/etc` and the state directory alone, and reminds the operator to re-enable any route still off (`routectl list` output printed first).
+ - The re-run guard applies as it does to the unit: a differing installed helper is a diff + exit 1 unless `--force`.
+4. `deploy/gateway-routectl-README.md` (new, short) — the operator's page: what the two units are, how to see them (`systemctl status dashboards-routectl.socket`, `journalctl -u 'dashboards-routectl@*'`), how to run the helper by hand on the box, how to undo it all, and the sentence that **no sudoers line is involved**: the grant is a file mode systemd enforces.
+5. `tests/test_deploy_scripts.py` — extend the fake-root sandbox:
+ - `test_with_routectl_installs_helper_and_units_and_leaves_the_agent_unit_byte_identical`;
+ - `test_the_socket_is_0600_and_owned_by_the_agent_user` (the fake `install`/`chown`/`chmod` log, the precedent that proved the bundle's `0640`);
+ - `test_the_helper_is_installed_0755_root_and_its_state_dir_is_created`;
+ - `test_without_routectl_removes_the_units_and_not_the_config_or_the_state`;
+ - `test_no_new_sudoers_line_exists` (the `deploy/agent-sudoers` file is unchanged, and nothing in the new units grants sudo);
+ - `test_the_install_checks_the_agent_can_reach_the_socket` — a fake where that connect fails makes the install exit non-zero rather than reporting a success nobody can use.
+
+## Testing & Quality
+- Unit: the pins above; the units are also parsed (`systemd-analyze verify` is not available in the sandbox, so the assertions are on the directive lines, and task 07 runs the real `systemctl` on the gateway).
+- Coverage: the installer is shell; the gate is the sandbox tests plus `bash -n`.
+
+## Completion Criteria
+- [ ] `bash -n deploy/install-agent.sh` clean; `grep -n "NoNewPrivileges\|ProtectSystem\|SystemCallFilter" deploy/install-agent.sh` shows the agent unit's values unchanged from before this task (the guard against "fixing" reachability by weakening the sandbox), and `git diff` for this task shows no edit inside the agent unit template block.
+- [ ] `uv run pytest tests/test_deploy_scripts.py -q` 100% passing, including the byte-identical agent-unit assertion; whole suite green; coverage not down.
+- [ ] The two unit files list exactly the paths the helper writes and no others, with the `os.replace`-needs-directory reason stated in a comment.
+- [ ] README.md/AGENTS.md gain the two unit names and the "no sudoers line" sentence (this task's user-visible surface) — the phase's final pass re-checks both project-wide.
+- [ ] No behaviour change in completed work: an install **without** `--with-routectl` is byte-identical to an install before this phase, on every host.
diff --git a/.agents/phases/todo/33_gateway_route_switching/03_the_agent_accepts_one_write.md b/.agents/phases/todo/33_gateway_route_switching/03_the_agent_accepts_one_write.md
new file mode 100644
index 0000000..e989c81
--- /dev/null
+++ b/.agents/phases/todo/33_gateway_route_switching/03_the_agent_accepts_one_write.md
@@ -0,0 +1,50 @@
+# Task 03 — Agent 1.4.0: one POST path, behind the certificate and a flag, plus the marker read back as `disabled`
+
+**Phase:** `33_gateway_route_switching` · **Source:** the agent's `do_GET`-only `Handler` and `_certificate_allows` (phase 15), and phase 30's `routeInConfig()` seam
+**Story:** n/a
+
+## Objective
+
+`host_agent.py` goes **1.3.0 → 1.4.0** with two additions and no other change: the two config parsers report a marker-authored line as a declared target with **`disabled: true`**, and one new path, `POST /route`, which is reachable only with a verified client certificate **and** an agent started with `--allow-writes`, forwards exactly `{id, action, dry_run}` to the task-02 socket, and answers with the helper's JSON. Every `GET` behaviour stays byte-identical, proven by the additivity control.
+
+## Work
+
+1. `agent/host_agent.py`
+ - Parsers: each haproxy `server` node and each nginx `proxy_pass` / `upstream` member / `map` entry gains `"disabled": ` — `false` for an ordinary line, `true` for one carrying `ROUTE_MARKER` (read with `split_marker`). Additive: no existing key changes meaning, and a route that is off **stays in the document** because "the config declares this and the operator switched it off" is a different fact from "the config never said it" (rule 2).
+ - **New path** in `Handler`:
+ ```python
+ def do_POST(self) -> None: # the BaseHTTPRequestHandler API name — keep it
+ if self.path.split("?", 1)[0].rstrip("/") != "/route":
+ self._send(405, {"ok": False, "detail": "no such write path"})
+ return
+ # the certificate check first, exactly as do_GET does it, revoked serial included;
+ # then the flag; then the body; then the peer. Nothing else in this method writes.
+ ```
+ Order, and each refusal is its own sentence: no bundle / no verified certificate → `403 client certificate required` (and `403 client certificate revoked` for a withdrawn serial, on this path too); agent started **without** `--allow-writes` → `403 writes are not enabled on this agent`; body not a JSON object, longer than `_ROUTE_MAX_BODY = 4096`, carrying a key outside `{id, action, dry_run}`, an `action` outside `{disable, enable}`, or an `id` longer than 256 chars → `422` with a fixed message and **no peer call**; no `--routectl-socket` configured → `503 no route helper on this host`.
+ - Peer call: one newline-delimited JSON request over `AF_UNIX`, `settimeout(ROUTE_TIMEOUT_SECONDS = 30)` (the helper may run `nginx -t` and a reload), one JSON line back, oversized or unparsable replies are `502 route helper answered something unreadable` and **never** retried — a retry of a write is a second reload. Any `OSError` → `502` with the errno word, no traceback text, no path echoed beyond the flag's own configured value.
+ - **No token path ever gets this**: on the plain-`http` bearer-token arm, `POST /route` is refused with `403 writes require a certificate` — the same reasoning phase 15 applied to reads (the handshake is the identity), and this app's fleet is mTLS anyway.
+ - `--allow-writes` (default off) and `--routectl-socket /run/dashboards-routectl.sock`; both appear in the `/schema` doc block. `--status` and `--uninstall` are unaffected.
+ - `log_message`: the POST line prints the path and the status only — never the body, never the id (an id is a hostname, and the agent's log line convention is that query strings stay out).
+ - `AGENT_VERSION = "1.4.0"`; `/schema` names `POST /route`, `--allow-writes`, `--routectl-socket`, and the `disabled` field on the proxy sections; the status page lists the write path with its refusal sentence so a human with a browser is not surprised by a 405.
+2. `tests/test_agent.py` — the TLS loopback harness (phase 15) plus a unix-socket stub peer that logs what it received:
+ - `test_the_agent_version_is_1_4_0_and_the_schema_names_the_write_path`;
+ - `test_a_post_without_a_client_certificate_is_refused` and `test_a_revoked_serial_is_refused_on_the_write_path_too` (the denylist is not a read-side rule);
+ - `test_writes_off_refuses_before_the_peer_is_touched` (stub logs nothing);
+ - `test_the_body_vocabulary_is_id_action_dry_run_exactly` — a key added, a wrong `action`, a 5 KB body, a non-object: all refused, all with the peer idle;
+ - `test_a_good_request_reaches_the_peer_once_and_the_answer_is_passed_through` (including `applied:false` staying `false` — the agent invents no success), `test_the_peer_is_called_once_even_when_it_times_out`, `test_an_unreadable_peer_answer_is_502_and_is_not_retried`;
+ - `test_token_mode_cannot_write`; `test_every_other_path_is_405`;
+ - `test_a_marked_server_is_reported_disabled_and_stays_in_the_document` (haproxy + all three nginx arms), `test_an_unmarked_config_has_disabled_false_everywhere`.
+ - **Additivity control re-run**: `data/logs/verify-33-additive.py` (from task 02 of phase 32) extended to demand 1.4.0's `GET /snapshot` equals 1.3.0's with `disabled` added at the target level and nothing else, and equal *exactly* on an unmarked config.
+3. `src/dashboards/collectors.py` — a `post_route(tls, target, body)` beside `fetch_gateway_snapshot`, reusing the same `AgentTls` material and the **same revoke-before-socket check**, and redacting the URL in every error string it produces (invariant 6: those strings become events).
+
+## Testing & Quality
+- Unit: the matrix above; hermetic (a stub unix socket, no helper, no root, no proxy binaries).
+- Coverage **>90%** on the new agent code and `collectors.post_route`; `ruff` + `pyright` clean.
+
+## Completion Criteria
+- [ ] `python3 agent/host_agent.py --help` lists `--allow-writes` and `--routectl-socket`; `/schema` names `POST /route` and `disabled`.
+- [ ] Against the fake peer: the full refusal matrix answers without a peer call, and the success path calls it **exactly once** and passes the JSON through unaltered.
+- [ ] `uv run python data/logs/verify-33-additive.py` exits 0: 1.4.0 equals 1.3.0 plus `disabled`, and equals it exactly on unmarked configs.
+- [ ] `uv run pytest` **100% passing**, coverage not down; `bash .agents/validate.sh` green.
+- [ ] README.md/AGENTS.md note the write path and its two agent-side gates (this task's user-visible surface) — the phase's final pass re-checks both project-wide.
+- [ ] No behaviour change in completed work: `GET /snapshot`, `/health`, `/info`, `/schema` and the TLS matrix behave exactly as 1.3.0; `deskwork`/`driveripper` are untouched.
diff --git a/.agents/phases/todo/33_gateway_route_switching/04_the_source_publishes_enabled_and_the_warnings_learn_the_marker.md b/.agents/phases/todo/33_gateway_route_switching/04_the_source_publishes_enabled_and_the_warnings_learn_the_marker.md
new file mode 100644
index 0000000..6bccc8b
--- /dev/null
+++ b/.agents/phases/todo/33_gateway_route_switching/04_the_source_publishes_enabled_and_the_warnings_learn_the_marker.md
@@ -0,0 +1,46 @@
+# Task 04 — `enabled` joins the payload, `off` becomes reachable, and the warnings stop calling a chosen outage a fault
+
+**Phase:** `33_gateway_route_switching` · **Source:** phase 30 decision 1 ("red is the **off** state, styled now, unreachable until the write path exists")
+**Story:** n/a
+
+## Objective
+
+`connections[].enabled` carries the config's own state (`true` declared and active, `false` declared and marker-off), so `routeInConfig()` stops being a literal and the red styling phase 30 built has a referent. And `warnings()` learns the marker: an empty backend, a targetless vhost or a sink-pointed map entry **caused by the operator's own switch** is not a config-integrity fault, while the same shape caused by a hand-deleted line still is. No count is ever written by this phase.
+
+## Work
+
+1. `src/dashboards/sources/gateway.py`
+ - `_connection()` gains `"enabled": True`; `config_connections()` sets it from the agent's per-target `disabled` flag (`enabled = not disabled`), and the merge rule keeps its meaning: **a line is enabled only if every claim that merged into it is enabled** — a union of selectors with one disabled line is two lines, so if a merge would mix states the source must not silently union them; state which arm wins and test it (recommended: split into two rows keyed by `enabled`, because "one of these selectors is off" is two facts).
+ - `_skeleton()`/`stub()` gain the key so the parity pin keeps holding; `enabled` is `None` in the stub (nobody read the config), `true`/`false` in an answer — never `false` in an arm that did not read it.
+ - `warnings()` marker-awareness, per kind, and each is a decision to write down rather than a suppression to hope nobody notices:
+ | kind | new rule |
+ |---|---|
+ | `haproxy_backend_empty` | not raised when the backend's only servers are `disabled: true` (the operator emptied it from `/gateway`); still raised when it has no `server` line at all |
+ | `haproxy_route_dangling` / `haproxy_backend_orphan` | unchanged — a switch never renames or removes a `backend`/`use_backend`, so a dangling name is still a broken config |
+ | `nginx_server_unlistened` | unchanged (a disabled `proxy_pass` does not remove a `listen`) |
+ | `nginx_pool_undeclared` / `nginx_variable_unmapped` | unchanged |
+ | `nginx_map_route_missing` | a map entry pointing at the **sink address** is not a missing route; it is a switched-off route, and the sink address is recognised from the payload's own `resolver`/config text rather than hard-coded in the source (a literal in two places is how this drifts) |
+ - The **socket join** is unchanged in code and in ethics: a disabled haproxy `server` has no live sockets after the reload because they drain, and a disabled map entry's sockets to the sink are the sink's own loopback pair. Nothing stamps `0`, nothing zeroes a count, and the `shared` rule is untouched.
+ - `samples()` publishes the gauge for an `enabled: false` line only if the join measured a real count for it (usually `0`, and `0` measured is a legitimate measurement — the distinction is *measured*, never *assumed*).
+ - No `severity` anywhere, still: `off` is a state, not a verdict. The recursive no-verdict walk in `tests/test_api.py` must stay green without an exception for `enabled`.
+2. `src/dashboards/api.py` — `/api/gateway/snapshot` is otherwise unchanged, but the `gateway` block in `/api/summary` is the one place this phase **does** add a field, because the overview's one line is where "something is switched off" belongs and a page-only fact would be invisible to a notifier: `disabled` (int, count of `enabled is false` rows, `null` in the arms that did not measure). That makes thirteen keys — restate the pinned key set in the same commit, with the reason, and keep `warnings` as a count beside it.
+3. `tests/test_gateway_source.py`
+ - `test_a_marker_off_route_is_declared_and_disabled` — a config tree with one marked haproxy server + one marked vhost `proxy_pass` + one sink-pointed map entry yields three rows, each `enabled: false`, all their selectors intact, every other row `enabled: true`.
+ - `test_the_source_never_calls_a_route_broken_because_the_operator_disabled_it` and `test_the_same_shape_without_a_marker_is_still_a_warning` — both directions for each of the two affected kinds, run over the **captured** configs plus a marker-injected copy of them (never a toy file).
+ - `test_the_sink_address_is_recognised_not_hard_coded` — a config that writes a different sink port still reads as switched-off, because the sink is identified from the marker+config, not from `44450`.
+ - `test_a_disabled_line_still_publishes_only_a_measured_count` — with no sockets, `connections: 0` only when the table answered; `null` when it did not, and no sample in the second case.
+ - `test_the_stub_and_the_answer_share_one_key_set` gains `enabled`; `test_the_gateway_snapshot_carries_no_verdict_and_no_window` unchanged (extended walk).
+4. `tests/test_api.py` — the `/api/summary` `gateway` block key set grows `disabled` with its reason in the test docstring; `test_the_overview_line_reads_the_gateway_block_it_claims` learns the new field (and that `0` prints nothing — a permanent `0 switched off` is the ink the empty-state rules exist to avoid, the `warnings` rule restated).
+
+## Testing & Quality
+- Unit: every rule above from real captures plus injected markers; both directions for each suppression.
+- Coverage **>90%** on `sources/gateway.py` and `api.py`; whole suite 100%.
+
+## Completion Criteria
+- [ ] `GET /api/gateway/snapshot` on a fixture with three markers shows three rows with `enabled: false`, their selectors and endpoints intact, and `warnings == []` for the marker-caused shapes.
+- [ ] Removing the markers from the same tree brings the corresponding warnings back (the suppression is marker-caused, not shape-caused) — asserted as one test pair.
+- [ ] `/api/summary`'s `gateway.disabled` is `3` on that fixture, `0` on the clean capture, `null` on the stub, and the overview line prints nothing for `0`.
+- [ ] No `severity` key at any depth, still (the recursive walk passes unmodified).
+- [ ] `uv run pytest` **100% passing**, coverage not down; `bash .agents/validate.sh` green.
+- [ ] README.md/AGENTS.md's `/gateway` paragraph names `enabled`/`off` and the marker-aware warnings rule — the phase's final pass re-checks both project-wide.
+- [ ] No behaviour change in completed work: the socket join, inbound counts, chart gauges and the phase-32 provenance fields are untouched.
diff --git a/.agents/phases/todo/33_gateway_route_switching/05_the_api_gates_the_write_ten_times.md b/.agents/phases/todo/33_gateway_route_switching/05_the_api_gates_the_write_ten_times.md
new file mode 100644
index 0000000..e6605b5
--- /dev/null
+++ b/.agents/phases/todo/33_gateway_route_switching/05_the_api_gates_the_write_ten_times.md
@@ -0,0 +1,52 @@
+# Task 05 — One route, ten gates: `POST /api/gateway/route` and the amendment of invariant 1
+
+**Phase:** `33_gateway_route_switching` · **Source:** operator request — "turn off and on connections as needed in the event of security concerns or upgrades" · **Shape borrowed from:** `/api/ups/command`'s four gates and `/api/certs/*`'s fixed-text audit events
+**Story:** n/a
+
+## Objective
+
+The app's **second and last** upstream write. `POST /api/gateway/route {id, action, danger?, dry_run?}` refuses in nine places before it dials anything, and in the tenth it forwards one reviewed request through `collectors.post_route` and answers with the helper's own triple. `GATEWAY_ALLOW_WRITES` defaults to **off**, `DASH_READ_ONLY` still refuses everything, and `AGENTS.md` invariant 1 is rewritten in this commit to name two exceptions — because a change to a written invariant that leaves the document describing the old one is the bug, not the omission.
+
+## Work
+
+1. `src/dashboards/config.py` — two settings beside the existing `GATEWAY_*` block, each with the reason in its comment:
+ - `GATEWAY_ALLOW_WRITES: bool` (default `False`, the same truthy rule as `NUT_ALLOW_ACTIONS`);
+ - `GATEWAY_TIMEOUT_SECONDS` **unchanged** (reads), plus `GATEWAY_WRITE_TIMEOUT_SECONDS: float = 35.0` — deliberately longer than the agent's own 30 s peer timeout so the dashboard never times out first and leaves the operator guessing whether the reload happened.
+2. `src/dashboards/collectors.py` — `post_route(tls, target, body, timeout)` beside `fetch_snapshot`: the same `AgentTls` client (built per dial, the phase-15 rule), the same **revocation check before any socket opens**, `Authorization` never used on the certificate path, and every error message run through `strip_userinfo` (those strings reach events and `/api/health`-adjacent payloads — invariant 6).
+3. `src/dashboards/api.py` — the route, and the gate order is the design, so it is written in the function as numbered comments and mirrored in the tests:
+ | # | Gate | Refusal |
+ |---|---|---|
+ | 1 | session (middleware) | `303`/`401`, unchanged |
+ | 2 | `Origin` / `Sec-Fetch-Site` | `403`, unchanged |
+ | 3 | this session's `X-CSRF-Token` on a cookie write | `403`, unchanged |
+ | 4 | `DASH_READ_ONLY` | `403 "this dashboard is read-only (DASH_READ_ONLY)"` |
+ | 5 | `GATEWAY_ALLOW_WRITES` | `403 "route switching is disabled — set GATEWAY_ALLOW_WRITES=1 to enable it"` |
+ | 6 | throttle `route:` on `ctx.login_throttle` | `429` + `Retry-After` (its third key shape; the per-process caveat stays gap 7) |
+ | 7 | body: `id` non-empty string ≤ 256, `action` in `{disable, enable}`, `dry_run` optional bool, **no other key** | `422`, and it is a `422` rather than a `400` for the same reason the login body is |
+ | 8 | `id` exists in the **current** payload (`409` if the job has never answered) and is not already in the requested state (`409 {changed: false}`) | never a guess about a route it cannot see |
+ | 9 | freshness: `gateway` job `ok` and not stale beyond 3× its interval, `host:` `ok`, `sections.haproxy`/`sections.nginx` both `true`, the agent's `version >= 1.4.0` | `409` naming which one — "do not rewrite a config you cannot currently read end to end" |
+ | 10 | `danger == "DANGER"` for **both** verbs | `422` naming the word, the UPS wording's sibling |
+ Then one `collectors.post_route`, and the response is the helper's object plus `host`, `id`, `action`, `dry_run`, and `hint` sentences owned by `api.py` (the `restart_required` precedent: the prose lives in the route, so the page prints what the route said).
+ - **Events**, one per call, `source="gateway"`, `subject=`, `kind` in `{route-disabled, route-enabled, route-denied}`, severity `warn` for a change and `error` for a refusal-that-matters, message fixed-shape: `disable brain.reeseapps.com → reeseapps-brain-of-reese.reeselink.com:443: applied=true validated=true reloaded=true (admin)`. **No diff, no file path, no config text** — `/api/events` is a feed a browser reads, and a config's bytes are not a log line. A `route-denied` from gates 4–10 writes the event with the gate named and **nothing** about which check the caller came closest to passing.
+ - `/api/config`'s `gateway` row gains `writes_enabled` (bool) so the page can render the honest arm instead of assuming (rule 2), and nothing else in that body changes.
+4. `tests/test_api.py`
+ - `test_the_gateway_surface_is_gets_only_and_the_write_stays_the_ups_one` is **rewritten**, not deleted: the verb enumeration now lists exactly two fleet writes — `/api/ups/command` and `/api/gateway/route` — beside the session writes and the certificate-authority writes, and the test still fails if a third appears anywhere.
+ - `test_each_gate_refuses_without_touching_the_peer`, parameterised over all ten with spies: `collectors.post_route` swapped for a recorder, and each refusal asserts the recorder is empty **and** the event is what the gate named. The CSRF half is proven on the wire in `tests/test_auth_api.py` the way the UPS one is: a scripted helper records nothing without the header and once with it.
+ - `test_danger_is_required_to_enable_as_well_as_disable`, `test_read_only_refuses_and_names_the_variable`, `test_a_route_that_is_already_off_says_so_and_dials_nothing`, `test_a_stale_gateway_or_dead_host_job_refuses_the_write`, `test_a_revoked_agent_refuses_the_write_without_a_socket`, `test_the_write_timeout_is_longer_than_the_agents_peer_timeout` (the ordering, not the numbers).
+ - `test_no_diff_or_config_text_reaches_an_event` — a successful write whose helper answer carries a `diff` field: the event message contains no `diff`, no `--- `/`+++ ` line, no path, and no `was:` marker.
+ - `test_the_writes_enabled_flag_reaches_the_page_config`.
+5. `tests/test_auth_api.py` — the served-route walk (`walk_routes`) now sees `POST /api/gateway/route` and demands a session; the public-surface list stays exactly four entries; the CSRF-on-the-wire test gains this endpoint.
+6. `AGENTS.md` — **in the same commit**: invariant 1 rewritten from "exactly one exception" to "exactly two, and both are gated on purpose", naming the two endpoints and the gate list, keeping the sentences that make it work ("Hiding a button is not a safety control", "the UI confirmation … `DANGER` for anything that can cut power" now extended: *or that can cut a route through the fleet's only ingress*). Also: `api.py`'s bullet (its three write lists become four facts and now include the gateway route), `collectors.py`'s bullet (`post_route`), `config.py`'s paragraph (the two new settings), and the `/gateway` UI-conventions sentence about the unwired switch is **removed** — it becomes the wired description in task 06, and the two must not both exist.
+
+## Testing & Quality
+- Unit/integration: every gate in both directions; the wire-level CSRF proof; the event-shape proof; the verb enumeration restated.
+- Coverage **>90%** on `api.py` and `collectors.py`; the whole suite 100%; `ruff` + `pyright` clean.
+
+## Completion Criteria
+- [ ] `curl` against the dev server with writes off answers the `GATEWAY_ALLOW_WRITES` sentence; with it on and no `DANGER` answers the `DANGER` sentence; with both and a live fake agent it answers `applied: true` and the event line is in `/api/events?source=gateway`.
+- [ ] `grep -n "DASH_READ_ONLY" src/dashboards/api.py` shows it refusing on **both** write paths.
+- [ ] The verb-enumeration test lists exactly two fleet writes and fails on a third by name; `walk_routes` covers the new POST; `PUBLIC_PATHS` is still four entries.
+- [ ] `/api/config` serves `gateway.writes_enabled` and the page's own arm is task 06's.
+- [ ] `AGENTS.md` invariant 1 names two exceptions and their gates in the same commit as the code that made it true.
+- [ ] `uv run pytest` **100% passing**, coverage not down; `bash .agents/validate.sh` green.
+- [ ] No behaviour change in completed work: `/api/ups/command`'s four gates behave exactly as before (the suite's existing UPS pins are untouched), and no read route changed shape.
diff --git a/.agents/phases/todo/33_gateway_route_switching/06_the_switch_obeys.md b/.agents/phases/todo/33_gateway_route_switching/06_the_switch_obeys.md
new file mode 100644
index 0000000..94a25a2
--- /dev/null
+++ b/.agents/phases/todo/33_gateway_route_switching/06_the_switch_obeys.md
@@ -0,0 +1,58 @@
+# Task 06 — The switch works, asks for `DANGER` with the diff on screen, and never claims a change it didn't get
+
+**Phase:** `33_gateway_route_switching` · **Source:** the operator's sketch (phase 30) + this phase's decision that a route off is a config edit with a reload behind it · **Shape borrowed from:** `page-ups.js`'s typed-`DANGER` confirm and `dash.css`'s `dialog` + `input[type="text"].confirm`
+**Story:** n/a
+
+## Objective
+
+Clicking a switch on `/gateway` shows the **exact one-line diff** the gateway would apply, asks for `DANGER`, applies it, and paints the row from the **answer** — not from hope. Where writes are disabled the switch stays visibly unwired and says which variable would change that, because `/gateway` must look the same on a deployment that chose not to have this feature as it did before the feature existed.
+
+## Work
+
+1. `src/dashboards/web/static/page-gateway.js`
+ - `routeInConfig(conn)` becomes a reading, not a literal: `return conn.enabled !== false;` — with the comment rewritten: `off` is now reachable, it means "declared in the config, switched off by the operator", and `enabled === undefined` (a pre-1.4.0 agent, or the stub arm) still means "on", so an old agent's page never goes red.
+ - `buildSwitch(conn)` splits into two arms, driven by `/api/config`'s `gateway.writes_enabled` (never inferred):
+ - **writes off** → today's markup exactly: `aria-disabled="true"`, `cursor: not-allowed`, `title` = `Route switching is off — set GATEWAY_ALLOW_WRITES=1 on the dashboard to enable it.` (the sentence from `api.py`, copied into a constant that `tests/test_api.py` compares against the route's refusal so the two cannot drift);
+ - **writes on** → a real control: no `aria-disabled`, `aria-checked` from `enabled`, a full accessible name (`endpoint, reached by , in the config, on|off, activate to switch it off`), `title` naming what activating does (edits the file, validates, reloads the proxy).
+ - **The flow**, one async handler, and the order is the safety:
+ 1. `POST /api/gateway/route` with `{id, action, dry_run: true}` → `diff` + `hint`;
+ 2. open a real `` (`showModal()`) whose body is: the row's inbound word and endpoint, the config's own `selectors`, the diff in a labelled ``, the route's `hint`, and a `input[type="text"].confirm` asking for `DANGER`;
+ 3. submit only when the typed word is exactly `DANGER` (client-side check of the *client's* convenience; the server re-checks, always);
+ 4. switch `aria-busy="true"`, `POST` with `danger: "DANGER"`, `dry_run: false`;
+ 5. paint from the **response**: `applied: true` → the row's `enabled` flips on the next poll (and immediately, optimistically **only** for the switch's own `aria-checked`, with `aria-busy` cleared and a note that the config is applied and the page re-reads); `applied: false` → nothing flips, the refusal prints verbatim through `textContent`;
+ 6. `await refresh()` so the numbers come from the agent's next reading rather than from the click.
+ - No optimistic colour, ever: the page does not turn a line green or red because a button was pressed. `pending` is the only state a click may create, and `aria-busy` is how it says so.
+ - A `429`/`409`/`403`/`422` prints the server's `detail` + `hint` in the dialog (`role="alert"`), leaves the dialog open so the operator can read it, and returns focus to the confirm field — the `/login` lesson about a form that eats its own error.
+2. `src/dashboards/web/pages/gateway.html`
+ - One `` with the four slots the script fills, shipped `hidden`/closed; no per-row dialogs (the same rows are patched, so one dialog is the whole surface, and a dialog per row is 33 focus targets in the tab order).
+ - Footer paragraph 3 becomes the truth and stays **one** paragraph:
+ > `the switch edits that route in its own config file, validates it with the proxy's own checker and reloads that proxy — nothing is restarted, and no route goes off unless GATEWAY_ALLOW_WRITES is set on the dashboard.`
+ - The `#gate-empty` setup block is untouched.
+3. `src/dashboards/web/static/dash.css`
+ - `#gate-switch-dialog pre` — mono, `overflow-x: auto`, `max-height` bounded, added/removed lines tinted from the **existing** tokens only (`.diff-add`/`.diff-del` deriving from `--gate-on`/`--gate-off`, the phase-30 existence pair, so no new colour enters the map and the diff reads as the same red/green the rows do);
+ - `button.gate-switch:not([aria-disabled="true"]):hover` and `cursor: pointer` — added **only** under that selector, so a writes-off switch never grows a hover affordance it cannot honour;
+ - any new transition (dialog, knob while `aria-busy`) is named in the file's one `@media (prefers-reduced-motion: reduce)` block — naming one and missing the other is the phase-18 lesson, and there is a test for it;
+ - at ≤640 px the dialog stays inside the viewport (`width: calc(100% - 2rem)` is already the shared rule) and the diff scrolls in its own box, never the document (phase 27's rule).
+4. `tests/test_api.py`
+ - `test_the_switch_is_built_and_explicitly_unwired` is **replaced** by `test_the_switch_is_wired_only_when_the_deployment_enables_writes`: with `writes_enabled: false` the served script keeps `aria-disabled="true"`, the `GATEWAY_ALLOW_WRITES` sentence, and no listener; with it true the listener exists, `aria-disabled` is gone, and the accessible name states the state and the consequence. The old test's *intent* survives: a dead-looking-live control still fails.
+ - `test_a_toggle_asks_for_a_preview_then_the_word_then_sends_once` — the served script issues `dry_run: true` before any `DANGER` send, requires the exact word, and sends exactly once per activation (no retry loop in the handler).
+ - `test_the_row_is_painted_from_the_answer_not_the_click` — no code path sets `off`/`on` other than the payload/`applied` pass; `applied: false` leaves `aria-checked` untouched.
+ - `test_the_switch_sentence_matches_the_routes_refusal` — the writes-off `title` and `api.py`'s `GATEWAY_ALLOW_WRITES` refusal are the same string, read from both files.
+ - `test_no_gateway_count_is_coloured_by_a_verdict` gains the reachable-`off` fact and keeps every assertion: the diff tints are `--gate-*`, no `.ok/.warn/.fail` or `--ok/--warn/--fail` enters the gateway section, and the warnings panel's `.warn` stays the one exception.
+ - `test_the_pipe_animation_stills_in_both_states_under_reduced_motion` extended to the new transitions (knob busy state, dialog) — and it still asserts there is **one** such block in the file.
+ - `test_the_gateway_page_is_exactly_two_connection_panels_and_a_warnings_list` and the footer-paragraph pin stay green (three paragraphs, one dialog, `` count unchanged).
+ - The orphan-`id` audit must find `#gate-switch-dialog` referenced by the script; every slot inside it is `[data-k=…]`, not an `id`.
+
+## Testing & Quality
+- Unit: the pins above; a fixture render for each arm (writes on/off, `enabled: false` from the payload, `applied: false` from the response) asserting class, `aria-checked`, `aria-busy`, `title` and the accessible name.
+- Integration: the dev server against a stub agent (the `tests/conftest.py` fake) answering `applied: true` then a payload with the row `enabled: false` — the row turns red **because of the payload**, and the second read of the switch's name says `off`.
+- Coverage: `node --check` clean; floor does not fall.
+
+## Completion Criteria
+- [ ] With `GATEWAY_ALLOW_WRITES=0` the page is indistinguishable from phase 32's: `aria-disabled`, the `GATEWAY_ALLOW_WRITES` sentence, no click effect, no hover affordance.
+- [ ] With it `=1` (and the fake agent): clicking shows the one-line diff and the `DANGER` field; the wrong word sends nothing; the right word sends once; the row's colour changes on the payload that follows and never before.
+- [ ] A stubbed `applied: false, validated: false, restored: true` leaves every row exactly as it was and prints the route's own sentence.
+- [ ] Tab order: dialog opens with focus in the confirm field, Escape closes it without a request, focus returns to the switch. At 360 px the dialog and its diff stay inside the viewport and the document scrolls no sideways pixels.
+- [ ] `uv run pytest` **100% passing**, coverage not down; `node --check` and `bash .agents/validate.sh` green.
+- [ ] README.md/AGENTS.md's `/gateway` paragraph describes the wired switch and both arms (replacing the "unwired" sentence task 05 deleted — the two must not coexist) — the phase's final pass re-checks both project-wide.
+- [ ] No behaviour change in completed work: tallies, warnings panel, charts, filters, colour semantics, and the other seven pages.
diff --git a/.agents/phases/todo/33_gateway_route_switching/07_rehearse_then_drill_on_the_live_ingress.md b/.agents/phases/todo/33_gateway_route_switching/07_rehearse_then_drill_on_the_live_ingress.md
new file mode 100644
index 0000000..313d112
--- /dev/null
+++ b/.agents/phases/todo/33_gateway_route_switching/07_rehearse_then_drill_on_the_live_ingress.md
@@ -0,0 +1,52 @@
+# Task 07 — Install the helper, prove it from both sides, and drill one named route with the operator watching
+
+**Phase:** `33_gateway_route_switching` · **Source:** AGENTS.md's rollout discipline (phases 24 and 28) applied to the one change in this repo that can take the fleet's ingress down
+**Story:** n/a
+
+## Objective
+
+`gateway` runs agent **1.4.0** with the socket-activated helper, and one route is switched off and back on **for real**, with the live ingress ending the task in the state it started in. The drill is not a formality: it is the only proof that `ReadWritePaths`, `SocketMode`, `SO_PEERCRED`, `nginx -t` and the reload all line up on a machine, which no sandbox can tell us. **If the operator is not present in the session, this task stops after step 3 and reports — that is the correct outcome, not a failure**, and ntfy is not a way to ask (it is outbound-only).
+
+## Work
+
+1. **Backups first, hashed.** On `gateway-ops` as root:
+ `cp -a /etc/haproxy /root/dashboards-33-backup-/haproxy && cp -a /etc/nginx /root/dashboards-33-backup-/nginx`, then `sha256sum` every file that the helper can edit (`haproxy.cfg`, `nginx.conf`, `conf.d/*.conf`, `stream.d/*.conf`) into the transcript. This is the restore point for every later step.
+2. **Sandbox rehearsal on the box** (writes nothing real): run the helper with `--apply` against a copy tree (`--root /tmp/dashboards-33-rehearsal`) with the *real* `nginx -t` and `haproxy -c` binaries on `PATH`, for each of the three marker arms and the `default` refusal. Record the three diffs. A checker that fails on a copied tree for path reasons is expected and is *not* the rehearsal's point — the arms and the restore byte-equality are.
+3. **Install, read-only-verified first**:
+ - re-stage `/home/ops/agent-install/` (repo `agent/host_agent.py` **1.4.0**, `deploy/install-agent.sh`, `deploy/dashboards-routectl.py`, the two unit files), leaving `*.20261023-backup` copies sudo will not execute;
+ - `systemctl cat dashboards-agent` → record its sha256 and the four security directives verbatim;
+ - `sudo /home/ops/agent-install/deploy/install-agent.sh --bind 10.1.1.27 --port 9120 --allow-writes --with-routectl` (arguments read back off the unit; **no** `--cert-bundle`, the bundle on disk is what drives the TLS lines — the phase-28 finding);
+ - the guard's diff is inspected before `--force`: the only legitimate change to the agent unit is the added `--allow-writes` in `ExecStart` — if `NoNewPrivileges`, `ProtectSystem`, `PrivateDevices`, `SystemCallFilter` or `CapabilityBoundingSet` moved, **stop** and report: the sandbox was not traded for this feature;
+ - `sudo systemctl restart dashboards-agent`; `systemctl is-active` for it and for `dashboards-routectl.socket`;
+ - reachability both ways: as `dashboards-agent`, connect to `/run/dashboards-routectl.sock` and call `list` (must answer `[]`); as any other non-root uid, connect and get `EACCES` (the mode is the first gate and the peer check is the second);
+ - read-only probes: CA-only `--status` answers **1.4.0**; the dashboard's mTLS read shows `agent_version 1.4.0`, every section intact with live numbers, `disabled: false` everywhere, and `/api/gateway/snapshot` rendering identically to phase 32's.
+4. **Preconditions for the drill — all checked, all recorded, any failure stops it:**
+ - the operator has said go, in this session, in words;
+ - `nut` is not on battery and no UPS event is in the last hour (the same "don't do the risky thing during a power event" rule the UPS commands keep);
+ - `gateway`, `host:gateway`, `disks:gateway` all `ok` and fresh; `warnings == []`;
+ - `nginx -t` and `haproxy -c -f /etc/haproxy/haproxy.cfg` pass on the box before anything is touched;
+ - `routectl list` is empty (no half-finished state from an earlier attempt);
+ - the drill target is **`iperf3-5201`** (`haproxy:5201->web.reeselink.com:5201`) — a benchmark service with no human dependency. **Never** the auth, git, alerts or file routes: not `keycloak*`, `gitea*`, `forgejo*`, `ntfy*`, `nextcloud*`, `immich*`, `brain*`, `keycloak`, or any `map` entry an operator would notice within a minute. If even `iperf3` is in doubt, the drill does not run and the task reports that instead.
+5. **The drill, in order, with the page open:**
+ 1. `dry_run` through `POST /api/gateway/route` → the diff, and the page's dialog shown;
+ 2. apply with `DANGER`; the helper answers `applied/validated/reloaded`;
+ 3. prove it four independent ways: `routectl list` names the route; the marked line is in `haproxy.cfg` with `was:`; `haproxy -c` still passes; `curl -sv --resolve :25565:127.0.0.1` (or the drill port) from the box connects and is refused/closed rather than proxied;
+ 4. the page: the row is **red** within one poll, its live count drains to `0` on its own, no other row changed, and `/api/summary`'s `gateway.disabled` is `1`;
+ 5. re-enable through the page; `routectl list` empty; `sha256sum` of every file equal to step 1's capture, byte-for-byte;
+ 6. the page green again, `disabled` back to `0`, and `journalctl -u 'dashboards-routectl@*'` showing exactly the two activations.
+6. **Abort rules, written where they can be followed:** if any step fails, restore from the step-1 backup (`cp -a` back, `haproxy -c`, reload), re-read the page, and write down what happened. Never leave a marked line behind without saying so in the transcript's first line. Never run two drills at once, never run one while the `gateway` job is stale, and never re-run an apply to "make sure" — the helper is the place idempotence lives, and the answer tells you which state you are in.
+7. `data/logs/NOTES-33-switching.md`: the hashes before and after, the unit diff that was guarded, the socket's owner/mode, both probe transcripts, the four proofs, the `journalctl` window, the screenshots' names, and — if the drill did not run — **exactly** which precondition stopped it, so the next operator can finish it deliberately.
+8. `tests/test_live_fleet.py`: `test_the_switch_round_trip_on_one_named_route`, marked `live` **and** gated on a separate `--allow-live-writes` flag, skipped by default with a reason naming the route it would touch, restoring in a `finally`. The default live suite stays read-only.
+
+## Testing & Quality
+- This task's code change is the one opt-in live test; everything else is procedure plus transcript.
+- After it: `uv run pytest`, `uv run pytest -m live --live` (green, round-trip **skipped**), `./scripts/dev-server.sh status` (ten sources `ok`).
+
+## Completion Criteria
+- [ ] `systemctl cat dashboards-agent` shows the four security directives **identical** to step 3's capture, with `--allow-writes` as the only added argument, and its pre/post sha256 pair is in the note.
+- [ ] `dashboards-routectl.socket` is `active`, owned `dashboards-agent:dashboards-agent` mode `0600`; a non-agent uid gets `EACCES`; the agent's own uid gets a JSON answer.
+- [ ] The drill's four proofs are in the transcript, plus the byte-identical `sha256sum` restore of every editable config file, and `routectl list` is empty at the end.
+- [ ] `/gateway` showed the row red and its count draining, and returned to green — screenshotted at both states.
+- [ ] `uv run pytest -m live --live` passes with the round-trip **skipped** by default; `uv run pytest -m live --live --allow-live-writes` passes too, if and only if the drill ran.
+- [ ] `data/logs/NOTES-33-switching.md` exists and its first line states the final state of the ingress (`all routes enabled`, or exactly what is off and why).
+- [ ] No repo file changed except the opt-in live test and `data/logs/`.
diff --git a/.agents/phases/todo/33_gateway_route_switching/08_docs_and_live_verify.md b/.agents/phases/todo/33_gateway_route_switching/08_docs_and_live_verify.md
new file mode 100644
index 0000000..5a59373
--- /dev/null
+++ b/.agents/phases/todo/33_gateway_route_switching/08_docs_and_live_verify.md
@@ -0,0 +1,47 @@
+# Task 08 — Docs that describe a dashboard which can change the fleet, the browser pass, the full gate
+
+**Phase:** `33_gateway_route_switching` · **Source:** AGENTS.md definition of done + the fact that this phase changed an invariant, so the documents are part of the change rather than a summary of it
+**Story:** n/a
+
+## Objective
+
+`README.md` and `AGENTS.md` describe the write path honestly — what it touches, what refuses, how to turn it off entirely, and how to recover a route by hand at 03:00 when the dashboard is the thing that is broken. Then the browser pass measures the wired page in both arms, the mobile audit re-runs, and every gate is green.
+
+## Work
+
+1. `AGENTS.md` — the full consistency pass, with these named as the passages this phase makes stale if left:
+ - **invariant 1** — two exceptions, both gated, the gate list, and the reason a typed word survives in the design (`Hiding a button is not a safety control`);
+ - `agent/host_agent.py` bullet — **1.4.0**, the marker grammar (`ROUTE_MARKER`, `split_marker`, `config_line_index`), `disabled` on every target, `POST /route` behind certificate + `--allow-writes`, the single peer call and its no-retry rule;
+ - the new deploy surface — `deploy/dashboards-routectl.py` (verbs, marker + `was:`, validate-restore-reload, never restart, the sink file, drift refusal), the two units, `--with-routectl`/`--without-routectl`, and the sentence that the agent's unit lost no security directive and gained no sudoers line;
+ - `sources/gateway.py` bullet — `enabled`, the merge rule with mixed states, the marker-aware warnings table, the `/api/summary` `disabled` field;
+ - `api.py` bullet — the two fleet writes, `/api/gateway/route`'s gate order, the fixed-shape audit events with no config text, `/api/config.gateway.writes_enabled`;
+ - `collectors.py` bullet — `post_route` and the shared revoke-before-socket rule;
+ - `config.py` paragraph + README's table — `GATEWAY_ALLOW_WRITES` (default off) and `GATEWAY_WRITE_TIMEOUT_SECONDS` (and why it exceeds the agent's own timeout);
+ - the `/gateway` UI-conventions paragraph — the switch is wired, the preview-then-`DANGER`-then-paint-from-the-answer flow, `off`'s appearance, the writes-disabled arm's sentence, the diff box scrolling in its own container;
+ - the **fleet record** — `gateway` at **1.4.0** with the helper units installed, the unit's directives re-read, the drill result and `NOTES-33-switching.md`;
+ - **gap list** — name-route switching **closed**, and the honest limits written as gaps: one admin (gap 6 unchanged, so anyone with the session can switch a route), no scheduler, no per-host kill switch, no runtime haproxy state (a hand reload cannot undo a marker), and `GATEWAY_ALLOW_WRITES` off by default means the feature is invisible on a fresh deployment until it is deliberately enabled.
+2. `README.md` + both tracked env templates — `.env.example` and `.env.dev.example` gain `GATEWAY_ALLOW_WRITES` with its default and a comment naming exactly what enabling it authorises, and `tests/test_auth_docs.py` gains the pin (the same device that keeps the auth settings declared in the templates), because a write gate no template names is a write gate nobody finds — and never a value, only the declaration. Then the operator-facing half: the `/gateway` table row (routes can be switched off **and on**), a short *Switching a route* subsection (what the dialog does, what `DANGER` means here, that the edit is persistent across reload and reboot, and the three recovery commands: `routectl list`, `routectl verify`, `routectl enable --id …` on the box), the *Enabling it* subsection (`GATEWAY_ALLOW_WRITES=1`, `--with-routectl`, the two units, how to undo everything), and the configuration table's two new rows. Also: the sentence that a route off is a **deliberate outage** and appears in the event feed, so an operator does not mistake it for an incident.
+3. `data/logs/33-switching.cjs` — Playwright pass (house shape, exit non-zero on FAIL, prints what it measured):
+ - writes-**off** arm: `aria-disabled`, the `GATEWAY_ALLOW_WRITES` sentence, a click does nothing (no request on the wire), no hover affordance;
+ - writes-**on** arm against the stubbed agent: the dialog opens with the diff and focus in the confirm field; the wrong word sends nothing; the right word sends exactly one request; the row's colour changes only after the payload says `enabled: false`; `applied: false` leaves the row untouched and prints the route's sentence; Escape closes with no request and returns focus;
+ - `off` colour contract: spine halves, tick, run, switch and diff tint all compute to the same `--gate-off` value in dark **and** light, and an `on` row is fully `--gate-on` — no fifth colour, no verdict token anywhere in the section;
+ - reduced motion: nothing animates, including the dialog and the busy knob;
+ - 360 px: the dialog and its `` stay inside the viewport, the diff scrolls in its own box, and the document scrolls zero sideways pixels;
+ - screenshots `data/logs/33-gateway-{writes-off,dialog,danger,off,off-light,refused,phone,phone-dialog}.png`, transcript `data/logs/33-switching.out`.
+4. Re-run `data/logs/27-task02-mobile-audit.cjs` (nine pages, both widths): exit 0, **0 FAIL / 0 FINDING**, tally recorded — the dialog is new markup and the audit is what catches a fact painted past a card edge.
+5. The whole gate, recorded in the transcript:
+ `uv run pytest`, `uv run pytest --cov`, `uv run pytest -m live --live`, `uv run ruff check src tests agent deploy`, `uv run pyright`, `bash .agents/validate.sh`, `uv pip list --outdated` (empty — no dependency is added by this phase, and `deploy/dashboards-routectl.py` is stdlib on a host's Python 3.10).
+6. `./scripts/dev-server.sh status` with writes **off** → ten sources `ok` and no change; with `GATEWAY_ALLOW_WRITES=1` and the fake agent → still ten `ok`, and a write through `curl` round-trips.
+
+## Testing & Quality
+- Integration: this task is the phase's proof that the documents and the shipped page agree; every completion-criteria number comes from `33-switching.out`, `NOTES-33-switching.md` or a gate's own output.
+- Coverage: floor green with the phase's new modules included; no `# pragma: no cover` added to reach it.
+
+## Completion Criteria
+- [ ] `grep -n "one exception\|exactly one write" AGENTS.md` finds nothing; invariant 1 names **two** endpoints and their gates, and the `/gateway` paragraph no longer says the switch is unwired (the two statements must not coexist).
+- [ ] `grep -n "GATEWAY_ALLOW_WRITES" README.md AGENTS.md .env.example .env.dev.example` — declared in both templates with its default and a comment saying what enabling it authorises, and documented in both documents.
+- [ ] `data/logs/33-switching.out` exits 0 with the both-arms results, the `--gate-off`/`--gate-on` equalities in both themes, the reduced-motion pass and 0 px sideways scroll at 360 px; the eight screenshots exist.
+- [ ] `data/logs/27-task02-mobile-audit.cjs` exits 0, 0 FAIL / 0 FINDING, tally recorded.
+- [ ] All five gates green, `uv pip list --outdated` empty, and the live suite green with the round-trip skipped by default.
+- [ ] A full read of `README.md` and `AGENTS.md` finds no inconsistency anywhere, including pre-existing ones, fixed in this phase's commits.
+- [ ] No behaviour change in completed work: the UPS write path and its four gates, the other five dashboards, `/settings`, `/certs`, `/login`, and every read route's payload are exactly as phases 31–32 left them.
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__00_phase.a1.err b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__00_phase.a1.err
new file mode 100644
index 0000000..e69de29
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__00_phase.a1.md b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__00_phase.a1.md
new file mode 100644
index 0000000..a33e99a
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__00_phase.a1.md
@@ -0,0 +1,18 @@
+**Phase 31 verification complete — all 5 tasks already in `complete/`; this was the final verification pass.**
+
+Verified / changed
+- Re-ran every phase-31 artifact live and green: `verify-31-page-only.py` 6 PASS/0 FAIL; browser pass `31-route-readability.cjs` **64 PASS / 0 FAIL** (exit 0); `27-task02-mobile-audit.cjs` **371 PASS / 0 FAIL / 0 FINDING** (exit 0); rebuilt `data/logs/31-route-readability.out` as the 4-part transcript.
+- Added the 4 degradation-arm screenshots the criterion asked for but the pass lacked (`31-gateway-{unconfigured,unreachable,no-nginx,sockets-quiet}.png`) — 12 frames now, one per arm.
+- Grep criteria: no gateway connector rule uses `border-strong`; no verdict token in the gateway CSS section or `page-gateway.js` beyond the `alerts.py`-owned `.warn`; exactly 4 `addEventListener` calls (none for the switch); `routeInConfig()` returns `true`; **no `.py` under `src/dashboards/` changed**.
+
+Tests / lint (all 100% green)
+- `uv run pytest` → **1796 passed, 16 skipped**; `--cov` → **98.94%** (floor 94); `ruff check src tests agent` → All checks passed; `pyright` → 0 errors; `node --check` clean; `bash .agents/validate.sh` → **exit 0**.
+- `uv run pytest -m live --live` → **12 passed / 0 failed**; `./scripts/dev-server.sh status` → all **10 sources ok**.
+
+Completion criteria: colour (33/33 rows every segment `--gate-on`, dark `rgb(63,185,80)` + light `rgb(26,127,55)`, zero grey dashes) ✔ · inbound-first rows + filter (33/33 line 1 = `out.selectors`, line 2 = `→ host:port · kind`; `stackexpected` → **6** rows, not the overview's "five" — the capture declares 6 such routes; tallies byte-identical `10/33/16/0`, zero requests) ✔ · trunk motion truth table + `null` arm prints `n/a` never `0` + reduced-motion stills 43 paths and every knob ✔ · screenshots/transcripts ✔ · payload page-only ✔ (literal byte-diff of a live socket table can never pass; answered by the no-`.py`-diff + shape-equality proof, as recorded in the transcript) · no behaviour change elsewhere ✔.
+
+Docs: fixed 6 inconsistencies — two identifiers split across line breaks (`test_the_pipe_animation_stills_in_both_states_under_reduced_motion`, `32_gateway_resolved_target_liveness`), stale "sixteen routes" count, stale "four machines/hosts" in README **and** AGENTS (fleet is three), "three fields"→"three field types", gap-14 headline wording; updated the pass's screenshot list.
+
+Deviations: `uv pip list --outdated` shows one advisory (`starlette 1.9.0 → 1.10.0`) — not upgraded, this phase moved no dependency (rule 8 / DoD apply "if deps moved"). `TODO.md` carries two new operator disk requests, left untouched.
+
+Next pending phase: `32_gateway_resolved_target_liveness`.
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__00_phase.a1.md.status b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__00_phase.a1.md.status
new file mode 100644
index 0000000..9766475
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__00_phase.a1.md.status
@@ -0,0 +1 @@
+ok
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__00_phase.a1.validate b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__00_phase.a1.validate
new file mode 100644
index 0000000..9c940eb
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__00_phase.a1.validate
@@ -0,0 +1,71 @@
+== uv run pytest --cov (hermetic: no network, live tests skip) ==
+........................................................................ [ 3%]
+........................................................................ [ 7%]
+........................................................................ [ 11%]
+........................................................................ [ 15%]
+........................................................................ [ 19%]
+........................................................................ [ 23%]
+........................................................................ [ 27%]
+........................................................................ [ 31%]
+.......s................................................................ [ 35%]
+........................................................................ [ 39%]
+........................................................................ [ 43%]
+........................................................................ [ 47%]
+........................................................................ [ 51%]
+........................................................................ [ 55%]
+........................................................................ [ 59%]
+........................................................................ [ 63%]
+........................................................................ [ 67%]
+........................................................................ [ 71%]
+......................................ssssssssssss...................... [ 75%]
+........................................................................ [ 79%]
+........................................................................ [ 83%]
+........................................................................ [ 87%]
+........................................................................ [ 91%]
+........................................................................ [ 95%]
+..........................sss........................................... [ 99%]
+............ [100%]
+=============================== warnings summary ===============================
+.venv/lib64/python3.14/site-packages/fastapi/testclient.py:1
+ /var/home/ducoterra/Projects/Personal/dashboards/.venv/lib64/python3.14/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
+ from starlette.testclient import TestClient as TestClient # noqa
+
+-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
+================================ tests coverage ================================
+_______________ coverage: platform linux, python 3.14.8-final-0 ________________
+
+Name Stmts Miss Cover Missing
+------------------------------------------------------------------
+src/dashboards/__init__.py 3 0 100%
+src/dashboards/__main__.py 14 1 93% 32
+src/dashboards/alerts.py 201 0 100%
+src/dashboards/api.py 499 3 99% 220, 250, 253
+src/dashboards/app.py 190 0 100%
+src/dashboards/auth.py 265 0 100%
+src/dashboards/certs.py 292 0 100%
+src/dashboards/collectors.py 216 4 98% 324, 328-329, 346
+src/dashboards/config.py 126 0 100%
+src/dashboards/debug.py 14 0 100%
+src/dashboards/poller.py 165 3 98% 192-194, 279
+src/dashboards/prom.py 112 5 96% 126, 163, 177, 180, 183
+src/dashboards/rates.py 73 0 100%
+src/dashboards/severity.py 49 0 100%
+src/dashboards/sources/__init__.py 0 0 100%
+src/dashboards/sources/disks.py 134 0 100%
+src/dashboards/sources/gateway.py 463 4 99% 518, 529, 637, 1129
+src/dashboards/sources/host.py 209 0 100%
+src/dashboards/sources/llm.py 178 1 99% 285
+src/dashboards/sources/nut.py 413 20 95% 153, 172, 186, 198, 204, 217, 225, 241, 319-320, 322, 579, 591, 626, 657, 661, 718-719, 724, 736
+src/dashboards/sources/nut_sim.py 134 0 100%
+src/dashboards/store.py 313 2 99% 553-554
+------------------------------------------------------------------
+TOTAL 4063 43 99%
+Required test coverage of 94% reached. Total coverage: 98.94%
+1796 passed, 16 skipped, 1 warning in 164.04s (0:02:44)
+== uv run ruff check src tests agent ==
+All checks passed!
+== uv run pyright ==
+0 errors, 0 warnings, 0 informations
+== node --check src/dashboards/web/static/*.js ==
+advisory: dependencies are out of date (AGENTS.md rule 8 — update on purpose):
+ starlette 1.9.0 1.10.0 wheel
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__01_the_whole_route_is_green.a1.err b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__01_the_whole_route_is_green.a1.err
new file mode 100644
index 0000000..e69de29
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__01_the_whole_route_is_green.a1.md b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__01_the_whole_route_is_green.a1.md
new file mode 100644
index 0000000..4d79fad
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__01_the_whole_route_is_green.a1.md
@@ -0,0 +1,16 @@
+**Implemented (task 01 — whole route is green)**
+- `dash.css` `gateway pipes`: base `.gate-link::before`/`::after`/`.gate-elbow` now `2px dashed transparent` (geometry, no colour); four new rules colour spine halves + tick from the **row's** `on`/`off` via `--gate-on`/`--gate-off`; zero `--border-strong` left in the section; header/mobile comments state decision 2 (shared spine may colour, never move).
+- `page-gateway.js`: `renderLeaf` toggles `on`/`off` on the ` ` beside the ``, same value, same pass; `leafRow()` ships no state class; `renderGroups` comment records why rows need no class pruning; header docstring restated.
+- `tests/test_api.py`: restated `test_haproxy_draws_straight_across_and_nginx_branches` (transparent base borders), extended `test_no_gateway_count_is_coloured_by_a_verdict` (connectors read the pair; `--border-strong` absent; all six connector selectors present), **new** `test_the_whole_route_takes_one_existence_class` (row+svg from one value, `transparent` base, switch `[aria-checked]` re-pinned).
+- Browser proof on the live ingress: `data/logs/31-task01-green.cjs` → `31-task01-green.out` **27 PASS / 0 FAIL** — 48 spine halves + 33 ticks + 33 runs + 33 switches all `rgb(63,185,80)` dark and `rgb(26,127,55)` light, 81 dashed segments 0 grey, `off` moves all four to red, stateless row computes `rgba(0,0,0,0)`/`stroke:none`, 360 px restored half green, 0 px sideways scroll; screenshots `31-task01-{dark,light,phone}.png`.
+
+**Verification**
+- `uv run pytest` → **1792 passed, 16 skipped**; `bash .agents/validate.sh` → exit 0, coverage **98.94%** (floor 94), ruff clean, pyright 0 errors, `node --check` clean.
+- `uv run pytest -m live --live` → **12 passed**; `./scripts/dev-server.sh status` → all **10 sources ok**; mobile audit re-run **371 PASS / 0 FAIL / 0 FINDING** (`data/logs/31-task01-mobile-audit.out`).
+- No Python changed — `git status` shows only `web/static/dash.css`, `web/static/page-gateway.js`, `tests/test_api.py`, `AGENTS.md`, `README.md` (so `/api/gateway/snapshot` is byte-identical); switch still unwired, `routeInConfig()` still `true`.
+
+**Docs**: AGENTS.md `/gateway` conventions (colour covers the whole row, motion stays on the run, `transparent` base rules, no per-width colour) and README's `/gateway` paragraph.
+
+**Decisions/deviations**: used the four explicit state rules rather than the `--gate-line` custom property (a new token would need a `:root` default for `test_no_stylesheet_rule_uses_an_undeclared_token` and would duplicate the `transparent` default); left the pre-existing `starlette 1.9.0→1.10.0` advisory untouched (phase decision 7 forbids dependency/Python changes).
+
+**Next pending task**: `31_gateway_route_readability/02_the_inbound_word_leads_the_row.md`.
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__01_the_whole_route_is_green.a1.md.status b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__01_the_whole_route_is_green.a1.md.status
new file mode 100644
index 0000000..9766475
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__01_the_whole_route_is_green.a1.md.status
@@ -0,0 +1 @@
+ok
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__01_the_whole_route_is_green.a1.validate b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__01_the_whole_route_is_green.a1.validate
new file mode 100644
index 0000000..6ed64b1
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__01_the_whole_route_is_green.a1.validate
@@ -0,0 +1,71 @@
+== uv run pytest --cov (hermetic: no network, live tests skip) ==
+........................................................................ [ 3%]
+........................................................................ [ 7%]
+........................................................................ [ 11%]
+........................................................................ [ 15%]
+........................................................................ [ 19%]
+........................................................................ [ 23%]
+........................................................................ [ 27%]
+........................................................................ [ 31%]
+...s.................................................................... [ 35%]
+........................................................................ [ 39%]
+........................................................................ [ 43%]
+........................................................................ [ 47%]
+........................................................................ [ 51%]
+........................................................................ [ 55%]
+........................................................................ [ 59%]
+........................................................................ [ 63%]
+........................................................................ [ 67%]
+........................................................................ [ 71%]
+..................................ssssssssssss.......................... [ 75%]
+........................................................................ [ 79%]
+........................................................................ [ 83%]
+........................................................................ [ 87%]
+........................................................................ [ 91%]
+........................................................................ [ 95%]
+......................sss............................................... [ 99%]
+........ [100%]
+=============================== warnings summary ===============================
+.venv/lib64/python3.14/site-packages/fastapi/testclient.py:1
+ /var/home/ducoterra/Projects/Personal/dashboards/.venv/lib64/python3.14/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
+ from starlette.testclient import TestClient as TestClient # noqa
+
+-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
+================================ tests coverage ================================
+_______________ coverage: platform linux, python 3.14.8-final-0 ________________
+
+Name Stmts Miss Cover Missing
+------------------------------------------------------------------
+src/dashboards/__init__.py 3 0 100%
+src/dashboards/__main__.py 14 1 93% 32
+src/dashboards/alerts.py 201 0 100%
+src/dashboards/api.py 499 3 99% 220, 250, 253
+src/dashboards/app.py 190 0 100%
+src/dashboards/auth.py 265 0 100%
+src/dashboards/certs.py 292 0 100%
+src/dashboards/collectors.py 216 5 98% 323-324, 328-329, 346
+src/dashboards/config.py 126 0 100%
+src/dashboards/debug.py 14 0 100%
+src/dashboards/poller.py 165 3 98% 192-194, 279
+src/dashboards/prom.py 112 5 96% 126, 163, 177, 180, 183
+src/dashboards/rates.py 73 0 100%
+src/dashboards/severity.py 49 0 100%
+src/dashboards/sources/__init__.py 0 0 100%
+src/dashboards/sources/disks.py 134 0 100%
+src/dashboards/sources/gateway.py 463 4 99% 518, 529, 637, 1129
+src/dashboards/sources/host.py 209 0 100%
+src/dashboards/sources/llm.py 178 1 99% 285
+src/dashboards/sources/nut.py 413 20 95% 153, 172, 186, 198, 204, 217, 225, 241, 319-320, 322, 579, 591, 626, 657, 661, 718-719, 724, 736
+src/dashboards/sources/nut_sim.py 134 0 100%
+src/dashboards/store.py 313 2 99% 553-554
+------------------------------------------------------------------
+TOTAL 4063 44 99%
+Required test coverage of 94% reached. Total coverage: 98.92%
+1792 passed, 16 skipped, 1 warning in 165.46s (0:02:45)
+== uv run ruff check src tests agent ==
+All checks passed!
+== uv run pyright ==
+0 errors, 0 warnings, 0 informations
+== node --check src/dashboards/web/static/*.js ==
+advisory: dependencies are out of date (AGENTS.md rule 8 — update on purpose):
+ starlette 1.9.0 1.10.0 wheel
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__02_the_inbound_word_leads_the_row.a1.err b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__02_the_inbound_word_leads_the_row.a1.err
new file mode 100644
index 0000000..e69de29
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__02_the_inbound_word_leads_the_row.a1.md b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__02_the_inbound_word_leads_the_row.a1.md
new file mode 100644
index 0000000..08e7e69
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__02_the_inbound_word_leads_the_row.a1.md
@@ -0,0 +1,18 @@
+**Implemented** (task 31/02 — page-only, no Python touched)
+- `page-gateway.js`: replaced `selectorText()` with `inboundText()` (`out.selectors` joined → fallback `out.kind`, never `out.host`) and `counterpartText()` (`→ host:port · kind`); added `ARROW`/`SHARED_WHY` constants; `renderLeaf()` now writes the inbound word to `.pipe-name` (endpoint only as the null-inbound fallback, so the primary line is never empty) and the counterpart to a new `.pipe-end mono` span; `leafTitle()` carries **both ends** + kind + sharing sentence; `leafAria()` unchanged in facts, now sharing one `SHARED_WHY` string.
+- `dash.css`: new `.pipe-end` rule (11px, mono class, same truncation trio) beside `.gate-selector`; `.gate-selector` comment now scopes it to the trunk; `.pipe-name` comment restated for the new rank/gap 13.
+- `gateway.html`: footer paragraph 2 rewritten to the operator's dash sentence (still exactly 3 paragraphs); card comments above both `.gate-map`s record the reading order.
+- `tests/test_api.py`: strengthened `test_a_clipped_pipe_label_keeps_its_full_text_on_the_element` (both ends whole in `title` *and* `aria-label`, no string-cutting in the helpers, longest-endpoint control over the live capture); new `test_the_leaf_row_leads_with_the_inbound_word` (helper sources, call sites, `GATEWAY_PAGE_FIELDS` both directions, `brain.reeseapps.com → …:443`, haproxy backend names, `default` verbatim, no empty primary line, `:80` refusal intact) + `rendered_leaf()` second-reading mirror. Negative controls confirmed both tests fail on reverted code.
+
+**Verification**: `bash .agents/validate.sh` exit 0 — `uv run pytest --cov --cov-fail-under=94` **1793 passed, 16 skipped**, coverage **98.94%**; `ruff check src tests agent` clean; `pyright` 0 errors; `node --check` clean. Live browser pass `data/logs/31-task02-inbound-row.cjs` → `31-task02-inbound-row.out`: **21/21 PASS**, 33/33 rows read inbound→counterpart, no console errors/non-GET, 0 px sideways scroll at 360 px; screenshots `31-task02-gateway-{1440,360}.png`. `27-task02-mobile-audit.cjs` re-run → exit 0, 0 FAIL / 0 FINDING (`31-task02-mobile-audit.out`). `dev-server.sh status`: all ten sources `ok`.
+
+**Docs**: README `/gateway` table row + UI-conventions paragraph and AGENTS.md table row + `/gateway` conventions paragraph now state line 1 = inbound word, line 2 = `→ host:port · kind`, both carried whole; AGENTS.md test count 1791→1793. Also corrected a stale claim in both files (haproxy's inbound word is the `backend` name, not the `server` name).
+
+**Decisions/deviations**
+- Arrow is rendered `→ host:port` (one space) rather than the task snippet's `→host:port`, matching the phase's completion-criterion rendering and the live transcript; `ARROW = '→'` stays as specified.
+- `GATEWAY_PAGE_FIELDS` already named all four `connections.out.*` paths, so I pinned the two-directional resolution in the new test + documented the second use instead of duplicating entries.
+- Task said the fleet's longest endpoint is `reeseapps-brain-of-code.reeselink.com:443`; the capture's longest is actually `reeseapps-brain-of-reese.reeselink.com:443` (42 chars) — pinned by length+family so either neighbour satisfies the control.
+- gap 13 measurement for task 05: 1440 px → 0 clipped; 360 px → 19/33 inbound and 33/33 counterpart lines ellipsised, every one keeping full text in `title` + `aria-label`.
+- Left phase 30's `data/logs/30-connection-map.cjs` untouched (its `sels` FINDING still reads `.gate-selector`, absent from leaf rows now — it still exits 0; gap 13's restatement is task 05's).
+
+**Next pending task**: `.agents/phases/todo/31_gateway_route_readability/03_the_trunk_moves_on_a_real_number.md`.
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__02_the_inbound_word_leads_the_row.a1.md.status b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__02_the_inbound_word_leads_the_row.a1.md.status
new file mode 100644
index 0000000..9766475
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__02_the_inbound_word_leads_the_row.a1.md.status
@@ -0,0 +1 @@
+ok
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__02_the_inbound_word_leads_the_row.a1.validate b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__02_the_inbound_word_leads_the_row.a1.validate
new file mode 100644
index 0000000..95fbb4a
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__02_the_inbound_word_leads_the_row.a1.validate
@@ -0,0 +1,71 @@
+== uv run pytest --cov (hermetic: no network, live tests skip) ==
+........................................................................ [ 3%]
+........................................................................ [ 7%]
+........................................................................ [ 11%]
+........................................................................ [ 15%]
+........................................................................ [ 19%]
+........................................................................ [ 23%]
+........................................................................ [ 27%]
+........................................................................ [ 31%]
+....s................................................................... [ 35%]
+........................................................................ [ 39%]
+........................................................................ [ 43%]
+........................................................................ [ 47%]
+........................................................................ [ 51%]
+........................................................................ [ 55%]
+........................................................................ [ 59%]
+........................................................................ [ 63%]
+........................................................................ [ 67%]
+........................................................................ [ 71%]
+...................................ssssssssssss......................... [ 75%]
+........................................................................ [ 79%]
+........................................................................ [ 83%]
+........................................................................ [ 87%]
+........................................................................ [ 91%]
+........................................................................ [ 95%]
+.......................sss.............................................. [ 99%]
+......... [100%]
+=============================== warnings summary ===============================
+.venv/lib64/python3.14/site-packages/fastapi/testclient.py:1
+ /var/home/ducoterra/Projects/Personal/dashboards/.venv/lib64/python3.14/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
+ from starlette.testclient import TestClient as TestClient # noqa
+
+-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
+================================ tests coverage ================================
+_______________ coverage: platform linux, python 3.14.8-final-0 ________________
+
+Name Stmts Miss Cover Missing
+------------------------------------------------------------------
+src/dashboards/__init__.py 3 0 100%
+src/dashboards/__main__.py 14 1 93% 32
+src/dashboards/alerts.py 201 0 100%
+src/dashboards/api.py 499 3 99% 220, 250, 253
+src/dashboards/app.py 190 0 100%
+src/dashboards/auth.py 265 0 100%
+src/dashboards/certs.py 292 0 100%
+src/dashboards/collectors.py 216 5 98% 323-324, 328-329, 346
+src/dashboards/config.py 126 0 100%
+src/dashboards/debug.py 14 0 100%
+src/dashboards/poller.py 165 3 98% 192-194, 279
+src/dashboards/prom.py 112 5 96% 126, 163, 177, 180, 183
+src/dashboards/rates.py 73 0 100%
+src/dashboards/severity.py 49 0 100%
+src/dashboards/sources/__init__.py 0 0 100%
+src/dashboards/sources/disks.py 134 0 100%
+src/dashboards/sources/gateway.py 463 4 99% 518, 529, 637, 1129
+src/dashboards/sources/host.py 209 0 100%
+src/dashboards/sources/llm.py 178 1 99% 285
+src/dashboards/sources/nut.py 413 20 95% 153, 172, 186, 198, 204, 217, 225, 241, 319-320, 322, 579, 591, 626, 657, 661, 718-719, 724, 736
+src/dashboards/sources/nut_sim.py 134 0 100%
+src/dashboards/store.py 313 2 99% 553-554
+------------------------------------------------------------------
+TOTAL 4063 44 99%
+Required test coverage of 94% reached. Total coverage: 98.92%
+1793 passed, 16 skipped, 1 warning in 179.17s (0:02:59)
+== uv run ruff check src tests agent ==
+All checks passed!
+== uv run pyright ==
+0 errors, 0 warnings, 0 informations
+== node --check src/dashboards/web/static/*.js ==
+advisory: dependencies are out of date (AGENTS.md rule 8 — update on purpose):
+ starlette 1.9.0 1.10.0 wheel
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__03_the_trunk_moves_on_a_real_number.a1.err b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__03_the_trunk_moves_on_a_real_number.a1.err
new file mode 100644
index 0000000..e69de29
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__03_the_trunk_moves_on_a_real_number.a1.md b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__03_the_trunk_moves_on_a_real_number.a1.md
new file mode 100644
index 0000000..6095cd2
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__03_the_trunk_moves_on_a_real_number.a1.md
@@ -0,0 +1,16 @@
+**Task 03 complete — all green.**
+
+**Implemented**
+- `page-gateway.js`: `buildPipe(trunk = false)` adds `pipe pipe-trunk` (one builder, one class shape for both lines); `groupElement()` appends the stub as `.gate-trunk`'s last child via DOM (`createElementNS`, commented); new `trunkAria(group)` — three pinned sentences, indexes only `listeners[].connections`; `renderTrunk()` patches `hidden`/`on`/`off`/`live`/`still` + `role="img"` + `aria-label`/`title`, with `measured` separating `0` from `null`; file-header bullet now says motion has two payload paths (leaf `connections[]`, trunk `listeners[]`) and never implies a leaf.
+- `dash.css`: `.pipe-trunk { width: 26px; height: 10px; flex: none; margin-inline-start: auto; }` — no new token, no new keyframe; motion/colour still come from `.pipe.on`/`.pipe.live`.
+- `tests/test_api.py`: new `test_the_trunk_pipe_is_an_accessible_image_of_its_port` (+ `rendered_trunk` mirror) covering both arms over the capture and over real `sockets_silent`; `test_a_pipe_moves_only_while_it_carries_a_connection` restated for the two payload paths with "trunk ≠ leaf" absences; reduced-motion pin now demands descendant selectors and forbids `.pipe-trunk` styling motion; the accessible-image pin now asserts two pipe builders, one `createElementNS`, `role`+`aria`+`title` on both.
+- Browser pass `data/logs/31-task03-trunk.cjs` → `31-task03-trunk.out` (35 PASS / 0 FAIL, exit 0) with `31-task03-trunk-{1440,360,light,sockets-quiet,reduced}.png`: `:443`/`:4443` run, the 8 idle ports sit still, all green `--gate-on` in dark *and* light, same colour either way; every `aria-label` is one of the three sentences and names no endpoint; socket-quiet arm is green, motionless, `n/a`, **0** occurrences of `0 live`; stub flush at the trunk's right edge (= the spine x) even on wrapped trunks, no clipping, 0 px sideways scroll at 360 px; reduced motion stills every stub with no `.pipe-trunk` rule.
+- `data/logs/27-task02-mobile-audit.cjs` re-run: **371 PASS / 0 FAIL / 0 FINDING**, exit 0 (`data/logs/31-task03-mobile-audit.out`).
+
+**Commands / results:** `uv run pytest` → **1794 passed, 16 skipped**; `uv run pytest --cov --cov-fail-under=94` → **98.94%** (floor met, not down); `uv run ruff check src tests agent` → all checks passed; `uv run pyright` → 0 errors; `node --check src/dashboards/web/static/page-gateway.js` → clean; `bash .agents/validate.sh` → **exit 0**. `git diff` touches **no** Python under `src/dashboards/` except `web/`; `routeInConfig()` still returns `true`; no switch listener.
+
+**Docs:** README `/gateway` conventions paragraph and AGENTS.md (the groups paragraph + the `live`/`still` bullet) now state the trunk's own line, its port-only claim and its three sentences.
+
+**Deviations (2, both measured):** added `margin-inline-start: auto` to `.pipe-trunk` — without it a trunk whose text wraps (`:80` live) dropped the dash alone at the trunk's far-left, stranded from the spine; it costs ~6 px of slack on one-line trunks. `aria-label` is set with `setAttribute` (the sketch's `setTxt` writes `textContent`, which an `` has no use for). Left alone: `starlette 1.9.0 → 1.10.0` advisory (pre-existing, `validate.sh` treats it as advisory; this task moves no dependencies).
+
+**Next pending task:** `.agents/phases/todo/31_gateway_route_readability/04_find_a_domain.md`
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__03_the_trunk_moves_on_a_real_number.a1.md.status b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__03_the_trunk_moves_on_a_real_number.a1.md.status
new file mode 100644
index 0000000..9766475
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__03_the_trunk_moves_on_a_real_number.a1.md.status
@@ -0,0 +1 @@
+ok
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__03_the_trunk_moves_on_a_real_number.a1.validate b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__03_the_trunk_moves_on_a_real_number.a1.validate
new file mode 100644
index 0000000..81135fc
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__03_the_trunk_moves_on_a_real_number.a1.validate
@@ -0,0 +1,71 @@
+== uv run pytest --cov (hermetic: no network, live tests skip) ==
+........................................................................ [ 3%]
+........................................................................ [ 7%]
+........................................................................ [ 11%]
+........................................................................ [ 15%]
+........................................................................ [ 19%]
+........................................................................ [ 23%]
+........................................................................ [ 27%]
+........................................................................ [ 31%]
+.....s.................................................................. [ 35%]
+........................................................................ [ 39%]
+........................................................................ [ 43%]
+........................................................................ [ 47%]
+........................................................................ [ 51%]
+........................................................................ [ 55%]
+........................................................................ [ 59%]
+........................................................................ [ 63%]
+........................................................................ [ 67%]
+........................................................................ [ 71%]
+....................................ssssssssssss........................ [ 75%]
+........................................................................ [ 79%]
+........................................................................ [ 83%]
+........................................................................ [ 87%]
+........................................................................ [ 91%]
+........................................................................ [ 95%]
+........................sss............................................. [ 99%]
+.......... [100%]
+=============================== warnings summary ===============================
+.venv/lib64/python3.14/site-packages/fastapi/testclient.py:1
+ /var/home/ducoterra/Projects/Personal/dashboards/.venv/lib64/python3.14/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
+ from starlette.testclient import TestClient as TestClient # noqa
+
+-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
+================================ tests coverage ================================
+_______________ coverage: platform linux, python 3.14.8-final-0 ________________
+
+Name Stmts Miss Cover Missing
+------------------------------------------------------------------
+src/dashboards/__init__.py 3 0 100%
+src/dashboards/__main__.py 14 1 93% 32
+src/dashboards/alerts.py 201 0 100%
+src/dashboards/api.py 499 3 99% 220, 250, 253
+src/dashboards/app.py 190 0 100%
+src/dashboards/auth.py 265 0 100%
+src/dashboards/certs.py 292 0 100%
+src/dashboards/collectors.py 216 5 98% 323-324, 328-329, 346
+src/dashboards/config.py 126 0 100%
+src/dashboards/debug.py 14 0 100%
+src/dashboards/poller.py 165 3 98% 192-194, 279
+src/dashboards/prom.py 112 5 96% 126, 163, 177, 180, 183
+src/dashboards/rates.py 73 0 100%
+src/dashboards/severity.py 49 0 100%
+src/dashboards/sources/__init__.py 0 0 100%
+src/dashboards/sources/disks.py 134 0 100%
+src/dashboards/sources/gateway.py 463 4 99% 518, 529, 637, 1129
+src/dashboards/sources/host.py 209 0 100%
+src/dashboards/sources/llm.py 178 1 99% 285
+src/dashboards/sources/nut.py 413 20 95% 153, 172, 186, 198, 204, 217, 225, 241, 319-320, 322, 579, 591, 626, 657, 661, 718-719, 724, 736
+src/dashboards/sources/nut_sim.py 134 0 100%
+src/dashboards/store.py 313 2 99% 553-554
+------------------------------------------------------------------
+TOTAL 4063 44 99%
+Required test coverage of 94% reached. Total coverage: 98.92%
+1794 passed, 16 skipped, 1 warning in 165.70s (0:02:45)
+== uv run ruff check src tests agent ==
+All checks passed!
+== uv run pyright ==
+0 errors, 0 warnings, 0 informations
+== node --check src/dashboards/web/static/*.js ==
+advisory: dependencies are out of date (AGENTS.md rule 8 — update on purpose):
+ starlette 1.9.0 1.10.0 wheel
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__04_find_a_domain.a1.err b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__04_find_a_domain.a1.err
new file mode 100644
index 0000000..e69de29
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__04_find_a_domain.a1.md b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__04_find_a_domain.a1.md
new file mode 100644
index 0000000..8cbfb04
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__04_find_a_domain.a1.md
@@ -0,0 +1,26 @@
+**Phase 31 task 04 (`04_find_a_domain.md`) is complete and green.**
+
+## What shipped
+
+| File | Change |
+|---|---|
+| `src/dashboards/web/pages/gateway.html` | `#gate-filter` (`type="search"`, `autocomplete="off"`, `spellcheck="false"`, `aria-label`) + `#gate-filter-count` chip in the *Connection map* head; `[data-k="no-match"]` sentence in each panel; the **fourth** footer paragraph |
+| `src/dashboards/web/static/dash.css` | `input[type="search"]` joined the shared field rule; `.gate-filter { max-width: 18rem; min-width: 0 }` + `width: 100%` at ≤640px; no `:hover`/`cursor`/`transition`, no new token |
+| `src/dashboards/web/static/page-gateway.js` | `state.filter`/`state.row`; `haystack()` / `trunkHaystack()` / `leafShown` / `trunkShown`; `renderPanels()` (the one repaint the poll, the keystroke and `Escape` all share); `li.hidden` by index in the patch pass; per-panel no-match; `N of M routes` chip |
+| `tests/test_api.py` | `test_the_filter_narrows_the_map_without_asking_anything`, `test_the_filter_field_is_markup_the_sheet_and_nobody_else_uses`; the switch pin's `addEventListener` set became an allow-list that still forbids `click`; footer pin 3 → 4 |
+| `README.md` / `AGENTS.md` | the filter named in both `/gateway` rows and paragraphs, the refusal to group/sort/colour by suffix, footer=4, the four real bindings, test count 1791 → 1796 |
+
+## Verification
+
+- `bash .agents/validate.sh` → **EXIT=0**: **1796 passed, 16 skipped**, coverage **98.94%** (floor 94), ruff clean, pyright 0 errors, `node --check` clean, hygiene clean. Only advisory: `starlette 1.9.0 → 1.10.0` (pre-existing; this task moves no dependency).
+- `data/logs/31-task04-filter.cjs` → `31-task04-filter.out` **34 PASS / 0 FAIL** on the live ingress (33 routes): `stackexpected` → 6 of 33 with only `nginx:443` + `haproxy:2000` standing; case-insensitive; tallies `10 / 33 / 12 / 0` identical either side of every keystroke; **zero** requests across five keystroke states; `Escape` restores all 33; a client address keeps `:443`'s whole 18-leaf fan-out; `no-such-domain-anywhere` hides 10/10 groups and prints the sentence in both panels; the same filtered view after a real 30 s poll; 360 px → 320 px field, **0 px** sideways scroll. Screenshots `31-task04-filter-{stackexpected,no-match,cleared,360}.png`.
+- `data/logs/27-task02-mobile-audit.cjs` → `31-task04-mobile-audit.out`: **371 PASS / 0 FAIL / 0 FINDING**, 10 skips, exit 0.
+- Report written: `.agents/reports/31_gateway_route_readability/31_gateway_route_readability__04_find_a_domain.a1.md` (+ `.status` = `ok`, + `.a1.validate`).
+- Dev server is up; `/api/gateway/snapshot` untouched — no Python changed (`git diff` under `src/dashboards/` is `web/` only).
+
+## Two things I need your answer on
+
+1. **Phase bookkeeping** (rule 4 — I won't edit `.agents/phases/todo/` unprompted): tick the Completion-Criteria boxes in `04_find_a_domain.md` and move it to `.agents/phases/complete/31_gateway_route_readability/` like tasks 01–03, tick only, or leave the phase tree alone?
+2. **Commit?** HEAD is still `phase: 30_gateway_connection_map`, so phase 31 tasks 01–04 are all uncommitted. Options: leave it, one phase-31-so-far commit, or task 04 only (all with `--no-gpg-sign` + `LLM-Generated: true`).
+
+Next in the phase is `05_docs_and_live_verify.md` (the project-wide README/AGENTS pass, gap 13's re-measurement with the new row + filter, and the read-only live check).
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__04_find_a_domain.a1.md.status b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__04_find_a_domain.a1.md.status
new file mode 100644
index 0000000..9766475
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__04_find_a_domain.a1.md.status
@@ -0,0 +1 @@
+ok
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__04_find_a_domain.a1.validate b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__04_find_a_domain.a1.validate
new file mode 100644
index 0000000..b656ce8
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__04_find_a_domain.a1.validate
@@ -0,0 +1,71 @@
+== uv run pytest --cov (hermetic: no network, live tests skip) ==
+........................................................................ [ 3%]
+........................................................................ [ 7%]
+........................................................................ [ 11%]
+........................................................................ [ 15%]
+........................................................................ [ 19%]
+........................................................................ [ 23%]
+........................................................................ [ 27%]
+........................................................................ [ 31%]
+.......s................................................................ [ 35%]
+........................................................................ [ 39%]
+........................................................................ [ 43%]
+........................................................................ [ 47%]
+........................................................................ [ 51%]
+........................................................................ [ 55%]
+........................................................................ [ 59%]
+........................................................................ [ 63%]
+........................................................................ [ 67%]
+........................................................................ [ 71%]
+......................................ssssssssssss...................... [ 75%]
+........................................................................ [ 79%]
+........................................................................ [ 83%]
+........................................................................ [ 87%]
+........................................................................ [ 91%]
+........................................................................ [ 95%]
+..........................sss........................................... [ 99%]
+............ [100%]
+=============================== warnings summary ===============================
+.venv/lib64/python3.14/site-packages/fastapi/testclient.py:1
+ /var/home/ducoterra/Projects/Personal/dashboards/.venv/lib64/python3.14/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
+ from starlette.testclient import TestClient as TestClient # noqa
+
+-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
+================================ tests coverage ================================
+_______________ coverage: platform linux, python 3.14.8-final-0 ________________
+
+Name Stmts Miss Cover Missing
+------------------------------------------------------------------
+src/dashboards/__init__.py 3 0 100%
+src/dashboards/__main__.py 14 1 93% 32
+src/dashboards/alerts.py 201 0 100%
+src/dashboards/api.py 499 3 99% 220, 250, 253
+src/dashboards/app.py 190 0 100%
+src/dashboards/auth.py 265 0 100%
+src/dashboards/certs.py 292 0 100%
+src/dashboards/collectors.py 216 4 98% 324, 328-329, 346
+src/dashboards/config.py 126 0 100%
+src/dashboards/debug.py 14 0 100%
+src/dashboards/poller.py 165 3 98% 192-194, 279
+src/dashboards/prom.py 112 5 96% 126, 163, 177, 180, 183
+src/dashboards/rates.py 73 0 100%
+src/dashboards/severity.py 49 0 100%
+src/dashboards/sources/__init__.py 0 0 100%
+src/dashboards/sources/disks.py 134 0 100%
+src/dashboards/sources/gateway.py 463 4 99% 518, 529, 637, 1129
+src/dashboards/sources/host.py 209 0 100%
+src/dashboards/sources/llm.py 178 1 99% 285
+src/dashboards/sources/nut.py 413 20 95% 153, 172, 186, 198, 204, 217, 225, 241, 319-320, 322, 579, 591, 626, 657, 661, 718-719, 724, 736
+src/dashboards/sources/nut_sim.py 134 0 100%
+src/dashboards/store.py 313 2 99% 553-554
+------------------------------------------------------------------
+TOTAL 4063 43 99%
+Required test coverage of 94% reached. Total coverage: 98.94%
+1796 passed, 16 skipped, 1 warning in 169.82s (0:02:49)
+== uv run ruff check src tests agent ==
+All checks passed!
+== uv run pyright ==
+0 errors, 0 warnings, 0 informations
+== node --check src/dashboards/web/static/*.js ==
+advisory: dependencies are out of date (AGENTS.md rule 8 — update on purpose):
+ starlette 1.9.0 1.10.0 wheel
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__05_docs_and_live_verify.a1.err b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__05_docs_and_live_verify.a1.err
new file mode 100644
index 0000000..e69de29
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__05_docs_and_live_verify.a1.md b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__05_docs_and_live_verify.a1.md
new file mode 100644
index 0000000..7b77a3c
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__05_docs_and_live_verify.a1.md
@@ -0,0 +1,12 @@
+Phase 31 task 05 is complete. Final state:
+
+**Implemented**
+- `data/logs/31-route-readability.cjs` — read-only live browser pass, **64 checks / 0 FAIL**: computed `--gate-on` on every segment of all 33 rows in **both** themes (`rgb(63,185,80)` / `rgb(26,127,55)`) with **no** dashed border computing `--border-strong`; gap‑13 clip counts at 1440 px (0/33 + 0/33, 361 px column) and 360 px (19/33 + 33/33, 139 px) with 33/33 rows carrying both ends whole; the trunk truth table plus a deterministic arm (7 sockets on `:443`, every leaf count removed → trunk moves, 0/18 leaves do); filter = **zero requests** with byte-identical tallies; reduced motion stills 43 paths + every knob; all degradation arms; 0 px sideways scroll at both widths; **zero non-GET requests**.
+- `data/logs/verify-31-page-only.py` (6/0) — the payload half, explained at the head of the transcript: a literal before/after byte diff of a live socket snapshot can never pass, so it proves the guarded question instead (no `.py` differs from the phase‑30 commit; 571 leaf paths with 0 non-volatile differences across a real poll; key set equal to `30-connection-map.out`).
+- Transcript `data/logs/31-route-readability.out` (4 parts, 222 lines) + 8 screenshots + `31-task05-mobile-audit.out` (audit **371 PASS / 0 FAIL / 0 FINDING**, exit 0).
+- **Real defect found and fixed**: `svg.title = aria` assigned a property `SVGElement` does not reflect — no tooltip ever painted. Now `setAttribute('title', aria)` (leaf + trunk), pinned in `tests/test_api.py`.
+- Docs: AGENTS `/gateway` paragraph (phase‑31 framing, measurement paragraph, dash→phase 32, `setAttribute`), gap 13 restated with the measured numbers, new gaps **14/15** (one line each for `32_gateway_resolved_target_liveness` and `33_gateway_route_switching`); README dash/what-runs-today paragraph (**agent 1.2.0**, no resolution, no switching); `gateway.html` footer comment three→four; stale "17-row fan-out" counts corrected to 18.
+
+**Results**: `uv run pytest` **1796 passed, 16 skipped**, coverage **98.92%** (floor 94) · `ruff` **All checks passed** · `pyright` **0 errors** · `node --check web/static/*.js` clean · `bash .agents/validate.sh` **exit 0** · live suite **12 passed, 0 failed** · dev server restarted, all **10 sources ok**.
+
+**Notes/deviations**: `validate.sh` prints one advisory (`starlette 1.9.0 → 1.10.0`) — not upgraded, this phase touched no dependency (rule 8 applies to dependency changes); `NOTES.md` left empty (this project's log is AGENTS.md + `data/logs/`); the phase dir stays in `todo/` for the harness and the task file is unmodified. Next pending: none in phase 31 — the harness may move it to `complete/`, after which phase 32 is the next work item.
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__05_docs_and_live_verify.a1.md.status b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__05_docs_and_live_verify.a1.md.status
new file mode 100644
index 0000000..9766475
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__05_docs_and_live_verify.a1.md.status
@@ -0,0 +1 @@
+ok
diff --git a/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__05_docs_and_live_verify.a1.validate b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__05_docs_and_live_verify.a1.validate
new file mode 100644
index 0000000..2eeb160
--- /dev/null
+++ b/.agents/reports/31_gateway_route_readability/31_gateway_route_readability__05_docs_and_live_verify.a1.validate
@@ -0,0 +1,71 @@
+== uv run pytest --cov (hermetic: no network, live tests skip) ==
+........................................................................ [ 3%]
+........................................................................ [ 7%]
+........................................................................ [ 11%]
+........................................................................ [ 15%]
+........................................................................ [ 19%]
+........................................................................ [ 23%]
+........................................................................ [ 27%]
+........................................................................ [ 31%]
+.......s................................................................ [ 35%]
+........................................................................ [ 39%]
+........................................................................ [ 43%]
+........................................................................ [ 47%]
+........................................................................ [ 51%]
+........................................................................ [ 55%]
+........................................................................ [ 59%]
+........................................................................ [ 63%]
+........................................................................ [ 67%]
+........................................................................ [ 71%]
+......................................ssssssssssss...................... [ 75%]
+........................................................................ [ 79%]
+........................................................................ [ 83%]
+........................................................................ [ 87%]
+........................................................................ [ 91%]
+........................................................................ [ 95%]
+..........................sss........................................... [ 99%]
+............ [100%]
+=============================== warnings summary ===============================
+.venv/lib64/python3.14/site-packages/fastapi/testclient.py:1
+ /var/home/ducoterra/Projects/Personal/dashboards/.venv/lib64/python3.14/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
+ from starlette.testclient import TestClient as TestClient # noqa
+
+-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
+================================ tests coverage ================================
+_______________ coverage: platform linux, python 3.14.8-final-0 ________________
+
+Name Stmts Miss Cover Missing
+------------------------------------------------------------------
+src/dashboards/__init__.py 3 0 100%
+src/dashboards/__main__.py 14 1 93% 32
+src/dashboards/alerts.py 201 0 100%
+src/dashboards/api.py 499 3 99% 220, 250, 253
+src/dashboards/app.py 190 0 100%
+src/dashboards/auth.py 265 0 100%
+src/dashboards/certs.py 292 0 100%
+src/dashboards/collectors.py 216 4 98% 324, 328-329, 346
+src/dashboards/config.py 126 0 100%
+src/dashboards/debug.py 14 0 100%
+src/dashboards/poller.py 165 3 98% 192-194, 279
+src/dashboards/prom.py 112 5 96% 126, 163, 177, 180, 183
+src/dashboards/rates.py 73 0 100%
+src/dashboards/severity.py 49 0 100%
+src/dashboards/sources/__init__.py 0 0 100%
+src/dashboards/sources/disks.py 134 0 100%
+src/dashboards/sources/gateway.py 463 4 99% 518, 529, 637, 1129
+src/dashboards/sources/host.py 209 0 100%
+src/dashboards/sources/llm.py 178 1 99% 285
+src/dashboards/sources/nut.py 413 20 95% 153, 172, 186, 198, 204, 217, 225, 241, 319-320, 322, 579, 591, 626, 657, 661, 718-719, 724, 736
+src/dashboards/sources/nut_sim.py 134 0 100%
+src/dashboards/store.py 313 2 99% 553-554
+------------------------------------------------------------------
+TOTAL 4063 43 99%
+Required test coverage of 94% reached. Total coverage: 98.94%
+1796 passed, 16 skipped, 1 warning in 167.52s (0:02:47)
+== uv run ruff check src tests agent ==
+All checks passed!
+== uv run pyright ==
+0 errors, 0 warnings, 0 informations
+== node --check src/dashboards/web/static/*.js ==
+advisory: dependencies are out of date (AGENTS.md rule 8 — update on purpose):
+ starlette 1.9.0 1.10.0 wheel
diff --git a/AGENTS.md b/AGENTS.md
index 5c5689f..c058c36 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -29,7 +29,7 @@ file — plus an overview page that says which of the five you need:
| `/disks` | Are any of my physical disks failing, and which one — health, temp, hours, wear | the same agents, `smartctl -i -A -H` per whole drive (never a partition) |
| `/llm` | Tokens/sec, active sessions, queue depth, KV pressure, latency percentiles | gufo `/metrics` + `/slots`, vLLM `/metrics` |
| `/ups` | Battery health, runtime left, power events, battery-test buttons | NUT `upsd` (our own wire-protocol client; 3051 here, not 3493) |
-| `/gateway` | Which domains come in on which port, and where each one goes — **two connection tables, one per proxy config file** (`nginx`, then `haproxy`), a trunk per bound port with its configured endpoints branching off it, each line carrying the config's own word for the route and its live socket count | the same agent (1.2.0) on the one host `GATEWAY_HOST` names: its `haproxy` + `nginx` config sections joined to its `/proc/net/tcp{,6}` sockets |
+| `/gateway` | Which domains come in on which port, and where each one goes — **two connection tables, one per proxy config file** (`nginx`, then `haproxy`), a trunk per bound port with its configured routes branching off it, each line reading the config's own **inbound** word (`server_name`, `map` key, `backend` name) over the counterpart it routes to, plus its live socket count, with one filter box above the map that hides the routes whose own labels do not contain what was typed | the same agent (1.2.0) on the one host `GATEWAY_HOST` names: its `haproxy` + `nginx` config sections joined to its `/proc/net/tcp{,6}` sockets |
History is a first-class feature, not a sparkline afterthought: every number worth graphing
is stored, rolled up (raw → 1m → 1h), and served from `/api/*/history`.
@@ -373,8 +373,8 @@ Responsibilities, one line each:
30 s, `GATEWAY_TIMEOUT_SECONDS` 10 s, health and events under the dashboard name `gateway` — but
**one** job rather than one per host (the `nut` shape), dialling the `HOST_TARGETS` entry
`GATEWAY_HOST` names with its `label` set to that host's name, because the page is about the single
- ingress and a record per machine would ask four hosts a question only one can answer. It exists
- only when that name is a target: an unconfigured source has no task that could look red
+ ingress and a record per machine would ask every host a question only one of them can answer. It exists only
+ when that name is a target: an unconfigured source has no task that could look red
(invariant 3), and it is handed no `RateEstimator` because a count is not a rate (rule 2).
The job list is built once (`app.build_hub()`) because it is wired twice — production and
the injected-store test path — and two hand-written copies drifting is how a source ends up
@@ -1616,7 +1616,7 @@ uv run python scripts/dev-certs-export.py --url http://127.0.0.1:8090 \
# GET /api/certs//bundle and writes
# data/certs/.bundle at 0600 — mints nothing
-uv run pytest # hermetic: 1791 passed + 16 skipped (12 live,
+uv run pytest # hermetic: 1796 passed + 16 skipped (12 live,
# 4 store_perf), no network
uv run pytest --cov # coverage gate (98.9%; floor 94%)
uv run pytest -m live --live # opt-in: real fleet / engines / upsd
@@ -2158,7 +2158,8 @@ charge float jitters every `NUT_INTERVAL_SECONDS`, and rebuilding the `` on
an accessible name for a difference no eye can see.
**The `/gateway` page is the config's own tree, and a line's only claim is a count** (phase 29;
-joined differently by phase 30 task 02; laid out as trunk→leaf panels by phase 30 task 04): **exactly
+joined differently by phase 30 task 02; laid out as trunk→leaf panels by phase 30 task 04; made
+readable — whole-row colour, inbound-first rows, a moving trunk, a filter — by phase 31): **exactly
two panels**, one per config file, in the order `nginx` then `haproxy` (`GATEWAY_CARD_KEYS`), each
shipping `hidden` and appearing on the poll that has rows for it — a gateway with no nginx in it
spends no panel saying so, and a section that did not answer at all is the page's one `why` line
@@ -2169,10 +2170,37 @@ the left-over of a rule the join stopped applying.
Inside a panel the rows are **groups** (`groupsFor()` → `renderGroups()` → `renderTrunk()` +
`renderLeaves()`): a *trunk* is one port that file binds (`:`, its live count, up to
-`MAX_CLIENTS` client addresses, and its `server_name` count with the whole list on `title`), and the
-*leaves* hanging off it are the endpoints that port names, each with the config's own word for the
-route above it (a haproxy `server` name, a vhost's `server_name`, a stream `map` key) and its own
-`metric`. The page draws what the config declares and nothing else: the deleted `0`-padding
+`MAX_CLIENTS` client addresses, its `server_name` count with the whole list on `title`, and — since
+phase 31 task 03 — a **short `.pipe.pipe-trunk` of its own**, appended through the DOM as the trunk's
+last child because an `` needs `createElementNS` and cannot come out of `groupElement()`'s static
+`innerHTML` template), and the *leaves* hanging off it are the routes that port's config declares,
+each with its own `metric`. That stub is the port's live count drawn as a line: `renderTrunk` puts
+`live` on it when `listeners[].connections >= 1`, `still` when it is `0` **or** when it is `null` —
+never `live` for an unknown, and never a `0` in `.pipe-count` for one either — and `on` always, because
+`listeners[]` contains only ports a config names, so the row existing *is* the existence fact. Its
+claim is **the port and never a leaf**: `trunkAria()` writes
+`:4443 — 9 connections are open on this port right now` / `… no connections are open …` /
+`… connections on this port are unknown: the socket table did not answer` into both `aria-label` and
+`title` — the latter with `setAttribute`, because `title` is a reflected IDL attribute of
+`HTMLElement` and **not** of `SVGElement`, so `svg.title = …` is a JavaScript property no tooltip ever
+reads (task 05's browser pass found the served code doing exactly that) — and it indexes nothing but
+`listeners[].connections`: no `endpointText`, no `out.*`, no client address, because attributing one
+port's sockets to one of the routes hanging under it is a claim `sources/gateway.py` does not make.
+`margin-inline-start: auto` on `.pipe-trunk` is measured, not polish: the trunk wraps, and
+`.pipe-count`'s own auto margin flushes only the item that *starts* a
+line, so without it a two-line trunk (`:80` on the live ingress) dropped the dash alone at the far
+left — ink stranded on the opposite side of the trunk from the spine.
+**A leaf reads inbound first** (phase 31 task 02, correcting phase 30's rank): line 1 is
+`.pipe-name` and carries the config's word for **who reaches** the endpoint — a vhost's
+`server_name`, a stream `map` key (the literal `default` verbatim), or a haproxy `backend` name —
+from `inboundText()`, which joins **every** `out.selectors` entry, falls back to `out.kind`, and
+never to `out.host`; line 2 is `.pipe-end` and carries `counterpartText()`'s
+`→ host:port · kind`, the counterpart it flows to. Both lines are mono so a fan-out of eighteen rows reads
+down its columns, `.pipe-name` stays the primary line of its row for the trunk too (a trunk prints
+its port there), and neither helper cuts a string: CSS clips, and `leafTitle()` / `leafAria()` carry
+**both ends whole** (gap 13). Phase 30 had the two reversed, which buried the domain the operator
+types into a browser under the address they never type. The page draws what the config declares and
+nothing else: the deleted `0`-padding
(listeners with no connection, endpoints no line reaches) is gone because a group *is* a listener and
an unrendered endpoint has no row to sit in. **A trunk whose config names no target is a fact and not
a gap in the drawing** — this fleet's nginx `:80` is a `return 301`, so its leaf list renders the
@@ -2181,7 +2209,8 @@ for it; `sources/gateway.py` refuses to warn about that shape for the same reaso
on the port, and rows on the connection's own `id`, in per-panel `Map`s (`state.groups`,
`state.rows`):
built once, patched afterwards, reordered with `appendChild` of the existing node and pruned once per
-panel by id, because rebuilding a 17-row fan-out every 30 s re-announces all of it to assistive tech
+panel by id, because rebuilding a fan-out the size of this ingress's `:443` every 30 s re-announces
+all of it to assistive tech
for a difference of one connection (the `/llm` slot-grid rule). `pruneCards()` wiping a panel's whole
map is the only bulk clear, for the case where the family itself left the payload.
@@ -2191,20 +2220,44 @@ quiet prints `n/a` (`setTxt`'s own word), while a **leaf** whose endpoint the co
**name** prints an em dash (`NO_COUNT`) whose `title` says `connections not attributed — the config
writes a name and nothing here resolves names`. That is the normal look of 31 of this ingress's 33
lines, and a column of `n/a` would be twelve identical words competing with the page's one footnote.
+The footer's second paragraph is the same sentence in the operator's terms rather than the join's —
+*a dash means the endpoint is written in the config as a name; the page matches sockets by address and
+resolves nothing, so this route is drawn but not counted* — because a column of dashes needs one
+explanation on the page and not thirty-two on the rows, and because it is a **name** that is the reason
+and not a fault. `32_gateway_resolved_target_liveness` is what removes the reason; until then the dash
+stays unexplained-looking by design rather than borrowing the trunk's `n/a` word.
The line itself is hand-rolled SVG (`role="img"` + an `aria-label` naming the inbound port, the
-endpoint, the selector and the count) and it carries **two independent class pairs** (phase 30 task
-05), because the operator's green and the socket count are two different facts:
+endpoint, the selector and the count) and the row carries **two independent class pairs** (phase 30
+task 05, moved onto the `` by phase 31 task 01), because the operator's green and the socket count
+are two different facts:
-* `live` / `still` — "≥ 1 ESTABLISHED socket on this pipe right now" — decides **motion only**. One
- `pipe-flow` keyframe whose sole property is `stroke-dashoffset`; the live rule declares no `stroke`,
- so a busy line and a resting line are the same colour and motion can never become a verdict.
-* `on` / `off` — "a proxy config declares this route" — decides **stroke only**, through the sheet's
- own existence pair `--gate-on` / `--gate-off` (declared once in `:root` as a substitution of the
- theme colours, so both themes follow and no gateway rule names `--ok`). `routeInConfig()` answers
- `true` unconditionally, which is honest rather than a stub: `connections[]` **is** the config's
- declaration list, so `off` is the styled seam the write phase will fill and never a second state in
- use. The base `.pipe-path` declares no `stroke` at all, which is what makes the state class the only
- way a colour can arrive.
+* `live` / `still` — "≥ 1 ESTABLISHED socket on this pipe right now" — decides **motion only**, and it
+ stays on the `` alone. One `pipe-flow` keyframe whose sole property is `stroke-dashoffset`; the
+ live rule declares no `stroke`, so a busy line and a resting line are the same colour and motion can
+ never become a verdict. Motion may not spread: the spine segment between two rows is **shared** by
+ both leaves, so a dash travelling down it could not be attributed to one route, and animating it
+ would put a per-route claim on a per-list structure. There are **two** moving pipes and they read two
+ different payload paths (phase 31 task 03): a leaf's run from `connections[].connections` and a
+ trunk's stub from `listeners[].connections`. One `.pipe` component serves both — `buildPipe(trunk)`
+ adds `pipe-trunk` and nothing else — which is also why the file's single
+ `@media (prefers-reduced-motion: reduce)` block stills the stub without naming it: the stilling rules
+ are descendant selectors (`.pipe.live .pipe-path`), and
+ `test_the_pipe_animation_stills_in_both_states_under_reduced_motion` pins that no `.pipe-trunk` rule
+ may style `animation`/`transition` itself and quietly step outside that block.
+* `on` / `off` — "a proxy config declares this route" — decides **colour for the whole row**, through
+ the sheet's own existence pair `--gate-on` / `--gate-off` (declared once in `:root` as a substitution
+ of the theme colours, so both themes follow and no gateway rule names `--ok`). `renderLeaf` toggles
+ it on the `` **and** the `` off the same value in the same pass, and four rules carry it to
+ the two spine halves and the tick, so a route is green from its trunk to its endpoint — phase 30
+ coloured `.pipe-path` only and the operator read that as two thirds of every route being inactive
+ (`test_the_whole_route_takes_one_existence_class` pins the row class, the four connector rules and
+ that no gateway rule names the structure token any more). `routeInConfig()` answers `true`
+ unconditionally, which is honest rather than a stub: `connections[]` **is** the config's declaration
+ list, so `off` is the styled seam the write phase will fill and never a second state in use. Colour
+ still only ever *arrives* from a state class: the base `.pipe-path` declares no `stroke` and the base
+ `.gate-link::before` / `::after` / `.gate-elbow` rules declare their border `transparent` — an SVG's
+ default stroke is `none` for free, a border's default colour is `currentColor`, so "a row built and
+ never rendered draws nothing" has to be written down for a border.
So the page is **green because the route exists**, never because a number is good: `severity.py` has
no `gateway.*` row, the payload carries no `severity` at any depth, and
@@ -2217,18 +2270,23 @@ one of them off) and coloured from the same existence pair, carrying a full acce
(`endpoint, reached by , in the nginx config, on`) because a colour cannot say that to a
screen reader. It is `aria-disabled="true"` — **never** the `disabled` attribute, which would take the
reading out of the a11y tree — with a `title` naming the missing write path, no listener (the file's
-only `addEventListener` calls are the charts `toggle` and `DOMContentLoaded`) and no `:hover` or
-`cursor: pointer` anywhere in the map, because invariant 1 means no browser can disable a route:
+`addEventListener` calls are exactly four — the charts' `toggle`, `DOMContentLoaded`, and the filter's
+`input`/`keydown` — and `test_the_switch_is_built_and_explicitly_unwired` pins that list as an
+allow-list whose missing member is the point: **no `click` is bound anywhere on this page**) and no
+`:hover` or `cursor: pointer` anywhere in the map, because invariant 1 means no browser can disable a
+route:
`haproxy.cfg` and the nginx `server` block are the only switches on this fleet. The one `transition`
is the knob's, and the reduced-motion block names it beside both pipe states.
-The branch is four CSS rules and no JavaScript: each `.gate-link` carries its own upper and lower half
-of the spine at the gutter's left edge (`::before` / `::after`, each reaching half a leaf gap past its
-row so consecutive halves meet), the first and last rows drop theirs so the spine starts at the first
-branch and stops at the last with no mask, no measured height and no background-coloured eraser —
-which is also why it stays right on the poll that adds a leaf — and `.gate-group.solo`, set by the
-script from the group's own leaf count, takes the vertical away so a one-route port runs **straight
-across** (every haproxy frontend here). `.gate-group { column-gap: 0 }` is what makes the trunk's
+The branch is four CSS rules of geometry plus four of colour, and no JavaScript: each `.gate-link`
+carries its own upper and lower half of the spine at the gutter's left edge (`::before` / `::after`,
+each reaching half a leaf gap past its row so consecutive halves meet), the first and last rows drop
+theirs so the spine starts at the first branch and stops at the last with no mask, no measured height
+and no background-coloured eraser — which is also why it stays right on the poll that adds a leaf — and
+`.gate-group.solo`, set by the script from the group's own leaf count, takes the vertical away so a
+one-route port runs **straight across** (every haproxy frontend here). The ≤640px block restates the
+reaching half's geometry and **no colour**, because a per-width copy of the existence pair is how a
+pair drifts from its theme. `.gate-group { column-gap: 0 }` is what makes the trunk's
right edge and the spine the same x, so each tick starts *at* its trunk, and at ≤640px the stacked
trunk is reconnected by bringing the first row's upper half back at `top: calc(var(--gate-row-gap) * -1)`.
@@ -2250,9 +2308,80 @@ and the legend names pipes because the panel heading already says which config f
degradation arm uses the payload's own words — the `why` sentence for a pre-1.2.0/`--no-proxy` agent or
a silent section, the `unreachable` dim for a host that has never answered, and `#gate-empty` (naming
`GATEWAY_HOST` and agent **1.2.0**) for `404 {configured: false}` — and a failed poll re-draws nothing,
-so the last topology stays on screen. The footer is **three** paragraphs and no more: why a line is
-drawn and what its motion means; why a **name** endpoint carries no number; and that the switch is not
-wired. The layout is three load-bearing declarations (`minmax(0, 9.5rem) minmax(0, 1fr)` per group so
+so the last topology stays on screen. The footer is **four** paragraphs and no more: why a line is
+drawn and what its motion means; why a **name** endpoint carries no number; that the switch is not
+wired; and what the filter box does to the map and what it leaves alone — the sentence is there because
+the field is the one control that could be read as a query, and it is not one.
+
+**`#gate-filter` is an eye, not a query** (phase 31 task 04). 33 routes in config order is not a
+lookup, and the operator's question is always about one domain, so one field above the panels hides the
+rows whose **own payload text** does not contain what was typed: `in.port`, `out.host`, `out.name`,
+`out.kind` and every `out.selectors` entry for a route (`haystack()`), `:${port}` plus
+`listeners[].domains` and `.clients` for a trunk (`trunkHaystack()`). Nothing else is readable and
+nothing else is matched — no DNS, no re-ranking, no rule about `.reeselink.com`, and no page-level
+split by domain suffix, because "`reeseapps.com` vs `stackexpected.com`" is a fact neither config file
+states and grouping by it would be inventing a taxonomy the ingress never declared (rule 2); the
+operator types the suffix and the page hides the rest. A **trunk** that matches keeps its whole
+fan-out: typing `4443` asks for the port, and its routes are the answer. Visibility is applied inside
+the patch pass (`renderLeaves` sets `li.hidden` by index into `group.connections`, `renderGroups` sets
+`el.hidden` and the panel's `[data-k="no-match"]`), so a poll cannot undo the filter, a hidden row
+keeps its identity and its ``, and only the *config* removing a route ever deletes a node. The
+repaint is `renderPanels(state.snapshot, state.row)` — **no** `fetchJSON` and no `refresh()` on the
+filter path, which is what the type of the feature is (`refresh()` would add a history pair per
+keystroke and change nothing), `Escape` clears the field because a filter you cannot leave with the
+keyboard is a trap on a page whose other shortcuts are all keys, `#gate-filter-count` reads
+`N of M routes` (leaf routes, both panels, and hidden while the field is empty), and
+`renderHeader()`/`renderWarnings()` hold no reference to `state.filter` at all: `ports`,
+`connections`, `live` and `warnings` describe the ingress, not the operator's current view of it, and
+the warnings panel is a different claim rather than a shorter version of this one. The field is the
+page's own markup wearing the sheet's shared field skin (`input[type="search"]` joined the
+`input[type="text"], input[type="password"]` rule — the only three field types the app has), it is
+`autocomplete="off" spellcheck="false"` with an `aria-label`, `.gate-filter` caps it at `18rem` on a
+desktop and goes `width: 100%` at ≤640px, and it declares no `:hover`, no `cursor` and no
+`transition` because the connection map owns one interactive-looking thing (the unwired knob) and this
+is not it. `data/logs/31-task04-filter.cjs` measured it on the live ingress (transcript
+`31-task04-filter.out`, screenshots `31-task04-filter-{stackexpected,no-match,cleared,360}.png`):
+`stackexpected` → 6 of 33 rows with `nginx:443` and `haproxy:2000` the only trunks standing, a client
+address → that port's whole fan-out, `no-such-domain-anywhere` → every group hidden with both panels
+saying `no route matches "…"` and neither the tallies (`10 / 33 / 12 / 0`, byte-identical either side
+of every keystroke) nor the warnings panel moving, **zero** requests across five keystroke states, the
+same filtered view after a real 30 s poll as before it, and 0 px of sideways document scroll at 360 px
+where the field is 320 px wide. `34 PASS / 0 FAIL`.
+
+Phase 31's own pass measured the whole map rather than its parts, and is the pin that the three
+readability changes landed together: `data/logs/31-route-readability.cjs` (transcript
+`31-route-readability.out`, which opens with `data/logs/verify-31-page-only.py`'s payload proof,
+screenshots `31-gateway-*.png`, twelve frames — 1440, 360, light, filtered, no-match, trunk-live,
+phone, and one per degradation arm: predates, unconfigured, unreachable, no-nginx, sockets-quiet) —
+signs in and reads **computed** colour, not classes — every segment of all 33 rows (both spine
+halves, the tick, the run, the knob) computes to `--gate-on`, `rgb(63, 185, 80)` in dark and `rgb(26, 127, 55)` after the real
+theme toggle, and **no dashed border anywhere inside `.gate-map` computes `--border-strong`**
+(`rgb(51, 59, 77)` dark / `rgb(195, 202, 214)` light — the grey plumbing the operator read as
+inactivity), with **0** boxes in the map carrying a verdict class in either theme. The motion truth
+table comes out of the DOM against the payload's own numbers: every trunk the kernel reported ≥ 1 for
+animated, every one it reported 0 for drew a motionless line, and each `0 live` string corresponded to
+a port the payload carried 0 for — a reading of traffic, never a stored fact. A second, deterministic
+arm settles the direction of the claim: with `:443` handed 7 sockets and **every** leaf's count set to
+`null`, the trunk animated and 0 of its 18 leaves did, so a port's number provably does not leak into
+its fan-out. The arm where the socket table
+answers nothing draws **ten motionless `n/a` stubs** reading `connections on this port are unknown: the
+socket table did not answer`, with **no** `0 live` ink anywhere, every leaf keeping its `—`, the header's
+`live` tally `n/a` — and no panel taking the shared `stale` class, because the configs *did* answer. It
+then holds that the **leaf** keeps its own claim: with a trunk live and the leaf under it at `—`, the
+trunk animates and that leaf does not, because a port's sockets are not one route's. The filter pass is
+zero requests across five keystroke states with the four tallies byte-identical either side of every
+keystroke and `Escape` clearing the same way; `prefers-reduced-motion: reduce` stills all 43 paths (10 of
+them trunk stubs, through the block's descendant selectors) and every knob; the degradation arms each
+show their own sentence (`404 {configured: false}`, a `supported: false` agent, a silent socket section,
+a never-answered host); and the document scrolls **0 px** sideways at 1440 px and at 360 px with both
+charts open and the widest fan-out on screen. It also found, and fixed, the one defect of the phase that no class-based check could see:
+`svg.title = aria` assigned a JavaScript property and produced **no tooltip**, because `title` is a
+reflected IDL attribute of `HTMLElement` and not of `SVGElement` — the two map tooltips are
+`setAttribute('title', …)` calls now, which is what the browser can show and what
+`tests/test_api.py` demands. Its mobile-audit sibling is `31-task05-mobile-audit.out` (the
+`27-task02-mobile-audit.cjs` sweep, 371 checks, 0 failures, 0 findings, exit 0).
+
+The layout is three load-bearing declarations (`minmax(0, 9.5rem) minmax(0, 1fr)` per group so
a fan-out lines its leaves up instead of re-flowing them to the widest target, `minmax(0, …)` on every
track so a 40-character hostname ellipsises instead of growing the card — phase 27's rule — and one
column with the trunk above its leaves at ≤640 px). Task 04 measured that layout with
@@ -3145,9 +3274,10 @@ memory plot; the `cpu.usage_pct@coreN` series is still stored and still queryabl
ordinary rotation hygiene, not a missing step.
13. **`/gateway`'s long endpoint labels are ellipsised on a phone — a column-width question, not a
- lost fact** (found by phase 29 task 06's live pass, **closed at the desktop width by phase 30
- task 04's trunk→leaf row and re-measured on 2026-10-23 by task 06's pass**;
- `data/logs/30-connection-map.out` is the current measurement, `data/logs/30-task04-panels.out`,
+ lost fact, and the filter is what a clipped label used to block** (found by phase 29 task 06's
+ live pass, **closed at the desktop width by phase 30 task 04's trunk→leaf row and re-measured
+ after phase 31 re-ranked the row on 2026-10-26**; `data/logs/31-route-readability.out` is the
+ current measurement, `data/logs/30-connection-map.out`, `data/logs/30-task04-panels.out`,
`data/logs/29-task06-live.out` and `data/logs/29-task06-card-haproxy.png` the history).
**Phase 30 task 04 closed the desktop half by changing the row, not the font.** The two
@@ -3160,26 +3290,35 @@ memory plot; the `cpu.usage_pct@coreN` series is still stored and still queryabl
and not a bug: the longest target here is 42 characters
(`reeseapps-brain-of-code.reeselink.com:443`) and it fits.
- The arm that remains is the **phone**, and it got narrower before it got better: task 05's
- **switch** moved into the leaf row and a group stacks to one column at 360 px, so the same labels
- now clip at **31 of 33** targets and **22 of 33** selectors in a **139 px** column (this phase's
- re-run; 27 / 13 in a 177 px column when task 04 measured it, the difference being the switch
- pill's 34 px and the tick's 26 px taken off the label). Nothing is lost —
- `renderLeaf()` puts the endpoint *and* the config's own selector on the row as `title` and
- `leafAria()` carries the whole endpoint on the line, which is what
- `tests/test_api.py::test_a_clipped_pipe_label_keeps_its_full_text_on_the_element` pins, alongside
- the declarations that decide *how much* it clips (`min-width: 0` on `.gate-target`,
- `minmax(0, 1fr)` on the leaf track, `max-content` on `.pipe-name`, `flex-wrap` on the trunk) so a
- future edit cannot squeeze a label back to the seven characters phase 29 measured. In order of cost:
- (a) at ≤640 px let the leaf row put the count on the target's second line instead of its own
- column, which buys roughly two more characters per label and is a stylesheet-only change;
- (b) accept it — the fan-out is read as a set, the part that fits is the selector, and the number
- the row is about is the count. Whoever picks this up re-runs
- `data/logs/30-connection-map.cjs` (task 06's pass, which supersedes
- `data/logs/30-task04-panels.cjs`): its two `FINDING` lines are the counts at both widths, and the
- run **fails** if any line ever stops carrying its full text — 33 of 33 rows carried a `title`
- naming their whole endpoint at 1440 px and at 360 px as this phase closed, which is the assertion
- the gap is actually about.
+ **Phase 31 kept the desktop half closed and moved the phone's clipping to where it belongs.** Its
+ pass (`data/logs/31-route-readability.cjs`, both widths, both themes) reads **0 of 33** inbound
+ lines and **0 of 33** counterpart lines ellipsised at 1440 px in the same **361 px** leaf column,
+ with the longest inbound word 35 characters and the longest counterpart line 50 — the row got a
+ second line and a `→ … · kind` wrapper and still fits. At **360 px** a group stacks and the column
+ is **139 px**, so the two lines now clip at **19 of 33** inbound and **33 of 33** counterpart.
+ That is the intended direction of the trade: phase 31 task 02 made line 1 the config's own short
+ word for *who reaches* the endpoint (`server_name`, `map` key, `backend` name) and demoted the long
+ `host:port` to line 2, so what still fits is the part an operator reads and what clips is the part
+ they read once. Nothing is lost: `renderLeaf()` puts **both** ends whole on the row's `title` and
+ `leafAria()`/`leafTitle()` carry them on the line, which is what
+ `tests/test_api.py::test_a_clipped_pipe_label_keeps_its_full_text_on_the_element` pins, and the
+ browser pass measured 33 of 33 rows carrying their whole pair at both widths — as a **painted**
+ tooltip now, because that pass found `svg.title = aria` had been assigning a property
+ `SVGElement` does not reflect and showing nothing, and the fix (`setAttribute`) is what makes
+ "nothing is lost" true in a browser rather than only in the DOM. The declarations that decide *how
+ much* clips stay pinned (`min-width: 0` on `.gate-target`, `minmax(0, 1fr)` on the leaf track,
+ `max-content` on `.pipe-name`, `flex-wrap` on the trunk) so a future edit cannot squeeze a label
+ back to the seven characters phase 29 measured. What changed the gap's *cost* is task 04's filter:
+ the reason a clipped label mattered was that a long target could not be **found**, and typing
+ `brain` now hides 31 of 33 rows without one request, matching whole text CSS never showed. In order
+ of cost for what is left: (a) at ≤640 px let the leaf row put the count on the counterpart's second
+ line instead of its own column, which buys roughly two more characters per label and is a
+ stylesheet-only change; (b) accept it — the fan-out is read as a set, the part that fits is the
+ inbound word, and the number the row is about is the count. Whoever picks this up re-runs
+ `data/logs/31-route-readability.cjs` (which supersedes `data/logs/30-connection-map.cjs`): its two
+ `FINDING` lines are the counts at both widths, and the run **fails** if any row ever stops carrying
+ its full pair — 33 of 33 at 1440 px and at 360 px as this phase closed, which is the assertion the
+ gap is actually about.
How it got here, kept because the two rejected fixes are the reason the current shape looks the
way it does: at 1440 px phase 29's outbound name showed **seven characters** (`reeseapps-…`) for a
@@ -3191,6 +3330,26 @@ memory plot; the `cpu.usage_pct@coreN` series is still stored and still queryabl
declarations and removed the reason they were needed: with the trunk in its own track, the leaf's
name is the widest thing in a column that is now wide enough for it.
+14. **A route whose endpoint the config writes as a *name* is drawn and never counted —
+ `32_gateway_resolved_target_liveness` is the phase that removes the reason** (recorded by phase
+ 31 task 05, which wrote no design for it). Today 31 of this ingress's 33 routes end in a
+ `server_name`/`map` target and so carry an em dash where a live count would go, because
+ `sources/gateway.py` matches sockets by
+ address and resolves nothing (rule 2 by choice, and pinned as an absence). The follow-on phase is
+ the one that makes such a target answer with its liveness and its live connections anyway — the
+ agent reporting resolved targets on the box that owns the config, which is an `AGENT_VERSION` bump
+ to **1.3.0** and therefore an agent + source + pin change, not a page change. Its acceptance line
+ is that a dash disappears from `/gateway` for a reason and not by hiding the column.
+
+15. **`/gateway`'s switches are knobs with no write behind them — `33_gateway_route_switching` is the
+ phase that decides whether they ever get one** (recorded by phase 31 task 05, no design written).
+ Enabling or disabling a route is a second gated upstream write path in front of the proxy configs,
+ which **amends invariant 1** (today `POST /api/ups/command` is the app's only upstream write, and
+ the route enumeration in `tests/test_api.py` is the pin that says so) and needs the operator's
+ sign-off in `.agents/PLAN.md` **before** it is written as a phase. Until that decision exists the
+ knobs stay `aria-disabled`, unbound, and explained in the footer; the `PATCH`-shaped endpoint, the
+ config writer and the rollback are that phase's work and none of it is here.
+
## Locked decisions (and why)
- **SQLite, not Prometheus/Grafana.** Handful of boxes, 1–10s resolution, one file the
diff --git a/README.md b/README.md
index bcbd8a9..f201e2a 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ file:
| `/disks` | Are any of my **physical** disks failing, and which one — health, temperature, power-on hours, wear, sector alarms | the same agents, running `smartctl -i -A -H` per whole drive (never a partition or a mount); a host whose agent has no `smartctl` is not a host on this page |
| `/llm` | Tokens/sec, active sessions, queue depth, KV-cache pressure, latency percentiles | llama.cpp-family (gufo) `/metrics` + `/slots`, vLLM `/metrics` — read-only |
| `/ups` | Battery health, runtime left, power events, and battery-test buttons | NUT `upsd`, on whatever port it really listens on (its own wire-protocol client) |
-| `/gateway` | Which domains are coming in on which port, and where each one goes — **two connection tables, one per proxy config file** (`nginx`, then `haproxy`): a trunk per bound port with its configured endpoints branching off it, each line labelled with the config's own word for the route (`server_name`, `server`, `map` key) and its live connection count | the agent on **one** host, `GATEWAY_HOST` (default `gateway`), reading its `haproxy.cfg` + nginx tree and `/proc/net/tcp{,6}` — so it needs **agent 1.2.0**, and the whole page is *unconfigured* (never red) unless `GATEWAY_HOST` names a `HOST_TARGETS` entry |
+| `/gateway` | Which domains are coming in on which port, and where each one goes — **two connection tables, one per proxy config file** (`nginx`, then `haproxy`): a trunk per bound port with its configured routes branching off it, each line reading the config's own **inbound** word (`server_name`, `map` key, `backend` name) on line 1 over the counterpart it routes to on line 2 (`→ host:port`), plus its live connection count — and one filter box above the map that hides the routes whose own labels do not contain what you typed, asking nothing of the server | the agent on **one** host, `GATEWAY_HOST` (default `gateway`), reading its `haproxy.cfg` + nginx tree and `/proc/net/tcp{,6}` — so it needs **agent 1.2.0**, and the whole page is *unconfigured* (never red) unless `GATEWAY_HOST` names a `HOST_TARGETS` entry |
No Prometheus, no Grafana, no CDN, no build step. Nothing is fetched from the internet at
runtime; every asset is served by this app.
@@ -732,7 +732,7 @@ certs.py ─ root CA + client cert, minted once at startup (unreadable row → n
`alerts.py` is why one dead agent is still one line on the overview rather than two. The gateway
page's job (phase 29) is the **third** reader of that same `/snapshot`, and one job for the whole
deployment rather than one per host — `GATEWAY_HOST` names the single ingress, and a job per host
- would ask four machines a question only one can answer — on its own 30 s cadence with no
+ would ask every machine a question only one of them can answer — on its own 30 s cadence with no
`RateEstimator`, because a connection count is not a rate. And it never quietly *stops*: the task
is that source's only poller, so a SQLite write that gets refused is reported (`ok: false`, the
real reason, the numbers aging, one line in the event log) instead of freezing the source under a
@@ -1078,21 +1078,54 @@ more. `GATEWAY_HOST` naming no `HOST_TARGETS` entry is
what routes out of each, and how many connections are live on each. It is **two panels** — one per
config file, `nginx` then `haproxy` — each hidden until a poll actually has rows for it, so a router
with no nginx in it spends no panel saying so. Inside a panel the rows are **groups**: a *trunk* is
- one port that file binds, and hanging off it are the *leaves* — the endpoints it names, the endpoint
- **exactly as the config wrote it** with the config's own word for the route above it (a `server_name`,
- a haproxy `server` name, a stream `map` key). That is the shape of the file, which is why the stream
+ one port that file binds, and hanging off it are the *leaves* — the routes that port's config names,
+ each reading **inbound first**: line 1 is the config's own word for who reaches the endpoint (a
+ `server_name`, a haproxy `backend` name, a stream `map` key, the literal `default`), and line 2 is
+ the counterpart it flows to, **exactly as the config wrote it**, marked `→ host:port` with the kind
+ of route after it. Both ends are verbatim, and both are carried whole on the row's tooltip and the
+ line's accessible name whichever one CSS has to ellipsise. That is the shape of the file, which is
+ why the stream
`map` is not a third panel: its entries are the nginx panel's `:443` leaves, so every SNI domain
reads beside the port it reaches. A trunk that names no target — this fleet's `:80` `return 301` —
prints "no target named in the config" instead of drawing nothing. Each line is joined to its
counterparts: nginx's ports **branch** — a dashed spine down the fan-out with a tick into every
endpoint — and haproxy's one-`server` frontends run **straight across**, because a port with one
- route behind it is not a branch. A line is **green because the config declares the route**, an
- existence colour of the page's own, and it **animates only while it carries at least one live
- connection** — motion is the socket, colour is the config, and a resting route keeps the same green
- as a busy one. **Nothing on the page is coloured by a verdict** — a busy ingress is the job, so
- `severity.py` rates no `gateway.*` metric and no number gets a green/amber/red tint. A line to an endpoint the config wrote as a **name** prints `—`, never `0`:
- counting it would need a DNS lookup and the join never asks one, and the row's tooltip says which of
- the two facts it is looking at. The header's four tallies are `ports`, `connections`, `live` and
+ route behind it is not a branch. A route is **green because the config declares it**, an existence
+ colour of the page's own, and that green covers **every segment of the row** — spine, tick, line and
+ switch all read one class on the row, so no part of an active route is drawn as grey plumbing — while
+ the line **animates only while it carries at least one live connection**: motion is the socket,
+ colour is the config, and a resting route keeps the same green as a busy one. The trunk carries a
+ **short line of its own** for that reason, and it reads from a *different* field: a leaf moves on its
+ endpoint's count, the trunk's stub moves on `listeners[].connections` — the sockets whose **local**
+ end is that port, which `/proc` states whether or not the route's target is a resolvable address. So
+ a busy port is visibly busy even when every leaf under it carries a `—`, which is the normal look of
+ this fleet's `:443`. That line's claim is about **the port and never about one route**: its
+ accessible name and tooltip say `:4443 — 9 connections are open on this port right now` (or
+ `no connections…`, or `connections on this port are unknown: the socket table did not answer`) and
+ name no endpoint, and the unknown arm prints `n/a` where the count is and no motion at all — never
+ `0`, and never a dash, because "the socket table went quiet" is a different fact from "this target
+ is a name".
+ Above the map, one **filter box** finds a domain among 33 routes (`stackexpected`, `brain`, `4443`,
+ `minecraft`) because the rows are in config order and the question is always about one name. It hides
+ what the payload already sent and asks for **nothing**: no request, no re-derivation, no new route.
+ It matches the strings the config wrote — the inbound word(s), the endpoint, the port, the haproxy
+ `server` name, and a trunk's own domains and client addresses — case-insensitively, so a label CSS
+ ellipsised still matches its whole text. A trunk that matches keeps its **whole fan-out**: typing
+ `4443` asks for the port, and every route hanging off it is the answer. `Escape` clears it, a chip
+ beside the field counts `N of M routes`, and a query that matches nothing leaves both panels standing
+ with `no route matches "…"` in each. What it never touches is the header's four tallies, the warnings
+ panel, or the charts — those describe the ingress, not the operator's current view of it — and it
+ never **groups, sorts or colours** by domain suffix: `reeseapps.com` versus `stackexpected.com` is a
+ fact neither config file states, so the operator types the suffix and the page hides the rest rather
+ than inventing a zone no proxy declared.
+ **Nothing on the page
+ is coloured by a verdict** — a busy ingress is the job, so `severity.py` rates no `gateway.*` metric
+ and no number gets a green/amber/red tint. A line to an endpoint the config wrote as a **name**
+ prints `—`, never `0`: counting it would need a DNS lookup and the join never asks one, and the row's
+ tooltip says which of the two facts it is looking at. Expect that on most of this ingress's routes —
+ 31 of its 33 are written as domains — and read it as *drawn, not counted* rather than as a fault; the
+ footer says the same thing once, in plain terms, because a dash per row needs one explanation and not
+ thirty-two. The header's four tallies are `ports`, `connections`, `live` and
`warnings`, every one of them the payload's own figure. A `warnings` count above zero raises a panel
above the map with the config-integrity rows (`a backend no frontend routes to`, a `proxy_pass` with
no `upstream` behind it, an SNI entry that reaches no address) in the overview's alert vocabulary;
@@ -1105,7 +1138,11 @@ more. `GATEWAY_HOST` naming no `HOST_TARGETS` entry is
for a screen reader (`endpoint, reached by , in the nginx config, on`) — and it is
**unwired on purpose**: `aria-disabled` with a tooltip that says so, and this app writes to no
upstream, so a route is disabled by editing `haproxy.cfg` or an nginx `server` block and by nothing
- in a browser.
+ in a browser. Giving either of those two dashes or knobs a real backing store is deliberately **not**
+ documented here as a thing you can have: name-based liveness needs the agent to report resolved
+ targets (a future agent version), and switching a route needs a second gated write path in front of
+ the proxy configs, which is a change to this app's read-only promise rather than a feature. What runs
+ today is **agent 1.2.0**, no name resolution, and no switching.
The four event feeds (`/system`, `/disks`, `/llm`, `/ups`) are a **paged window** over the `event`
table rather than a printout of it: the list is a bounded box that scrolls, 50 events to a
page, with `1–50 of 200` between `‹ prev` and `next ›` (disabled at the ends) underneath.
diff --git a/src/dashboards/web/pages/gateway.html b/src/dashboards/web/pages/gateway.html
index bf709fe..7648729 100644
--- a/src/dashboards/web/pages/gateway.html
+++ b/src/dashboards/web/pages/gateway.html
@@ -105,7 +105,20 @@
hidden and appears on the poll that has groups for it (or a config that answered and named
none), so a gateway with no nginx in it does not spend a panel saying so. -->