CCDV-P Study Guide
Free study guide for the Claude Certified Developer - Professional (CCDV-P) exam: 25 lessons, one per official skill, on running Claude systems in production. One chapter per exam domain, one page per lesson, in the order the official exam guide lists them.
5. Domain 5: Evaluation Engineering and Quality Assurance
5.1. 5.1 Evaluation system design: golden sets, CI gates and suites that stay valid
CCDV-P · Domain 5 · Lesson 5.1 · 19 min read
Offline evals that gate releases: golden sets from real traffic, code-graded checks, retrieval and groundedness metrics, release criteria per change, suite upkeep.
Why a suite that always passes is bad news
Tessaro Wealth runs a portfolio-commentary generator for its 140 financial advisers. Every month it drafts about 9,000 client letters: how the portfolio performed against its benchmark, what drove the result, what the house view says about the next quarter, and the risk disclosures the regulator requires. Advisers review every draft before it goes out. Behind the generator sits a 300-case regression suite, and no release reaches advisers without passing it.
For four months the suite has passed every release, eleven in a row, at 99% to 100%. Over the same months advisers have edited 34% of drafts, and the same three corrections make up most of the edits. A fund is credited with beating "the market" when it lagged its own benchmark. A research note the investment committee withdrew in the spring is still quoted. Portfolios with one holding above 10% of their value arrive without the concentration-risk paragraph.
Selma, the engineer who owns the generator, opens the suite and finds the explanation in an afternoon. The 300 cases were written at launch from synthetic portfolios, before multi-currency accounts and structured products were offered. Twenty-two of them were later pasted into the prompt as worked examples. And no case asks whether a cited note is still current. The suite is not lying; it is answering a question nobody asks any more.
An offline evaluation system is the machinery that measures a candidate change against a fixed set of cases before release, and blocks the release when quality drops. It has four parts: the cases, the graders, the gate that turns scores into a decision, and the upkeep that keeps the cases representative. Selma has the first three. She is missing the fourth, and that has quietly broken the other three.
Golden sets: where cases come from and how they are labelled
Where should test cases come from? It is tempting to have someone imagine typical inputs and write the perfect answer for each. Resist it. Imagined cases cover what the author thought of, and production fails on what nobody thought of.
A golden set is a fixed collection of inputs, each with a labelled expected outcome. Anthropic's guidance is to mirror your real task distribution, edge cases included. Its agent-evaluation advice adds the most valuable source of all: start with the manual checks you already run and the failures users have reported, because 20 to 50 cases drawn from real failures is a good start. Tessaro already has a failure log it never used: every adviser edit is a labelled example of what the draft got wrong.
| Source | What it gives the suite | What to watch |
|---|---|---|
| Production failures (adviser edits, complaints) | The mistakes that actually happen, already labelled by an expert | Client data must be pseudonymised before it enters the set |
| Stratified production sample | The real mix of segments: currencies, products, mandates | Needs expert labelling; random samples miss rare segments |
| Hand-written edge cases | Empty holdings, a missing benchmark, a withdrawn note | Only as good as the author's imagination |
| Synthetic expansion (Claude generates variants) | Volume from a small labelled seed | Inherits the seed's blind spots; label before trusting |
Memorise the first two rows: real failures and a stratified sample of traffic are the backbone. Synthetic cases are a multiplier, never the base. The docs suggest asking Claude to generate more cases from a baseline set of examples, but a human still labels what correct looks like.
Labelling is where Tessaro's original suite went wrong. Each case stored one ideal letter, written by an engineer. A commentary can be right in a thousand wordings, so the graders compared vaguely and passed almost anything. Label checkable facts instead: the figures allowed to appear, the disclosures that must appear, the notes that may be cited, the claims that are forbidden. Compliance staff and senior advisers label, not engineers. Two of them label the same 10% independently; where they disagree, the case is ambiguous and gets rewritten. Anthropic's agent-evaluation guide defines a good task as one where two domain experts would independently reach the same pass or fail verdict, and a disputed label is the clearest sign that a case falls short of it.
How a case enters the golden set
Size follows the decisions you need to make. A slice with 10 cases can only move in steps of 10 points, so it cannot show a 3-point regression. Tessaro sets a floor of 30 cases for every slice that carries more than 5% of traffic or any regulatory duty, which takes the suite from 300 to about 640 cases.
Behavioural checks, retrieval and groundedness metrics
Once the cases are labelled, who decides whether an output passed? Anthropic's rule is clear: choose the fastest, most reliable and most scalable method that works. That means code-based grading wherever a rule can decide, an LLM grader for complex judgement once you have tested its reliability, and human grading, slow and expensive, only where nothing else will do.
A behavioural check is a code-graded assertion about what the output must or must not do. It checks a behaviour, not a wording, so it survives every harmless rephrasing. Tessaro's three recurring corrections all turn out to be checkable by code. Look at the first two blocks, which catch invented figures and the missing disclosure, and at the last lines, which score retrieval separately from the letter.
import re
def grade(case, letter, retrieved_ids, cited_ids):
fails = []
# FIGURES: every percentage must come from the case's performance data
for figure in re.findall(r"-?\d+(?:\.\d+)?%", letter):
if figure not in case["allowed_figures"]:
fails.append(f"figure not in data: {figure}")
# DISCLOSURE: any holding above 10% requires the concentration paragraph
if case["max_weight"] > 0.10 and "concentration risk" not in letter.lower():
fails.append("missing concentration disclosure")
# CURRENCY: a withdrawn house view may never be cited
fails += [f"withdrawn note cited: {n}" for n in cited_ids if n in case["withdrawn_ids"]]
# RETRIEVAL: scored apart from the letter, against the labelled relevant notes
hits = set(case["relevant_ids"]) & set(retrieved_ids)
precision = len(hits) / len(retrieved_ids) if retrieved_ids else 0.0
recall = len(hits) / len(case["relevant_ids"]) if case["relevant_ids"] else 1.0
return fails, precision, recall
The retrieval lines matter because Tessaro's generator is retrieval-grounded: it fetches research notes and writes from them. When a letter quotes a withdrawn note, the fault may sit in retrieval (the index returned it) or in generation (the model chose it over the current one). One end-to-end score cannot tell you which. So you measure the stages separately.
| Metric | Question it answers | Stage it diagnoses |
|---|---|---|
| Retrieval precision@k | Of the k notes retrieved, what share were relevant? | Retrieval: noise in the context |
| Retrieval recall@k | Of the relevant notes, what share were retrieved? | Retrieval: missing evidence |
| Groundedness | Is every claim in the letter supported by the retrieved notes? | Generation: invented or distorted claims |
| Answer correctness | Does the letter match the labelled facts? | End to end |
Anthropic's Contextual Retrieval work reports retrieval this way, as the share of relevant chunks that fail to appear in the top 20 (1 minus recall@20). Groundedness needs one caution. With the API's citations feature, the API extracts each cited_text itself, and the docs state that citations are guaranteed to contain valid pointers to the documents you provided, so the quoted text is real. That guarantee covers the quote, not the sentence that carries it. Treat support as something you still grade: a code check where the claim is a figure, an LLM grader where it is prose. The two metrics also fail independently: a letter can be perfectly grounded in a withdrawn note, faithful to the evidence and still wrong.
CI gates and release criteria per change type
Selma's suite did run on every release. What turned it into a rubber stamp was the gate: one number, the overall pass rate, compared with a fixed 95% threshold. Averages hide exactly the regressions that matter. A release that breaks every multi-currency letter but improves everything else can pass.
A CI/CD evaluation gate is a pipeline step that runs the suite on the candidate and on the current production configuration, compares them case by case and slice by slice, and blocks the merge or deployment when the criteria fail. Three rules make it trustworthy. Critical checks, such as regulatory disclosures, must pass on every case, never on average. Each slice is compared with its own baseline, not with a global threshold. And because outputs vary between runs, cases run several times. Anthropic's agent-evaluation guide distinguishes pass@k (at least one of k trials succeeds) from pass^k (all k succeed). A disclosure that appears in 75% of runs passes three runs in a row only about 42% of the time, and pass^k is the measure that exposes it.
Tessaro's evaluation gate
What the gate checks depends on what changed, because each kind of change breaks different things.
| Change type | What it tends to break | Release criteria at Tessaro |
|---|---|---|
| Prompt | The behaviours the edited instruction touched; interactions with other instructions | Full suite; all critical checks pass; no slice regresses; cases for the edited behaviour added first |
| Model | Anything: tone, length, instruction-following, token counts, cost and latency | Full suite at more trials; per-slice comparison; effort level re-tuned on the evals; cost and latency re-baselined |
| Agent (tools, harness, retrieval) | Tool choice, task completion, retrieval quality, cost per task | Grade outcomes and end state, not the exact tool-call path; retrieval metrics per slice; pass^k on critical tasks |
A model change gets the strictest criteria. Anthropic's migration guides say tuned settings do not carry over: effort levels are recalibrated between models, so you re-run your effort sweep against your own evaluations, and you re-baseline cost, because a different tokenizer can turn the same text into more tokens. An agent change needs a different kind of grading, not just more of it. When Tessaro lets the generator fetch holdings and notes itself, a check that demands one fixed sequence of tool calls would fail valid runs; the agent-evaluation guide recommends grading what the agent produced, not the path it took.
Keeping the suite valid: contamination, saturation, coverage
Here is the question the exam loves: the suite passes, production is getting worse, so what is wrong? Usually the suite has stopped being valid, in one of three ways. Tessaro's suite had all three.
Three ways a suite stops measuring
Contamination
Fix: overlap check in CI, a held-out set
Saturation
Fix: harder cases; seed a known-bad candidate
Coverage gap
Fix: refresh from production failures
Contamination means suite cases have leaked into what the system sees: the prompt, few-shot examples, a fine-tuning set, or instructions written to fix one specific case. Tessaro's 22 pasted cases now pass because the model has seen their answers. Think of a teacher who hands out the exam questions as homework: the class scores well, and the grade says nothing. The fix is mechanical. A CI step checks the prompt and example store for overlap with the golden set, and a held-out slice is never shown to the people writing prompts.
Saturation means everything passes, so the suite no longer discriminates between good and bad candidates. Anthropic describes regression suites as sitting near 100% by design, which is exactly why you need a separate test that the suite still has teeth. Seed a known-bad candidate, such as a prompt with the disclosure instruction deleted, and confirm the gate blocks it. Move cases every candidate passes into a fast smoke set, and add harder cases where scores still vary.
A coverage gap opens when production traffic shifts and the suite does not. Selma compares slice shares: multi-currency accounts are 18% of traffic and 0% of the suite; structured products 9% and 0%. The standing fix is a refresh loop: every week, adviser corrections are grouped by cause, and each new cause becomes pseudonymised cases. Every quarter, slice shares are compared with traffic. The suite becomes a living artefact with an owner, like unit tests, not a launch deliverable.
The exam traps
Every trap here either trusts the suite's number or fixes the wrong layer.
- ✗ Treating a suite that has passed every release as proof of quality. ✓ Test that it still fails: seed a known-bad candidate, check for contamination, compare slice shares with traffic. A perfect record is a symptom to investigate.
- ✗ Building the golden set from imagined cases with one ideal answer each. ✓ Draw cases from production failures and stratified traffic, labelled with checkable facts by domain experts. Imagined cases miss what production does.
- ✗ Grading everything with an LLM judge because it handles nuance. ✓ Use code-based behavioural checks for every requirement that can be an assertion, and a judge only where judgement is needed. Code is fast, reproducible and cannot drift.
- ✗ Gating on one overall pass rate with a fixed threshold. ✓ Require critical checks on every case across repeated trials, and compare each slice with the baseline. An average hides a broken segment.
- ✗ Using the same release criteria for a prompt edit, a model upgrade and a new tool. ✓ Match the criteria to what the change can break: a model change needs every slice plus cost and latency; an agent change needs outcome grading.
- ✗ Reporting one end-to-end score for a retrieval-grounded system. ✓ Measure retrieval precision and recall separately from groundedness, so the failing stage is visible.
Put it together: build a gate that can fail
You now have every piece: real cases labelled as checkable facts, code-graded checks with retrieval scored apart, a gate that compares slices across repeated trials, and the upkeep that keeps it honest. The best way to own them is to build a tiny suite and prove that it can fail.
Offline evaluation is the first layer of the domain, not the whole of it. LLM-as-judge engineering (5.2) calibrates the graders for what code cannot check, before they earn gating authority. Online quality measurement (5.3) watches live traffic after the gate, where the suite's blind spots show up first. Incident learning loops (4.2) feed each production failure back into the golden set.
Key takeaways
- ✓ An offline evaluation system has four parts: cases, graders, a gate and upkeep; without upkeep the other three decay quietly.
- ✓ Build golden sets from production failures and stratified traffic, labelled with checkable facts by domain experts, with every slice large enough to show the regression you care about.
- ✓ Prefer code-based behavioural checks, and measure retrieval precision and recall separately from groundedness and correctness.
- ✓ A CI/CD gate compares candidate and baseline on the same cases, requires critical checks on every case across repeated trials, and compares slices instead of one average.
- ✓ Release criteria follow the change type: prompt changes on touched behaviours, model changes on everything plus cost and latency, agent changes on outcomes.
- ✓ Keep the suite valid by preventing contamination, testing for saturation with a known-bad candidate, and refreshing coverage from production failures.
Practise this
Practice questions for CCDV-P are being written and are not in this course yet. Read this lesson on the web to answer its check questions, with every option explained: https://claude.termidy.com/learn/ccdv-p/evaluation-engineering/evaluation-system-design/.