Repository navigation
fix(verifiers): a judge the verifier deploys leaves no sandbox folder, and _judged's judge deploy and sample fan-out become helpers - #919
Merged
Conversation
…_judged, and share the run's sample overrides - `_judge_agent_of` finds or deploys the agent judge. - `_judge_agents` holds the judges for the grade and terminates the ones the step deployed. - `_side_by_side` and `_merged_samples` run and merge samples and batches. - `_JudgeOutcome` names the judge call's four results. - `judge_samples.overrides` builds the run overrides that bundle runs, `task run` and `eval run` each built by hand. - `splits` and `disagreement` share one tally. One judge and one batch still run in the caller's task, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
marked this pull request as ready for review
November 25, 2026 03:21
… behind A run's teardown removes the work folders of the sandboxes it records. A judge the verifier deploys isn't recorded, so `_terminate_auto_deployed_judge` stopped its container and left its folder in the local sandbox directory: one per grade, and since judge samples, one per sample. Once the sandbox is terminated, it now removes the folder when the sandbox ran on this machine, as the gateway provider does after a failed deploy. It keeps the folder of a sandbox it couldn't terminate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What changes
Two changes after #905: one fix, and a refactor that changes no behavior.
The fix. A judge the verifier deploys left its sandbox folder in the local sandbox directory. Main does this too: one folder per grade, and since judge samples, one per sample.
_terminate_auto_deployed_judgestopped the judge's container and nothing removed its folder.remove_local_work_dir), as the gateway env provider does after a failed deploy.The refactor.
RubricsVerifierTaskStep._judgedhad grown to 434 lines with eight nested functions. This PR moves its judge setup and its fan-out into helpers of their own, and the method drops to 357 lines._judge_agent_of(context, run): finds the task's agent judge (agent_name), or deploys one with the run's model key and endpoint. This code was inline in a closure._judge_agents(make, count): an async context manager that holds the grade's agent judges: none for a direct judge, one, or one per sample. It terminates each one the step deployed on the way out. It replaces the hand-written task group, the cleanup on a failed deploy, and thefinallyat the end of grading._side_by_side(calls): runs coroutines at once and raises the first failure as itself. It replaces two copies of the TaskGroup-and-unwrap code, one for samples and one for batches._merged_samples(outcomes): merges a batch's samples into one outcome: median rows, summed retries, discrepancies named by sample, the first trajectory._JudgeOutcome: aNamedTuplefor the four results_run_judge_with_output_retriesreturns. Code readso.rowsando.retriesinstead of unpacking_, _, ds, _. It's still a tuple, so subclasses and test stubs that return plain tuples work unchanged.judge_samples.overrides(samples, bar): builds the run overrides.bundle/run.py,task runandeval runeach built them by hand, with the same asymmetry: a count is left out when it's None, but a bar of 0 is kept.judge_samples.py:splitsanddisagreementshare one tally of passes. A local variable no longer shadowssplits, and both functions use one test for a sampled row.One judge and one batch still run in the caller's task, as before #905, so the one-sample path runs the same code.
Tests
tst/unit/task_step, the bundle-run and CLI tests. The 4 tests incomputer_exec_test.pyfail on macOS before and after this change, because they shell out with GNU tools.test_rubrics_verifier_judge_samples.pyadds two assertions onjudge_samples.overrides.test_rubrics_verifier_judge_teardown.pychecks the fix three ways: a judge on this machine has its folder removed, one elsewhere has nothing removed, and one whose terminate failed keeps its folder. Three test fakes of a sandbox now declareON_THIS_MACHINE, as every real sandbox does through theSandboxbase.E2E
Run on an admin VM through the real LiteLLM proxy, behind the logging pass-through and grade checker that #905's rounds used, on 8601fab beside main af545d9, then on c39ba7c for the fix. It spent about $7.20.
Scenarios, 25 of 25:
One sample, beside main: seven bundle tasks graded the same on both. They cover a direct judge, an agent judge the verifier deploys, the task's own judge, an always-on judge, partial samples and
user_sim_judge.A judge per sample:
Agreement:
retry_configgraded again, its line namingJudgeDisagreementError.judge-agent-effortat 3 samples passed with c2 named as split, and at 1.0 failed on it.Chaos: 15 minutes, 119 runs with 0 crashes. The runs varied the model, the sample count (82 runs sampled), the bar (53 runs set one), the format, and injected proxy and store faults.
Agent-judge chaos: 30 real
agent-env runs of verifier-deployed, task-deployed and always-on judges at 1 to 5 samples. That chaos above used direct judges only, and these are the paths_judge_agent_ofand_judge_agentstook over. After every run a checker looked for containers left up, sandbox folders left behind and tracebacks._judge_agentsterminated every one.AgentUnreachableErrornaming it, the run exited 1, and the other samples' judges were terminated.LocalSandbox.terminate()keeps the folder, and teardown removes only the folders of sandboxes a run records. Main left one folder at one sample and two at two. This PR now fixes it.The fix, on c39ba7c: 9 more runs. They covered:
None left a judge folder, any other sandbox folder, or a container.
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no actionable new issues were found.Summary
Extracts judge setup, cleanup, parallel calls, and sample merging into helpers. Shares sample overrides across bundle and CLI runs.
Reviews (7) · Last reviewed commit: "fix(verifiers): a judge the verifier dep..." · Reviewed by Greptile