fix(f1_radio_rag): give the assertion judge the retrieved messages - #30
Merged
Merged
Conversation
Test-suite assertions are judged on the trace input/output only, but the task returned the retrieved messages as a separate top-level context key that the run_tests judge never reads. The groundedness assertions (grounded in the messages; does not invent events absent from them) therefore had no source to verify against, yielding trivial passes and unstable verdicts. Add _suite_task, which folds the messages into input (keeping expected_output out so the judge cannot cheat), and point run_tests at it. evaluate() keeps _rag_task: the ContextRecall and Hallucination metrics read a top-level context arg and are unaffected. README documents the input/output-only judge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
LeoRoccoBreedt
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
f1_radio_ragtest suite checks groundedness assertions — e.g. "grounded in the provided radio messages", "does not invent events absent from the messages", "refers only to drivers named in the messages".But Opik's assertion judge (
run_tests) builds its prompt from only the traceinputandoutput. The task returned the retrieved messages as a separate top-levelcontextkey:So the judge saw
query+summarybut never the messages it was supposed to check against. Every groundedness assertion was effectively unverifiable → trivial passes and unstable verdicts.(The
evaluate()path was already fine:ContextRecall/Hallucinationdeclarecontextas a first-class argument and read the top-level key directly.)Fix
Add
_suite_task, which folds the retrieved messages intoinputso the judge can see them, and pointrun_testsat it:evaluate()keeps_rag_task— the metrics read top-levelcontext, so they are unaffected.expected_outputis deliberately kept out ofinput(per the Building Test Suites docs), so the judge can't use it to pass assertions that should fail.input/output, hence the fold.Verification
python -m py_compileclean onevaluation.py.uv run f1rag evaldry-run path unchanged (no creds needed).🤖 Generated with Claude Code