Add forbidden skills to skill invocation grader#291
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class forbidden_skills support to the skill_invocation grader so negative-trigger evals can assert that a specific skill was not invoked without rejecting unrelated skill use. Validation is relaxed so either required_skills or forbidden_skills (or both) define the grader, and schemas, docs, and generator guidance are updated accordingly.
Changes:
- Add
ForbiddenSkillsfield toSkillInvocationGraderParametersand relax validation in both spec and testcase models. - Extend grader logic to compute forbidden-skill violations (failing with score
0.0) while preserving existing required-skill F1 scoring; default mode toany_orderfor forbidden-only configs. - Update eval/task JSON schemas (anyOf + conditional
moderequirement), docs, generator prompt, and regression tests.
Show a summary per file
| File | Description |
|---|---|
| internal/graders/skill_invocation_grader.go | Implement forbidden-skill detection, scoring, feedback, and details |
| internal/graders/skill_invocation_grader_test.go | Add tests for forbidden-only, mixed, validation, and details coverage |
| internal/models/grader_params.go | Add ForbiddenSkills field to grader parameters |
| internal/models/spec.go | Relax validation to accept forbidden-only configs |
| internal/models/testcase.go | Relax validator-side validation similarly |
| internal/models/grader_validation_test.go | Add validation tests for forbidden-only configs |
| schemas/eval.schema.json | Schema: anyOf required/forbidden + conditional mode requirement |
| schemas/task.schema.json | Mirror schema change in task schema |
| docs/graders/skill_invocation.md | Document forbidden_skills semantics and examples |
| site/src/content/docs/guides/graders.mdx | Update site guide with forbidden_skills options and example |
| internal/suggest/prompt.go | Update generator prompt to mention forbidden/required/mixed usage |
Copilot's findings
- Files reviewed: 11/11 changed files
- Comments generated: 0
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.
Negative trigger evals need to assert that one specific skill was not invoked without rejecting unrelated skill use. This adds first-class
forbidden_skillssupport to theskill_invocationgrader so those checks can stay deterministic and scoped to the skill under test.Summary
forbidden_skillstoSkillInvocationGraderParametersand relax validation so eitherrequired_skillsorforbidden_skillscan define the grader.0.0when a forbidden skill appears.Review notes
This is a medium feature with schema and docs impact, so please have a squad member review before merging.
moderemains required whenrequired_skillsis set, but forbidden-only configs can omit it because ordering is irrelevant.Validation
go test ./...make buildmake lint(skipped by Makefile becausegolangci-lintis not installed)cd site && npm ci --no-audit --no-fund && npm run buildjq empty schemas/eval.schema.json schemas/task.schema.jsonFixes: #286