Skip to content

Commit 49d5ee9

Browse files
kentwelcomeclaude
andcommitted
fix(dab): isolate per-query validator failures in verify_batch
A validator raising (e.g. validate_qN calling .lower() on a non-string answer when the agent returns a JSON list) aborted emit_reward for the whole dataset, so no reward.json was written and the entire dataset was dropped from the run as a RewardFileNotFoundError trial error — silently removing it from the stratified Pass@1 denominator rather than scoring 0. Wrap the per-query validate_fn call in try/except: score the offending query 0.0 with the exception as the reason and continue grading the rest. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c2dd2c3 commit 49d5ee9

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • packages/razorback-plugin-dab/src/razorback_plugin_dab/verify

packages/razorback-plugin-dab/src/razorback_plugin_dab/verify/verify_batch.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ def emit_reward(
2424
answer = answers.get(key, "") if isinstance(answers, dict) else ""
2525
validate_fn = _load_validate(validators[query_id])
2626
if answer:
27-
is_valid, reason = validate_fn(answer)
27+
# Isolate per-query validator failures: a single validator raising
28+
# (e.g. a validator calling .lower() on a non-string answer) must NOT
29+
# abort grading for the whole dataset — that would write no reward.json
30+
# and silently drop the entire dataset from the run (RewardFileNotFoundError).
31+
# Score the offending query 0 with the error as the reason and continue.
32+
try:
33+
is_valid, reason = validate_fn(answer)
34+
except Exception as exc: # noqa: BLE001 — robustness boundary, any validator error
35+
is_valid, reason = False, f"validator error: {type(exc).__name__}: {exc}"
2836
else:
2937
is_valid, reason = False, "empty answer"
3038
reward = 1.0 if is_valid else 0.0

0 commit comments

Comments
 (0)