fix(core): derive score from assertions when score absent in code-grader#1212
Merged
fix(core): derive score from assertions when score absent in code-grader#1212
Conversation
…grader
When a code-grader script returns `{ assertions }` without an explicit
`score`, the harness now computes score as passing/total instead of
defaulting to 0. Also removes redundant manual score computations from
six example scripts that already had assertions covering the same logic.
Closes #1211
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deploying agentv with
|
| Latest commit: |
87c61fa
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://66859700.agentv.pages.dev |
| Branch Preview URL: | https://fix-1211-derive-score-from-a.agentv.pages.dev |
… test
Addresses code review feedback:
- Drop redundant passing/total score computation from functional-check.ts,
validate-sync.ts, keyword-check.ts, and length-check.ts — same pattern
as the 6 scripts updated in the previous commit
- Add test for `{"assertions":[]}` without score → score 0 (empty guard)
Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
{ assertions }without an explicitscore, the harness now derives score aspassing / totalinstead of defaulting to0passing / totalbefore returning{ score, assertions }— they now return{ assertions }onlyWhat changed
packages/core/src/evaluation/graders/code-grader.ts— Reordered soassertionsis built first, thenscoreis derived from them whenparsed.scoreis absent.6 example scripts simplified (drop redundant
scorefield):copilot-log-eval/graders/transcript-quality.tsimport-claude/graders/transcript-quality.tscode-grader-sdk/scripts/verify-attachments.tsexecution-metrics/scripts/check-metrics-present.tsworkspace-artifact/scripts/check-csv-artifact.tsfile-changes-with-repos/scripts/check-file-changes.tsNot simplified (intentional custom scores):
execution-metrics/check-efficiency.ts— rounds score and slices assertion list; derived score from slice would differtrial-output-consistency— uses a custom floating-point similarity scoreTest plan
assertions without score → derived as passing/total,all passing → score 1,all failing → score 0Closes #1211