Expand description
Historical-runs capability: inspect the run history of a (corpus, service) as an agent API
(the JSON twin of the human history screen).
Follows the symmetry contract — one shared RunDto is the read model for both the agent API
(GET /api/runs/...) and the server-rendered human screen (runs_page, GET /runs/...).
Handlers live here; the app is assembled in crate::frontend::server. The binary’s legacy
history page (Vega charts) still renders today and migrates onto this surface in a later
increment.
Structs§
- RunDiff
Dto - A comparison of two saved task-status snapshots of a
(corpus, service): the status-transition matrix (what improved / regressed between runs) plus the snapshot dates available to compare. - RunDiff
Transition Dto - One cell of the run-comparison matrix: how many tasks moved from
previous_statustocurrent_statusbetween the two snapshots. - RunDto
- A historical
(corpus, service)run as exposed over the API: a stableidhandle, who/why/when, whether it has completed, and the per-severity task tallies. For a completed run these are the snapshot frozen at completion; for an open run they are overlaid with live progress (HistoricalRun::with_live_tallies), since stored tallies are only frozen at completion — so an in-progress run reports its real state, not zeros. - RunOverview
Dto - A historical run as exposed in the system-wide overview: the per-
(corpus, service)RunDtofields plus the corpus + service names (the overview spans every pair, so the names are part of the row). The read model forGET /api/runsand the/admin/runsmanagement screen. - Task
Diff Dto - A single task’s status transition between two snapshots — which document regressed or improved, and when each snapshot was taken.
Functions§
- all_
runs_ page - The system-wide run-management overview (
GET /admin/runs): the most recent runs, filterable by corpus/service/owner, each linking into its per-service history + diff drill-downs. Signed-in admins only (unauthenticated → sign-in, returning here). - api_
all_ runs - The system-wide run history (agent twin of the
/admin/runsscreen): the most recent runs, newest first, optionally filtered bycorpus/service/owner, capped atlimit(default 100, max 500).503if the pool is exhausted. - api_
run_ current - Returns the currently open run of a
(corpus, service), ornullif none is in progress.404if the corpus or service is unknown. - api_
run_ diff - Compares two task-status snapshots of a
(corpus, service)(the agent twin of the diff-summary screen).previous/currentare snapshot timestamps fromavailable_dates; omit them to use the most recent saved pair.400on a malformed date,404if the corpus/service is unknown. - api_
run_ task_ diffs - Lists the individual tasks whose status changed between two snapshots of a
(corpus, service)— the drill-down behind the comparison matrix (which documents regressed/improved). Optionally filtered to aprevious_status/current_statustransition and paginated (offset/page_size, default 100).400on a malformed date or status,404if the corpus/service is unknown. - api_
runs - Lists the run history of a
(corpus, service), most-recent first (the agent twin of the history screen).404if the corpus or service is unknown. - history_
page - The former standalone history chart page. The success-rate Vega chart is now merged into
runs_page, rendering inline above the run-history table at/runs/<corpus>/<service>, so this route redirects there — keeping old links, bookmarks, and nav entries working. - routes
- The route set for the historical-runs capability.
- runs_
diff_ page - The human diff-summary screen: the server-rendered status-transition matrix between two
snapshots — the 1:1 HTML twin of
api_run_diff, sharingRunDiffTransitionDto. A snapshot pair is chosen with two date dropdowns (a JS-free<form method=get>); each transition cell links into theruns_tasks_pagedrill-down pre-filtered to thatprevious → currenttransition. Reusesparse_snapshot_date, so a malformed date is a400and404on an unknown corpus/service. It replaced the legacydiff-summarybinary route, which.unwrap()ed the date and panicked on the dispatch path (the F-1 gap, now closed). - runs_
page - The human run-history screen: a server-rendered table of the same runs
GET /api/runs/...returns (the 1:1 HTML twin, sharingRunDto).404if the corpus/service is unknown. - runs_
tasks_ page - The human task-diff screen: a server-rendered, filterable table of the individual tasks whose
status changed between two snapshots — the 1:1 HTML twin of
api_run_task_diffs, sharingTaskDiffDto. This is the filter-driven heart of run management: pick aprevious_status → current_statustransition (and optionally a snapshot pair) and see exactly which documents regressed or improved. This parses gracefully:400on a malformed date/status,404on an unknown corpus/service, and an empty filter just lists every change. It replaced the legacydiff-historybinary route, which.expect()ed the status params and.unwrap()ed the dates — panicking on the dispatch path (the F-1 gap, now closed).