chore: fix sampled field semantics on JudgeResult#137
Merged
jsonbailey merged 3 commits intomainfrom Apr 16, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
keelerm84
approved these changes
Apr 16, 2026
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.
Summary
sampledfield semantics onJudgeResult:sampled=Truenow means the evaluation was sampled and run;sampled=Falsemeans it was not sampled (bypassed by the sampling rate).sampled=Trueindicated the evaluation was skipped, which was counterintuitive and inconsistent with the field name.LDAIConfigTracker.track_judge_result()to skip tracking whennot result.sampled.Test plan
sampled=Falseon skip pathsampled=Trueassertions to both successful evaluation tests🤖 Generated with Claude Code
Note
Medium Risk
Changes a public result-field meaning and alters when judge metrics are emitted, which can affect downstream consumers and analytics even though the code changes are small.
Overview
JudgeResult.sampledsemantics are inverted sosampled=Truenow indicates the judge evaluation ran (and remainsFalsewhen skipped bysampling_rate).Judge.evaluate()setssampled=Trueonly on the run path, andLDAIConfigTracker.track_judge_result()now early-returns whennot sampledto avoid emitting metrics for skipped evaluations.Tests are updated to assert the new behavior for both success and sampling-skip cases.
Reviewed by Cursor Bugbot for commit c4e949e. Bugbot is set up for automated code reviews on this repo. Configure here.