You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Task]: the Claude judge provider rejects verdicts it cannot parse as JSON, aborting eval runs whose judge text says pass #796
Status: In progress; Priority: P1; Size: S; Order: 6; Depends on: none
Problem
The Claude judge provider rejects replies that visibly begin with a passing JSON verdict when the verdict is not accepted as the reply's last decodable object. The eval runner records graderError and aborts as UNVERIFIED instead of recording the skill result.
This has reproduced across TDD, review, strengthening-tests, executable-scope, and external-skill evals. The current error stores only a 400-character excerpt, so the malformed tail cannot be diagnosed.
Expected outcome
A clear verdict is extracted reliably. A genuinely unparseable reply is retried once, then reported as a judge error with enough preserved evidence to diagnose the shape.
Scope
Verdict extraction in tests/evals/promptfoo/providers/claude_cli.py.
The judge prompt in claude-judge.yaml.
One bounded retry for parse failure.
Safe preservation/reporting of the raw judge reply on terminal parse failure.
Real-capture fixtures from the recorded failures.
Acceptance criteria
Real failing replies are captured as redacted fixtures.
Verdict extraction handles every captured valid shape without requiring it to be the last JSON object.
Ambiguous or conflicting verdict objects remain errors.
A reply with no extractable verdict is retried exactly once before ABORT.
The terminal error preserves the full redacted reply in a diagnostic artifact and gives a concise console excerpt.
No rubric, pass threshold, or candidate output is loosened.
Existing valid judge replies remain byte-compatible at the provider boundary.
Test plan
Add parser tests over real captures, including leading verdicts, trailing prose/objects, malformed JSON, and conflicting verdicts. Prove the old parser fails the fixtures, then run a focused real Claude-pair eval after the fix.
Dependencies
None. Related: #694 owns re-grading saved outputs; #617 owns broader eval diagnosis UX; #830 owns the judge model version.
Non-goals
Changing the judge model.
Re-grading historical runs.
Treating a visible "pass": true substring as sufficient without parsing a coherent verdict object.
This reproduced 2 runs out of 2 on the #769 TDD seed at commit 495b891 (Claude pair, single pass, separate PROMPTFOO_CONFIG_DIR per run).
What the judge replied: the reply opens {"pass": true, "score": 0.88 and 0.90, followed by "A SHAPE: PASS".
What the harness did: it tagged the llm-rubric graderError with "judge reply has no verdict object with a "pass" key as its last JSON object".
Where it fails:tests/evals/promptfoo/providers/claude_cli.py_verdict requires the verdict to be the reply's last JSON object, and this reply's verdict comes first.
The captured reports were saved locally during the batch (rbm.json, tdd-run1.json, tdd.json). They are real captures for the fixture acceptance criterion.
Five more occurrences from the 2026-10-02 batch (Claude pair, haiku candidate, opus judge, single pass). Each judge reply carried a passing verdict and each was rejected by _verdict with has no verdict object with a "pass" key as its last JSON object, recorded as graderError and aborted as UNVERIFIED rather than a skill result. The captured reports are kept locally from the batch and are real captures for the first acceptance criterion.
config / case
run
raw judge reply head (as recorded)
skill-implementing-with-tdd, shipping_cost seed case
{"pass": true, "score": 0.93, "reason": "A SHAPE: PASS - names target file (tests/ecommerce/test_shipping.py), function under test (shipping_cost), concrete input ($30+$30 cart with discount_total=15.0), the discriminating assertion (== 7.99, broken returns 0.0), ...
skill-implementing-with-tdd, same case
its rerun
{"pass": true, "score": 0.93, "reason": "A SHAPE: PASS - names target test file (tests/ecommerce/test_shipping.py), ... closes with exactly pinned handoff phrasing (b) 'I'll run this and surface the ...
skill-reviewing-before-merge, "SEED - auth helper fix with fresh passing tests"
{"pass": true, "score": 0.91, "reason": "A SHAPE: PASS - all three prior-turn named risks (Auth Bypass, Inactive Admin Access, Regression of Owner/Admin Allow Paths) are listed by label, ...
{"pass": true, "score": 0.92, "reason": "A SHAPE: PASS - opens with one short line naming the mutant surface (M7, order.subtotalCents > 10000 ...) ... closes with an explicit 'Production code stays unchanged.' and n...
{"pass": true, "score": 0.85, "reason": "A SHAPE: PASS - classifies the test-path JS helper as infrastructure_change (executable eval assert), runs the stateful structural probe on the inFence toggle ..., prescribes the 4-backtick-open/3-backtick-inner nested-fence discriminator ...
(Where the judge wrote an em dash it is shown as "-". Middle elisions are mine.)
What makes them unparseable cannot be read from these records: the error string keeps only the first 400 characters of the reply (_EXCERPT), so the tail is cut and the full reply is not stored anywhere in the report. All five share the shape the earlier comment describes: the verdict object opens the reply with a long reason, and the parser requires it to be the reply's last top-level JSON object. Either the reply continues with another decodable {...} after the verdict, or the verdict object itself does not decode as a whole (a raw control character or an unescaped quote inside the long reason would do it), after which a later { in the reason text becomes the last object. The scores (0.85 to 0.93) and "pass": true are visible in all five. Storing the full raw reply on a parse failure (the third acceptance criterion) would settle which.
Further evidence: skill-suggesting-external-skill-conversion.yaml on the #807 branch. The case 'execute success returns a skill_body to FOLLOW, not finished markdown' aborted the run (exit 3, errors=1) with 'judge reply has no verdict object with a "pass" key as its last JSON object'. The judge text started {"pass": true, "score": 0.9, ... in both the full-config run and a single-case --filter-pattern rerun. On the next full run of the same config the judge reply parsed, and all 8 cases passed.
Reconciling this issue against main at d08258c before implementing (branch fix/issue-796-judge-verdict-parse):
No full failing reply is stored anywhere reachable. The first acceptance criterion assumes the saved reports hold the real failing replies. They do not: all 31 reports found that carry this error (the [Quality]: name inherited subprocess environment (GIT_DIR under hooks) as a risk in TDD and review #769 batch's tdd.json, tdd-run1.json, the PR fix(skills): stop downstream skills leaking announce lines and approach labels #816 reports, the [Task]: downstream sumo-qa skills still leak announce lines and catalogue approach labels into user output #735 runs, and others) keep only the 400-character excerpt the error string records, so the tail that broke the parse is lost in every one. The fixtures are therefore the three real, full judge replies that are reachable: two claude-opus-5 replies from an earlier tee capture of the retrospective regression case, and one claude-opus-5-5 reply from this branch's real run. The failure shapes the excerpts point at (an object or prose after the verdict, a raw newline inside reason, a repeated verdict, a contradicting verdict) are built from those real replies in the tests. The new tests/evals/results/judge-replies/ file is what will capture the real shape the next time a reply fails twice.
The judge prompt in claude-judge.yaml is unchanged. No captured reply shows what the prompt should say differently, and any change to it moves every grade in the matrix, which would need a matrix rerun to validate.
One existing rule tightens. A reply with two different verdict objects used to be graded by its last one. It is now an error (then the one retry), as the "ambiguous or conflicting verdict objects remain errors" criterion requires. The same verdict repeated still grades.
CI: all 28 checks green on a97552829f0e819a53c712bf79e645de40f2c441, including the Windows pytest legs (fixed in 08deb84d: the tests now build paths portably).
Mutation gate: triggered (tests/**). Run 37202525282: every module at or above baseline, 0 survivors, strict gate passed.
Review threads: 0 open. The review bot's P1 ("Final verdict is FAIL" not read) and P2 (credential assignments not redacted in kept replies) were fixed in e0eb76a5 and tightened in a9755282 (a stated grade is read only on its own line, as an uppercase PASS/FAIL; credential values are redacted for bold, env-style, quoted and Authorization forms); both threads resolved.
Per-file review (sumo-qa reviewing_before_merge, full content vs origin/main): no fail-open regression versus origin/main's provider; all captured fixture shapes grade.
/code-review (high): whole diff, then every fix delta. After six rounds of heuristics each opened new silent-pass cases, the parser was rewritten fail-closed (your decision); later rounds closed duplicate keys, variant pass keys, cut-out objects, and nested or stated-verdict contradictions.
Behavioural verification (step 4.7):
#
behaviour
observed
met
1
real judge replies grade normally through the changed provider
final head a9755282, real Claude pair (haiku candidate, claude-opus-5-5 judge) on skill-deciding-approach.yaml (5/5) and skill-implementing-with-tdd.yaml (6/7; the one fail is a deterministic candidate assertion, the judge passed it at 0.85): 12 judge calls, 0 judge errors, 0 retries, 0 kept-reply files; every graded pass matches its "Verdict" word. An earlier head (54f51bf2) also ran three configs, 13 judge calls, 0 errors
yes
2
a reply with no verdict is retried exactly once, then errors
provider call_api with a stub claude: two calls, then judge reply has no verdict object ... (asked twice; both replies kept at ~/.../judge-reply-<id>.json)
yes
3
the terminal error keeps the full redacted reply and a concise excerpt
kept file holds both replies whole, planted token and home path redacted; console excerpt names the file
yes
4
conflicting / contradicting / duplicate-key replies are errors
each made 2 calls and errored; origin/main's provider graded all three silently
yes
5
valid replies byte-compatible at the provider boundary
the three real fixture verdicts return identical dicts from this head and origin/main
yes
6
no rubric, threshold or candidate output loosened
only the provider, its README, its test and the fixture changed; no yaml
yes
Acceptance criteria (#796): 2-7 met. AC1 ("real failing replies captured as redacted fixtures") is met only as real replies plus the failure shapes reconstructed from the surviving 400-character excerpts: the original failing replies were never stored in full. The new kept-reply file captures the full reply next time.
Activity
sumithr commentedon Oct 1, 2026
This reproduced 2 runs out of 2 on the #769 TDD seed at commit 495b891 (Claude pair, single pass, separate
PROMPTFOO_CONFIG_DIRper run).{"pass": true, "score": 0.88and0.90, followed by "A SHAPE: PASS".graderErrorwith "judge reply has no verdict object with a "pass" key as its last JSON object".tests/evals/promptfoo/providers/claude_cli.py_verdictrequires the verdict to be the reply's last JSON object, and this reply's verdict comes first.The captured reports were saved locally during the batch (
rbm.json,tdd-run1.json,tdd.json). They are real captures for the fixture acceptance criterion.feat(skills): name inherited subprocess environment as a TDD and revi…
fix(skills): stop downstream skills leaking announce lines and approa…
sumithr commentedon Oct 2, 2026
Five more occurrences from the 2026-10-02 batch (Claude pair, haiku candidate, opus judge, single pass). Each judge reply carried a passing verdict and each was rejected by
_verdictwithhas no verdict object with a "pass" key as its last JSON object, recorded asgraderErrorand aborted as UNVERIFIED rather than a skill result. The captured reports are kept locally from the batch and are real captures for the first acceptance criterion.{"pass": true, "score": 0.93, "reason": "A SHAPE: PASS - names target file (tests/ecommerce/test_shipping.py), function under test (shipping_cost), concrete input ($30+$30 cart with discount_total=15.0), the discriminating assertion (== 7.99, broken returns 0.0), ...{"pass": true, "score": 0.93, "reason": "A SHAPE: PASS - names target test file (tests/ecommerce/test_shipping.py), ... closes with exactly pinned handoff phrasing (b) 'I'll run this and surface the ...{"pass": true, "score": 0.91, "reason": "A SHAPE: PASS - all three prior-turn named risks (Auth Bypass, Inactive Admin Access, Regression of Owner/Admin Allow Paths) are listed by label, ...{"pass": true, "score": 0.92, "reason": "A SHAPE: PASS - opens with one short line naming the mutant surface (M7, order.subtotalCents > 10000 ...) ... closes with an explicit 'Production code stays unchanged.' and n...{"pass": true, "score": 0.85, "reason": "A SHAPE: PASS - classifies the test-path JS helper as infrastructure_change (executable eval assert), runs the stateful structural probe on the inFence toggle ..., prescribes the 4-backtick-open/3-backtick-inner nested-fence discriminator ...(Where the judge wrote an em dash it is shown as "-". Middle elisions are mine.)
What makes them unparseable cannot be read from these records: the error string keeps only the first 400 characters of the reply (
_EXCERPT), so the tail is cut and the full reply is not stored anywhere in the report. All five share the shape the earlier comment describes: the verdict object opens the reply with a longreason, and the parser requires it to be the reply's last top-level JSON object. Either the reply continues with another decodable{...}after the verdict, or the verdict object itself does not decode as a whole (a raw control character or an unescaped quote inside the longreasonwould do it), after which a later{in the reason text becomes the last object. The scores (0.85 to 0.93) and"pass": trueare visible in all five. Storing the full raw reply on a parse failure (the third acceptance criterion) would settle which.fix(skills): decide executable-ness by behaviour, not path, in routin…
sumithr commentedon Oct 3, 2026
Further evidence: skill-suggesting-external-skill-conversion.yaml on the #807 branch. The case 'execute success returns a skill_body to FOLLOW, not finished markdown' aborted the run (exit 3, errors=1) with 'judge reply has no verdict object with a "pass" key as its last JSON object'. The judge text started {"pass": true, "score": 0.9, ... in both the full-config run and a single-case --filter-pattern rerun. On the next full run of the same config the judge reply parsed, and all 8 cases passed.
feat(server): report the active profile and opt-in groups in capabili…
sumithr commentedon Oct 3, 2026
Reconciling this issue against
mainat d08258c before implementing (branchfix/issue-796-judge-verdict-parse):tdd.json,tdd-run1.json, the PR fix(skills): stop downstream skills leaking announce lines and approach labels #816 reports, the [Task]: downstream sumo-qa skills still leak announce lines and catalogue approach labels into user output #735 runs, and others) keep only the 400-character excerpt the error string records, so the tail that broke the parse is lost in every one. The fixtures are therefore the three real, full judge replies that are reachable: twoclaude-opus-5replies from an earlier tee capture of the retrospective regression case, and oneclaude-opus-5-5reply from this branch's real run. The failure shapes the excerpts point at (an object or prose after the verdict, a raw newline insidereason, a repeated verdict, a contradicting verdict) are built from those real replies in the tests. The newtests/evals/results/judge-replies/file is what will capture the real shape the next time a reply fails twice.claude-opus-5-5(chore(evals): run the judge on claude-opus-5-5 #831), returned a single well-formed verdict that the old and the new parser both accept (pass: false, score 0.45, a rubric verdict on the candidate,errors=0). The cause of the recorded rejections is still unobserved.claude-judge.yamlis unchanged. No captured reply shows what the prompt should say differently, and any change to it moves every grade in the matrix, which would need a matrix rerun to validate.fix(evals): grade the judge's one verdict wherever it sits, retry a r…
fix(evals): grade the judge's one verdict wherever it sits, retry a r…
sumithr commentedon Oct 4, 2026
Merge-readiness evidence, head
a9755282CI: all 28 checks green on
a97552829f0e819a53c712bf79e645de40f2c441, including the Windows pytest legs (fixed in08deb84d: the tests now build paths portably).Mutation gate: triggered (
tests/**). Run 37202525282: every module at or above baseline, 0 survivors, strict gate passed.Review threads: 0 open. The review bot's P1 ("Final verdict is FAIL" not read) and P2 (credential assignments not redacted in kept replies) were fixed in
e0eb76a5and tightened ina9755282(a stated grade is read only on its own line, as an uppercase PASS/FAIL; credential values are redacted for bold, env-style, quoted and Authorization forms); both threads resolved.Per-file review (sumo-qa
reviewing_before_merge, full content vsorigin/main): no fail-open regression versusorigin/main's provider; all captured fixture shapes grade./code-review(high): whole diff, then every fix delta. After six rounds of heuristics each opened new silent-pass cases, the parser was rewritten fail-closed (your decision); later rounds closed duplicate keys, variant pass keys, cut-out objects, and nested or stated-verdict contradictions.Behavioural verification (step 4.7):
a9755282, real Claude pair (haiku candidate,claude-opus-5-5judge) onskill-deciding-approach.yaml(5/5) andskill-implementing-with-tdd.yaml(6/7; the one fail is a deterministic candidate assertion, the judge passed it at 0.85): 12 judge calls, 0 judge errors, 0 retries, 0 kept-reply files; every gradedpassmatches its "Verdict" word. An earlier head (54f51bf2) also ran three configs, 13 judge calls, 0 errorscall_apiwith a stubclaude: two calls, thenjudge reply has no verdict object ... (asked twice; both replies kept at ~/.../judge-reply-<id>.json)origin/main's provider graded all three silentlyorigin/mainAcceptance criteria (#796): 2-7 met. AC1 ("real failing replies captured as redacted fixtures") is met only as real replies plus the failure shapes reconstructed from the surviving 400-character excerpts: the original failing replies were never stored in full. The new kept-reply file captures the full reply next time.