Repository navigation
feat(verifiers): judge_samples keeps each criterion's median of N judge calls, and min_judge_agreement can fail a split - #905
Merged
Conversation
…orker, without a garbage collection that held the loop Its deadline started before a gc.collect() that, in a test worker's large heap, can take seconds; the wait then ended before the nameserver's replies came back, so it failed on CI across PRs. The collection couldn't catch the bug it was added for either (a task waiting on a socket is reachable from the loop's reader); the async lint guards that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… times and keeps its median A rubric_binary or rubric_partial judge given judge_samples N (a step field, a run override, or --judge-samples on run, task run, task run-batch and eval run) grades each criterion N times, each sample a call of its own under the judge's batch concurrency, and keeps each criterion's median: the row of the first sample that scored it, with every sample's score and justification in samples. Each call's record names its sample; a sample that fails fails the grade. N must be odd; a format without one score a row refuses it at load, and a run's count it can't take is recorded in not_sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dle refuses a count that isn't positive and odd, the DNS test's wait is named Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t of its own per sample Its samples share no sandbox, so none can see or clobber another's files: each sample's judge is deployed, has the trajectory staged in its sandbox and is terminated after, and each call's stored input lists the files staged in its own judge's sandbox. A deploy that fails fails the grade and every judge already deployed is terminated. The task's own judge (agent_name) still takes every sample. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… for context loss Staging ran in each sample's own task, so the flag it set never reached the run: its judge calls lost the context_loss fields and the entry its count. The flag is now a holder the run sets, which staging fills. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the lower score An even count's median is the lower of its two middle scores, always one a sample gave. A score of 1 is always the agent's pass, so a tie fails: two samples pass only together, four need three; an odd count stays a majority vote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… unless min_judge_agreement allows it Each sampled row records its agreement, the share of samples giving its verdict, and each sample's verdict. A row under min_judge_agreement (1.0 by default, so any split) fails the grade, keeping its rows, then the step, so the step's fail_task_on_error and retry_config decide what follows. Set on the step, per run, or with --min-judge-agreement on run, task run, task run-batch and eval run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agreement is kept to two places so 0.67 is two of three; past 200 samples a single dissent rounded to 1.0 and passed the default bar. A split's agreement now stops at 0.99, and is 1.0 only when every sample agrees. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… said once The e2e showed a judge split printed three times on a fatal failure and not at all on a retry: the verifier logged it, then the task's failure line and the summary repeated it, while the retry line said only "failed". The retry line now names the error, and the verifier leaves saying it to the task. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The retry line printed the whole exception message, and some steps put a full response body in theirs. It now gives the type and the message on one line, cut to 300 characters; the run record keeps the whole error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…un names the criteria samples split on At 1.0 a split anywhere failed the grade, and splits compound across a rubric: a run-wide --judge-samples could fail most of an eval's grades. 0.5 never fails, so the median decides unless a task or run asks for more, and 1.0 still fails any split. So a vote doesn't hide disagreement, the run summary names each criterion a grade that stood split on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Even cut short, the message could carry the start of a response body some steps put in their errors. The line now names the error's type, which says why at a glance; the run record and a judge's grade keep the whole error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…samples # Conflicts: # src/agent_env/cli/run.py # tst/unit/bundle/run_test.py
The cap is derived from the places, so the display precision and the check that only unanimous samples read 1.0 can't drift apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
added a commit
that referenced
this pull request
Nov 25, 2026
The conflict was in always_on's context-loss gate: main holds it in a _ContextLoss each run sets (#905), and this branch asks a run whose trajectories hold a compaction too; the gate is main's holder, asked through _harness_read. 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
The last of four PRs on judges recording how they ran. An LLM judge isn't deterministic: grading the same run twice can flip a criterion. With
judge_samples: Na judge grades each criterion N times and keeps the median, so no single call decides it, and each row records how far its samples agreed. A task or run that needs a criterion never to shift raisesmin_judge_agreement, and then a split fails the grade. The defaults change nothing (1 sample), or vote (a bar of 0.5, which never fails). N samples cost N times the judge's calls.judge_samples: N(default 1, so nothing changes unless asked)rubric_binaryandrubric_partial,always_on_agent_verifierincluded (JudgeOutputFormatSpec.samplable). The evidence formats anduser_sim_judgerefuse ajudge_samplesabove 1, or anymin_judge_agreement, when the task loads. A run's count and bar reach them too: such a judge grades once, and itsverifier_settingsrecordjudge_samples: 1with what was asked innot_sent.judge_batch_concurrency, so sampling adds calls, not parallel load.samples(every sample's score, verdictpassedand justification, in order) andagreement: the share of samples whose verdict is the kept row's, to two places, so 0.67 is two of three, and 1.0 only when every sample agrees. Agreement counts verdicts, not scores: partial scores of 0.75 and 0.7 that both pass agree. A row of one sample is as before.judge_a2a_agent_id) gets a deployment of its own per sample: its own sandbox, the trajectory staged in it, its own agent config, terminated after. No sample can see or clobber another's files, and each call's stored input lists the files staged in its own judge's sandbox. A deploy that fails fails the grade, and every judge already deployed is terminated. Batches within a sample share that sample's judge.agent_name, filled by the task'sload_artifactsteps) takes every sample, side by side in its one sandbox, since the verifier can't recreate what the task's steps put there. A task whose judge writes scratch files can setjudge_batch_concurrency: 1.judge_calls.judge_callsnames itssample, beside itsbatchandattempt. The legacy entry recordsjudge_samples, andjudge_sample_trajectory_object_urlsfor an agent judge's sampled calls.min_judge_agreement(default 0.5): how many of a criterion's samples must give its kept verdict, as a sharefailed, no score, every row kept with its samples, and an error naming each split, such asc2 (2 of 3 samples pass it). The legacy entry getsjudge_disagreementwith the same rows. Then the step fails (JudgeDisagreementError), so the step's ownretry_configcan grade again with fresh samples, and after the last retry itsfail_task_on_errordecides whether the task fails.Step judge failed (JudgeDisagreementError); rolling back span …, for every retried step; it said only "failed" before. It leaves the message out, since some steps put a response body in theirs; the run record keeps it.A split that stood is named.
agent-env run's summary adds a line under each run whose grade stood with a split (TaskRun.splits), so a vote doesn't hide that the judge was unsure:Where they're set: both are step fields and run overrides (
user_overrides.judge_samples,user_overrides.min_judge_agreement),--judge-samplesand--min-judge-agreementonagent-env run,task run,task run-batchandeval run, andrun_bundle(judge_samples=, min_judge_agreement=).verifier_settingsrecords them, withoverriddennaming a run's; a sampled judge records the bar it applied, the default included.The rule lives in
judge_utils/judge_samples.py(validated,validated_agreement,median_rows,disagreeing,disagreement,splits).Also folded in, at Edgar's ask: the DNS-over-UDP test flake (
test_dns_over_udp_answers_every_query_a_client_sends_while_a_slow_nameserver_holds_them_open), which failed Integration Tests across PRs (#845, #829, #772, #892, #893, #897). Its 2 s deadline started before agc.collect(), and a full collection in a CI worker's heap can take seconds with the event loop held, so the wait ended before the nameserver's replies came back (reproduced: a 2.5 s collection gives exactlyassert 1 == (20 + 1)). The collection couldn't catch the bug it was added for either: a task waiting on a socket is reachable from the loop's reader, so the test passes against the resolver before #848 too; the async lint #848 added guards that. The test now waits, generously, for every answer, without the collection.Decisions (with Edgar)
rubric_binaryandrubric_partial, direct and agent,always_on_agent_verifierincluded; the evidence formats anduser_sim_judgerefuse it for now.--judge-samples; a judge that can't take a run's count grades once and records it innot_sent.min_judge_agreement(added in review): a split under it fails the grade, and then the step, as a judge error does;fail_task_on_errorandretry_configdecide what follows. Per criterion; agreement is on verdicts, so partial scores need no tolerance.--judge-sampleswould fail most of an eval's grades, and a trainer would lose most rollouts. The run summary names the splits instead, and 1.0 is one setting away.Moves a score?
No: the default is 1 sample. A task or run that sets N above 1 grades each criterion by its samples' median; one that also raises
min_judge_agreementfails a grade its samples split on more than it allows.Tests
test_rubrics_verifier_judge_samples.py:user_sim_judge), or sets a bar on one, fails to load; both fields round-trip;judge_disagreementthe same rows, then fails the step;Task.run, a split fails the task, or is tolerated and recorded when the step'sfail_task_on_erroris off;test_always_on_agent_verifier.py: an always-on judge deployed per sample, grading a run with the PSI harness's agent labels, is still asked for context loss, and the entry counts it.retry_test.py: a self-retry's line names the error's type, and not its message.run_test.py:agent-env runnames the criteria a sampled judge's samples split on in a grade that stood.installed_test.py:--judge-samplesand--min-judge-agreementneed a bundle, as the other run options do.E2E
Six rounds on admin VMs through the real LiteLLM proxy, behind a logging pass-through that checks each request against its record, with a checker holding each grade to the rules above; about $29 in all.
Real multi-agent tasks, on 4a40c79 beside main 4067fbc:
agent-env runs, on four VMs of their own.agent-env run's summary is the same apart from its numbers.judge_batch_concurrency(4).JudgeDisagreementErrornaming the row, and validity and the final score didn't run. Judge B's split was recorded as tolerated (is_fatal: false), and each legacy entry'sjudge_disagreementnamed the same rows.agent-env runon main and the branch at one sample, and on the branch with--judge-samples 3. Every grade held and every run tore down. Judging at 3 samples took 234 and 264 s, against 154 to 224 s at one.The default, on 280361b: a test task whose judge takes 5 samples and also grades a criterion it must decide at random split in all three runs; the median decided each (0, 1, 0) and the summary named each split.
judge-agent-effortwith 3 samples passed withsamples split: judge on c2 (2 of 3 pass).A bar of 1.0, on 729ab5e and 280361b: the same splits failed the grade and the task, the error naming each; with
fail_task_on_error: falsethe task carried on; withretry_configon the judge step it was graded again with fresh samples until a unanimous grade stood. A split's message prints once on the failure line and once in the summary.Agreement: 9/9 scenarios at the judge with bars from 0.5 to 1.0, on the step and for the run, partial scores, one sample, and an evidence judge that records a run's bar as not sent.
A judge per sample, on 226b170: a Claude Code judge the verifier deploys started 3 containers for 3 samples and 5 for 5; the task's own judge used 1 for 3; always-on staged each sample's run in a folder of its own; nothing was left running.
Even counts, on edbe475: 8/8 scenarios at 2, 3, 4 and 5 samples; every tie kept the lower score.
Beside main, on 5684084: six bundle tasks with 1 sample graded as on main (one agent judge's own variance aside);
--judge-samples 3sampled every judge that can, anduser_sim_judgegraded once with the count innot_sent.Chaos: 205, 98 and 110 runs over three rounds (counts from 1 to 5, random bars, models, efforts, formats, proxy and store faults): 0 crashes, and every grade held the rules. What the checker flags is its own (the OpenAI client's own retries, LiteLLM sending nothing to Claude for
minimal, a failed run's calls landing in the next run's window). Chaos came to 42 minutes, over the usual 30, since the agreement round was asked for.Each round in full, and the fixes after each
Run on an admin VM through the real LiteLLM proxy, behind a logging pass-through that checks each request against its record, on 5684084 and main 4a95a6d side by side; about $3.10 spent.
judge_samples: 1,not_sent: {judge_samples: 3}.agent-env run), one sample, main and the branch: the same grades on five of six tasks. The sixth,judge-agent-effort, graded 1.0 on the branch and 0.0 on main: its Claude Code judge's own variance, the noise sampling is for.--judge-samples 3:always_on_agent_verifierand a task-deployed agent judge included;judge-agent-efforthad a criterion split 1, 1, 0, which the median took, grading 1.0;simjudgegraded once withnot_sent: {judge_samples: 3}.judge_samples: 3on a directrubric_partialjudge in batches of 2): 6 calls, partial scores per sample, graded.not_sent(8 runs).minimal(31);--judge-samples 3, and one with 5), each run's judge containers counted from Docker's events:judge-agent-effortandjudge-agent-trajectory, whose Claude Code judge the verifier deploys: 3 judge containers for 3 samples, and 5 for 5;judge-task-loaded, the task's own Claude Code judge: 1 container, taking all 3 samples;always-on-judged, whose judge the verifier deploys: each sample's stored input lists the 23 files staged in a folder of its own judge's sandbox (3 different folders);always_on_agent_verifiernamesjudge_samplesas its own parameter,run_bundlerefuses a count that isn't positive before planning, and the DNS test's wait is named; each is covered by its unit test.judge-direct-trajectorywith--judge-samples 2: two calls, graded 1.0 as before;judge-agent-effortwith--judge-samples 2: 2 Claude Code judge containers, one per sample; one criterion split 1 and 0, which the tie failed, so it graded 0.0 (it graded 1.0 at 1 sample, and at 3 samples, where one criterion split 1, 1, 0); nothing it started was left up;minimalon Claude, and a failed run's calls landing in the next run's window.judge_disagreementlisting the same rows):not_sent;agent-env run) of a test task whose direct judge takes 5 samples and also grades a criterion it must decide at random:fail_task_on_error: false, the task carried on with the failed step recorded as not fatal; the run is still reported failed at that step, as any failed step is;retry_configon the judge step, a split was rolled back and graded again, and the retry's unanimous grade stood. The first try's retry was refused because the task's other verifier ran beside the judge, the engine's existing rule; the rerun ordered the judge after it;--min-judge-agreement 0.6, it graded 1.0 with that criterion at 3 of 5;judge-agent-effortwith--judge-samples 3split 2 to 1 on c2 and failed; with--min-judge-agreement 0.67too, it graded 1.0.judge-direct-trajectoryandjudge-partial-samplesagreed and graded as before. Nothing was left running;Step judge failed (JudgeDisagreementError); rolling back span …), since some steps put a response body in their messages; the run record and the grade keep the whole error.min_judge_agreementdefaults to 0.5, andagent-env runnames the splits. Checked on a test host on 280361b ($0.31): at the default, the coin task split in all three runs and the median decided each (0, 1, 0), the summary naming each split, such assamples split: judge on coin (3 of 5 pass);judge-agent-effortwith 3 samples passed withsamples split: judge on c2 (2 of 3 pass), and at--min-judge-agreement 1.0the same split failed the grade. At 1.0 a split's message printed once on the failure line and once in the summary, and a retry graded twice more, its line namingJudgeDisagreementError, before its unanimous third grade stood. Every grade held the agreement rules, and nothing was left running. Chaos wasn't run again: its random bars already covered 0.5, the same path as the new default.Docs
The docs should cover
judge_samplesandmin_judge_agreement(where they're set, which judges take them, the default 0.5 that never fails and 1.0 that fails any split, what each bar means at each N, the run summary'ssamples splitline,agreementandsampleson a row, the failed grade andJudgeDisagreementErrorwithfail_task_on_errorandretry_config, the median rule and an even count's tie,sampleon a call record,not_sentfor a judge that can't take a run's count or bar), and--judge-samplesand--min-judge-agreement.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues were found.Summary
Adds repeated judge calls, per-criterion median scores, and an optional agreement threshold.
Reviews (20) · Last reviewed commit: "refactor(verifiers): name agreement's de..." · Reviewed by Greptile