Add control board web page and local server (#1503)

Step 2 of the control board MVP (MOSAIC-STACK-D-001): `serve` command starts
a loopback-only local server that serves one self-contained page and re-runs
the status scanner on each /api/board request. The page lists sessions
waiting on Jason first (errors on top), then one table per project with
plain-word states, ages, last messages, expandable detail rows, per-project
hide-offline, and a 10-second auto-refresh with pause.

Tests: control-board 33/33 (10 new: loopback rules, host refusal, all routes,
per-request rescan, 500 path, CLI refusals, live serve, page escaping guard);
registry 69/69 unchanged. Receipt:
docs/plans/reviews/2026-09-12_control-board-step2-review.md.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
2026-09-12 07:58:38 -05:00
co-authored by Claude Fable 5.1
parent b9f59a5903
commit ebedd1281e
10 changed files with 914 additions and 26 deletions
+13 -13
View File
@@ -10,20 +10,20 @@ update this file to the next action). No ambiguity, no re-planning.
Jason decided on 2026-09-12 (MOSAIC-STACK-D-001) that the MVP is the control
board: one web page listing running agent sessions across projects, showing each
one's status, and flagging which ones are waiting on him. Plan page:
`docs/plans/2026-09-12_control-board-mvp.md`. Tracking: #1503. Step 1 (status
scanner `packages/control-board`, plan page, ticket) is done in this checkout;
running `node packages/control-board/src/cli.mjs scan --print` writes one status
file per agent under `<dataRoot>/board/`. The registry line (increment 3,
headless identity-env leak) stays parked; #1500 is closed.
`docs/plans/2026-09-12_control-board-mvp.md`. Tracking: #1503. Steps 1 and 2
are done in this checkout: `packages/control-board` scans every Pi agent
(repo `.pi/state/*` and `~/.mosaic/fleet`) and serves the page.
Next action: step 2 of #1503 — the web page. One local page that reads
`<dataRoot>/board/index.json`, groups sessions by project, shows the plain-word
state per agent, puts a "waiting on you" section at the top, and refreshes
itself (re-running the scanner on each refresh is acceptable). Reuse Dewey's
control-board mockups under `agents/dewey/work/wui/` for layout where they fit.
Acceptance: Jason opens the page in a browser and sees the same rows the
`--print` output shows, with no manual steps beyond starting the page. No auth,
no hooks/plugins, no comms, no launcher changes, no new root files.
Start it with `node packages/control-board/src/cli.mjs serve` and open
http://127.0.0.1:7331/ (loopback only, no auth, no daemon; Ctrl-C stops it).
Next action: step 3 of #1503 — daily use. Jason opens the page while he works
and reports what is wrong, missing or confusing; each report becomes a small
fix on this package with a test, committed and pushed to `refactor`. Close
#1503 when Jason says the page answers "who is waiting on me" without him
opening a terminal. Out of scope until he asks: auth, hooks/plugins, comms,
memory, launcher changes, non-Pi harnesses, new root files. The registry line
(increment 3, headless identity-env leak) stays parked; #1500 is closed.
## Completed checkpoint: #1500 increment 2 (historical)