Skip to main content

A Golden Set of Failures

Why This Matters

You cannot grade a verdict without knowing the right answer. A golden set is to a prompt what a regression suite is to code: the cases your team has agreed on, so nobody has to argue about them twice, and every change can be checked against them.

From fixtures to a golden set

A golden case is a failure plus the agreed answer and the reason:

{
  "id": "golden-001",
  "source": "run-1042/t-002",
  "expected": "product_bug",
  "acceptable": [],
  "why": "Discount accepted by the API but not applied to the total, right after a pricing refactor; history all green."
}

Create fixtures/golden/ with one file per case (the failure data plus the label), or one cases.json that points to the fixtures. Start with the five failures from run-1042 and your notes from lesson 8.

How many cases?

  • At least five per category to start, more for the categories that matter most to your team.
  • Include the “unknown” cases. A tool that never says unknown is guessing; you can only measure that with cases where unknown is the right answer.
  • Include easy cases too. They catch regressions where a change breaks the obvious.

Thirty well-chosen cases beat three hundred random ones.

Adding the hard ones

Run every case ten times:

npm run eval -- --repeat 10

Cases where TestPilot changes its mind between runs are your most valuable cases: they show where the definitions or the evidence are not clear enough. Mark them in the set so you can watch them specifically.

When labellers disagree

Ask two testers to label the same twenty failures without talking. Where they disagree, the problem is rarely the testers: the definition is ambiguous. Is a timeout because the page was slow “flaky” or “environment”? Write the decision into the category definitions in the system prompt, and you have improved TestPilot before writing a line of code.

Keep it honest

  • Do not tune on the cases you report. Keep a separate set (a “holdout”) that you only use to report the final score. Otherwise you are fitting the prompt to the test.
  • Version the set. Changes to labels go through review with a reason, like changes to test expectations.
  • Add every real mistake. When TestPilot gets a real failure wrong in production, it becomes a golden case.

Exercise

Build a golden set with at least ten cases: the five from run-1042 plus five you write yourself, including at least two where “unknown” is the right answer. Run each ten times and mark the unstable ones. Compare with fixtures/golden/cases.json on solution/lesson-18-eval: 20 cases, four per category, each with its reason.