Skip to content

Commit 27bd6ed

Browse files
authored
fix(evaluation): remove public llm-grader assertion
Remove the public llm-grader assertion surface in favor of llm-rubric and agent-rubric guidance.
1 parent ba7993e commit 27bd6ed

34 files changed

Lines changed: 249 additions & 191 deletions

.agents/conventions.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ Grader types use kebab-case everywhere.
141141
- Internal TypeScript may keep shared LLM grader implementation names, but new authored evals should not use `llm-grader` as a public type.
142142
- Output `scores[].type`: use the authored grader type when available, such as `"llm-rubric"`, `"g-eval"`, or `"is-json"`.
143143
- Registry keys: `registry.register('llm-rubric', ...)` for the authored rubric surface, with `llm-grader` retained as internal/shared implementation plumbing.
144+
- Public SDK assertion helpers and authored YAML schemas must not expose `llm-grader`; use `llmRubricGrader()` / `type: llm-rubric` or `type: agent-rubric`.
144145

145146
Source of truth: `GRADER_KIND_VALUES` in `packages/core/src/evaluation/types.ts`.
146147

@@ -149,10 +150,10 @@ Backward compatibility:
149150
- Snake_case is accepted in YAML by `normalizeGraderType()` in `grader-parser.ts`, for example `llm_rubric` -> `llm-rubric`.
150151
- Single-word types such as `contains`, `equals`, `regex`, `latency`, and `cost` are unchanged.
151152

152-
Two type definitions exist and must stay in sync:
153+
Public and internal type definitions intentionally differ for internal-only grader plumbing:
153154

154-
- `EvaluatorKind` in `packages/core/src/evaluation/types.ts`
155-
- `AssertionType` in `packages/sdk/src/assertion.ts`
155+
- `GraderKind` in `packages/core/src/evaluation/types.ts` includes internal/runtime keys such as `llm-grader`.
156+
- `AssertionType` in `packages/sdk/src/assertion.ts` includes public authored assertion types only.
156157

157158
## Python Scripts
158159

apps/cli/test/commands/eval/pipeline/fixtures/input-test.eval.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ tests:
1212
command: node grader-score-1.js
1313
weight: 1
1414
- metric: relevance
15-
type: llm-grader
16-
prompt: Did the response echo the input?
15+
type: llm-rubric
16+
value: Did the response echo the input?
1717
weight: 2
1818
vars:
1919
input: hello world

apps/web/src/content/docs/docs/next/graders/llm-graders.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ Use `provider:` when you want different `llm-rubric` entries in the same eval to
5050

5151
Use `type: agent-rubric` when a Promptfoo-style rubric needs an agentic grader
5252
that can inspect the workspace instead of only judging the final answer text.
53-
AgentV routes `agent-rubric` through the same `llm-rubric` / `llm-grader`
54-
scoring path, so results still appear as normal `EvaluationScore` entries.
53+
AgentV routes `agent-rubric` through the same shared LLM rubric scoring path,
54+
so results still appear as normal `EvaluationScore` entries.
5555

5656
```yaml
5757
assert:

apps/web/src/content/docs/docs/v4.42.4/evaluation/eval-cases.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ tests:
8686
target: gpt4_target
8787
assertions:
8888
- name: depth_check
89-
type: llm-grader
89+
type: llm-rubric
9090
prompt: ./graders/depth.md
9191
```
9292

@@ -111,7 +111,7 @@ tests:
111111
skip_defaults: true
112112
assertions:
113113
- name: custom_eval
114-
type: llm-grader
114+
type: llm-rubric
115115
# Does NOT get latency_check
116116
```
117117

@@ -330,14 +330,14 @@ The `criteria` field is a **data field** that describes what the response should
330330

331331
### No `assertions` — implicit LLM grader
332332

333-
When a test has no `assertions` field, a default `llm-grader` grader runs automatically and uses `criteria` as the evaluation prompt:
333+
When a test has no `assertions` field, a default `llm-rubric` grader runs automatically and uses `criteria` as the evaluation prompt:
334334

335335
```yaml
336336
tests:
337337
- id: simple-eval
338338
criteria: Assistant correctly explains the bug and proposes a fix
339339
input: "Debug this function..."
340-
# No assertions → default llm-grader evaluates against criteria
340+
# No assertions → default llm-rubric evaluates against criteria
341341
```
342342

343343
Suite-level `preprocessors` also apply to this implicit grader. That matters when the agent output is a `ContentFile` block rather than plain text:
@@ -355,13 +355,13 @@ tests:
355355

356356
### `assertions` present — explicit graders only
357357

358-
When `assertions` is defined, only the declared graders run. No implicit grader is added. Graders that are declared (such as `llm-grader`, `code-grader`, or `rubrics`) receive `criteria` as input automatically.
358+
When `assertions` is defined, only the declared graders run. No implicit grader is added. Graders that are declared (such as `llm-rubric`, `script`, or `rubrics`) receive `criteria` as input automatically.
359359

360360
If `assertions` contains only deterministic graders (like `contains` or `regex`), the `criteria` field is not evaluated and a warning is emitted:
361361

362362
```
363363
Warning: Test 'my-test': criteria is defined but no grader in assertions
364-
will evaluate it. Add 'type: llm-grader' to assertions, or remove criteria
364+
will evaluate it. Add 'type: llm-rubric' to assertions, or remove criteria
365365
if it is documentation-only.
366366
```
367367

@@ -373,7 +373,7 @@ tests:
373373
criteria: Response is helpful and mentions the fix
374374
input: "Debug this function..."
375375
assertions:
376-
- type: llm-grader # explicit — receives criteria automatically
376+
- type: llm-rubric # explicit — receives criteria automatically
377377
- type: contains
378378
value: "fix"
379379
```
@@ -390,7 +390,7 @@ tests:
390390
criteria: Response is helpful and mentions the fix
391391
input: "Debug this function..."
392392
assertions:
393-
- type: llm-grader
393+
- type: llm-rubric
394394
preprocessors:
395395
- type: xlsx
396396
command: ["bun", "run", "scripts/preprocessors/xlsx-to-json.ts"]

