Commit d5f2b62
fix: auto-weight grouped rubrics shorthand by criteria count (#1099)
* fix: auto-weight grouped rubrics shorthand by criteria count
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>
* style: fix biome formatting
* test: remove redundant shorthand weight tests
* style: fix trailing blank line
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 209db97 commit d5f2b62
2 files changed
Lines changed: 35 additions & 1 deletion
File tree
- packages/core
- src/evaluation/loaders
- test/evaluation/loaders
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
292 | 300 | | |
293 | 301 | | |
294 | 302 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1989 | 1989 | | |
1990 | 1990 | | |
1991 | 1991 | | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
1992 | 2018 | | |
1993 | 2019 | | |
1994 | 2020 | | |
| |||
0 commit comments