feat(calibration): LLM-judge calibration certificate (#12)#20
Merged
Conversation
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
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.
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.py—calibration_metrics(predicted, reference)(chance-corrected kappa; degenerate/empty/length-mismatch 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).
Self-contained, additive.