fix: auto-weight grouped rubrics shorthand by criteria count#1099
Draft
fix: auto-weight grouped rubrics shorthand by criteria count#1099
Conversation
When string shorthand assertions are mixed with other explicit graders, the rubrics grader created from the strings now gets weight = number of criteria, making each user-visible assertion contribute equal weight to the overall score. Before: [contains, "A", "B", "C"] → contains(w=1) + rubrics(w=1) → 50/50 After: [contains, "A", "B", "C"] → contains(w=1) + rubrics(w=3) → 25/75 The shorthand abstraction is now transparent — users who write N string criteria alongside M explicit graders get equal weight per visible line, without needing to know about internal grader grouping. Closes #1098 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deploying agentv with
|
| Latest commit: |
20efd94
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://16a9af3e.agentv.pages.dev |
| Branch Preview URL: | https://fix-1098-rubrics-shorthand-a.agentv.pages.dev |
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 #1098
Problem
When string shorthand assertions are mixed with explicit graders, the internal grouping creates a hidden weight asymmetry. A user who writes 4 assertions expects equal weight per line:
But the framework creates 2 graders —
rubrics(weight 1) andcontains(weight 1) — socontainsgot 50% of the score instead of 25%.Fix
One line change in the string shorthand grouping logic (
evaluator-parser.ts): when string criteria are grouped into a rubrics grader, set itsweight = criteria.length. This makes each user-visible assertion contribute equal weight regardless of how many strings are grouped together.Before:
rubrics(w=1) + contains(w=1)→ 50/50After:
rubrics(w=3) + contains(w=1)→ 75/25 (each of 4 lines = 25%)Behaviour
type: rubricswithweight:set: unaffected (different code path) ✓weight:on string shorthand: not possible by design — usetype: rubricsfor that🤖 Generated with Claude Code