Skip to content

Commit fc8f617

Browse files
committed
evals: wire @corbits/evals + first dispatch-routing eval
Add @corbits/evals@0.1.1 as a devDependency (LGPL-2.1-only; deps @corbits/system-one ^0.3.0) and land the first eval built on it (CL-10452): dispatch-routing exercises the real dispatch director system prompt (agents/dispatch/src/prompt.ts) against 9 brand-new routing requests via evaluate() with mentions/avoids/under checks and per-check miss allowances. Run: bun run eval:prompts-dispatch.
1 parent 40e19ce commit fc8f617

6 files changed

Lines changed: 314 additions & 7 deletions

File tree

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ worktrees
2525
evals/capability/results/*
2626
!evals/capability/results/baseline-0286.json
2727
evals/public/results/*
28+
evals/prompts/dispatch-routing/last.json
2829
local-harness-bench/
2930
subagents/
3031

‎bun.lock‎

Lines changed: 12 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Dispatch routing eval (first `@corbits/evals` eval)
2+
3+
First eval wired through the published [`@corbits/evals`](https://github.com/corbitsdev/corbits-evals#readme)
4+
package (CL-10452). It exercises the **real dispatch director system prompt**
5+
(`agents/dispatch/src/prompt.ts`, exported by `@corbits/code-agent-dispatch`)
6+
against **brand-new routing requests**: each case is a user request that the
7+
dispatch director must route to one specialist.
8+
9+
## Run
10+
11+
```sh
12+
bun scripts/eval-prompts-dispatch.ts
13+
# or
14+
bun run eval:prompts-dispatch
15+
```
16+
17+
The run calls a model through local Ollama by default (matching the package's
18+
own examples). Override with env:
19+
20+
```sh
21+
EVAL_MODEL=tev1:0.8b bun scripts/eval-prompts-dispatch.ts
22+
EVAL_OLLAMA_URL=http://localhost:11434 EVAL_MODEL=qwen3:0.6b bun scripts/eval-prompts-dispatch.ts
23+
```
24+
25+
## What it measures
26+
27+
The run composes the dispatch card **verbatim** + the case request + a fixed
28+
reply-format stanza (harness glue so the routing decision is measurable), then
29+
asks the model which specialist it would spawn. Checks:
30+
31+
| Check | Helper | Passes when |
32+
| --------- | ----------- | ------------------------------------------------------- |
33+
| `routes` | `mentions` | the reply names the expected specialist |
34+
| `noDiy` | `avoids` | the reply does not volunteer to do the work itself |
35+
| `fast` | `under` | the run finishes within 120s |
36+
37+
## Cases
38+
39+
`cases.jsonl` — 9 brand-new routing prompts. Each case:
40+
41+
```json
42+
{
43+
"name": "map-retry-backoff",
44+
"input": "Where does the repo handle retry backoff? Find every call site and sketch the flow between them.",
45+
"expect": { "route": "explorer", "decoys": ["coder", "planner"] }
46+
}
47+
```
48+
49+
`expect.route` is the correct specialist; `expect.decoys` lists the likely
50+
wrong picks for humans scanning the report.
51+
52+
## Gates
53+
54+
Per check, `allow` in `scripts/eval-prompts-dispatch.ts`:
55+
56+
- `routes: { miss: 6, drop: 0 }` — the gate trips only when fewer than 3 of 9
57+
cases route correctly. Calibrated to the local smoke model (`qwen3:0.6b`,
58+
observed 3/9); **tighten when running a capable model** (e.g. `miss: 1`).
59+
- `noDiy: { miss: 2 }`
60+
- `fast: 0`
61+
62+
`compare` + `save` point at `last.json`: each run compares drops against the
63+
previous stored run, then replaces it. Until a capable-model baseline is
64+
stored, drops are not gated.
65+
66+
## Integration notes
67+
68+
- `@corbits/evals@0.1.1` is a devDependency (LGPL-2.1-only — see the PR body).
69+
- The package's `evaluate()` is the whole harness: run, cases, checks, and
70+
per-check miss/drop allowances in one call. It rejects with `EvalFailure`
71+
when a check breaks its allowance; `.report.markdown()` prints the summary.
72+
- Jev (LLM-as-judge string/`ask` checks) needs the `@corbits/system-one`
73+
gateway; this eval uses code checks only so it runs offline.
74+
- Trajectory scoring (`ranSteps` / `@corbits/evals/workflow`) is the
75+
CL-10452 follow-up: this first eval uses a plain function run.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{"name":"map-retry-backoff","input":"Where does the repo handle retry backoff? Find every call site and sketch the flow between them.","expect":{"route":"explorer","decoys":["coder","planner"]}}
2+
{"name":"plan-offline-mode","input":"We need offline mode. Write a build plan with phases, risks, and acceptance criteria.","expect":{"route":"planner","decoys":["coder","explorer"]}}
3+
{"name":"fix-token-refresh","input":"There's a bug in the login flow: the token refresh silently fails. Fix it and add a regression test.","expect":{"route":"coder","decoys":["explorer","reviewer"]}}
4+
{"name":"review-ship-diff","input":"Review the attached diff for correctness and edge cases before we ship it.","expect":{"route":"reviewer","decoys":["coder"]}}
5+
{"name":"design-settings-cramped","input":"The settings screen looks cramped. Update the design tokens and spacing rules.","expect":{"route":"designer","decoys":["coder","explorer"]}}
6+
{"name":"doc-storage-layer","input":"Write the architecture doc for the new storage layer, covering the write path and failure modes.","expect":{"route":"shakespeare","decoys":["explorer","planner"]}}
7+
{"name":"audit-permissions-boundary","input":"Audit the new permissions boundary for trust issues and secret exposure.","expect":{"route":"warden","decoys":["reviewer"]}}
8+
{"name":"probe-latency-percentiles","input":"Measure latency percentiles for the new model endpoint across 200 requests and report the distribution.","expect":{"route":"prober","decoys":["qa-lead","reviewer"]}}
9+
{"name":"qa-onboarding-run","input":"Run the CLI through the onboarding flow end to end and show it works with a pass/fail record.","expect":{"route":"qa-lead","decoys":["prober","coder"]}}

‎package.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"check": "bun run lint && bun run typecheck && bun run check:dead-exports && bun run build && bun run check:projects-dir-guard",
4242
"start": "bun run build && bun ./dist/index.js",
4343
"eval:capability": "bun scripts/eval-capability.ts",
44+
"eval:prompts-dispatch": "bun scripts/eval-prompts-dispatch.ts",
4445
"eval:public-swe-one": "bun scripts/eval-public-swe-one.ts",
4546
"tui:smoke": "bun ./src/tui/smoke.ts"
4647
},
@@ -115,6 +116,7 @@
115116
"@corbits/code-agent-explorer": "workspace:*"
116117
},
117118
"devDependencies": {
119+
"@corbits/evals": "^0.1.1",
118120
"@intx/inference-testing": "0.3.0",
119121
"@types/bun": "1.3.9",
120122
"oxfmt": "^0.67.0",

0 commit comments

Comments
 (0)