judging: enforce the two-level minimum that Rubric validation already states - #28
Open
ChrisW09 wants to merge 1 commit into
Open
judging: enforce the two-level minimum that Rubric validation already states#28ChrisW09 wants to merge 1 commit into
ChrisW09 wants to merge 1 commit into
Conversation
The validator checked 'if not self.levels', so a one-level rubric passed despite the error message's stated invariant, producing a degenerate constant scale (min == max) downstream models can't fit. Fixes #16 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes #16.
Rubric.__post_init__checkedif not self.levels:while raising "a rubric needs at least two levels" — so a one-level rubric was accepted, yieldingmin_value == max_value, a grade hint of "exactly one of: 1", and a degenerate constant scale the downstream ordinal/binary models cannot fit.One-line fix (
len(self.levels) < 2) plus a regression test pinning both the empty and one-level cases.Test:
pytest packages/cafe-core/tests/test_judging.py— 17 passed.🤖 Generated with Claude Code