Skip to content

fix(validate): smarter validation — cases, .eval.yaml enforcement, schema sync, custom assertions#1089

Merged
christso merged 3 commits intomainfrom
fix/validate-cases-and-examples
Apr 13, 2026
Merged

fix(validate): smarter validation — cases, .eval.yaml enforcement, schema sync, custom assertions#1089
christso merged 3 commits intomainfrom
fix/validate-cases-and-examples

Conversation

@christso
Copy link
Copy Markdown
Collaborator

Summary

  • Cases file support: YAML array roots are detected as 'cases' type and validated by a new validateCasesFile() — each item must have id and input
  • .eval.yaml enforcement: directory scanning only picks up *.eval.yaml files (not all YAML); inferFileTypeFromPath requires .eval.yaml suffix to return 'eval', otherwise 'unknown'
  • Schema sync with yaml-parser.ts: added preprocessors, category to KNOWN_TOP_LEVEL_FIELDS; added rubrics to KNOWN_TEST_FIELDS; removed non-existent note field from schema
  • Deprecation hints: evaluator, assert, eval_cases/evalcases, expected_outcome now emit specific deprecation messages instead of generic "unknown field" warnings
  • Custom assertion discovery: validator walks .agentv/assertions/ directories (same as runtime) to suppress false-positive "unknown assertion type" warnings for plugin assertion types
  • Example fixes: renamed tool-eval-demo.yaml.eval.yaml; replaced description: with YAML comments in trace-file-demo; removed deprecated evaluator: from basic-jsonl; replaced reference_answer: with proper expected_output: in prompt-template-sdk
  • agentv validate examples/ now reports 68/68 valid, 0 invalid, 0 warnings

Test plan

  • All 1618 core tests pass
  • TypeScript typecheck passes
  • Biome lint clean
  • agentv validate examples/ → 68/68 valid, 0 invalid, 0 warnings
  • Custom assertion word-count in sdk-custom-assertion example no longer triggers a false-positive warning

🤖 Generated with Claude Code

christso and others added 2 commits April 13, 2026 22:20
…ment, schema sync, custom assertion discovery

- FileType: add 'cases' type; directory scanner only picks up *.eval.yaml
- file-type.ts: YAML array root → 'cases'; require .eval.yaml suffix for eval inference
- cases-validator.ts: new validateCasesFile() validates YAML array test case files
- eval-validator.ts: sync KNOWN_*_FIELDS with yaml-parser.ts (add preprocessors, category, rubrics); add DEPRECATED maps with migration hints for evaluator/assert/eval_cases/expected_outcome; discover custom assertion types from .agentv/assertions/ to suppress false-positive warnings; remove redundant 'note' field
- eval-file.schema.ts: remove 'note' field from Zod schema
- examples: rename tool-eval-demo.yaml → .eval.yaml; fix trace-file-demo (description → YAML comments); fix basic-jsonl (remove deprecated evaluator); fix prompt-template-sdk (reference_answer → expected_output)
- agentv validate examples/: 68/68 valid, 0 warnings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 13, 2026

Deploying agentv with  Cloudflare Pages  Cloudflare Pages

Latest commit: 333c7cc
Status: ✅  Deploy successful!
Preview URL: https://c5cca464.agentv.pages.dev
Branch Preview URL: https://fix-validate-cases-and-examp.agentv.pages.dev

View logs

…n discovery

- Validate all files concurrently with Promise.all instead of sequential loop
- Cache discoverCustomAssertionTypes() results by directory so N files in the
  same directory only pay for one filesystem walk (not N)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@christso christso merged commit 88586cc into main Apr 13, 2026
4 checks passed
@christso christso deleted the fix/validate-cases-and-examples branch April 13, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant