Transcript → regression test: bad conversations become CI checks
Annotate the turn where a voice agent went wrong; the kit replays the conversation up to it, checks the agent's next move, and a per-tag gate fails the change that brings the bug back.
- Context
- Open-source kit · evaluation layer of LOG-04
- Role
- Author: format, checks, gate, CI
- Shows
- Turning production failures into a regression suite that tells you which rule broke, not just that the score dropped.
- 23
- checkpoints from 12 synthetic annotated conversations
- 23 → 14
- passing checkpoints when mock v2 simulates a "more helpful" prompt change
- 9 / 9
- checkpoints broken by the mock's two injected behaviours that the gate caught; the other 14 stay green
Problem
Every conversational AI team keeps a folder of conversations where the agent did something wrong. It read a bill to the caller's wife, kept chatting during a gas leak, or argued with a customer who asked for a human. The fix ships, and three prompt changes later the bug is back. Nobody notices, because the eval dashboard shows one average and the average barely moved. Yet each of those rules has a price: a missed handoff becomes a complaint, a bill read to the wrong person becomes a GDPR incident, a mishandled gas leak becomes a liability.
How it works
- Annotate, don't rewrite. A transcript stays a transcript. On the turn that matters you add
an
expectblock: tools that must or must not be called, phrases that must or must not appear, a length cap for voice, whether the agent must hand off. - One checkpoint, one decision. Each test replays the recorded history, tool calls and results included, then asks the agent only for its next move. A mistake at turn 2 does not cascade into turn 5, so a red test points at exactly one decision.
- Gate per tag, not on the average. Every conversation is tagged (auth, escalation, safety, privacy…). The gate compares each tag with a baseline and fails the pull request when one drops.
- Runs without a key. Pull-request checks run a deterministic mock agent: they prove the kit, not a prompt. The same tests run on demand against the live agent (Claude with strict tool schemas), with its own baseline, pass^k over repeated trials and zero tolerance on safety, security and privacy. The handshake variants of its test T-012 (T-012a–f, from LOG-05) have been run against three Claude models (results); the kit's own suite has no live baseline yet.
The demo that makes the point
The kit ships with two versions of a mock agent for a fictional Italian utility. Version 2 is the same agent after a "make it more helpful" prompt change: it treats a customer code as proof of identity and talks callers out of a human handoff. The aggregate drops from 23/23 to 14/23, a number that invites a debate. The gate report does not: auth at 46%, escalation at 20%, and outages, safety, security and scope still at 100%, with the nine broken checkpoints listed by name.
Where it sits
Sierra's agent development life cycle, voice-testing platforms like Hamming and Cekura, and Langfuse or Braintrust all turn production failures into tests. At a customer I would start from one of them. This kit is the mechanism in a few hundred lines, so every decision can be argued in an interview: replay to a single checkpoint, gate per tag, checks in the agent's language.
What I learned building it
The first full run found two bugs in my own checks, not in the agent. Accent-insensitive
matching turned "€" into an empty string, so a "never say €" rule failed on every reply. And an
escalate flag next to an explicit handoff check counted the same failure twice. A regression
suite needs tests of its own, so the kit has them.
What I would do differently
Replay is off-policy: it pinpoints one decision but cannot see errors that compound over turns, so the next layer is a simulated-caller suite, which Deployment in a box adds. The kit checks text decisions, not audio (recognition errors, latency, barge-in). The first live runs found three things: one check failed for the wrong reason (it counted words while the prompt asked for two sentences), another failed right answers (a holder-name check), and the runner kept only the first failing trial's reasons, so it now counts every trial's failures. The kit's own suite still needs its baseline.