-
Notifications
You must be signed in to change notification settings - Fork 2
feat: show config diff relative to defaults, not just baseline #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: show config diff relative to defaults, not just baseline #174
Conversation
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances evaluation reports to display configuration flag differences against both baseline runs and default values. Previously, config changes were only shown when a baseline existed, providing no configuration context for initial runs or runs without baselines.
Key changes:
- Added
defaultFlagConfigfield to suite data, populated fromconfigEnd.flags - Enhanced
calculateFlagDiffto compare against both baseline and default configurations - Updated display logic to show default and baseline values on separate lines
- Changed
scoresdefault fromundefinedto{}to prevent null access errors when accessing baseline scores
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ai/src/evals/eval.types.ts | Added default field to FlagDiff type |
| packages/ai/src/evals/reporter.ts | Captures defaultFlagConfig from configEnd.flags and adds it to suite data |
| packages/ai/src/evals/reporter.console-utils.ts | Enhanced calculateFlagDiff to compare against both baseline and defaults; updated printing logic to display both comparisons |
| packages/ai/src/evals/eval.service.ts | Changed scores default from undefined to {} to prevent crashes when accessing baseline scores |
| packages/ai/test/evals/reporter.console-utils.test.ts | Added comprehensive tests for new flag diff scenarios and display logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| logger( | ||
| `│ • ${flag}: ${current ?? '<not set>'} ${c.gray(`(baseline: ${baseline ?? '<not set>'})`)}`, | ||
| ); | ||
| const hasConfigChanges = flagDiff.length > 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly flagDiff will only show up if there's a baseline right?
const flagDiff = suite.baseline ? calculateFlagDiff(suite) : [];So we are not showing flagDiff for debug evals, is that intended?
Changes
Evaluation reports now show config flag differences against both the baseline run and the default values. Previously, config changes were only shown when comparing against a baseline—meaning first runs or runs without baselines showed no config context.
{}instead ofundefinedto avoid null access errors (because we cast toCase, where it is expected for this to exist)Demo
Before:

After:
