Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion evaluation/run_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# task-specific data never mix at the top level.
_UNIVERSAL_KEYS = {"reward", "score", "detail", "kind", "passed", "persona",
"criteria", "checks", "verdict", "passed_count", "total_checks",
"points", "max_points"}
"points", "max_points", "error", "status", "error_stage", "stage"}


def _normalize_output(findings: dict, evaluator: str | None) -> dict:
Expand Down
16 changes: 16 additions & 0 deletions evaluation/tests/test_verifier_error_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def test_scored_results_are_not_errors(self) -> None:
"checks": [{"verdict": "HELD"}, {"verdict": "VIOLATED"}, {"verdict": "NOT_ADDRESSED"}]},
):
self.assertIsNone(run_task._verifier_reported_error(findings), findings)
normalized = run_task._normalize_output(findings, "rule-based")
self.assertIsNone(run_task._verifier_reported_error(normalized), normalized)

def test_error_shapes_verifiers_write_are_errors(self) -> None:
for findings in (
Expand All @@ -52,6 +54,20 @@ def test_error_shapes_verifiers_write_are_errors(self) -> None:
):
self.assertIsNotNone(run_task._verifier_reported_error(findings), findings)

def test_normalization_preserves_verifier_errors(self) -> None:
for findings in (
{"reward": 0.0, "stage": "verify", "error": "invalid app output"},
{"reward": 0.0, "status": "judge_error", "detail": "judge failed"},
{"reward": 0.0, "status": "configuration_error"},
{"reward": 0.0, "error_stage": "judge_call", "detail": "judge failed"},
):
with self.subTest(findings=findings):
normalized = run_task._normalize_output(findings, "rule-based")
self.assertEqual(run_task._verifier_reported_error(normalized),
run_task._verifier_reported_error(findings))
if "stage" in findings:
self.assertEqual(normalized.get("stage"), findings["stage"])


class ReportMaxPointsTest(unittest.TestCase):
def test_missing_envelope_takes_denominator_from_score(self) -> None:
Expand Down