apps/web/src/content/docs/docs/v4.42.4/evaluation/examples.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ tests:
9191
command: [uv, run, validate_json.py]
9292
cwd: ./graders
9393
- name: content_evaluator
94-
type: llm-grader
94+
type: llm-rubric
9595
prompt: ./graders/semantic_correctness.md
9696

9797
input: |-
@@ -108,7 +108,7 @@ tests:
108108
109109
## File Output Preprocessing
110110
111-
Convert a binary file output into text before the `llm-grader` sees it:
111+
Convert a binary file output into text before the `llm-rubric` sees it:
112112

113113
```yaml
114114
description: Grade spreadsheet output via a preprocessor
@@ -183,15 +183,15 @@ assertions:
183183
threshold: 0.6
184184
assertions:
185185
- name: grader-gpt-5-mini
186-
type: llm-grader
186+
type: llm-rubric
187187
target: grader_gpt_5_mini
188188
prompt: ../prompts/grader-pass-fail-v1.md
189189
- name: grader-claude-haiku
190-
type: llm-grader
190+
type: llm-rubric
191191
target: grader_claude_haiku
192192
prompt: ../prompts/grader-pass-fail-v1.md
193193
- name: grader-gemini-flash
194-
type: llm-grader
194+
type: llm-rubric
195195
target: grader_gemini_flash
196196
prompt: ../prompts/grader-pass-fail-v1.md
197197
```

apps/web/src/content/docs/docs/v4.42.4/graders/execution-metrics.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ tests:
129129
assertions:
130130
# Semantic quality
131131
- name: quality
132-
type: llm-grader
132+
type: llm-rubric
133133
prompt: ./prompts/code-quality.md
134134
135135
# Efficiency constraints

apps/web/src/content/docs/docs/v4.42.4/graders/llm-graders.mdx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ LLM graders use a language model to evaluate agent responses against custom crit
1212

1313
## Default Grader
1414

15-
When a test defines `criteria` but has **no `assertions` field**, a default `llm-grader` runs automatically. The built-in prompt evaluates the response against your `criteria` and `expected_output`:
15+
When a test defines `criteria` but has **no `assertions` field**, a default `llm-rubric` runs automatically. The built-in prompt evaluates the response against your `criteria` and `expected_output`:
1616

1717
```yaml
1818
tests:
1919
- id: simple-eval
2020
criteria: Correctly explains the bug and proposes a fix
2121
input: "Debug this function..."
22-
# No assertions needed — default llm-grader evaluates against criteria
22+
# No assertions needed — default llm-rubric evaluates against criteria
2323
```
2424

