Skip to content

feat(calibration): LLM-judge calibration certificate (#12)#20

Merged
amitpaz1 merged 1 commit into
mainfrom
feat/issue-12-judge-calibration
Jun 26, 2026
Merged

feat(calibration): LLM-judge calibration certificate (#12)#20
amitpaz1 merged 1 commit into
mainfrom
feat/issue-12-judge-calibration

Conversation

@amitpaz1

Copy link
Copy Markdown
Member

Closes #12 (built on #11, merged).

What: quantifies how well an LLM-judge's verdicts agree with reference (human) labels on a calibration set — agreement + Cohen's kappa + confusion + precision/recall — scoped to the exact dataset (the #11 suite provenance hash) and the reference label distribution. Content-hashed + optionally HMAC-signed → the calibration claim is notarized, not merely asserted (cf. DeepEval/Braintrust).

How:

  • calibration.pycalibration_metrics(predicted, reference) (chance-corrected kappa; degenerate/empty/length-mismatch guarded) + build_calibration_certificate(...) (pure).
  • commands/calibrate.pyagenteval calibrate RUN_ID --labels labels.json [--judge-model M --suite-file S]: compares the run's per-case verdicts to reference labels (no live LLM), optional suite-hash dataset scoping. Registered.

Tests: 9 (perfect→kappa 1.0, total-disagreement→negative kappa, confusion + precision/recall, length-mismatch→ValueError, empty→null, degenerate, cert shape+hash, signed cert, command registered). pytest 9/9, mypy + ruff clean (venv).

Self-contained, additive.

Quantifies how well an LLM-judge's verdicts agree with reference (human) labels
on a calibration set — agreement + Cohen's kappa + confusion + precision/recall
— scoped to the EXACT dataset (the #11 suite provenance hash) and the reference
label distribution. Content-hashed + optionally HMAC-signed
(AGENTEVAL_CALIBRATION_SIGNING_KEY), so the calibration claim is notarized, not
merely asserted (cf. DeepEval/Braintrust). Builds on #11 (merged).

- calibration.py: calibration_metrics(predicted, reference) (chance-corrected
  kappa, degenerate/empty guarded) + build_calibration_certificate(...) (pure).
- commands/calibrate.py: `agenteval calibrate RUN_ID --labels labels.json
  [--judge-model M --suite-file S]` — compares the run's per-case verdicts to
  reference labels (no live LLM), optional suite-hash dataset scoping. Registered.

Tests: 9 (perfect→kappa 1.0, total-disagreement→negative kappa, confusion +
precision/recall, length-mismatch→ValueError, empty→null, degenerate, cert shape
+ hash, signed cert, command registered). pytest 9/9, mypy + ruff clean (venv).

Closes #12.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019tXZpN29akdmG8AEjgSZwk
@amitpaz1
amitpaz1 merged commit 00576d0 into main Jun 26, 2026
4 checks passed
@amitpaz1
amitpaz1 deleted the feat/issue-12-judge-calibration branch June 26, 2026 08:00
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.

LLM-judge calibration certificate, scoped to exact dataset/version/distribution (dependent on #11)

1 participant