Skip to content

Regression thresholds

Thresholds turn judge scores into a pass/fail gate. After scoring, the harness compares each judge's aggregate against the bounds you declare in eval.yaml and exits non-zero if any is missed — so a regression fails a CI job instead of quietly landing in a report.

eval.yaml
thresholds:
  has_content:    { min_pass_rate: 1.0 }   # boolean judge
  completeness: { min_mean: 3.5 }        # numeric (1–5) judge
  pairwise:       { min_win_rate: 0.6 }     # pairwise comparison

Each key under thresholds is a judge name; each value is a dict of one or more threshold checks.

The four threshold keys

Three of the keys are minimums — the run passes when the metric is >= the value. max_error_rate is the exception: it is a maximum, and passes when the error rate is <= the value. Either way a metric exactly equal to its threshold passes. Which key you use must match the value type the judge produces.

Key Judge type Metric compared Value range
min_pass_rate Boolean (return True/False, feedback_type: bool) Fraction of cases that passed 0.0–1.0
min_mean Numeric (a score on the judge's score_range) Mean score across cases matches the score scale
min_win_rate Pairwise Win rate vs. a baseline run 0.0–1.0
max_error_rate Any judge Fraction of cases where the judge errored 0.0–1.0

How aggregates are derived

The harness aggregates each judge across all cases before checking thresholds:

  • Boolean judges get a pass_rate (fraction of True), and mean is set to the same value. So min_mean also works on a boolean judge — 0.9 means "90% passed".
  • Numeric judges get a mean; their pass_rate is always None.
  • win_rate is not stored anywhere. score.py regression computes it from the run's pairwise section (written by score.py pairwise --baseline <id>) as wins_a / (wins_a + wins_b + ties). A is the run under test, so a tie counts against it, and errored comparisons are left out. With no pairwise section, or with every comparison errored, win_rate is unavailable and min_win_rate regresses. score.py judges runs before the comparison, so it does not check min_win_rate.

Match the key to the judge's value type

This is the most common misconfiguration. A min_pass_rate on a numeric judge has no metric to compare — and that is not silently ignored.

A missing metric is reported AS a regression

When a configured threshold's metric is None (the judge errored on every case, no case produced a value, or the key targets the wrong judge type), the harness records it as a regression with an n/a value rather than skipping it. The rationale: a threshold you asked for but that can never evaluate is a mistake worth surfacing, not hiding.

REGRESSIONS: 1 detected
  [completeness] pass_rate: >= 0.9 -> n/a

The detail names the cause: "pass_rate unavailable — judge errored on 12 cases; see the per-case rationales" when every value was rejected (by its score_range, say), "…not a boolean judge" for a wrong-type key, or "…no case produced a value" when the judge returned no value at all. Fix the first by looking at the rationales, the second by switching to min_mean for a numeric judge.

A judge skipped by its if: for every case is not applicable

When a judge's if: condition is false for every selected case — running a subset with no triage cases against a triage-only judge, say — its min_pass_rate and min_mean are not applicable: neither a pass nor a regression. The scoring command prints NOT APPLICABLE: [triage] `if:` false for all 3 cases; score thresholds not evaluated, and the report shows N/A.

This holds only when every selected case was explicitly skipped by its condition. A condition that raised (including an unreadable or non-mapping annotations.yaml), a judge error, incomplete evidence or a result without a value keeps the judge applicable, so those still regress, as does a wrong-type key (min_win_rate on a non-pairwise judge, or min_pass_rate on a numeric judge: one that declares feedback_type: int/float or a score_range, or an LLM/agent judge that declares no feedback_type: bool, which is scored numerically by default). A check/module judge that declares no type may return either, so its min_pass_rate is waived. A judge's max_error_rate is unaffected: it is still checked. When at least one case is scored, the thresholds apply to the scored cases as usual.

The distinction comes from skipped_cases and selected_cases in summary.yaml; the judge is not applicable only when the two are equal. A local summary written before those fields existed keeps the old behavior: the threshold regresses with "…judge skipped for all cases or not a boolean judge". Harbor and EvalHub summaries never record them, and omit a judge that produced no values at all, so its thresholds are not evaluated there — no regression and no N/A. The same eval.yaml can therefore pass on Harbor/EvalHub where a local run reports N/A, and a judge that produced no value for a reason other than its if: goes unflagged there. If a suite must have at least one applicable case, enforce that separately: a not-applicable judge does not prove coverage.

Partial errors shrink the sample — gate them with max_error_rate

A judge that errors on some cases still produces a mean — over the survivors only. Two off-scale cases out of ten leave min_mean gating the remaining eight, and one good score with nine errors passes a min_mean outright. The report shows ERROR for the judge only when no case produced a value.

One class of error is exempt: a case where the judge was denied material it should have graded fails the run on its own, with no max_error_rate set. See incomplete evidence.

thresholds:
  completeness:
    min_mean: 3.5
    max_error_rate: 0.2    # ...over at least 80% of the dataset

max_error_rate is off unless declared, so this is opt-in: one flaky judge run should not fail a suite by default.

Unknown keys and unknown judges are silently ignored

Thresholds are stored as-is at config load — there is no key-name validation. A typo like min_pass (instead of min_pass_rate) simply does nothing, and a threshold naming a judge that doesn't exist in the results is skipped. Only the four keys above are honored.

How detection works

flowchart TD
    A[thresholds: judge -> checks] --> B{judge in results?}
    B -- no --> S[skip]
    B -- yes --> C{check present}
    C --> D[min_pass_rate -> pass_rate]
    C --> E[min_mean -> mean]
    C --> F[min_win_rate -> win_rate]
    C --> EC[max_error_rate -> error_rate]
    D & E --> NA{if: false for every case?}
    NA -- yes --> N[not applicable]
    NA -- no --> G
    F --> G{metric is None?}
    G -- yes --> R1[regression: n/a]
    G -- no --> H{metric < threshold?}
    H -- yes --> R2[regression]
    H -- no --> P[pass]
    EC --> HE{error_rate > threshold?}
    HE -- yes --> R2
    HE -- no --> P
    R1 & R2 --> X[exit code 1]

You can define several checks for one judge; each is evaluated independently and any failure counts.

Exit-code gating

Thresholds are enforced in two places, both of which exit(1) on any regression:

/eval-run (which calls score.py judges) checks thresholds at the end of scoring:

  REGRESSIONS: 1 detected
    [completeness] mean: >= 3.5 -> 3.1

A non-zero exit fails the surrounding CI step. See the CI guide.

Re-check a completed run's saved summary.yaml without re-scoring:

python3 skills/eval-run/scripts/score.py regression \
  --run-id <id> --config eval.yaml

Prints REGRESSIONS: 0 and exits 0 when clean, or lists each regression and exits 1 otherwise.

Optional baseline comparison

Pass a prior run to also flag relative degradation, independent of the absolute bounds above:

python3 skills/eval-run/scripts/score.py regression \
  --run-id <id> --baseline <prior-id> --config eval.yaml

For each judge present in both runs, the current mean and pass_rate are compared to the baseline's. A drop of more than 0.5 (absolute) is reported as a <metric>_vs_baseline regression. Because that comparison gates on a score, it also arms the incomplete evidence gate for those judges — a run that withheld evidence cannot clear a baseline on its survivors either:

  [completeness] mean_vs_baseline: 4.2 -> 3.4   Degraded vs baseline

0.5 is a fixed absolute delta

The baseline tolerance is hard-coded, not configurable per judge. It catches a real slide (a full half-point on a 1–5 mean, or 50 percentage points on a rate) while absorbing normal judge noise. Use min_mean / min_pass_rate for the absolute floor and the baseline for drift detection.

See also