2525
When `assertions` **is** present, no default grader is added. To use an LLM grader alongside other graders, declare it explicitly. See [How criteria and assertions interact](/docs/v4.42.4/evaluation/eval-cases/#how-criteria-and-assertions-interact).
@@ -31,12 +31,12 @@ Reference an LLM grader in your eval file:
3131
```yaml
3232
assertions:
3333
- name: semantic_check
34-
type: llm-grader
34+
type: llm-rubric
3535
prompt: file://graders/correctness.md
3636
target: grader_gpt_5_mini # optional: route this grader to a named LLM target
3737
```
3838
39-
Use `target:` when you want different `llm-grader` entries in the same eval to run on different grader models. This is useful for grader panels, majority-vote ensembles, and grader A/B benchmarks.
39+
Use `target:` when you want different `llm-rubric` entries in the same eval to run on different grader models. This is useful for grader panels, majority-vote ensembles, and grader A/B benchmarks.
4040

4141
## Prompt Files
4242

@@ -100,26 +100,26 @@ tests:
100100
row: 1
101101
assertions:
102102
- name: dexter_semantic
103-
type: llm-grader
103+
type: llm-rubric
104104
prompt: file://prompts/dexter-grader.md
105-
rubrics:
105+
value:
106106
- operator: correctness
107-
criteria: Uses the provided ticker and company.
107+
outcome: Uses the provided ticker and company.
108108
```
109109

110110
## Per-Grader Target
111111

112-
By default, an `llm-grader` uses `defaults.grader` from the resolved config graph.
112+
By default, an `llm-rubric` uses `defaults.grader` from the resolved config graph.
113113
Override it per grader when you need multiple grader models in one run:
114114

115115
```yaml
116116
assertions:
117117
- name: grader-gpt
118-
type: llm-grader
118+
type: llm-rubric
119119
target: grader_gpt_5_mini
120120
prompt: ./prompts/pass-fail.md
121121
- name: grader-haiku
122-
type: llm-grader
122+
type: llm-rubric
123123
target: grader_claude_haiku
124124
prompt: ./prompts/pass-fail.md
125125
```
@@ -178,7 +178,7 @@ When using TypeScript templates, configure them in YAML with optional `config` d
178178
```yaml
179179
assertions:
180180
- name: custom-eval
181-
type: llm-grader
181+
type: llm-rubric
182182
prompt:
183183
command: [bun, run, ../prompts/custom-grader.ts]
184184
config:
@@ -190,7 +190,7 @@ The `config` object is available as `ctx.config` inside the template function.
190190

191191
## Preprocessing File Outputs
192192

193-
If an agent returns a `ContentFile` block instead of plain text, you can preprocess that file into text before `llm-grader` builds the candidate prompt.
193+
If an agent returns a `ContentFile` block instead of plain text, you can preprocess that file into text before `llm-rubric` builds the candidate prompt.
194194

195195
AgentV always tries a default UTF-8 text read first. That is enough for text-based formats such as CSV, JSON, SQL, Markdown, YAML, HTML, XML, and plain text. For binary formats such as `.xlsx`, `.pdf`, or `.docx`, add a preprocessor command:
196196

@@ -205,7 +205,7 @@ tests:
205205
input: Generate the spreadsheet report
206206
assertions:
207207
- name: spreadsheet-check
208-
type: llm-grader
208+
type: llm-rubric
209209
prompt: |
210210
Check whether the transformed spreadsheet text contains the revenue rows:
211211
@@ -220,7 +220,7 @@ Resolution order:
220220
- if no preprocessor matches, AgentV falls back to a UTF-8 text read
221221
- if the fallback read looks binary or invalid, the grader receives a warning note instead of failing the test run
222222

223-
The implicit default `llm-grader` also inherits suite-level `preprocessors`, so you can omit `assertions` and still preprocess file outputs before grading.
223+
The implicit default `llm-rubric` also inherits suite-level `preprocessors`, so you can omit `assertions` and still preprocess file outputs before grading.
224224

225225
See [`examples/features/preprocessors/`](../../../../../examples/features/preprocessors/) for a runnable example with a file-producing target and a custom preprocessor script.
226226

apps/web/src/content/docs/docs/v4.42.4/guides/benchmark-provenance.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ description: Generated finance research cases with row-level provenance.
212212
213213
assertions:
214214
- name: answer-quality
215-
type: llm-grader
215+
type: llm-rubric
216216
prompt: ./graders/finance-answer.md
217217
required: true
218218

apps/web/src/content/docs/docs/v4.42.4/guides/evaluation-types.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ AgentV's eval tooling is designed for **execution quality**:
6767
- **`EVAL.yaml`** — define test cases with inputs, expected outputs, and assertions
6868
- **`evals.json`** — lightweight skill evaluation format (prompt/expected-output pairs)
6969
- **`agentv eval`** — execute evaluations and collect results
70-
- **Graders**`llm-grader`, `code-grader`, `tool-trajectory`, `rubrics`, `contains`, `regex`, and others all measure execution behavior
70+
- **Graders**`llm-rubric`, `script`, `tool-trajectory`, `rubrics`, `contains`, `regex`, and others all measure execution behavior
7171

7272
These tools assume the skill is already loaded and invoked. They measure what happens *after* routing, not the routing decision itself.
7373

apps/web/src/content/docs/docs/v4.42.4/guides/human-review.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ The `feedback.json` file is a structured annotation of a single eval run. It rec
9696
"notes": "Missing coverage of multi-document queries.",
9797
"evaluator_overrides": {
9898
"code-grader:format-check": "Too strict — penalized valid output with trailing newline",
99-
"llm-grader:quality": "Score 0.6 seems fair, answer was incomplete"
99+
"llm-rubric:quality": "Score 0.6 seems fair, answer was incomplete"
100100
},
101101
"workspace_notes": "Workspace had stale cached files from previous run — may have affected retrieval results."
102102
},
@@ -148,7 +148,7 @@ For workspace evaluations with multiple graders (code graders, LLM graders, tool
148148
"verdict": "needs_improvement",
149149
"evaluator_overrides": {
150150
"code-grader:test-pass": "Tests pass but the refactored code has a subtle race condition the tests don't cover",
151-
"llm-grader:quality": "Score 0.9 is too high — the agent left dead code behind",
151+
"llm-rubric:quality": "Score 0.9 is too high — the agent left dead code behind",
152152
"tool-trajectory:efficiency": "Used 12 tool calls where 5 would suffice, but the result is correct"
153153
},
154154
"workspace_notes": "Agent cloned the repo correctly but didn't clean up temp files."

0 commit comments

Comments
 (0)