Lesson 11.07 · Phase 11 · Evaluation & Observability

Replay and regression

Record a run once (every model reply and every tool result) and you can re-run it forever: no API cost, no network, no refunds issued twice. Replay strictly and you'll know the moment anything you send the model changes. Replay leniently through a new version and you'll see the first step where it acts differently. That turns "I only refactored" into something you can check in CI.

Learning objectives

  • Record model calls (with a hash of each request) and tool results into a cassette file.
  • Replay a cassette with no network and no side effects, keyed by call order for the model and by arguments for tools.
  • Use strict replay to detect request drift, and lenient replay to find behavioural divergence in the agent's own code.
  • Know what replay can't tell you, and when you need a live eval instead.

You refactor the code between the model and your tools: tidy up argument handling, add a helper, rename a variable. The unit tests pass. You can't afford to run the full live eval on every commit (it costs money and takes 20 minutes), and when you do run it, it's noisy (Lesson 1). So the refactor ships, and a week later finance notices refunds of $26 on $25.50 orders.

Loading the full lesson…