- title
- Eval-Driven Development (EDD) — alpha
- kind
- sop
- triggers
- tools
Standard Operating Procedure: Eval-Driven Development (EDD)
Alpha. Companion: docs/edd.md, evals/edd/README.md. When changing agent prompts, MCP tool schemas, or routing behavior, use this harness instead of ad-hoc playground checks. A green scripted run is not proof the live host model is correct.
Loop (red → green → refactor)
- Red - Define intent: Add a JSONL case (
id,prompt, optionalhistory/tags/expect) and point a YAML suite at it with metrics (tool_selection,schema_match,argument_correctness,task_completion,criteria_judge,mcp_use,plan_adherence,step_efficiency,plugin,llm_as_judge,self_correction,terminal_fallback). - Green - Implement interface: Register the tool contract (MCP JSON under
evals/edd/tools/or suitemcp_tools) and system prompt. Runwk eval run --suite … --style local(or--style http/--style cli). - Refactor - Refine context: Iterate tool
description/ parameter hints / system prompt until routing and schema assertions pass without hallucinated parameters.
CLI
| Command | Purpose |
|---|---|
wk eval run --suite <path> --model <name> | Execute one suite |
wk eval watch --suite <path> --target <file> | Re-run on prompt / tool schema changes |
wk eval report --format md|json --out <dir> [--github-summary] | Markdown or JSON cost/latency/failure report; optional Actions job summary |
wk eval ci --threshold-routing 95 --out out/reports | Headless gate; fail if routing accuracy < threshold |
wk eval run --suite evals/edd/goldens/architecture_routing.yaml --style cli --cli cursor-agent --model … | Live golden (not CI) |
wk eval dataset lint|dedupe|synthesize|from-trace | Dataset hygiene (schema lint, dedupe, paraphrases, prod promote) |
IDEs vs live keys
Cursor, Claude Code, Copilot, and Antigravity load Kit via host pointers and MCP files (docs/hosts.md). Run evals with --style local; no provider key. --style http POSTs to an OpenAI-compatible /chat/completions. --style cli shells out to one assistant binary for agent and judge. Key order, nightly vs PR: docs/edd.md.
CI
- Local gate:
.github/workflows/ci.ymlVerify runswk check/wk eval ciwith--style local. Cases taggedrequires-liveare skipped so paraphrases do not fail CI.wk checkcovers architecture routing, model routing, kit-knowledge, Cloudflare ops, safety, self-correction, and terminal-fallback suites. - Live weekly:
.github/workflows/edd-live.ymlruns Sundays 03:00 UTC whenCURSOR_API_KEYis set. It installs Cursor CLI and runs--style cli --cli cursor-agent. Optional repo variableKIT_EVAL_MODEL(defaultcursor-grok-4.6-medium). MissingCURSOR_API_KEYfails the scheduled job. Manualworkflow_dispatchcan skip withallow_unkeyed_skip. Live is extra proof;wk checkstays the merge gate. - Threshold gating:
--threshold-routing 95blocks merges when routing/schema extraction fails more than 5% of routing-tagged cases. - Artifacts: Reports upload with
if: always()(out/reports/eval-report.md,edd-report.md/.json). - Job summaries: CI workflows publish an overview table plus the full Markdown report to
$GITHUB_STEP_SUMMARY(viawk eval report --github-summary, or automatically whenGITHUB_ACTIONS=true). Open the workflow run → Summary to read pass rate, routing/schema, and failure traces without downloading artifacts. Unit tests usepnpm test:ci, which also writesout/reports/unit-test-report.mdinto that Summary.
Reports
wk eval report emits overall pass rate, token/latency cost, routing + schema adherence, and failure traces (expected vs actual tool/args, diagnosis, suggested fix). Example: evals/edd/examples/eval-report.md.
Under GitHub Actions, the same Markdown is folded into the job summary so green/red checks carry meaning (what gated, which suites, metrics).
Production bridge
Live spans share eval field names (emitAgentSpan). Hard failures convert to JSONL via productionTraceToJsonl / wk eval dataset from-trace. Shadow sample + judge: wk eval shadow --infile … --sample 0.05. See SOPs/edd-production-telemetry.md.
IDE session → EDD (debug / lessons)
When a miss appears in the current Cursor, Claude, Copilot, or Antigravity thread (wrong tool, bad args, prompt/schema drift), agent-debug must promote a case from context (no user paste required), then red/green with wk eval (hypothesis-driven-debug.md §11). Lessons that capture the same friction set EDD case + optional Promote to evals/edd/*.jsonl (templates/lesson.md). Threads you cannot see stay invisible until reopened or exported.