Skip to content

Commit caac219

Browse files
authored
fix(schema): reject stale authored skill and trajectory graders (#1686)
* fix(schema): reject stale authored skill and trajectory graders * test(cli): migrate prepared grade trajectory assertions * fix(codemod): migrate stale snake case grader aliases * docs(examples): retire stale grader example names
1 parent 1c2988b commit caac219

73 files changed

Lines changed: 1534 additions & 673 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/cli/test/commands/grade/grade-prepared.test.ts

Lines changed: 51 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,18 @@ describe('agentv grade prepared attempts', () => {
254254
tempDir,
255255
`
256256
- metric: expected-tool-sequence
257-
type: tool-trajectory
258-
mode: exact
259-
expected:
260-
- tool: Read
261-
args:
262-
path: app.txt
257+
type: trajectory:tool-sequence
258+
value:
259+
mode: exact
260+
steps:
261+
- Read
262+
- metric: expected-tool-args
263+
type: trajectory:tool-args-match
264+
value:
265+
name: Read
266+
args:
267+
path: app.txt
268+
mode: partial
263269
`,
264270
);
265271
const preparedDir = path.join(tempDir, 'prepared', 'trace-tools');
@@ -287,10 +293,17 @@ describe('agentv grade prepared attempts', () => {
287293
expect(row.score).toBe(0);
288294
expect(row.scores[0]).toMatchObject({
289295
name: 'expected-tool-sequence',
290-
type: 'tool-trajectory',
296+
type: 'trajectory:tool-sequence',
291297
score: 0,
292298
pass: false,
293-
reason: 'No trace available for evaluation',
299+
reason: 'No trace data available for trajectory:tool-sequence assertion',
300+
});
301+
expect(row.scores[1]).toMatchObject({
302+
name: 'expected-tool-args',
303+
type: 'trajectory:tool-args-match',
304+
score: 0,
305+
pass: false,
306+
reason: 'No trace data available for trajectory:tool-args-match assertion',
294307
});
295308
});
296309

@@ -299,12 +312,18 @@ describe('agentv grade prepared attempts', () => {
299312
tempDir,
300313
`
301314
- metric: expected-tool-sequence
302-
type: tool-trajectory
303-
mode: in_order
304-
expected:
305-
- tool: Read
306-
args:
307-
path: app.txt
315+
type: trajectory:tool-sequence
316+
value:
317+
mode: in_order
318+
steps:
319+
- Read
320+
- metric: expected-tool-args
321+
type: trajectory:tool-args-match
322+
value:
323+
name: Read
324+
args:
325+
path: app.txt
326+
mode: partial
308327
`,
309328
);
310329
const preparedDir = path.join(tempDir, 'prepared', 'trace-tools-with-trace');
@@ -397,7 +416,14 @@ describe('agentv grade prepared attempts', () => {
397416
expect(row.score).toBe(1);
398417
expect(row.scores[0]).toMatchObject({
399418
name: 'expected-tool-sequence',
400-
type: 'tool-trajectory',
419+
type: 'trajectory:tool-sequence',
420+
score: 1,
421+
pass: true,
422+
reason: 'Grader passed.',
423+
});
424+
expect(row.scores[1]).toMatchObject({
425+
name: 'expected-tool-args',
426+
type: 'trajectory:tool-args-match',
401427
score: 1,
402428
pass: true,
403429
reason: 'Grader passed.',
@@ -410,10 +436,11 @@ describe('agentv grade prepared attempts', () => {
410436
tempDir,
411437
`
412438
- metric: expected-tool-sequence
413-
type: tool-trajectory
414-
mode: in_order
415-
expected:
416-
- tool: Read
439+
type: trajectory:tool-sequence
440+
value:
441+
mode: in_order
442+
steps:
443+
- Read
417444
`,
418445
);
419446
const preparedDir = path.join(tempDir, 'prepared', 'wrong-transcript-target');
@@ -453,10 +480,11 @@ describe('agentv grade prepared attempts', () => {
453480
tempDir,
454481
`
455482
- metric: expected-tool-sequence
456-
type: tool-trajectory
457-
mode: in_order
458-
expected:
459-
- tool: Read
483+
type: trajectory:tool-sequence
484+
value:
485+
mode: in_order
486+
steps:
487+
- Read
460488
`,
461489
);
462490
const preparedDir = path.join(tempDir, 'prepared', 'wrong-envelope-target');

docs/plans/2026-06-06-001-agentv-eval-authoring-extensibility-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ Initial reference evals to consider:
268268

269269
- WTG.AI.Prompts PR 679 as the primary WTG example, because it represents skill/prompt QA, workspace-sensitive coding-agent behavior, regression checks, pinned workspace setup, and before/after eval-driven prompt improvement in one artifact set.
270270
- `financial-research-agent/evals/financial-research-agent.eval.yaml` for Dexter-derived financial research rubric/provenance/operator semantics.
271-
- AgentV public examples such as `examples/features/rubric/`, `examples/showcase/grader-conformance/`, `examples/features/trace-evaluation/`, and `examples/features/tool-trajectory-simple/` are secondary reference material, not the main private parity corpus.
271+
- AgentV public examples such as `examples/features/rubric/`, `examples/showcase/grader-conformance/`, `examples/features/trace-evaluation/`, and `examples/features/trajectory-assertions-simple/` are secondary reference material, not the main private parity corpus.
272272

273273
Placement constraints:
274274

docs/plans/public-agentv-demo-projects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Out of scope:
276276
- Origin requirements: `docs/brainstorms/2026-06-04-public-agentv-demo-projects-requirements.md`
277277
- Existing plugin-variant pattern: `examples/showcase/bug-fix-benchmark/evals/bug-fixes.eval.yaml`, `examples/showcase/bug-fix-benchmark/scripts/setup-variant.sh`
278278
- Existing previous-commit workspace pattern: `examples/features/repo-lifecycle/evals/suite.yaml`, `examples/showcase/cross-repo-sync/evals/suite.yaml`, `examples/showcase/cross-repo-sync/scripts/setup.ts`
279-
- Existing multi-provider skill eval pattern: `examples/features/agent-skills-evals/multi-provider-skill-trigger.EVAL.yaml`
279+
- Existing multi-provider skill eval pattern: `examples/features/agent-skills-evals/multi-provider-skill-use.EVAL.yaml`
280280
- Project registry and wire format: `packages/core/src/projects.ts`, `packages/core/test/projects.test.ts`
281281
- Existing private results-repo wiring: `agentv-deploy` repository setup scripts and result config blocks
282282
- Git checkout behavior: `packages/core/src/evaluation/workspace/repo-manager.ts`, `packages/core/test/evaluation/workspace/repo-manager.test.ts`

evals/agentic-engineering/agent-plugin-review.eval.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ tests:
1515
- id: detect-missing-eval
1616
criteria: Identifies that deploy-rollback skill has no corresponding eval file
1717
assert:
18-
- type: skill-trigger
19-
skill: agent-plugin-review
18+
- type: skill-used
19+
value: agent-plugin-review
2020
- type: contains
2121
value: deploy-rollback
2222
- type: rubrics

examples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ Focused demonstrations of specific AgentV capabilities. Each example includes it
4242

4343
- [basic](features/basic/) - Core schema features
4444
- [rubric](features/rubric/) - Rubric-based evaluation
45-
- [tool-trajectory-simple](features/tool-trajectory-simple/) - Tool trajectory validation
46-
- [tool-trajectory-advanced](features/tool-trajectory-advanced/) - Advanced tool trajectory with expected_output
45+
- [trajectory-assertions-simple](features/trajectory-assertions-simple/) - Promptfoo trajectory assertion validation
46+
- [trajectory-assertions-advanced](features/trajectory-assertions-advanced/) - Advanced trajectory assertions with expected_output
4747
- [assert-set](features/assert-set/) - Assertion grouping patterns
4848
- [weighted-graders](features/weighted-graders/) - Weighted graders
4949
- [execution-metrics](features/execution-metrics/) - Metrics tracking (tokens, cost, latency)

examples/features/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ Focused examples for specific AgentV capabilities. Find your use case below, the
4949
### Evaluate tool use and agent behavior
5050
| Example | Description |
5151
|---------|-------------|
52-
| [tool-trajectory-simple](tool-trajectory-simple/) | Validate expected tool call sequences |
53-
| [tool-trajectory-advanced](tool-trajectory-advanced/) | Tool trajectory checks with `expected_output` and per-call assertions |
54-
| [latency-assertions](latency-assertions/) | Assert `max_duration_ms` per tool call to catch performance regressions |
52+
| [trajectory-assertions-simple](trajectory-assertions-simple/) | Validate expected tool calls with Promptfoo trajectory assertions |
53+
| [trajectory-assertions-advanced](trajectory-assertions-advanced/) | Promptfoo trajectory assertions with `expected_output` and per-call checks |
54+
| [latency-assertions](latency-assertions/) | Tool sequence and argument checks for a latency-flavored mock target |
5555
| [tool-evaluation-plugins](tool-evaluation-plugins/) | F1 precision/recall scoring for tool-call accuracy |
5656
| [trace-evaluation](trace-evaluation/) | Inspect agent internals: LLM call counts, tool executions, step durations |
5757

@@ -172,8 +172,8 @@ Focused examples for specific AgentV capabilities. Find your use case below, the
172172
| [test-vars-templating](test-vars-templating/) | Dataset & prompt templates |
173173
| [threshold-grader](threshold-grader/) | LLM grading |
174174
| [tool-evaluation-plugins](tool-evaluation-plugins/) | Tool & agent evaluation |
175-
| [tool-trajectory-advanced](tool-trajectory-advanced/) | Tool & agent evaluation |
176-
| [tool-trajectory-simple](tool-trajectory-simple/) | Tool & agent evaluation |
175+
| [trajectory-assertions-advanced](trajectory-assertions-advanced/) | Tool & agent evaluation |
176+
| [trajectory-assertions-simple](trajectory-assertions-simple/) | Tool & agent evaluation |
177177
| [trace-analysis](trace-analysis/) | Offline evaluation |
178178
| [trace-evaluation](trace-evaluation/) | Tool & agent evaluation |
179179
| [trial-output-consistency](trial-output-consistency/) | Benchmarking |

examples/features/agent-skills-evals/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ tests:
6363
- type: text
6464
value: "Find the top 3 months by revenue."
6565
assert:
66-
- type: skill-trigger
67-
skill: csv-analyzer
68-
should_trigger: true
66+
- type: skill-used
67+
value: csv-analyzer
6968
- type: llm-rubric
7069
value: "Output identifies November as the highest revenue month"
7170
- type: contains
@@ -98,14 +97,14 @@ The `csv-analyzer` skill is included in this example under `.claude/skills/csv-a
9897

9998
## Multi-provider eval
10099

101-
`multi-provider-skill-trigger.EVAL.yaml` tests the same skill across multiple providers:
100+
`multi-provider-skill-use.EVAL.yaml` tests the same skill across multiple providers:
102101

103102
```bash
104-
bun apps/cli/src/cli.ts eval multi-provider-skill-trigger.EVAL.yaml \
103+
bun apps/cli/src/cli.ts eval multi-provider-skill-use.EVAL.yaml \
105104
--target copilot-cli --targets ../.agentv/targets.yaml
106105
```
107106

108-
The `skill-trigger` grader automatically handles each provider's tool-call format:
107+
The `skill-used` and `not-skill-used` graders automatically handle each provider's tool-call format:
109108

110109
| Provider | Detection method |
111110
|----------|-----------------|
@@ -115,7 +114,7 @@ The `skill-trigger` grader automatically handles each provider's tool-call forma
115114

116115
## Copilot note
117116

118-
When running `skill-trigger` evals against Copilot targets, real traces may show provider-specific tool names such as:
117+
When running skill-use evals against Copilot targets, real traces may show provider-specific tool names such as:
119118

120119
```text
121120
Using skill: <skill-name>

examples/features/agent-skills-evals/csv-analyzer.EVAL.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
tags:
22
- agent
3-
- skill-trigger
3+
- skill-use
44
extensions:
55
- agentv:agent-rules
66
environment:
@@ -11,9 +11,8 @@ prompts:
1111
tests:
1212
- id: csv-top-months
1313
assert:
14-
- type: skill-trigger
15-
skill: csv-analyzer
16-
should_trigger: true
14+
- type: skill-used
15+
value: csv-analyzer
1716
- type: llm-rubric
1817
value:
1918
- "Output applies seasonal weighting factors (Q1: 0.85, Q2: 1.00, Q3: 1.15, Q4: 1.25)"
@@ -35,8 +34,7 @@ tests:
3534
sure to apply the seasonal weighting formula from the skill.
3635
- id: irrelevant-query
3736
assert:
38-
- type: skill-trigger
39-
skill: csv-analyzer
40-
should_trigger: false
37+
- type: not-skill-used
38+
value: csv-analyzer
4139
vars:
4240
input: What time is it?

examples/features/agent-skills-evals/multi-provider-skill-trigger.EVAL.yaml renamed to examples/features/agent-skills-evals/multi-provider-skill-use.EVAL.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,25 @@ prompts:
88
tests:
99
- id: should-trigger-direct-request
1010
assert:
11-
- type: skill-trigger
12-
skill: acme-deploy
13-
should_trigger: true
11+
- type: skill-used
12+
value: acme-deploy
1413
vars:
1514
input: How do I deploy payments-api to production?
1615
- id: should-trigger-casual-phrasing
1716
assert:
18-
- type: skill-trigger
19-
skill: acme-deploy
20-
should_trigger: true
17+
- type: skill-used
18+
value: acme-deploy
2119
vars:
2220
input: I need to roll back user-service in staging, what's the Acme deploy procedure for that?
2321
- id: should-not-trigger-unrelated
2422
assert:
25-
- type: skill-trigger
26-
skill: acme-deploy
27-
should_trigger: false
23+
- type: not-skill-used
24+
value: acme-deploy
2825
vars:
2926
input: What time is it in Tokyo right now?
3027
- id: should-not-trigger-near-miss
3128
assert:
32-
- type: skill-trigger
33-
skill: acme-deploy
34-
should_trigger: false
29+
- type: not-skill-used
30+
value: acme-deploy
3531
vars:
3632
input: Write a Python function that parses JSON logs and extracts error messages

examples/features/batch-cli/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This example demonstrates an **external batch runner** pattern for a (synthetic)
1010

1111
3. **Batch processing**: `batch-cli-runner.ts` reads the CSV and applies synthetic AML screening rules, writing **actual responses** as JSONL to a temporary file. Each JSONL record includes `output` with `tool_calls` for trace extraction.
1212

13-
4. **Evaluation**: AgentV compares the actual JSONL output against the ground truth in `evals/suite.yaml` using graders like `script` and `tool-trajectory`.
13+
4. **Evaluation**: AgentV compares the actual JSONL output against the ground truth in `evals/suite.yaml` using graders like `script` and `trajectory:tool-used`.
1414

1515
## Batch error handling (missing JSONL id)
1616

@@ -45,7 +45,7 @@ The batch runner outputs JSONL records with `output` containing `tool_calls`:
4545
}
4646
```
4747

48-
The `tool_trajectory` grader extracts tool calls directly from `output[].tool_calls[]`. This is the primary format - no separate `trace` field is required.
48+
Trajectory assertions extract tool calls directly from `output[].tool_calls[]`. This is the primary format - no separate `trace` field is required.
4949

5050
## Files
5151

0 commit comments

Comments
 (0)