relay-eval: add /api/phi/history endpoint
single-host coverage history with precomputed coverage_pct + a
summary block (mean/min/max coverage, connected-run count).
complements /api/phi/monitors — monitors for "what is the state
now", history for "what was the state over the last N runs".
usage:
GET /api/phi/history?name=<host>&limit=<n>
default limit = 288 (~24h at 5-min eval cadence), max = 2016 (~7d).
response shape:
{
"name": "...",
"limit": N,
"points": [ {ts, coverage_pct, events, dids, connected}, ... ],
"summary": {
"mean_coverage_pct": N,
"min_coverage_pct": N,
"max_coverage_pct": N,
"connected_runs": N,
"total_runs": N
}
}
coverage semantics match /api/phi/monitors: unique_dids / MAX(unique_dids)
per run, self-normalizing against replay. summary stats are computed
over connected points only; disconnected runs are reported separately
as the connected_runs count so phi can say "alive 272/288 runs".
Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>