fix(agent): judge fails an assertion when one repeated value contradicts it
Merged
OK
2mo ago+121+121+012345678901234567890123456789-5-5-0123456789
An external review of e2e found agent.assert passing a wrong checkout total because another summary on the same page showed the right one. The judge had no rule for a value shown twice.
- New rule in
JUDGMENT_REQUEST(packages/e2e/src/agent/prompts.ts): a value or state shown in more than one place holds only when every place agrees. One contradicting place isfails. - An instruction that names the place (
the order summary total is $42.00) is judged on that place alone. - Scoped to one value shown twice. A claim about some item (
a todo is marked done) still holds when one item matches. - Applies to
waitFortoo, since it uses the same judge. - Testbed
/checkoutpage with a planted bug: after a quantity change the summary total updates, the "Pay" button keeps the old amount. - Four judgment tests in
apps/testbed/tests-agent/judgments.e2e.ts: the conflicting total must fail, plus three controls that must still hold (the named summary total beside the stale pay button, a correct line total, and "a todo is marked done" with one of two done).
Verified
Ran it locally: yes
- testbed agent suite,
pnpm --filter @e2e-dev/testbed test:agent --grep ... --repeat-each Nthrough the AI Gateway
The judge must reject "the order total is $42.00" when the summary shows $42.00 and the pay button shows $18.00:
| model | main | this branch |
|---|---|---|
| openai/gpt-6-luna-fast | 0/4 caught | 6/6 caught |
| anthropic/claude-sonnet-5-5 | 0/4 caught | 6/6 caught |
- Whole
judgments.e2e.ts(all controls included) with--repeat-each 5: 45/45 on each model. - Without the named-place line,
the order summary total is $42.00failed 12/12 across both models; with it, it holds every time. - Full testbed agent suite on the default model: 26/26.