CourseAI Engineering: The Complete Course · Module 12: Evaluation and Observability · part 92 of 105
Part 92 · Module 12: Evaluation and Observability

Lab: An eval harness with traces and a gate

17 min read·13 Oct 2026
Module 12 · Lab · About 60 minutes · Needs: lessons 1 and 2 of this module (evaluation, observability)

What you are building

WHAT YOU BUILD: EVALS, TRACES AND A GATE eval set 10 cases, JSON harness engine + scores 21 hosted calls v1, v2 results traces.jsonl exit 0: ship exit 1: block every score links to its span tree by trace_id
The finished piece: an eval set feeds the harness (blue, your system), runs and traces are saved, and a gate passes (green) or blocks (red) the change.

Dev still wants to shorten the answer engine's prompt, and Priya still wants to know whether Tom will hear about the 30-day window. This lab builds the piece Module 12 adds to BrightCart: tests that tell you whether a change made the assistant better or worse. A harness runs the engine over a 10-case eval set saved as JSON, scores key facts and groundedness by word overlap, and saves each run under its prompt version. Every model call is traced with Lesson 2's tracer, so each score links to a span tree with latency, tokens and cost. Two prompt versions are compared case by case, and a gate script fails the release when correctness drops. One run makes 21 hosted calls and no judge calls.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.