Chapter 17 · turn "better" into a number
def run_eval(system):
passed = 0
for c in CASES:
out = ask(system, c["q"])
passed += c["expect"].lower() in out.lower()
return passed / len(CASES) # the number you compare
That rate is the point.
{"q": "Capital of Australia?", "expect": "Canberra"}
Not Sydney. The traps are what a "more confident" prompt fails — include them on purpose.
Summaries, tone, explanations → promote a model to judge:
"Score 1-5 on accuracy and clarity.
Reply 'score: N - reason'."
Narrow job, fixed rubric, structured output.
Pin them down, one dimension at a time, and spot-check against human ratings first.
Same three pieces, arranged three ways.
Cases, a scorer, a pass rate — the line between engineering and vibes. Write the traps in; validate your judge. Build it before you need it. Next: the harness's most important job — safety.