contract · Markdowncanonical

12 — Eval harness

docs/design/12-evals.md
Raw
3.1 KB68 linesSnapshot ed4ab258

12 — Eval harness

Status: implemented in 2.0.0

The Binding-Constraint Thesis (harness variance beats model variance) made operational: vak eval runs a deterministic suite that exercises the production agent loop, tools, permissions, and session ledger — only the provider is scripted.

Design

  • In-process: no HTTP, no external processes for the model; each case's trajectory is a Vec<ScriptedTurn> served by an EvalProvider. Runs in ~100ms total; safe for every CI run.
  • Real workspace per case: files are materialized into a tempdir; the agent loop executes real tool calls against them.
  • Verification is a bash command run with the production BashTool in the same workspace after the loop finishes. Exit 0 = pass.
  • Metrics on every case: tokens in/out (from the session ledger), duration, and any loop error (aborted / failed / max-turns) are recorded even when verification passes.
  • --report <path> writes JSON (passed, total, token totals, per-case details) for trend tracking; exit code is non-zero when any case fails, so regressions block releases.

Built-in suite

casecapability exercised
write-filewrite tool + exact content
edit-fileatomic edit on setup file
bash-pipelinemulti-step bash + artifact
parallel-writesbatched parallel tool execution
permission-denial-adaptsfull-access path sanity

The suite also runs as a cargo test --workspace integration test (builtin_suite_fully_green) so any harness regression fails CI directly.

General-purpose suite (non-coding)

general_suite() proves the harness is a general agent, not a code-only one: the same six-tool kernel driven through research, data-analysis, writing, conversion, and inventory scenarios. Also runs as an integration test (general_suite_fully_green) and in the default vak eval.

casescenario domain exercised
general-research-synthesismulti-source read → synthesized summary artifact
general-csv-analysisbash arithmetic over tabular data → report
general-writing-draftstructured writing with mechanical constraints
general-doc-conversionfree-form notes → machine-readable JSON
general-inventory-indexglob+grep discovery across non-code records
general-error-adapts-noncodefailed lookup → error-driven correction

Beyond the scripted suites, harness behavior in general flows is covered by crates/vak-agent/tests/general_flows.rs: mid-run steering, abort preserving partial artifacts, the stop gate blocking unverified reports, compaction during long research sessions (append-only asserted against the raw JSONL), MCP meta-tool lookups, and read-only mode denials.

Live-model evals

vak eval --live runs live_suite() (create-file, sort-lines, json-edit — small, verifiable, environment-independent) against the configured provider with no scripted trajectory: the model must genuinely solve each task. Same report format, same token/cost accounting, so nightly runs track real model performance through the harness. Requires API keys in the environment; respects provider/model config and flags.