Skip to content

fix(analyze): read lenient rescores and report overall two-stage success rate - #411

Open
phatloi0010 wants to merge 1 commit into
TIGER-AI-Lab:mainfrom
phatloi0010:fix/analyze-lenient-rescore-and-overall-stage2-408
Open

phatloi0010 wants to merge 1 commit into
TIGER-AI-Lab:mainfrom
phatloi0010:fix/analyze-lenient-rescore-and-overall-stage2-408

Conversation

@phatloi0010

Copy link
Copy Markdown

Summary

Fixes #408

clawbench-rescore defaults to --rubric lenient and writes <run>/judge_llm.json, whereas clawbench-analyze previously only read strict judge.json, run-meta.json.judge_match, and reward.json. In addition, analyze_batch only reported the conditional pass rate among judged runs (stage2_rate = judged_pass / have_judge) without reporting overall two-stage success over all runs (count(intercepted AND selected_match is True) / total_runs) or judgment coverage.

What changed

  • Explicit rubric selection & separate per-rubric reporting (src/clawbench/eval/analyze.py):
    • Added --rubric {auto,lenient,strict,both} to clawbench-analyze (run_summary and analyze_batch), reading lenient verdicts from judge_llm.json (and lenient Harbor artifacts) and strict verdicts from judge.json / run-meta.json.judge_match / reward.json, while recording the rubric and actual judge_model / judge_models.
    • When analyzing under lenient (either explicitly via --rubric lenient or automatically when lenient rescore artifacts exist in the batch), missing lenient verdicts on individual runs remain None (judge_status="unjudged") rather than silently falling back to an older strict/native verdict.
    • Added by_rubric: {"lenient": ..., "strict": ...} to analyze_batch output and a per-rubric Markdown breakdown when both rubrics are present or --rubric both is requested.
  • Overall two-stage success rate & judgment coverage:
    • Reported stage2_overall_pass / stage2_overall_rate (two_stage_pass / two_stage_rate = count(intercepted AND selected_match is True) / total_runs) alongside conditional stage2_rate (judged_pass / have_judge) and stage2_coverage / stage2_intercepted_coverage.
    • Kept inconclusive (match: null / judge_inconclusive) and missing judgments explicit (stage2_inconclusive, stage2_missing, stage2_unjudged) rather than counting them as rejections (stage2_fail).
    • Gated positive Stage-2 verdicts on intercepted=True (judge_status="stale_unintercepted") so a non-intercepted run with a stale positive verdict can never bypass Stage 1.
  • Regression tests (tests/test_analyze.py):

Verification

  • pytest tests/test_analyze.py -v -> 11 passed
  • ruff check src/clawbench/eval/analyze.py tests/test_analyze.py -> All checks passed!
  • ruff format --check src/clawbench/eval/analyze.py tests/test_analyze.py -> 2 files already formatted
  • basedpyright src/clawbench/eval/analyze.py tests/test_analyze.py -> 0 errors

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

analyze ignores default lenient rescores and omits overall two-stage success rate

1 participant