EvalSuite.
Quick Start
How It Works
A trace passes through four independent gates; the score is the fraction of gates that pass.| Gate | What it checks | When it passes |
|---|---|---|
| Artifacts | Every required_artifacts entry is present in the trace | No missing artifacts |
| Tool calls | Number of tool calls in the trace | count >= min_tool_calls |
| Schema hash | sha256[:16] of tool_schema vs expected_schema_hash | Hashes match (or no hash set) |
| Judge | judge_score from the trace | score >= judge_threshold (or no score present) |
tool_calls → tool_trace → tools and artifacts from artifacts → files → outputs, so real harness traces score unmodified. An integer under a tool-calls key means “N calls”; dict-shaped artifacts are unwrapped via path/name/file/filename/artifact.
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
trace | Dict[str, Any] | required | Harness trace dict (tool_calls/tool_trace/tools, artifacts/files/outputs, tool_schema, judge_score). |
required_artifacts | Optional[List[str]] | None | Artifact paths/names that must be present to pass. |
min_tool_calls | int | 0 | Minimum number of tool calls required (0 = no gate). |
expected_schema_hash | Optional[str] | None | If set, the trace’s tool-schema sha256[:16] hash must match this value. |
judge_threshold | float | 7.0 | Judge score (0–10) at/above which the judge gate passes. |
name | Optional[str] | None | Optional evaluation name. |
save_results_path | Optional[str] | None | Optional path to persist the result JSON. |
verbose | bool | False | Enable verbose logging. |
| Method | Returns | Purpose |
|---|---|---|
run(print_summary=False) | HarnessResult | Computes the 4 gates and aggregates |
to_eval_result(case_name=None) | EvalResult | Converts the latest run for EvalReport export |
harness_row_to_eval_case(row) maps a CSV harness row (id/name/scenario, prompt/input, optional fixture, rubric, expected) into an EvalCase with metadata["source"] = "harness".
run() returns a HarnessResult exposing passed, score, tool_call_count, tool_calls_sufficient, schema_hash, schema_consistent, artifacts_complete, missing_artifacts, judge_score, and judge_passed, plus to_dict(), to_json(), and print_summary().
Eval Module Reference
Full Python API for the eval package
Trace shape
Keys are order-insensitive — the first non-empty match wins.| Field | Accepted keys | Accepted forms |
|---|---|---|
| Tool calls | tool_calls → tool_trace → tools | list of dicts/objects, or an int (counted) |
| Artifacts | artifacts → files → outputs | list of strings, list of dicts (path/name/file/filename/artifact), or a dict (values used) |
| Tool schema | tool_schema | any JSON-serialisable dict |
| Judge score | judge_score | float (malformed values fail the judge gate) |
Common Patterns
Aggregate CSV harness scenarios into anEvalReport with harness_row_to_eval_case():
Best Practices
A bad judge score fails safely — it never crashes the suite
A bad judge score fails safely — it never crashes the suite
A non-numeric
judge_score fails the judge gate but does not raise, so one broken scenario won’t abort a mixed CI run. A trace with no judge_score treats the judge as “not configured” — the judge gate simply passes and does not count against you.The tool-call fallbacks let you pass real traces unmodified
The tool-call fallbacks let you pass real traces unmodified
Tool calls are read from
tool_calls, then tool_trace, then tools, and artifacts from artifacts, then files, then outputs. Whatever key your harness emits, the evaluator finds it — no reshaping step before scoring.Use min_tool_calls for behaviour, expected_schema_hash for parity
Use min_tool_calls for behaviour, expected_schema_hash for parity
Set
min_tool_calls when a scenario must actually exercise tools (a smoke test that made zero calls is suspect). Set expected_schema_hash when you need the tool surface to stay identical between two runs — for example native vs. plugin-provided tools.Persist results for CI artifacts
Persist results for CI artifacts
Pass
save_results_path to write the result JSON, or call result.to_json() yourself, so failed CI runs keep the per-gate breakdown for debugging.Related
Evaluation Suite
Run all four evaluators as one CI gate
Context Evaluator
Score multi-agent handoff fidelity
Evaluation Loop
Iterative agent → judge → improve loop
Judge
LLM-as-judge for evaluating outputs
Evaluation
Evaluators, suites, and reports
CHL Engineering
The Context / Harness / Loop rubric this evaluator scores against.

