judge_probe.py¶
scripts/judge_probe.py
Reproduce ONE judge call exactly as the grader makes it, and show the raw failure.
main
int judge_probe.main()
Make one judge call and print the raw result.
Source · 31 lines
def main() -> int:
"""@brief Probe one judge call.
@return Exit code.
@version 1
"""
answer_path = ROOT / sys.argv[1]
rubric = load(ROOT / sys.argv[2])
qid = answer_path.stem.split("_")[0]
question = next(q for q in rubric.questions if q.id == qid)
mark = question.marks[1]
prompt = judge.verdict_prompt(mark.text, judge.anonymise(answer_path.read_text("utf-8")))
print(f"prompt bytes: {len(prompt)}")
argv = [
"claude",
"-p",
prompt,
"--model",
rubric.judge_model,
"--output-format",
"json",
"--allowedTools",
"",
]
done = subprocess.run(argv, capture_output=True, text=True, timeout=300, check=False)
print(f"rc={done.returncode}")
print(f"stdout[:600]: {done.stdout[:600]!r}")
print(f"stderr[:600]: {done.stderr[:600]!r}")
return 0