kpi.pensanta.com: a plain sortable agent table over Postgres - nothing fancy, and it replaces the current page
Elazar 2026-09-12 CLI, verbatim intent: a simple webpage listing agents that he can sort by token usage or any field. On the current page: 'some strange thing, i just want a list of agents i can sort by token ussage or whatever, current https://kpi.pensanta.com/ i have no clue what it does (and dondt want to know)'. So this REPLACES the existing page, it does not add a second one. MEASURED: kpi-web.service is a live SYSTEM unit, node on 127.0.0.1:9876, title 'kpi-web - telemetry', already reading the Postgres agent_telemetry lane we are keeping - so the host and the data source already exist and kpi-t (:8766, sqlite) is what dies, per OPS-223. Columns, which are exactly fleet-tokens.sh's own: agent, provider, hosts, net_new, total, cache_read, responses, net_per_resp. Sort on any column, default net_new descending. Window selector reusing fleet-tokens' vocabulary (hours 1/2/4/6/8/12/24/36/48/72, days 7/14/28). Rank by NET-NEW (total minus cache_read), not raw total - cache_read is 98.7 percent of total on the heaviest agent, so sorting by total ranks context size rather than work. MUST CARRY THE GRAIN AND STALENESS HONESTY fleet-tokens.sh already prints: claude is bucket-grain (observed_at IS the hour bucket, so up to 60m of apparent age is the bucket not lag) while codex is event-grain, and a feed can be STALE, UNFED or MISSING - none of which means an agent was idle. Copy that wording; do not invent new phrasing and do not render a stale feed as a zero. No auth changes, no new vhost, no second service. Plain HTML table is acceptable and preferred over a framework.
Activity
-
ACCEPTANCE CRITERIA (approved by pmmaster 2026-09-12): (1) New plain HTML page at kpi.pensanta.com replaces the current page entirely - not a second page, not a redirect. (2) Reads live from kpi-web/agent_telemetry Postgres on 127.0.0.1:9876 (measured live system unit, confirmed correct target per 2026-08-28 domain swap - no new vhost, no new service). (3) Columns exactly match fleet-tokens.sh: agent, provider, hosts, net_new, total, cache_read, responses, net_per_resp. (4) Sortable on every column, default sort net_new descending (never raw total - cache_read is ~98.7% of total on the heaviest agent, so total-sort ranks context size not work). (5) Window selector using fleet-tokens' own vocabulary: hours 1/2/4/6/8/12/24/36/48/72, days 7/14/28. (6) Must carry fleet-tokens.sh's own grain/staleness wording verbatim (claude=bucket-grain, codex=event-grain, STALE/UNFED/MISSING states) - none of those states may render as a zero or be read as idle. (7) No auth changes, no framework required - plain HTML table is sufficient. Checkable by: load the page, confirm it queries agent_telemetry not a stale/cached export, confirm sort order and window selector work, confirm a MISSING/STALE feed renders as such and not as 0.