Add end-to-end eval system with LLM judge#152
Merged
Conversation
Replace the old examples-based eval system with a proper end-to-end behavioral evaluation framework: - Central YAML files per category (bug-detection.yaml, security-scanning.yaml, precision.yaml) instead of scattered _eval.json per directory - BDD-style format: given/should_find/should_not_find - Fixture files under evals/fixtures/, test skills under evals/skills/ - Harness discovers YAML files, resolves paths, runs full Warden pipeline - LLM-as-a-judge (Sonnet) evaluates findings against assertions - Zod validation for YAML schema (EvalFileSchema, EvalScenarioSchema) - 8 eval scenarios across 3 categories with 1045 passing tests - Legacy src/examples/ reduced to backwards-compatible re-exports - Scoped lint-staged to src/**/*.ts to skip eval fixtures Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> https://claude.ai/code/session_012bNS6DN3SVigGHTCh8BaWv
The eval runner now creates a temporary git repo for each scenario: - git init with main branch + empty base commit - eval branch with fixture files committed - EventContext built from real git diff (buildLocalEventContext) - Agent operates in a real git repo with Read/Grep tools - Temp repo cleaned up after each eval This makes evals truly end-to-end: the only thing mocked is the GitHub event payload. Everything else (git state, diff parsing, SDK invocation, finding extraction) runs for real. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> https://claude.ai/code/session_012bNS6DN3SVigGHTCh8BaWv
- Move skill copy into setupEvalRepo (it's repo setup, not a pipeline step) - Drop existsSync guard (rmSync with force handles missing paths) - Remove comments that restate the next line of code - Derive skill path from known repo layout instead of reconstructing it Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> https://claude.ai/code/session_012bNS6DN3SVigGHTCh8BaWv
Two bugs fixed: 1. If setupEvalRepo partially fails (e.g. git init succeeds but git commit throws), the temp directory leaked because the caller never got the path back. Now setupEvalRepo catches and cleans up itself. 2. Skills using the directory format (skill-name/SKILL.md) can have resource subdirectories (scripts/, references/, assets/) that the agent reads during analysis. The old code only copied the single .md file. Now it copies the entire skill directory when SKILL.md is present, so the agent has access to all resources. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> https://claude.ai/code/session_012bNS6DN3SVigGHTCh8BaWv
- AGENTS.md: add evals/ to architecture tree and a short Evals section pointing to evals/README.md - README.md: add pnpm test:evals to Contributing and link to eval docs - evals/README.md: update "How It Works" to reflect real git repo setup instead of the old "synthetic EventContext" description Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> https://claude.ai/code/session_012bNS6DN3SVigGHTCh8BaWv
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
- Remove broken backwards-compat shim in src/examples/ (Warden F2Q-E7W, QXN-PSJ). The re-exports changed return types without maintaining compatibility, and nothing outside the module consumed them. - Move setup.ts to src/evals/ and update vitest configs. - Mark precision eval's should_find as optional since the eval tests for absence of false positives, not presence of findings (Cursor Bugbot). - Fix off-by-one fixture loop condition: use <= so only the documented Math.floor bug remains (Cursor Bugbot). Co-Authored-By: Claude Opus 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
Introduces a comprehensive end-to-end evaluation system for Warden that uses YAML-defined test scenarios and an LLM judge to verify the pipeline behaves correctly on known code. This replaces the legacy examples infrastructure with a more structured, BDD-style approach.
Key Changes
New eval infrastructure (
src/evals/):index.ts: Discovers and loads YAML eval files, resolves metadatatypes.ts: Zod schemas for eval files, scenarios, judge responses, and result formattingjudge.ts: LLM judge that evaluates agent findings against BDD assertions (should_find/should_not_find)runner.ts: End-to-end eval execution with real git repo setup, skill loading, and agent invocationevals.integration.test.ts: Integration test suite for all discovered evalsEval definitions (
evals/):bug-detection.yaml,security-scanning.yaml,precision.yamlskills/: bug-detection.md, security-scanning.md, precision.mdfixtures/: null-property-access, off-by-one, missing-await, wrong-comparison, stale-closure, sql-injection, xss-reflected, ignores-style-issuesBackwards compatibility:
src/examples/index.ts: Refactored to re-export eval functions for legacy codesrc/examples/examples.integration.test.ts: Updated to wrap eval runnersrc/examples/index.test.ts: Marked deprecated with re-export testsBuild configuration:
vitest.evals.config.ts: Separate test config for eval integration testspackage.json: Addedtest:evalsscriptImplementation Details
Testing
ANTHROPIC_API_KEYenvironment variable for integration testshttps://claude.ai/code/session_012bNS6DN3SVigGHTCh8BaWv