Advanced

The eval gate

A gate is a check that stops a model change when the score drops or a regression appears. It is the difference between an eval that is read and an eval that protects.

What you will see

One line of reason. A gate override without a reason is a bug that leaves no trace.

About 1 min of reading

Try It

Write a gate that blocks one change

1

Write the bar

printf 'min_pass_rate 0.80\ncritical_cases q1,q2\n' > /tmp/bar.txt; cat /tmp/bar.txt

Before you run it, say out loud what it will print. Then open the answer.

What it prints
A rate and a critical list. Both are needed before a gate can decide.
2

Run the gate against a failing set

printf 'q1 fail\nq2 pass\nq3 pass\n' > /tmp/run.txt; grep -c '^q1 fail' /tmp/run.txt

Before you run it, say out loud what it will print. Then open the answer.

What it prints
One. A critical case failed, so the gate must block.
3

Write the override reason

printf 'override: q1 rule is wrong, case retired 2026-10-10\n' >> /tmp/bar.txt; tail -1 /tmp/bar.txt

Before you run it, say out loud what it will print. Then open the answer.

What it prints
One line of reason. A gate override without a reason is a bug that leaves no trace.

Data Flow

A change to a blocked or allowed deploy
1 The change is proposed
↓
2 The frozen set runs against the change
↓
3 Score and regressions are compared to the bar
↓
4 The deploy is allowed, blocked, or overridden with a reason
Why this works
Why the gate runs on the served system

Gating the config in a notebook gates the wrong thing. The gate runs against what is deployed, the same way the tests do.

The escape hatch

A gate that cannot be overridden is a gate that cannot ship anything urgent. The override is a written reason, not a flag.

Examples

What a gate refuses

The gate refuses a score drop beyond the tolerance, and any regression on a case marked critical.

Why tolerance is not zero

Model output varies between runs. A tolerance of zero turns normal variation into a failed deploy every time.

Critical cases are chosen by hand

Critical means a user would notice. That judgement belongs to a person, and it is written in the case file.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

← Budgeting an eval run
Previous Lesson
Budgeting an eval run
Next Lesson
A harness that survives a model swap
A harness that survives a model swap →