Read 100 Real Traces Before You Write One Test
Most LLM test suites measure failures their author imagined. LLM error analysis in ai-eval: read real traces, name failure modes that need three trace references each, and build a dataset with at least 30% real inputs.
Key takeaways
- Write hard policies two people cannot disagree on, and mark any rule you cannot test as SCOPE-GAP instead of softening it.
- Read the first 30 traces yourself, with open coding first and axial coding second, and stop at saturation.
- A failure mode needs at least three real trace references, and lint error E003 rejects one with fewer.
- A dataset needs at least 30% of its cases from real traces, a case for every open failure mode, and never changes after a run references it.
- Rates from a dataset built failure-rich must be read against its sampling weights, or they overstate the failure rate.
Contents
FAQ
How many traces do I need to read?
The profile asks for at least 100 traces to code, until saturation, and a human codes the first 30 before any AI suggestion. Rows labelled ANN-AI are suggestions until a human confirms them.
What if I have no production traces yet?
The orchestrator refuses a dataset below 30% real cases unless you state in writing that no traces exist and accept the consequence.
Sources
Only you and the owner see your answer and rating. Send private feedback
Enjoyed it? Support fx-blog with a coffee.
Related posts
Read the Scorecard: Intervals, Gates and a Frozen Baseline
A scorecard that says 87% can hide that 60 cases cannot support it. An LLM evaluation scorecard in ai-eval: every rate with its 95% interval, gates on the lower bound, and a regression gate on the largest drop in the total or any failure mode.
Who Checks the AI Judge? Calibrate It Before It Gates
A judge that agrees with your reviewers 60% of the time produces numbers that look like a good one. LLM judge validation in ai-eval: held-out labels, rates computed by calibrate.py, and a lint that fails any gate on an unvalidated judge.
An AI Eval Pipeline That Can Say NOT-EVALUABLE
A quality number for an AI feature means little when nobody can say who checked the judge, how many cases it rests on or how sure it is. Five questions to ask of any setup, and the route ai-eval takes from traces to a scorecard that can say NOT-EVALUABLE.
Comments
Oldest firstNo comments yet. Start the conversation.
Part 1, An AI Eval Pipeline That Can Say NOT-EVALUABLE, left the orders support assistant inventing order 881234 in one trace. How often it does that, and in which kinds of message, is unknown. This part answers it from real traces, before a single test is written.
This series, in four parts:
Every number labelled "sample" comes from the illustrative scenario in the bundle's showcase,
docs/showcase/pipeline.html, not from a measured product.Write the rule first, so two people cannot disagree
/eval-scopewrites.evals/system-card.md. Its## Hard policiessection holds one rule per line, and each must be testable: could two people reading the same output disagree about whether it was broken?"Be accurate and helpful" fails that test. A rule you cannot make testable is written as
SCOPE-GAP, never softened until it sounds testable.Read the first 30 traces yourself
/eval-explore --from-profile --count 100pulls a batch of traces, each the record of one request: the input, the tool calls and the answer. A failure mode is one named way the system goes wrong. The first 30 are yours to read, because after 30 you can judge a proposed failure mode in seconds, and before 30 you cannot judge one at all.A suggestion the AI wrote is not a label: rows tagged
ANN-AIcount only after a human confirms them.A failure mode needs three real traces
The seed ships FM-001,
.evals/taxonomy/FM-001-invented-order-id.md: 4 of 100 coded traces, severityblocking, and three trace references as evidence. One had a six-digit id the tool could not find; one had no id at all and the answer invented one; one belonged to another customer. Its detector isassert:no-invented-ids, decided in code with no judge.Lint holds every failure mode to that bar:
In the sample, "curt to frustrated users" had two observations. It stayed in the notes.
Build the dataset from what you found
/eval-datawrites.evals/datasets/DS-<slug>-v1.jsonl, one case per combination of dimensions, taking the input from a real trace wherever one exists. The rules:origin: trace. The orchestrator refuses a dataset below that unless you state in writing that no traces exist.v2.The seed dataset
DS-example-v1has 3 cases, 2 of them from traces. Its.meta.mdrecords the weights: the happy path is 96% of traffic and 33% of the dataset, so rates must be read against those weights or they overstate the failure rate.Try it
Read the first 30 traces before you accept any suggestion, then count how many references each failure mode has. FM-001 has a rule, evidence and a code detector. The second failure mode in the sample, a wrong refund timeline, does not: an assertion cannot tell "in about a week" from 7 days. Part 3, Who Checks the AI Judge? Calibrate It Before It Gates, asks what happens when a model has to judge that.
Read this with your AI