Skip to content

Pilot, scorers & judge

Every run ends with an evaluation that combines three perspectives:

Hard, repeatable checks computed on every run: green %, flakiness, semantic checklist coverage. Same inputs → same score, so trends are comparable across runs.

A model reviews outputs case by case where rules can’t capture quality — did the generated test actually verify what the case described?

One holistic verdict for the whole run — the thing you’d put in a CI gate. Since v0.3.0 the Pilot verdict runs on the strong reasoner role (Anthropic claude-opus-4-8) rather than the cheap judge tier, for sounder go/no-go calls:

Run result
12 specs 11 green · 91.7% 1 flaky → repaired ◆ Pilot: PASS (92%)

Every run scores itself. The numbers appear in the console (=== Metrics ===), in each run’s report.md (with a one-line meaning per metric), and in Langfuse when configured. ↑ = higher is better, ↓ = lower is better. case_redundancy and flaky_ratio are the only “lower is better” metrics — every other metric is higher-is-better.

These mirror Cairn’s source of truth, src/eval/legend.ts (METRIC_LEGEND) — same metric names, directions, and blurbs.

Deterministic (computed from run data, no LLM):

metricdirectionmeaning
runs_green↑ higher is betterShare of generated tests that pass on validation.
flaky_ratio↓ lower is betterShare of tests classified flaky (inconsistent pass/fail).
verified_ratio↑ higher is betterShare of identified elements that resolve to exactly one element (unique locator).
grounding↑ higher is betterShare of cases whose element refs all point to real on-page elements (no hallucinated refs).
locator_quality↑ higher is betterShare of user-facing locators (getByRole/Label/Text…) vs fragile (.locator/getByTestId).
locator_robustness↑ higher is betterWeighted selector strength: role 1.0 > label/text 0.8 > test-id 0.5 > css 0.
technique_coverage↑ higher is betterDistinct test techniques used out of the 6 (ISO/IEC/IEEE 29119-4).
case_redundancy↓ lower is betterShare of cases that are near-duplicates of another (0 = all distinct).

Judge (LLM-scored):

metricdirectionmeaning
test_case_quality↑ higher is betterHolistic quality of the cases (clarity, correctness, usefulness).
methodology_adherence↑ higher is betterHow well the cases follow the testing methodology.
checklist_coverage↑ higher is betterSemantic coverage of the provided checklist by the cases.

The holistic Pilot verdict is separate — a pass / needs-work / fail judgment on the whole run, not a 0–1 score.

When a generated spec fails, Cairn attempts repair (up to MAX_REPAIR times, default 2) with a keep-best guarantee: a repair never makes the suite worse than the best state seen so far.

Best cases accumulate between runs — results-level learning works fully offline from runs/<id>/report.json, and richer tracing is available with Langfuse (optional).