-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevals.html
More file actions
403 lines (374 loc) · 30.1 KB
/
Copy pathevals.html
File metadata and controls
403 lines (374 loc) · 30.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Kompass Docs — Eval Learnings Log</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,700;0,9..40,800;1,9..40,500&family=DM+Mono:wght@400;500&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="assets/style.css" />
</head>
<body>
<nav class="nav">
<div class="nav-inner">
<a class="brand" href="index.html"><span class="compass">🧭</span> Kompass Docs</a>
<div class="nav-links">
<a href="index.html">Overview</a>
<a href="architecture.html">Architecture</a>
<a href="evals.html" class="active">Evals</a>
<a href="product.html">Product</a>
<a href="design.html">Design</a>
<a href="user-stories.html">User Stories</a>
<a href="index.html#flow">Flow Demo</a>
</div>
</div>
</nav>
<div class="wrap">
<header class="hero">
<span class="eyebrow">Eval-driven development · a living log</span>
<h1 class="page-title">What we <span class="grad">learned</span> by measuring the agent instead of vibing it</h1>
<p class="lead">Anyone can prompt an LLM into building a travel agent demo. The differentiator is proving it
works — and keeps working — with a repeatable, numeric harness. This page is the running receipt: every
time <code>evals/run.py</code> surfaces something real, it gets an entry below, with the before/after
evidence. It's updated every time we discover something new, not rewritten after the fact.</p>
</header>
<!-- SNAPSHOT -->
<section id="snapshot" style="padding-top:8px">
<div class="stats">
<div class="stat"><div class="num">30</div><div class="lbl">Golden cases</div></div>
<div class="stat"><div class="num">7</div><div class="lbl">Categories · 10 evaluators</div></div>
<div class="stat"><div class="num">4</div><div class="lbl">Real regressions caught</div></div>
<div class="stat"><div class="num">99.3%</div><div class="lbl">Executed assertions, latest full run</div></div>
</div>
</section>
<!-- WHY -->
<section id="why">
<span class="eyebrow">Why this page exists</span>
<h2>"It got better" is a vibe. A pass-rate delta is a fact.</h2>
<p class="lead">Every entry below follows the same loop: the eval suite measures something, a specific number
moves or a specific run fails, we root-cause it, we fix it at the right layer (never by begging the model
harder in the prompt), and we re-run to confirm. That loop — not the travel-planning demo itself — is the
part that's hard to fake and expensive to skip.</p>
<div class="grid cols-3">
<div class="card"><div class="icon i-pink">🩻</div><h3>Blind spots, made visible</h3>
<p>60 pytest tests covered <em>code</em> and stayed green the whole time the model was silently reporting
wrong subtotals. Only a behavioral eval — the real LLM, a real prompt, adversarial fixtures — caught it.</p></div>
<div class="card"><div class="icon i-purple">🎯</div><h3>Attributable, not anecdotal</h3>
<p>The data layer (flights, hotels, research) is faked deterministically, so when a number moves, it can
only be the model or the prompt — never "Kiwi changed its prices today."</p></div>
<div class="card"><div class="icon i-blue">🧯</div><h3>Root cause over prompt-pleading</h3>
<p>The headline finding below is deliberately <em>not</em> "we told Gemini to be more careful with math."
Arithmetic moved out of the model's job entirely — evals are what make that kind of fix findable.</p></div>
</div>
</section>
<!-- THE LOG -->
<section id="log">
<span class="eyebrow">The log</span>
<h2>Every discovery, in order</h2>
<p class="lead">Chronological, oldest first — each entry is appended when a run teaches us something, never
edited after the fact to look tidier. Full mechanics of the suite (fixtures, evaluators, harness) live in
<a href="evals.md">docs/evals.md</a>.</p>
<div class="timeline">
<div class="t-item">
<span class="pill phase">Phase 1 · 2026-07-04</span>
<b>Making the agent evaluable headless nearly broke on a tool that doesn't exist headless</b>
<p><code>ask_clarifying_question</code> is a <em>frontend</em> tool (CopilotKit's human-in-the-loop card) —
it has no implementation outside the browser. The first headless runs silently burned their output-retry
budget every time the model reached for it. <b>Learning:</b> evaluability isn't free; it required a
scripted stub toolset in the harness from day one, and extracting <code>ResearchServicePort</code> so
grounded web search could be swapped for a fake like every other data source. All 59 pytest tests stayed
green through the refactor.</p>
</div>
<div class="t-item">
<span class="pill phase">Phase 2 · 2026-07-04</span>
<b>First golden baseline: 12 cases, 6 categories, 93.8% — and it immediately paid for itself</b>
<p>The very first live run against production <code>gemini-2.5-flash</code> flagged one assertion,
<code>itemized_costs_sum_to_subtotals</code>, at 75%. Everything else — budget caps, direct-only
<code>max_stops=0</code>, no-red-eye legs, party-size propagation, empty-route fallback, per-island
lodging — passed cold on the first try.</p>
</div>
<div class="t-item">
<span class="pill done">Fixed · 2026-07-04</span>
<b>Headline finding: Flash can gather six flight/hotel line items correctly and still fail to add them up</b>
<p>Diagnosis of the failing island-hop run showed the model's itemized legs and hotels were <em>correct
and complete</em> — but the subtotals it reported were fiction: transportation €600 when its own six legs
summed to €1252. This is a data-gathering success and a pure arithmetic failure.</p>
<div class="bar"><span style="width:75%"></span></div>
<p style="margin-top:4px;font-size:13px">Before — <code>itemized_costs_sum_to_subtotals</code>: <b>75%</b> (9/12)</p>
<p style="margin-top:10px"><b>Fix:</b> stopped delegating arithmetic to the model. <code>generate_scenarios</code>
now re-derives <code>transportation</code>/<code>accommodation</code> subtotals by summing the model's own
<code>Leg.cost</code> / <code>Accommodation.cost</code> line items server-side, then the grand total from
those subtotals — deterministic code, not a prompt plea. A new unit test
(<code>test_generate_scenarios_normalizes_subtotals_from_line_items</code>) locks it in.</p>
<div class="bar green"><span style="width:100%"></span></div>
<p style="margin-top:4px;font-size:13px">After re-run — <code>itemized_costs_sum_to_subtotals</code>: <b>100%</b>, every category 100%.</p>
<div class="callout"><b>Why it matters:</b> the assertion flipped from a <em>model signal</em> into a
<em>pipeline invariant guard</em> — it now exists to catch anyone who accidentally removes the
normalization, which is exactly what a regression test should do.</div>
</div>
<div class="t-item">
<span class="pill info">Noted · 2026-07-04</span>
<b>Fixing one thing surfaced the next: heavy single-plan synthesis is flaky</b>
<p>Re-running the full suite after the cost fix landed a new, different failure: the heaviest case in the
set (a 12-day Greek island hop rendered as <em>one</em> fully-detailed plan) passed in the baseline but
errored on the very next run with <code>UnexpectedModelBehavior: Exceeded maximum output retries</code>.
Flagged rather than chased immediately — a single data point isn't a diagnosis, it's a reason to run a
variance study.</p>
</div>
<div class="t-item">
<span class="pill phase">Phase 3 · 2026-07-05</span>
<b>Dataset grown 12 → 30 cases; the suite learned to judge things a Python <code>assert</code> can't</b>
<p>Added human-in-the-loop cases (does the agent ask when info is genuinely missing, and stay quiet when
it isn't?), multi-turn refinement cases (shared <code>message_history</code> across turns — "now add a
cheaper option", "make it for 4 people instead"), and a small LLM-as-judge (<code>evals/judge.py</code>)
for soft criteria no deterministic check can express: is the chat reply a concise recommendation rather
than a wall of prose, and do the day-by-day activities actually match the requested vibe ("relaxed
foodie", "adventure hiking")? The judge is deliberately decoupled from the agent under test — see below.</p>
</div>
<div class="t-item">
<span class="pill info">Noted · 2026-07-05</span>
<b>A "28 cases failed" run taught a meta-lesson: don't trust a red run before you've ruled out infra</b>
<p>The first full variance pass (30 cases × 3 repeats at concurrency 6) came back with almost everything
"erroring." Reading the actual error bodies showed <code>429 RESOURCE_EXHAUSTED</code> quota errors and
<code>504 DEADLINE_EXCEEDED</code> timeouts — the harness was firing more concurrent Gemini requests than
the API tier allows, not a model or prompt regression. <b>Practice adopted:</b> re-run flagged cases at
low concurrency before treating any failure as a real signal; the runner's per-case aggregation now
separates <code>error_runs</code> from genuine assertion failures for exactly this reason.</p>
</div>
<div class="t-item">
<span class="pill done">Isolated · 2026-07-05</span>
<b>After removing the noise: a clean, real signal — two heavy-synthesis cases genuinely fail</b>
<p>At safe concurrency, 22 of 30 cases ran clean with <b>100%</b> of executed assertions passing —
budgets, currency propagation, direct-only, no-red-eye, party-size (solo through groups of 6), ferry/rail
multi-city chains, HITL ask/don't-ask, multi-turn refinement, and the LLM-judge criteria all held.
Re-running the 8 flagged cases individually separated 6 transient infra errors from <b>2 reproducible</b>
failures: <code>greek_island_hop_single_plan</code> and <code>vibe_relaxed_foodie</code> — both single,
maximally-detailed 12-day plans — consistently hit
<code>UnexpectedModelBehavior: Exceeded maximum output retries</code>. Root cause: on a very large
final-synthesis context, Flash intermittently returns an empty completion with no first token.</p>
</div>
<div class="t-item">
<span class="pill partial">Open · 2026-07-05</span>
<b>Tried the obvious fix; it wasn't enough — logged as open, not papered over</b>
<p>Raised the agent's output-retry budget from the pydantic-ai default of 1 to 2
(<code>retries={'tools': 2, 'output': 2}</code>) to give a large synthesis a second chance at a
non-empty completion. Re-verified on the same two cases: <b>still fails</b>, now as
<code>Exceeded maximum output retries (2)</code>. This is the honest outcome of the loop, not a hidden
one — the fix has to be architectural (lighten the day-by-day detail the prompt asks for in single-plan
mode, or split the synthesis into two calls), and that's queued as the next thing the eval suite will
verify once it ships.</p>
</div>
<div class="t-item">
<span class="pill info">Improved · 2026-07-05</span>
<b>Made the eval config itself a first-class, observable setting</b>
<p>The LLM judge now defaults to <code>gemini-2.5-flash-lite</code> — cheap and plenty for a boolean
rubric — while the agent under test stays on whatever ships in <code>LLM_MODEL</code>, so a judge-cost
optimization can never quietly change what's actually being measured. Both are configurable three ways
(CLI flag → env var → default) via <code>EVAL_MODEL</code> / <code>EVAL_JUDGE_MODEL</code> in
<code>backend/.env</code>, and every JSON report now records exactly which model played which role for
full reproducibility.</p>
</div>
<div class="t-item">
<span class="pill done">Fixed · 2026-07-05</span>
<b>Three fix-verify loops off one full run: an evaluator false-negative, an ambiguous prompt, and a real fabrication bug</b>
<p><b>1) False-negative in the harness itself:</b> <code>infeasible_budget_no_fabrication</code> failed
<code>produced_a_plan</code> for correctly <em>refusing</em> to invent a plan for an impossible budget —
the evaluator, not the agent, was wrong. Fixed by skipping that assertion when
<code>CaseMeta.budget_infeasible</code> is set. <b>2) Ambiguous case wording:</b>
<code>multi_city_rail_europe</code> said Prague→Vienna must be "BY TRAIN" but left the Berlin legs
unspecified — the model reasonably flew them, failing <code>ground_legs_present</code>. Reworded to
"no flights at all, including the way back" and added explicit <code>forbidden_tools</code>.
<b>3) The real one:</b> <code>group_of_six_propagation</code> — phrasing the travelers as "a group of
friends" instead of "6 people" made the agent skip <code>search_flights</code>/<code>search_accommodations</code>
entirely and hand-wave numbers straight into <code>generate_scenarios</code>. Casual framing was being read
as license to skip the tools. Fixed with a new system-prompt directive: informal phrasing describes the
travelers, never a license to fabricate prices.</p>
<div class="bar green"><span style="width:100%"></span></div>
<p style="margin-top:4px;font-size:13px">All three cases: <b>3/3</b> repeats clean after their fix; the
full 30-case suite re-run confirmed no regressions.</p>
<div class="callout"><b>Also surfaced, still open:</b> <code>already_have_flights_zero_transport</code>
reproducibly hits <code>504 DEADLINE_EXCEEDED</code> even run in isolation with extended timeouts — a
Google-side infra issue pydantic-ai's retry logic doesn't currently absorb. The output-retry-exhaustion
issue above has now also been seen on <code>refine_change_party_size</code> and
<code>empty_route_falls_back_and_flags_estimated</code> — logged as open rather than quietly ignored.</div>
</div>
<div class="t-item">
<span class="pill info">Shipped · 2026-07-05</span>
<b>Langfuse wired into the eval suite — eval traces now tell themselves apart from live traffic</b>
<p>Every case run now flows through the same Langfuse/OpenTelemetry pipeline as production
(<code>app/telemetry.py</code>), tagged <code>environment="eval"</code>, <code>session_id=<run
timestamp></code> (groups every case + repeat of one <code>evals.run</code> invocation into one Langfuse
session), <code>trace_name=<case name></code>, and <code>tags=["kompass-eval", <category>]</code>.
Production traces got the mirror-image <code>environment="production"</code> so the two populations never
mix in a shared Langfuse project.</p>
<p style="margin-top:10px"><b>Verified live, not just wired:</b> ran
<code>evals.run --case group_of_six_propagation</code> and queried the Langfuse API directly — the trace
landed with <code>environment=eval</code>, <code>traceName=group_of_six_propagation</code>,
<code>sessionId</code> matching the run's timestamp, and <code>eval_category</code>/<code>eval_repeat</code>
metadata on every span, alongside the full token/cost/tool-call detail pydantic-ai already emits.</p>
<div class="callout"><b>Why it matters:</b> every case in the entry above was root-caused with a throwaway
<code>_debug_case.py</code> script and raw stdout. Next time, it's a Langfuse query — filter
<code>environment = eval</code>, <code>traceName = <case></code> — and see the model's exact
reasoning and tool-call arguments for every attempt, with zero one-off scripts and zero noise in
production dashboards. See <a href="evals.md#10-langfuse-observability-telling-eval-traces-from-live-traffic">evals.md §10</a>
for the mechanics.</div>
</div>
<div class="t-item">
<span class="pill info">Debugged via Langfuse · 2026-07-05</span>
<b>First real debugging session using the new Langfuse wiring — and it paid off in two clicks, not a custom script</b>
<p>A full 30-case run flagged <code>empty_route_falls_back_and_flags_estimated</code> failing
<code>prices_flagged_estimated</code>. Instead of writing a throwaway debug script, filtered Langfuse to
<code>environment = eval</code>, <code>traceName = empty_route_falls_back_and_flags_estimated</code>, and
read the <code>generate_scenarios</code> tool call directly: the model's own <code>reasoning_summary</code>
said <em>"the total cost is an estimate due to flight prices being sourced from web search"</em> — but the
structured <code>estimated</code> argument it actually passed to the tool was <code>false</code>. Right
reasoning, wrong structured output — the same failure shape as the itemized-costs bug (§7 in
<a href="evals.md">evals.md</a>), just far less frequent.</p>
<p style="margin-top:10px"><b>Quantified before acting:</b> repeated the case 9 more times rather than
prompt-patching off one sample. Result: <b>8/9</b> passed <code>prices_flagged_estimated</code> cleanly —
genuine low-rate model flakiness, not a deterministic bug, so left unfixed rather than overfitting a prompt
change to one data point.</p>
<div class="callout"><b>Bonus finding — revised, not resolved:</b> one of those 9 repeats hit the
<em>known-open</em> <code>Exceeded maximum output retries (2)</code> error — but on this small, single-leg
case, not a heavy multi-day synthesis. The trace showed the empty completion firing right after a plain
<code>search_web</code> response, before <code>generate_scenarios</code> was ever called. That downgrades
"large final-synthesis context" from root cause to correlation — the real trigger looks like an
intermittent Flash empty-completion glitch on any post-tool-call turn. Still open, still needs an
architectural fix, but now a more accurate diagnosis of what to fix.</div>
</div>
<div class="t-item">
<span class="pill done">Shipped · 2026-07-05</span>
<b>Langfuse dataset runs — eval scores are now browsable version-over-version, not just per-run</b>
<p>Roadmap item 3.5, done. The trace tagging shipped earlier answers "let me look at <em>this</em> run";
this closes the loop with the other question — "how did case <em>X</em>, or category <em>Y</em>, score across
<em>every</em> run and prompt/model version?" Each <code>evals.run</code> now mirrors the golden set into a
Langfuse dataset (<code>kompass-golden</code>) and publishes the run as a <b>dataset run</b>: one item-run per
case linked to its agent trace, one <code>BOOLEAN</code> score per assertion, plus per-category and overall
<code>NUMERIC</code> scores on the run itself — so Langfuse's dataset comparison view charts and diffs score
history across versions.</p>
<p style="margin-top:10px"><b>Design — mirror, don't re-run:</b> kept pydantic-evals as the source of truth
rather than re-scoring on Langfuse's own experiment runner (which would double the model spend). The catch was
linking each Langfuse score to the right case: pydantic-evals owns the execution loop, so
<code>evals/tasks.py</code> wraps each case in a Langfuse span and stamps its trace id onto the
<code>ReportCase</code> via <code>set_eval_attribute("langfuse_trace_id", …)</code> — an exact, per-row link.
<code>evals/langfuse_dataset.py</code> then does the sync + publish; failed cases (which lose their attributes)
fall back to a per-run trace registry. On by default when Langfuse keys are set, skippable with
<code>--no-langfuse-dataset</code>, a no-op otherwise.</p>
<div class="callout"><b>Verified live, not just wired:</b> ran a single-case <code>evals.run</code> and queried
the Langfuse API back — the dataset run was created, its item linked to the agent trace, and all four assertion
scores plus <code>overall_pass_rate</code> and <code>category:human_in_the_loop</code> run-level scores were
confirmed present. 67 backend tests green. See
<a href="evals.md#101-langfuse-dataset-runs-score-history-across-versions">evals.md §10.1</a> for the mechanics.</div>
</div>
<div class="t-item">
<span class="pill done">Verified · 2026-07-05</span>
<b>First full 30-case run through the dataset-run publisher — clean, plus one Langfuse tidiness fix</b>
<p>Ran the whole suite (<code>uv run python -m evals.run</code>, <code>gemini-2.5-flash</code> agent /
<code>flash-lite</code> judge): <b>29/30 cases clean with 100% of executed assertions passing</b> across all
seven categories. The one failure was the <em>known-open</em> <code>greek_island_hop_single_plan</code>
output-retry exhaustion (§9), plus a transient <code>503</code> from the judge model on one case (infra
noise, not a regression). The Langfuse dataset run published correctly and was verified back via the API:
<b>30/30 run items linked to their agent traces</b> — including the failed case, linked via the trace registry
fallback and flagged <code>task_error=1</code> — with per-assertion scores and the run-level
<code>overall_pass_rate</code>/<code>category:*</code> aggregates all present.</p>
<div class="callout"><b>Tidiness fix the run surfaced:</b> the dataset run and per-case eval traces were all
correctly tagged <code>environment=eval</code>, but a handful of stray <code>agent run</code> traces were
landing in the <code>default</code> environment. Root cause: the <b>LLM-as-judge</b> runs inside evaluators,
<em>after</em> the task and outside the per-case trace context, so its calls weren't inheriting the eval tags.
Fixed by wrapping the judge's own run in <code>trace_attributes(environment="eval", trace_name="judge",
tags=["kompass-eval","judge"])</code> (and naming the agent <code>kompass_judge</code>) — verified the judge
call now lands as a <code>judge</code> trace in <code>environment=eval</code>. Pre-existing, not caused by the
dataset-run work, but caught because the full run made it visible. 67 backend tests green.</div>
</div>
<div class="t-item">
<span class="pill done">Fixed · 2026-07-05</span>
<b>Dataset runs were API-visible but the Langfuse <em>Experiments</em> tab was empty — made each case a real experiment item</b>
<p>Follow-up to the dataset-run work above: the runs existed and every score was present via the API, yet the
dataset's <b>Experiments</b> tab showed "No data". Root cause: linking a trace to a run with the low-level
<code>api.dataset_run_items.create</code> call produces a valid dataset run, but the Experiments tab only
surfaces traces that the SDK's own <code>run_experiment()</code> marks as <b>experiment items</b> —
<code>environment="sdk-experiment"</code> plus a set of <code>langfuse.experiment.*</code> span attributes. Our
traces were tagged <code>environment=eval</code> with none of those attributes, so they never qualified.</p>
<div class="callout"><b>Fix:</b> replicate exactly what <code>run_experiment()</code> does per item, minus
re-running the agent (keeping pydantic-evals as the executor). During the run, <code>tasks.py</code> now calls
<code>create_run_item()</code> (links the case's own agent trace to the run) and <code>experiment_context()</code>
(flips the root span to the <code>sdk-experiment</code> environment and propagates the experiment identity —
id/name/dataset/item — to the agent's child spans via the SDK's own propagation helper). Scores are written in
that same <code>sdk-experiment</code> environment so the tab's score columns line up. <code>publish_report()</code>
is now scores-only (the run + items are created during the run). Verified via the API: each case's trace lands in
<code>sdk-experiment</code> with a linked run item, and <code>task_error</code>/assertion/run-level scores are
present in that environment. Also hardened a latent crash — <code>report.case_groups</code> is a method, not a
list, so the empty-<code>report.cases</code> fallback (every case errored) used to raise
<code>TypeError</code>. 67 backend tests green.</div>
</div>
<div class="t-item">
<span class="pill partial">Open · 2026-07-05</span>
<b>Migrating the agent's model to a cheaper tier paid for itself — and cost one honest regression</b>
<p>Swapped the agent-under-test default from <code>gemini-2.5-flash</code> to
<code>gemini-3.1-flash-lite</code> (<code>app/config.py</code>; the judge stayed decoupled on
<code>gemini-2.5-flash-lite</code> on purpose) and validated the switch with a same-day A/B rather than
trusting the model card. A <code>--concurrency 4</code> run on the old model came back noisy — several
categories (<code>human_in_the_loop</code>, <code>itinerary_quality</code>) produced zero assertions after
<code>429 RESOURCE_EXHAUSTED</code> quota errors ate most of the run, landing 62/63 (98.4%) of what did
execute. Re-running at <code>--concurrency 2</code> on the new model completed cleanly across all seven
categories — 152/153 (99.3%) — at roughly <b>34% lower</b> per-case token cost.</p>
<div class="callout"><b>Not just faster and cheaper — the same A/B caught a real regression:</b>
<code>infeasible_budget_no_fabrication</code> now fails <code>no_overbudget_plan</code> (0/1). Given a
deliberately impossible budget, the old model correctly declined it; the new, cheaper model instead
produces a plan that blows the budget — a fabrication-adjacent failure this case exists specifically to
catch. The model swap shipped anyway (a clear win on 6 of 7 categories plus real cost savings), but this
regression is logged <b>open</b>, not quietly absorbed into a headline pass-rate that still looks good.</div>
</div>
<div class="t-item">
<span class="pill done">Fixed · 2026-07-06</span>
<b>The judge itself started 503ing under load — wrapped it in a fallback chain instead of hoping it clears up</b>
<p><code>gemini-2.5-flash-lite</code> (the default <code>EVAL_JUDGE_MODEL</code>) began returning
<code>503 UNAVAILABLE</code> ("high demand") on judge-backed assertions
(<code>concise_recommendation</code>, <code>vibe_matches_activities</code>) — a transient Google-side
capacity ceiling, not a prompt or model problem, but enough to silently drop a check or fail a whole run.</p>
<p style="margin-top:10px"><b>Fix:</b> <code>judge.py</code> now wraps the judge agent in PydanticAI's
<code>FallbackModel</code>, retrying the next model in the new <code>EVAL_JUDGE_FALLBACK_MODELS</code> env
var (default <code>google:gemini-2.0-flash-lite,google:gemini-2.5-flash</code> — separate Gemini capacity
pools) on any <code>ModelAPIError</code>, which covers 503s. Only the judge gets the fallback chain; the
agent-under-test's own model is untouched, since decoupling the judge from prod is the whole point
(<a href="evals.md#6-evaluators--assertions">evals.md §6</a>).</p>
<div class="callout"><b>Verified, not just wired:</b> confirmed the judge agent resolves to a
<code>FallbackModel</code> wrapping all three tiers, then made a live judge call end-to-end and got a
correct verdict back.</div>
</div>
</div>
<div class="callout" style="margin-top:30px">
<b>Next entry TBD.</b> This section grows every time <code>uv run python -m evals.run</code> teaches us
something — a new regression caught, a threshold set from variance data, or a CI gate landing in Phase 4.
</div>
</section>
<!-- HOW TO REPRODUCE -->
<section id="reproduce">
<span class="eyebrow">Reproduce it yourself</span>
<h2>Every claim above is one command away</h2>
<div class="table-wrap">
<table>
<thead><tr><th>What</th><th>Command</th></tr></thead>
<tbody>
<tr><td>Full suite, prod model</td><td><code>cd backend && uv run python -m evals.run</code></td></tr>
<tr><td>One case</td><td><code>uv run python -m evals.run --case greek_island_hop_single_plan</code></td></tr>
<tr><td>Variance study</td><td><code>uv run python -m evals.run --repeat 3 --concurrency 3</code></td></tr>
<tr><td>Override the judge model</td><td><code>uv run python -m evals.run --judge-model google:gemini-2.5-flash-lite</code></td></tr>
<tr><td>Live results dashboard</td><td><code>uv run python -m evals.dashboard</code> → <code>http://localhost:8420</code></td></tr>
<tr><td>Skip Langfuse dataset run</td><td><code>uv run python -m evals.run --no-langfuse-dataset</code></td></tr>
</tbody>
</table>
</div>
<div class="callout"><b>Cost/keys.</b> Real runs call Gemini and spend tokens (needs <code>GOOGLE_API_KEY</code>).
The data layer (flights/hotels/research) is faked, so no paid third-party API calls are made.
<code>artifacts/</code> (the JSON reports) is git-ignored — reports stay local; this page is the durable
record of what they found.</div>
</section>
<footer class="footer">
Full technical reference: <a href="evals.md">docs/evals.md</a>
· Architecture: <a href="architecture.html">architecture.html</a>
</footer>
</div>
</body>
</html>