Compare Runs
compare_runsCompare two runs to show whether a change made the agent worse, better, or equivalent, pairing cases statistically and flagging regressions and improvements.
Instructions
Did this change make the agent worse? Compares two runs: worse, better, equivalent, or too little evidence to tell.
What it does. Pairs by case_key (McNemar exact), else Newcombe. A rule counts only where it ran; no better if the second run was judged on less. Refuses unlike runs unless force. Local, no model call. Full detail: iris://capabilities.
When not to use it. To score one output (evaluate_output). As a gate: it reports; blocking is your policy.
Returns. JSON: comparable, incomparable_because, forced, method, before, after, difference, paired, worse, better, improvement_withheld, call, smallest_detectable, equivalent_within, coverage, critical_rises, rules_tested, regressions, improvements, discordant, discordant_total, summary, dataset.
Errors. IRIS_INVALID_ARGUMENT (empty run id, no baseline, bad margin or dataset); IRIS_STORAGE_ERROR. Failures return {"error":{code,message,recovery}} with isError; follow recovery.
Siblings. log_trace — record into a run; get_traces — find a run's traces.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | Yes | the run id to compare against it | |
| force | No | Compare even when the runs are not strictly comparable; the response still names what changed | |
| before | No | the baseline run id (`run` on log_trace); omit to use the run pinned with PATCH /api/v1/runs/:id | |
| dataset | No | Restrict both runs to the case keys of this dataset (its id or label); every count then covers only those cases | |
| equivalence_margin | No | δ for the equivalence test, as a difference in pass rate (0.05 = five points). Absent: equivalence is not tested; how far apart two runs may be and still count as the same is yours to choose |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| call | Yes | ||
| after | Yes | ||
| worse | Yes | ||
| before | Yes | ||
| better | Yes | ||
| forced | Yes | ||
| method | Yes | ||
| paired | Yes | ||
| dataset | Yes | ||
| summary | Yes | ||
| coverage | Yes | ||
| comparable | Yes | ||
| difference | Yes | ||
| discordant | Yes | ||
| regressions | Yes | ||
| improvements | Yes | ||
| rules_tested | Yes | ||
| critical_rises | Yes | ||
| discordant_total | Yes | ||
| equivalent_within | Yes | ||
| smallest_detectable | Yes | ||
| improvement_withheld | Yes | ||
| incomparable_because | Yes |