feat: bake sampling_rate into Judge at construction; simplify Evaluator to List[Judge]#159
Merged
jsonbailey merged 3 commits intomainfrom May 1, 2026
Merged
Conversation
…or to List[Judge]
keelerm84
approved these changes
May 1, 2026
…ove dead except in _build_evaluator
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2d80afe. Configure here.
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
Judge.__init__gainssample_rate: float = 1.0; stored asself.sample_rateJudge.evaluate(sampling_rate=None)andevaluate_messages(sampling_ratio=None)fall back toself.sample_ratewhen the arg is omitted; an explicit0.0still overrides correctlyEvaluatorconstructor simplified toList[Judge]only —JudgeConfigurationremoved from the constructor and evaluate pathEvaluator.noop()returnscls([])_initialize_judgesdeleted;_build_evaluatorinlined via a private_create_judge_instancehelper shared withcreate_judgeso the publiccreate_judgesurface is unchanged and no usage-tracking event is emitted during internal evaluator constructionsample_ratedefault, explicit value, instance-rate fallback, and per-call overrideTest plan
🤖 Generated with Claude Code
Note
Medium Risk
Changes how judge sampling rates are applied and refactors
Evaluator/judge construction, which can alter when evaluations run and could affect tracking or performance if misconfigured. Scope is limited to judge/evaluator plumbing and is covered by added unit tests.Overview
Bakes per-judge sampling into
Judgeinstances by adding asample_rateconstructor arg and makingJudge.evaluate()/evaluate_messages()default to the instance rate when no per-call rate is provided.Simplifies
Evaluatorto hold aList[Judge](removingJudgeConfigurationfrom the execution path) and updatesLDAIClient._build_evaluator()to materialize judges inline via a new_create_judge_instance()helper that avoids emitting the public create-judge usage event during internal evaluator construction.Adds tests covering
sample_ratedefaulting, constructor override, instance-rate fallback, and per-call override behavior.Reviewed by Cursor Bugbot for commit 13b38fd. Bugbot is set up for automated code reviews on this repo. Configure here.