Implementation: ALPHA (server) · Exposure: PREVIEW, not in the v0.3 contract. These endpoints are served by allternit-api’s Agency API alpha (cmd/allternit-api/src/agency_api/evals/). Shapes may change.
An eval applies graders to trajectories. A trajectory is what a run did: the steps it took in order, the effects it performed, what the verifier said, what it cost. Graders are deterministic checks over that trajectory (“did it run the policy check before it wrote the file?”), so an eval needs no model. Evals are built on replays. A case can be a recorded run, replayed k times through the same recorded-only engine as POST /v1/replays/batch (optionally with a candidate head, model class or graph as overrides), or a goal fixture for a task type, walked by the scripted runner (no model, no effect). Every replayed effect is recorded_only: the replay asserts zero live effects and fails closed otherwise.

Endpoints

Suites and eval runs belong to the user who created them. A replayed case only reads runs you own; decisions admins (ALLTERNIT_DECISIONS_ADMINS) may also replay other users’ runs in their evals. A case whose run you cannot read is skipped with ERR_NOT_FOUND, never replayed.

Suites

A suite is a versioned JSON document:

Graders

For a replayed case the trajectory is the replay’s: its node path and outcomes, its verifier verdict and its replay totals (tokens, cost_usd, latency_ms from the replay results). Effects are the source run’s effects, served from the recording, for the nodes the replay committed. Text for must_cite is the recorded model output and document content.

Run an eval

The eval runs in the request unless a case needs live model calls (a model_class or graph_version override outside scripted mode); then it is accepted with status: running and finishes in the background. Live model calls count against the server’s daily spending caps exactly like replays: a reached cap stops the case with ERR_BUDGET_CAP_REACHED and no further calls. The eval run (evr_…) has one entry per suite in suites, each with its cases and metrics, and metrics pooled over all suites. Each case result has via (replay, scripted, or scripted_fixture), attempts (with pass, every grader’s grades, and for replays the replay_id, readable at /v1/replays/{replay_id}, and the verdict), passes, pass_rate (passes over k) and pass (by the case’s rule). Skipped cases carry skip_reason.

Promote a run into a regression case

Owner only, finished runs only (completed, partial, failed). Snapshots the run into a suite as a regression case, typically a run the trace monitor flagged. The case keeps ids and fixtures, not content: the run id, task type, graph and template ids, write set, committed path, effect count, verifier verdict, spend, the monitor’s finding checks, and a SHA-256 of the goal. It never copies the goal text, model outputs or credentials. Task-type runs also get a scripted fixture (their WAIT answers and failed steps) so the case still runs where the recording is not available. The response (201) is { "object": "eval_case", "suite_id", "case", "suite_case_count" }.

The CI regression gate

scripts/agency-eval-gate.mjs runs the shipped task-type eval sets and the committed suites (cmd/allternit-api/src/agency_api/evals/suites/*.v1.json) offline, with the scripted runner only (no model, no secrets), through the cargo test agency_api::evals::tests::eval_gate_offline_report. It compares the report with evals/baseline.v1.json and exits non-zero when:
  • a suite’s pass rate drops more than 2 percentage points below its baseline (max_drop_pp in the baseline, or --max-drop-pp);
  • any high-stakes (all-of-k) case fails;
  • a baseline suite is missing from the report or graded nothing.
Exit codes: 0 pass, 1 regression, 2 usage or infrastructure error. The comparison logic is tested by node --test scripts/agency-eval-gate.test.mjs. The gate needs a build of allternit-api, which takes well over five minutes on a GitHub-hosted runner, so it is a manual workflow (.github/workflows/agency-eval-gate.yml, workflow_dispatch), not a required check. The same offline report also runs, and is checked against the baseline, in cargo test -p allternit-api --lib agency_api. Gizzi uses the same suite format and grader vocabulary. See Gizzi evals.