Track 05 · EvalsLesson 05 of 10
Regression tests and CI gates
Block the prompt or model change that quietly breaks a live workflow.
- The FDE path · Stage 5 of 6
- 35 min read
- 60 min hands-on
- Pro
What you'll be able to do
01- Assemble a regression suite from the golden set, canaries, must-pass cases and every past incident.
- Design a gate that combines absolute floors, limits relative to the baseline, per-slice thresholds and must-pass rules.
- Handle non-determinism with repeated runs, majority verdicts, flaky-case quarantine and a paired statistical test.
- Implement a two-tier CI pipeline: fast replayed tests on every push, budget-capped live evals before merge.
- Run a model upgrade or deprecation migration as a gated change with evidence the customer can sign.
Before you start
- From requirements to eval criteria: what each check measures and why.
- Golden datasets and the metrics that matter: the cases the gate runs, sample sizes and confidence intervals.
- LLM judges and rubrics you can trust and Evaluating each step, not just the answer: the scorers inside the suite.
- Treat prompts like releases: the release unit (prompt, model, parameters, schema) that the gate evaluates.
The short version
Every change to an LLM application can change its behaviour: a prompt edit, a new tool description, a retrieval setting, a library upgrade, and most of all a model change. A regression gate is the automated check that stands between those changes and production. It runs a fixed suite (golden cases, canaries, must-pass safety cases and every past failure) against the candidate and the current baseline, compares them case by case, and blocks the merge if quality drops beyond agreed limits, overall or in any slice, or if a single must-pass case fails. Because models are non-deterministic, the gate runs cases several times, treats unstable cases as flaky rather than as pass or fail, and uses a paired test to tell real regressions from noise. It runs fast and cheap on every push using recorded responses, and live, under a budget, before merge. When a provider deprecates a model, the replacement goes through exactly the same gate.
Key takeaways:
- The suite grows from incidents: every production failure becomes a permanent test case.
- Gate per slice, not only overall. Averages hide the language or segment that broke.
- One must-pass failure blocks the change, whatever the overall score.
- Run each case several times; quarantine and fix flaky cases instead of rerunning until green.
- Compare candidate with baseline on the same cases, paired. Unpaired averages waste statistical power.
Pro lesson
The rest of this lesson is in Pro.
The mental model, worked example, field note, failure table, exercise and self-check, with the voice tutor.
Pro opens this stage
Stage 5 · Prove it and pass review- 7 lessons, with the voice tutor
- Lab · Clean a golden set before you trust it, graded here
- Halden week 4 · First slice due
- Halden week 6 · Instructions hidden in an invoice
- The lab kit, to run Halden weeks on your machine
Also in Pro
- Every stage and specialisation, in full
- Every lab and every role project
- Halden weeks 2–10, on your record
- Every drill, live in the playground
- All solutions, plus the server judge
- Lab Assistant and every Teach with AI