Repository navigation
test(evals): Migrate evals to the vitest-evals harness API - #1974
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
Move every eval suite off `vitest-evals/legacy` onto the root
harness API: `describeEval(name, { harness, judges, judgeThreshold },
(it) => ...)`.
Each eval case is the harness input. The task only receives the
prompt; suite-level judges read `expectedTools` and `expected` from
the case, so one `run()` per case still averages every judge against
the suite threshold, as the scorer-first API did.
- `createTaskHarness` adapts the existing task runners into a harness
with a normalized transcript (prompt, tool calls, output).
- `ToolPredictionScorer` and the local `StructuredOutputScorer` become
judges with unchanged prompts and scoring.
- `ToolCallJudge` wraps the built-in judge, which shares the legacy
`ToolCallScorer` implementation.
Cases, expected tool calls, structured-output checks, thresholds and
timeouts are unchanged. The harness design follows #1132.
Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
|
whats the cause of the toatl lines increase? |
This branch was successfully deployed
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.
#1973 got the eval suite running on vitest-evals 0.18, but it did that by moving every import to the temporary
vitest-evals/legacyentrypoint. This PR moves every suite onto the root harness API:describeEval(name, { harness, judges, judgeThreshold }, (it) => ...). Novitest-evals/legacyimports are left.This is a migration only. Cases, expected tool calls, structured-output checks, thresholds, timeouts and test names are all unchanged. Product code and eval prompts are untouched.
How the conversion works
expectedToolsandexpectedfrom the case, which the vitest-evals README allows ("put criteria oninput"). I didn't use per-casetoSatisfyJudge(...)matchers, because they apply a threshold to each judge separately. The legacy API averaged all scorers and compared that average to the threshold, and keeping onerun()per case with automatic judges gives the same pass/fail.createTaskHarnesswraps the existing task runners (NoOpTaskRunner,McpToolCallTaskRunner, the embedded-agent tasks). It returns a normalized transcript: the prompt, the tool calls, then the output.defineEvalCasesregisters one test per case.ToolPredictionJudgeisToolPredictionScorerconverted to a judge. The prompt, model, schema and scoring are the same.StructuredOutputJudgestays a local judge with the same matching logic. The built-in judge's fuzzy matching (substring, case-insensitive) would change scores.ToolCallJudgewraps the built-in vitest-evals judge so it can readexpectedToolsfrom the case. The legacyToolCallScorerwas already a thin wrapper around this same scorer.task.meta.evalkeeps the shape thateval.yml's status check reads (avgScore,scores[].metadata.rationale). Thevitest-evals/reporterCI path doesn't change. Nothing changes invitest.config.ts,eval.yml,package.jsonor the lockfile.Relation to #1132
This replaces the harness part of @dcramer's #1132. It reuses that PR's harness-adapter design (
createTaskHarness, which turns tool calls into transcript events) and its judge conversions, updated for 0.18. It leaves out a few parts of #1132, because each one changes what the evals measure:mcp-coresearch agent prompt and config changes (search-events,search-issues,search-issue-events)McpToolCallTaskRunnersystem promptAny of these can be a follow-up PR.
Eval cases and test names are the same, but the harness changes what each run records, so any Roach recordings (#1972) will need to re-record once.
via @dcramer.
--
View Session [Sentry]