Skip to content

Commit ea8a134

Browse files
committed
fix: address Copilot review feedback on #386
- Add Type field to synthesized _checkpoint_error GraderResults - Fix docs to reference 'graders:' (the actual YAML key) instead of 'validators:' - Update schema-changes.md Policy section to reflect current 1.1 default emission while preserving 1.0 reader fallback for back-compat Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b2656e1 commit ea8a134

6 files changed

Lines changed: 20 additions & 10 deletions

File tree

.impeccable/hook.cache.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":1,"sessions":{}}

internal/orchestration/checkpoints.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ type checkpointRunner struct {
3434
}
3535

3636
// newCheckpointRunner builds a checkpointRunner from a TestCase. Returns nil
37-
// when the task has no checkpoints — callers should always check for nil
38-
// before invoking methods.
37+
// when the task has no checkpoints, but all methods on *checkpointRunner are
38+
// nil-safe — callers can invoke runForTurn/results on the returned value
39+
// directly without a nil guard.
3940
func newCheckpointRunner(runner *EvalRunner, tc *models.TestCase) *checkpointRunner {
4041
if tc == nil || len(tc.Checkpoints) == 0 {
4142
return nil
@@ -112,6 +113,7 @@ func (cr *checkpointRunner) runForTurn(ctx context.Context, turn int, resp *exec
112113
}
113114
outcome.Validations["_checkpoint_error"] = models.GraderResults{
114115
Name: "_checkpoint_error",
116+
Type: models.GraderKind("checkpoint_error"),
115117
Score: 0,
116118
Passed: false,
117119
Feedback: err.Error(),

internal/orchestration/runner.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,13 +1231,20 @@ func (r *EvalRunner) executeRun(ctx context.Context, tc *models.TestCase, runNum
12311231

12321232
// Surface checkpoint failures in the run status even when graders are
12331233
// skipped or when the final-pass graders all passed. A failed checkpoint
1234-
// without on_failure: stop should still mark the run as failed.
1234+
// without on_failure: stop should still mark the run as failed; a
1235+
// checkpoint that recorded StatusError (grader-execution error) should
1236+
// promote the run to StatusError so consumers can distinguish
1237+
// infrastructure problems from assertion failures.
12351238
checkpointOutcomes := cps.results()
12361239
if status != models.StatusError {
12371240
for _, co := range checkpointOutcomes {
1238-
if co.Status != models.StatusPassed {
1239-
status = models.StatusFailed
1240-
break
1241+
switch co.Status {
1242+
case models.StatusError:
1243+
status = models.StatusError
1244+
case models.StatusFailed:
1245+
if status != models.StatusError {
1246+
status = models.StatusFailed
1247+
}
12411248
}
12421249
}
12431250
}

site/src/content/docs/guides/eval-yaml.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ Each checkpoint accepts:
443443
| Field | Type | Description |
444444
| ------------ | -------- | --------------------------------------------------------------------------------- |
445445
| `after_turn` | int | 1-based turn number this checkpoint runs after (initial prompt is turn 1). |
446-
| `graders` | array | Inline graders, same schema as task `validators:` / eval-level `graders:`. |
446+
| `graders` | array | Inline graders, same schema as the task-level `graders:` / eval-level `graders:` field. |
447447
| `on_failure` | string | `continue` (default) or `stop` — abort remaining turns when this checkpoint fails.|
448448

449449
Outcomes are recorded per-checkpoint on `results.json` under `checkpoints[]`, alongside the final `validations`. `waza gate` still uses final-pass status. Available with `schemaVersion: "1.1"` and above (additive — older 1.0 files load unchanged).

site/src/content/docs/reference/schema-changes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Schema versions use `MAJOR.MINOR` format with no patch component.
2020

2121
- **MINOR** changes are backward-compatible additions, usually optional fields. Readers accept same-major artifacts and warn when they see unknown fields.
2222
- **MAJOR** changes are breaking. Readers refuse artifacts from a different major version and point to `waza migrate <file>`.
23-
- Missing `schemaVersion` defaults to `1.0` for backward compatibility with existing `eval.yaml` and `results.json` files.
24-
- New artifacts should include `schemaVersion: "1.0"` or `"schemaVersion": "1.0"` explicitly.
23+
- Missing `schemaVersion` defaults to `1.0` for backward compatibility with eval suites authored before the field was introduced. Same-major readers continue to accept `1.0`-defaulted files unchanged.
24+
- New artifacts should emit the current `schemaVersion` (currently `1.1`). The version is automatically populated by the writer; you only need to set it manually when authoring fixtures or schema-pinned test data.
2525

2626
## Migration command
2727

site/src/content/docs/reference/schema.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ Per-turn graders that run at specific turn boundaries during multi-turn conversa
574574
| Field | Type | Required | Description |
575575
|--------------|---------|----------|----------------------------------------------------------------------------------------------|
576576
| `after_turn` | integer | yes | 1-based turn number to grade after. Turn 1 is the initial prompt; follow-ups are 2, 3, ... |
577-
| `graders` | array | yes | Inline graders (same schema as task `validators:`). |
577+
| `graders` | array | yes | Inline graders (same schema as the task-level `graders:` field). |
578578
| `on_failure` | string | no | `continue` (default) or `stop`. `stop` aborts remaining turns when this checkpoint fails. |
579579

580580
```yaml

0 commit comments

Comments
 (0)