Repository navigation
fix(tier3): compute judge scores from verdicts and save judge evidence - #303
Conversation
The Tier 3 LLM judges were asked for both verdicts and a score, and some
replies were scored from the number instead of the verdicts:
- The prompt-based goal_accuracy judge, which runs whenever RAGAS does
not (including with the default NVIDIA Build provider), let a reply's
score override its achieved verdict, so achieved=false with score=1.0
scored 1.0.
- An accuracy reply with only a numeric total was accepted and clamped
into 0..1, so a reply of {"score": 99} scored 1.0.
- A behavior_check reply was checked only for its entry count, so two
behaviors judged as steps [1, 1] scored 1.0.
- Positive cases graded the no-skill baseline on SKILL_IDENTIFIED, which
capped a correct baseline answer at 0.8 and inflated accuracy lift.
Judges now return verdicts only and the verifier computes every score:
accuracy is passing criteria / 5, goal_accuracy is 1.0 when achieved
and 0.0 otherwise, and behavior_check is the share of behaviors
observed, each judged exactly once by its step number. A score field in
a reply is ignored and the schemas and prompts no longer ask for one.
Accuracy replaces SKILL_IDENTIFIED with FORMAT_FOLLOWED, so every case
and both arms use the same five outcome criteria; skill use stays in
skill_execution. Both judge_accuracy copies still accept the
skill_identification_applicable keyword and ignore it, so existing
callers keep working. A RAGAS score that is not 0.0 or 1.0 falls back
to the prompt judge. The N/A results for cases without ground_truth or
expected_behavior and the opt-in character facts are unchanged.
An invalid reply is retried once with the exact problem (for example
"steps not judged: [2]") instead of a generic reminder. The behavior
prompt example has one entry per expected behavior, and the goal prompt
drops its empty tool-call section.
The verifier writes every judge attempt to judge_attempts.json next to
skill_evaluator_reward.json as it happens, so a failed judge leaves
evidence. A behavior_check score rebuilt from a truncated reply adds a
"salvage" entry. Saved prompts and replies are bounded and redacted with
the verifier's existing helpers, plus masking for URL userinfo,
Authorization, API-key, token and Cookie header values, and credential
flag values such as --token and curl -u user:password. A judge deadline
during the write is re-raised, and write failures never change a score.
Rewards record judge_contract: skill-evaluator-judges-v2, which is a
reserved metadata name for custom graders.
The host copy in eval_core/llm_judge.py gets the same contract, and
reports still honor excluded_criteria in older rewards. The character
facts tests now script accuracy replies with the five new criteria.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Automated review: 6 findings (0 P1, 3 P2, 3 P3); 5 posted inline.
Findings outside the diff or about the description:
-
PR_DESCRIPTION: P3: The PR text still treats #302 as open andmainas v0.7.0, but #302 merged on 2026-10-30. This branch's single commit now sits on that revert (a61e1f3), so there is no v0.7.0 base. These sentences are out of date: -
The Summary says the CHANGELOG entries are "under Unreleased, after v0.7.0".
-
Conflicts > Others says "Open PR #302 reverts the v0.7.0 release commit ... If it lands first, move this PR's Added, Changed and Fixed entries into the matching Unreleased subsections."
-
Tests says the results were taken "on top of current
main(v0.7.0)", with the full suite run "before the v0.7.0 release commit".
At the PR head, CHANGELOG.md has no ## 0.7.0 heading, and the next heading after ## Unreleased is ## 0.6.0 - 2026-10-20. The new entries are already under Unreleased ### Added, ### Changed and ### Fixed, so the move the text asks for is already done. A reviewer who follows the merge-order note will look for a heading and a conflict that no longer exist, and the Results paragraph describes a base the branch is no longer on.
Suggested fix: In the Summary, Conflicts and Tests sections, say the PR is based on the #302 revert (a61e1f3), drop the "if #302 lands first" instruction, and say the CHANGELOG entries are already in the Unreleased Added, Changed and Fixed subsections. Then restate which test results apply to that base.
No conflicted files. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dge evidence The judge-evidence Authorization pattern only knew the Bearer, Basic and Token schemes, so "Authorization: ApiKey VALUE" (or Bot, SSWS, ...) masked the scheme word and kept the credential. The header patterns also stopped at the "]" of the Python subscript form, so headers["Authorization"] = "..." and headers["X-API-Key"] = "..." were saved unchanged. The Authorization value is now masked up to its closing quote or the end of the line, and all three header patterns accept an optional "]", ":" or "=", and an f/r/b/u string prefix before the value's quote. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
FORMAT_FOLLOWED told the judge to answer true whenever the question requires no format, so a trial that ran but gave no answer scored 0.2 instead of 0.0. Both judge copies now make that default true only when the response gives an answer, and the prompt says every criterion is false when the evidence holds no answer. Docs and CHANGELOG say so. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The negative behavior fixtures still salvaged entries without a "step", so they failed closed on the step check whatever the salvage parser did. Removing the duplicate-key/non-finite hooks, the nesting limit, the structural-prefix check or the append-only check failed no test. Every entry in those fixtures now has a valid, distinct step, so each case can fail only on the check its id names. The accuracy duplicate, NaN and Infinity score cases carry all five criteria, and boolean-score is dropped from the reject list because a boolean score next to valid criteria is ignored by design. Each guard removal now fails 4-22 tests. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The docs and the salvage comment said both behavior attempts stay "rejected" when the score comes from a truncated reply. When the retry fails in transport, the second attempt is saved as "error", and the salvage entry is numbered like the truncated first attempt. A verifier run test now pins that sequence. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
No test used a prompt or reply longer than the saved-evidence limits, so dropping the cut, or cutting before redaction, passed every test. The new test records an attempt with a prompt and a reply over 50,000 characters, each holding a configured credential across the cut point, and checks that both fit their limits and that no part of the credential is saved. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
No conflicted files. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
No conflicted files. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
chrisknvidia
left a comment
There was a problem hiding this comment.
I read both judge copies, the verifier wiring and the evidence writer end to end, and checked the scoring paths. Scores now come only from the verdicts, the step checks reject repeats and gaps, and I could not find a path where a reply's score still counts. The two problems are in the saved-evidence redaction, which the docs and CHANGELOG say masks these values: quoted flag values like --password='x' are saved in clear, and an Authorization value is only masked for its first 256 characters, so the tail of a long token is saved. The scheme and subscript header handling and the FORMAT_FOLLOWED change look right to me.
Not blocking: judge_attempts.json is written into the Harbor trial directory, and those directories are deleted at the end of a run unless --harbor-keep-jobs is set. The docs say so, but nothing in the report or in the reward error text points at the file. A user who only sees that a judge failed has no hint to rerun with the flag, so a short line in the evaluation error text or the run summary would help.
Behavior and goal prompts render tool-call arguments with json.dumps, so
header names and values in an agent's Bash or python -c command reach
judge_attempts.json with escaped quotes (\"Authorization\": \"ApiKey ...\").
The header separator now allows a backslash before each quote, so these
forms are masked like their unescaped versions.
Digest values hold quoted fields, so they are masked up to a single quote,
backtick or the end of the line. A quoted token after Bearer, Basic or
Token ('Bearer "token"') is masked as well.
Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The accuracy prompt said every criterion is false when the evidence holds no answer, naming a refusal as an example. For a case whose expected answer is a refusal, a judge could then score a correct refusal 0.0. Both prompt copies and the tier3 docs now make an exception for an expected refusal. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts: CHANGELOG.md, docs/tier3-live-evaluation.mdx. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…judge evidence Quoted --password/--token/-u user:password values were left in judge_attempts.json, and an Authorization value over 256 characters kept its tail. Mask both and add redaction cases. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
No conflicts. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
No conflicts. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ests The curl -u fixture added to the judge evidence redaction tests trips the curl-auth-user rule, and Gitleaks scans the full branch history, so a later edit cannot clear it. Allow that one value, in that one test file, for that one rule, and pin the scope of curl-auth-user allowlists. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
No conflicts. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
No conflicts; picks up the branch update from main. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
chrisknvidia
left a comment
There was a problem hiding this comment.
Follow-up on the current head. The quoted-flag and long Authorization fixes work for the cases I reported: I re-ran them, plus a 900-character Bearer token and a 700-character Digest value, through _redact_judge_evidence, and all are masked. The JSON-escaped header handling and the refusal exception in both accuracy prompt copies read correctly. One gap remains, inline: a quoted flag value longer than 256 characters is not masked at all.
Handle quoted credential and user values of any length in judge evidence redaction. Signed-off-by: Christopher Kevin <[email protected]>
…racts Signed-off-by: Christopher Kevin <[email protected]>
Resolve conflicts with #303's judge contract: - judge_goal_accuracy: keep this PR's redacted warning when RAGAS falls back, plus main's judge_attempts.json records for the failed and the accepted RAGAS attempt. - _judge_goal_accuracy_ragas: keep main's binary-score check (which also rejects NaN) in place of the finite check, plus this PR's judge-model provenance and _record_judge_call. - docs/tier3-live-evaluation.mdx: describe both the non-binary fallback and the warning and method fields. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
The Tier 3 LLM judges now return verdicts only, and the verifier computes every score from them. Invalid replies are retried once, and the retry names the exact problem. Every judge attempt is saved as redacted evidence.
templates/eval.py) andeval_core/llm_judge.py.accuracy= passing criteria / 5.goal_accuracy=1.0whenachieved, else0.0.behavior_check= behaviors observed / expected behaviors.scorefield in a reply is ignored. The JSON schemas and prompts no longer ask for one.ground_truthorexpected_behaviorstill returnmain's N/A result, and the opt-in character facts are still appended to all three prompts.accuracyneeds all five true/false criteria. A reply with only a score is rejected.behavior_checkmust judge each behavior exactly once by its integerstepnumber. Duplicate, missing or out-of-range steps are rejected.0.0or1.0falls back to the prompt judge. Before, it was clamped.SKILL_IDENTIFIEDis replaced byFORMAT_FOLLOWED: the response follows any output format the question explicitly requires.skill_execution.excluded_criteria/applicable-accuracy-criteria/v1path is removed.report._applicable_accuracy_criteriastill honorsexcluded_criteriain older rewards.judge_accuracycopies still accept theskill_identification_applicablekeyword and ignore it. Existing callers keep working, including the call site in open PR feat(plugin): Add Plugin evaluation support across all tiers #28.steps not judged: [2]orcriteria has unexpected keys SKILL_IDENTIFIED. The behavior judge now goes through the shared_call_validated_json_judge, which gained an optionalsalvagehook for truncated replies.AGENT'S TOOL CALLSsection. The verifier always passedtool_summary="".main()runs the judges, the verifier writesjudge_attempts.jsonnext toskill_evaluator_reward.json, rewritten atomically after each attempt.llm/ragas/salvage), judge model, status (accepted/rejected/error), and the problem.behavior_checkis scored from a truncated reply, both attempts stayrejectedand anacceptedsalvageentry, numbered like the attempt it came from, holds the rebuilt results._redact_evidence_text,_redact_configured_credentials, and the shared_SECRET_PATTERNS). Judge prompts quote agent commands, so it also masks credentials with no fixed key shape:https://user:token@host);Authorizationheader values;X-API-Key,Api-Key,X-Auth-Token,X-Access-TokenandPrivate-Tokenheader values;name=valuepair of aCookieheader;--token,--password,--api-keyand similar flags;-u/--uservalues inuser:passwordform.python -u,pip install --user,--max-tokensand--cookie-jarare left alone. A password glued to a short option (mysql -pVALUE) is not masked, because-pis also an ordinary option (mkdir -p).TimeoutErrorraised during the write is re-raised, not swallowed.judge_contract: skill-evaluator-judges-v2, so scores from the old prompts are not mistaken for these.judge_contractis added to the reserved metadata names inmetrics.pyandcustom_grader_runner.py, and to the custom-grader docs.tier3-live-evaluation.mdx,custom-graders.mdx) and CHANGELOG (Added / Changed / Fixed under Unreleased, after v0.7.0) are updated.Not in this PR:
apply_patch/MCP calls as productive, and leaving planning calls out of the score, changescheck_tool_efficiency. fix(tier3): count explicit root searches as wasted tool calls #229 (root-search waste) has merged, so this is the next follow-up, together with the Codex argv-list root-search case.main's partial-salvage scoring and adds only the distinct-step check.create-eval-datasettemplate and LLM guidance,--refineskipping SKILL.md reads, atier3 validatelint for skill-use prompts and assertions, and the bundled reference datasets. It touches separate dataset tooling and is left for its own PR.Why
The judges asked for both verdicts and a score, and the score could override the verdicts. I reproduced each case below against
mainwith stubbed provider calls:{"achieved": false, "score": 1.0}scored1.0. This judge runs whenever RAGAS does not, which includes the default NVIDIA Build provider. The goal prompt's own example showed"score": 1.0next to"achieved": true/false.{"score": 99}was accepted and clamped to1.0.[1, 1]scored1.0, because only the entry count was checked.SKILL_IDENTIFIED("Does the response reference or use the correct skill?"). A correct baseline answer was capped at0.8, so accuracy lift was inflated on every run with a baseline. Skill use is already measured byskill_execution.When a judge did fail, the generic retry reminder did not say what was wrong, and no prompt or reply was kept to see why.
Impact on scores. Baseline accuracy rises for correct answers that do not name the skill, so accuracy lift falls for the same runs.
judge_contractmarks the new scores. The metric set, score policy, lift computation, verdict gates and N/A handling are unchanged.Related, already closed by narrower fixes: #189 (accuracy derived from criteria, PR #190) and #70 (one retry for malformed replies, PR #78). This PR builds on both.
Builds on merged PRs
test_character_facts.pyandtest_judge_failure_artifacts.pyscripted accuracy replies with the old criteria; they now use the five new criteria (FORMAT_FOLLOWEDinstead ofSKILL_IDENTIFIED, noscore)._SECRET_PATTERNSname the template keeps fromeval_core/checks.py.ground_truth/expected_behaviorare kept in both copies. Itsallow_not_applicable=arguments to_call_required_judgestay, inside thejudge_attempts.jsonevidence context. Itsskill_identification_applicable=argument is dropped from the accuracy call, since the keyword no longer has an effect.Conflicts with open PRs
#28 (plugin evaluation). #28 rewrites the same judge code in both copies, so whichever PR lands second has conflicts to resolve and a scoring policy to settle. Merge order needs a decision. #28 already conflicts with current
mainin these files (14 hunks intemplates/eval.py, 4 ineval_core/llm_judge.py, 1 intests/tier3/test_judge_result_semantics.py). On top ofmainplus this PR, that becomes 18, 7 and 4._behavior_payload_scoreis_behavior_payload_errorhere. Both copies, and the behavior prompt and judge around them, conflict.salvaged=Trueand_covers_every_step(), which reject a salvaged reply unless it judges steps 1..N.salvageevidence entry.skill_identification_applicable.SKILL_IDENTIFIEDand passesskill_identification_applicable=from ajudge_kwargstable in its main() judge loop. This PR removes the criterion and the keyword's effect.judge_accuracycopies still accept the keyword and ignore it. If a merge keeps feat(plugin): Add Plugin evaluation support across all tiers #28's call site, accuracy is judged on the five outcome criteria. The verifier does not hit aTypeErrorthat would leave every trial unscored.skill_identification_applicable,SKILL_IDENTIFIED,_behavior_payload_scoreor_covers_every_stepneed updating._JUDGED_METRICSwithallow_not_applicable. This PR wraps the three judge calls in the_ACTIVE_JUDGE_EVIDENCEcontext that feedsjudge_attempts.json. The merged loop belongs inside that context.#286 (RAGAS goal scorer port). No conflict with
main; on top of this PR, 2 hunks intemplates/eval.pyand 1 indocs/tier3-live-evaluation.mdx.judge_goal_accuracy, keep fix(tier3): score goal_accuracy with RAGAS for eligible OpenAI judges #286's warning log in the RAGASexceptblock next to this PR'sragaserror attempt, and keep this PR's binary-score check andacceptedattempt._judge_goal_accuracy_ragas, keep fix(tier3): score goal_accuracy with RAGAS for eligible OpenAI judges #286's keywordascore(user_input=..., reference=...)call, client cleanup and_record_judge_callprovenance. Replace its non-finite check and clamp with this PR's binary check, and keep theachievedfield.0.0or1.0" fallback.Others. #259 (behavior bundle truncation) already conflicts with
mainintemplates/eval.pyandCHANGELOG.md, and this PR adds no new conflict with it. #264 (private runtime) merges cleanly. The open port PRs overlap only inCHANGELOG.mdand, for some, other sections oftier3-live-evaluation.mdx. Open PR #302 reverts the v0.7.0 release commit and removes the## 0.7.0heading right below this PR's Unreleased entries. If it lands first, move this PR's Added, Changed and Fixed entries into the matching Unreleased subsections.Kept from public
_judge_errordicts._call_required_judgenormalizes them and the verifier fails closed. No exception-based "judge unavailable" path was introduced._has_judge_reference,_judge_not_applicableand theallow_not_applicablenormalization are unchanged.call_public_llm/_call_public_llm_with_provenance, theresponse_schema/schema_namestructured output, schema downgrade, refusal fallback, andjudge_model_used/judge_reasoning_effort/judge_fallback_usedare unchanged. The model recorded for each saved attempt comes from_ACTIVE_JUDGE_CALLSor the call's provenance.eval_core/llm_judge.pyis not deleted. It gets the same contract, and the shared-vs-template parity tests still run over both.Salvaged k/N. Rejecting partial salvage is left to open PR feat(plugin): Add Plugin evaluation support across all tiers #28 (see above).extract_json/_extract_jsonand_salvage_behavior_results(duplicate keys, non-finite constants, nesting limits, append-only prefixes) are unchanged._redact_evidence_text,_redact_configured_credentialsand_SECRET_PATTERNSfirst. The new userinfo, header and flag patterns run only on judge evidence, after those helpers.write_reward_outputsnow gets its sidecar directory from the shared_verifier_output_dir()helper. The resulting path is the same as before.Tests
New file
tests/tier3/test_judge_contracts.py(75 tests). All 75 fail against unmodifiedmain. They cover:score, in both copies. The behavior example is valid for 1, 2, 3, 5 and 12 behaviors. The empty tool section is dropped and a real one is kept.achieved: false, score: 1.0scores0.0.stepare retried with the exact problem, then rejected.SKILL_IDENTIFIEDkey, missing criterion) and goal (string verdict, score-only, empty) replies are each retried once, and the retry names the exact problem.judge_accuracy(..., skill_identification_applicable=True/False)gives the same prompt and result as a call without it, in both copies, and the keyword is not passed on to the transport._call_required_judge("accuracy", judge_accuracy, ..., skill_identification_applicable=False)scores normally.judge_contract, andjudge_attempts.jsonlists one accepted attempt per judge with model, reply and prompt hash.rejectedattempts and no score. The retry wording appears in the second attempt's prompt only.0.5from its salvaged step, and the file shows tworejectedattempts plus anacceptedsalvageentry for attempt 2 with the rebuilt results and no prompt.errorattempt with the credential masked.sk-key and URL userinfo in the prompt are masked.TimeoutErrorduring the write propagates.Authorizationheaders (shell and JSON forms),X-API-Key(shell and JSON forms),PRIVATE-TOKEN, everyCookiepair,--token,--password=andcurl -u user:passwordvalues are masked.python -u,pip install -U,pip install --user,git push -u,--max-tokens,--token-limit,--cookie-jar, plain URLs,mailto:and prose "Authorization" are left unchanged. The curl examples use repeated-letter credentials, which stay below Gitleaks' curl-rule entropy thresholds.0.5,NaN) falls back to the prompt judge and is saved as aragaserror attempt. A binary RAGAS score is saved as anacceptedattempt.judge_contractis reserved metadata.Existing tests updated to the new contract:
test_judge_result_semantics.py,test_accuracy_arithmetic.py,test_llm_judge.py,test_judge_parse_robustness.py,test_judge_failure_artifacts.py,test_judge_http_response_contract.py,test_behavior_evidence.py,test_evidence_compiler.pyandtest_character_facts.py.skill_identification_applicabletests are replaced by outcome-only accuracy tests, plus a report test for older rewards that still listexcluded_criteria.Results, on one commit on top of current
main(v0.7.0). The full suite ran before the v0.7.0 release commit, which changes only version strings and the CHANGELOG heading; the judge, docs and CHANGELOG suites were rerun after rebasing onto it.test_judge_contracts.py): 815 passed. The 13test_generated_custom_only_script_*cases intest_judge_failure_artifacts.pyrun the generated script with the hostpython3. They fail on this machine's Python 3.9 on unmodifiedmaintoo, and pass with Python 3.12 first onPATH.test_oss_packaging.py,test_tier3_public_runtime.py,test_ci_change_classifier.py,test_benchmark_rollout_docs.py): 432 passed.pytest -n 8with Python 3.12 first onPATH: 18696 passed, 29 skipped, 23 failed.*sidecar_retains_*tests intest_harbor_secure_docker_environment.py. They read host env and fail on unmodifiedmainon this machine too.test_harbor_local_mode.py,test_harbor_runner_status.pyandtest_harbor_runtime_preflight.py, run under a host load average of about 35. Rerun serially, all 155 selected tests in that group passed.ruff checkpasses onsrcandtests.ruff format --check:templates/eval.py.test_behavior_evidence.pyandtest_evidence_compiler.pyalready have formatting drift onmain, outside the hunks this PR touches.scripts/check_oss_boundary.pypasses.🤖 Generated with Claude Code