def build_judge_command()

in project/paperbench/paperbench/nano/utils.py [0:0]


def build_judge_command(judge: "JudgeConfig", task: "PaperBenchTask") -> str:  # type: ignore
    """Builds the command to run the judge."""

    cmd = [
        "/opt/conda/envs/grader/bin/python",  # Use the conda env installed in `pb-grader`
        f"{WORKSPACE_BASE}/run_judge.py",  # Assumes judge script exists here
        f"--submission-path {SUBMISSION_DIR}",
        f"--paper-id {task.paper_id}",
        f"--judge {judge.scaffold}",
        "--out-dir /output",
    ]

    if judge.model not in ("dummy", "random"):
        cmd.extend(["--model", judge.model])

    if judge.reasoning_effort:
        cmd.extend(["--reasoning-effort", judge.reasoning_effort])

    if judge.code_only:
        cmd.append("--code-only")

    if judge.max_depth:
        cmd.extend(["--max-depth", str(judge.max_depth)])

    return " ".join(map(str, cmd))