docs(agent-team): describe the live pipeline map + /api/state endpoint

This commit is contained in:
Adam Moussa 2026-06-23 14:39:30 -04:00
parent 4e75a0bf93
commit 505fdeebd3

View file

@ -165,12 +165,28 @@ not change to `0.0.0.0`). See the deploy script's step 6 for how to start it.
### Status dashboard (optional, LAN/VPN-only, READ-ONLY)
`agent_team/status_page.py` serves a tiny self-refreshing HTML page showing the
coordinator queue: each task's short `thread_id`, description, current phase and
status; which tasks have an **open** pending question (blocked on the human gate)
vs. progressing; active/parked counts; and recent `budget_ledger` spend. It opens
the SQLite ledger **READ-ONLY** (`mode=ro`) and has **no mutating endpoints and
no auth**.
`agent_team/status_page.py` serves a **live visual pipeline map** of the
coordinator. The top of the page is a hand-rolled inline-SVG diagram of the
agent-team DAG (`INTAKE → CLARIFY ⇄ human gate → PLAN ⇄ REVIEW →
[BUILD → VERIFY → DISPATCH] → DONE`); each stage node is labelled with its model
role (Claude on subscription for CLARIFY/PLAN/VERIFY, GPT-4.1 cross_reviewer for
REVIEW, Gemini for SCAN, DeepSeek fast_coder for BUILD, the Slack owner for the
HUMAN GATE) and is colour-coded by live state — idle / active / awaiting-human
(an **open** pending question) / parked — with a count badge of tasks in that
stage. Hovering (or keyboard-focusing) a node shows what it is working on: the
short `thread_id`, description, status, and waiting age of each task there.
Below the map, the original detail tables remain: all tasks, the human-gate
wait-list, and recent `budget_ledger` spend.
The page **auto-updates without a full reload**: a `GET /api/state` JSON sidecar
returns the same snapshot, and an inline vanilla-JS poller (`fetch()`, no
libraries, no CDN) re-paints node states, counts, the cards, the tooltip data,
and the "last updated" clock every ~4s in place, so hover/scroll/focus survive.
A `<noscript>` 10s meta-refresh is the JS-disabled fallback. Everything
(SVG + CSS + JS) is inline in the served document — nothing is fetched from a
CDN, because the VM is offline/LAN-only. It opens the SQLite ledger
**READ-ONLY** (`mode=ro`), exposes only the two read GETs (`/` and `/api/state`)
and **no mutating endpoints and no auth**.
It is a **separate, optional process** — `agent-team-status.service` (mirrors the
coordinator unit's hardening; `User=adam`, `EnvironmentFile=-/home/adam/secrev.env`,
@ -191,7 +207,8 @@ cd ~/orchestrator/agent-team && . .venv/bin/activate && \
python3 -c "from agent_team.status_page import serve; serve()"
```
Then browse `http://10.10.60.120:8770/` from the LAN/VPN.
Then browse `http://10.10.60.120:8770/` from the LAN/VPN (the live map polls
`http://10.10.60.120:8770/api/state` itself).
**Config (env):** `AGENT_TEAM_DB` (default `state/agent_team.sqlite`),
`AGENT_TEAM_STATUS_HOST` (default `0.0.0.0`), `AGENT_TEAM_STATUS_PORT` (default