Deterministic scoring of recorded agent outputs against golden cases, in dependency-free Python.
When you change a prompt, swap a model, or bump a library, you want to know
which answers got worse. agent-eval-check scores recorded outputs (from
any agent or model, captured earlier) against written expectations and diffs
the result against a saved baseline, so regressions show up as failing
cases instead of vibes. It makes no live model calls and uses no judge
model: substring, exclusion, regex, and length checks only.
Cases file (JSONL), one case per line:
{"id": "founding-year", "prompt": "What year was Acme Demo founded?",
"expect": {"contains": ["2142"], "not_contains": ["2141"],
"regex": ["\\b21\\d{2}\\b"], "max_chars": 300}}Expectation keys: contains, not_contains, regex (each a list of
strings; every one must hold), max_chars, min_chars (integers).
Outputs file (JSONL), one row per case per model:
{"case_id": "founding-year", "model": "model-a", "output": "Founded in 2142."}Scoring: every expectation check is evaluated per output; a case passes
when all its checks pass. The report gives a per-model pass rate and one
FAIL line per failed check. With --baseline results.json, any case+model
that passed in the baseline and fails now is reported as a REGRESSION.
# Score this week's recorded outputs python3 eval_check.py score --cases cases.jsonl --outputs outputs.jsonl # Save this run as the baseline, then diff next week's run against it python3 eval_check.py score --cases cases.jsonl --outputs outputs.jsonl \ --save-baseline baseline.json python3 eval_check.py score --cases cases.jsonl --outputs next.jsonl \ --baseline baseline.json python3 eval_check.py score --cases cases.jsonl --outputs outputs.jsonl --json
Exit codes: 0 every case passes for every model and no regressions, 1
any failure or regression, 2 usage or input error.
python3 demo.py runs a synthetic comparison of three fictional models on
four trivia cases, including a baseline regression.
- Pattern matching, not understanding. These checks verify that expected strings appear and forbidden ones do not. They cannot judge whether an answer is good, only whether it matches what you wrote down. A pass is not quality; a fail is a mismatch worth reading.
- Case sensitivity is literal.
contains: ["spice"]does not match "Spice". Write expectations accordingly, or useregex. - You supply the outputs. The tool never calls a model. Record outputs with your own harness and keep the recording settings (temperature, prompt) with the file, or comparisons across runs mean little.
- Golden cases rot. When the correct answer changes, the case file must change too. A regression flag against a stale baseline is a stale baseline, not a broken model.
- No semantic, fuzzy, or LLM-judged scoring by design; add that layer yourself if you need it.
python3 -m unittest test_eval_check -v
25 tests cover case/output validation, every check kind, pass/fail scoring, duplicate and unknown-output findings, baseline regressions, and CLI exit codes.
MIT