fix(evaluation): harden judge calibration workflow - #35
Merged
Conversation
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.
Problem
The existing judge-calibration path could not reliably validate the published benchmark.
The legacy worksheet reconstructed cited source excerpts instead of retaining the exact ordered contexts evaluated by RAGAS Faithfulness. The legacy report script also accepted an arbitrary flat JSON file without validating evidence provenance, human-label scale, sample completeness, minimum sample size, or per-dimension agreement.
As a result, an aggregate score could hide a Faithfulness or Answer Relevancy failure.
Solution
Introduce one fail-closed calibration workflow based on the exact evidence seen by the judge.
The answer harness now persists ordered judge contexts. The calibration builder creates a deterministic, stratified, blind-labeling workspace, and the finalizer validates the workspace before enforcing overall and per-dimension agreement gates.
Main changes
judge_contextsin answer and question records.0.0,0.5, and1.0ordinal scale.judge_calibration_report.pyentrypoint and flat-file loader.20260726T185553Zcalibration workspace with hashes and an explicit warning.Test evidence
New entrypoint tests cover:
Security and data impact
No credentials, secrets, or personal data are introduced.
Exact judge contexts are retained locally as run evidence. The current benchmark corpus consists of public official legal texts. The privacy documentation now records this retention explicitly.
The archived legacy workspace contains only public benchmark material and unfilled human labels. It is retained for audit history and is explicitly ineligible for calibration.
Operational and rollout impact
New benchmark runs include
judge_contextsinrecords.jsonl, increasing artifact size.Runs created before evidence schema v1 cannot be retrospectively calibrated and fail closed. They must be rerun to produce an eligible human-calibration workspace.
The canonical workflow is:
Risks and follow-ups