docs(web-ui): document the new per-agent /stats chips + result trend

Backfills the agent /stats page docs after the P1 stats enrichments:
the result-trend stacked bar (per-bucket result outcomes over time) and
the cache hit-rate + tokens/turn summary chips.
This commit is contained in:
iris 2026-06-05 23:37:02 +02:00 committed by mara
commit f8cf76b62d

View file

@ -368,11 +368,17 @@ it with Chart.js (bundled into `stats.js` via esbuild — no CDN
dependency). Charts: turns, duration (p50 · p95 · avg), context
tokens, token cost per bucket, a **turns-by-model** stacked bar
(model choice drives token cost, so it sits directly under the
cost chart), and doughnuts for tool / wake-source / result mix.
A summary chip row carries window totals; when `reminder_stats`
is present (fetched via `ReminderRollup` RPC and merged into the
snapshot in `web_ui.rs::api_stats`) three extra chips appear:
**reminders scheduled / delivered / pending** for the window.
cost chart), doughnuts for tool / wake-source / result mix, and a
**result-trend** stacked bar — per-bucket `result_counts` so
error / rate-limit / compaction outcomes are visible over time
(the doughnut shows only the window total).
A summary chip row carries window totals, plus two
token-efficiency chips derived from the bucket sums: **cache
hit-rate** (`cache_read` over all input-side tokens) and
**tokens/turn**. When `reminder_stats` is present (fetched via
`ReminderRollup` RPC and merged into the snapshot in
`web_ui.rs::api_stats`) three more chips appear: **reminders
scheduled / delivered / pending** for the window.
`stats.rs` opens the sqlite db read-only and degrades to an
empty snapshot on any error — the page is decorative, never
authoritative.