Topic 5 of 5 · 4 min read
Closing the loop from errors to fixes
Goal: Turn a week of feedback and error logs into three failure categories, each with one test case that would catch it.
Close the loop: sort errors and feedback into a few failure categories, turn each category into a test case, and tell users what changed. Reports that never change anything teach users to stop sending them.
Check yourself · 1 of 3
What is the first step in turning a week of feedback into fixes?
Why it matters
A week of logs, thumbs-downs and written complaints is a pile, not a plan. Hamel Husain's guide to evals argues that the fastest way to improve an AI product is to read real failures, group them, and build tests from them. Without that step, teams fix whatever was reported most recently, and old failures return.
How to do it
- Collect in one place. Pull error logs, reports with reason codes and support tickets into one list, each with its request id.
- Read a sample by hand. Open 30 to 50 real cases and write what went wrong in a plain sentence. Do not start with a fixed category list; let the categories come from what you see.
- Group into 3 to 6 categories. For example: "cites a document that says something else", "ignores the requested length", "refuses a normal tax question". Count each. Fix the biggest and most harmful first.
- Turn each category into a test case. Take a real failing input, write what a good answer must contain or must not contain, and save it. Run the set whenever you change the prompt, model or retrieval, so an old failure cannot come back unnoticed.
- Tell users. When a fix ships, say so where they will see it: a release note, or a reply to the user who reported it. "You reported wrong refund windows. This is fixed." is what keeps reporting alive.
- Check the fix. Watch the category's count in the next week's reports.
Before and after
Before: Support forwards a screenshot to the developer, who changes the prompt. Three weeks later the same error appears after a model upgrade.
After: The failure joins the category "wrong refund window", has a saved test with the expected 30 days, and runs on every change. The model upgrade fails the test before release.
What goes wrong
- Fixing individual reports instead of categories, so each fix is a patch.
- Writing tests that check exact wording, which break on harmless changes. Check facts and rules instead.
- No owner for a category, so the list grows and nothing ships.
- Shipping a fix and never telling the people who reported it.
For engineers (optional)
A saved failure becomes a regression test:
import { test, expect } from "vitest";
import { answer } from "./assistant";
test("refund window comes from the policy, not a guess", async () => {
const res = await answer("How long do I have to return an item?");
expect(res.text).toContain("30 days");
expect(res.sources.map((s) => s.id)).toContain("returns-policy");
});
The test checks the fact and the source, not the exact sentence.
Examples
From a week of reports to categories
40 reports read by hand: 17 "cites a source that says something else", 11 "ignores the word limit", 7 "refuses a normal tax question", 5 other.
Owners: retrieval team for the first, prompt team for the second, safety team for the third. Each gets one saved test from a real failing case.
A user-facing note
"You told us that refund answers sometimes gave the wrong number of days. We now check every refund answer against the returns policy. Thank you for the reports."
Key points
- Read real cases by hand and let the failure categories come from what you find.
- Group reports into a few categories and fix the biggest or most harmful first.
- Turn each category into a saved test case so old failures cannot return unnoticed.
- Test facts and rules rather than exact wording.
- Tell users when a reported problem is fixed, so they keep reporting.
Common mistakes
- Patching single reports instead of grouping them.
- Writing tests that match exact wording.
- Leaving a failure category without an owner.
- Never telling reporters that their problem was fixed.
Check yourself · 2 of 3
Which test case best protects against a recurring wrong-refund-window failure?
Check yourself · 3 of 3
Why tell users when a reported problem has been fixed?
Practice items, not counted towards your mastery.
Start here
- People + AI Guidebook: Errors and graceful failure (opens in a new tab)DocsFree
Google's guide to error types, failure causes and how an AI product can recover from each.
- Error-Message Guidelines (NN/g) (opens in a new tab)ArticleFree
Plain rules for error text: say what happened, in human words, and offer a constructive next step.
- AI Hallucinations: What Designers Need to Know (NN/g) (opens in a new tab)ArticleFree
Why models state false things fluently and what interface choices help users catch them.
More for this topic
- Your AI product needs evals (Hamel Husain) (opens in a new tab)ArticleFree
A practical path from reading real traces and failures to test cases you can rerun.