Skip to content

feat(cli): validate only selected cases in run (#121)#131

Merged
zpzjzj merged 1 commit into
mainfrom
feat/validate-selected-cases
Jul 6, 2026
Merged

feat(cli): validate only selected cases in run (#121)#131
zpzjzj merged 1 commit into
mainfrom
feat/validate-selected-cases

Conversation

@zpzjzj

@zpzjzj zpzjzj commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Fixes #121.

Problem

skill-up run validated the whole suite (eval config + every case) before applying --include-case-name / --exclude-case-name filters. So one invalid unselected case blocked a filtered run — forcing teams to split smoke and full suites into separate eval files even when they share the same skill/environment/engine/fixtures.

Change

  • run now validates the eval-level config at load, then validates only the cases left after filtering. An invalid case that is filtered out no longer blocks the run.
  • skill-up validate is unchanged and still validates the whole suite (every case) regardless of filters.

Implementation

  • Split Validator.ValidateAll into ValidateEvalConfig (suite-level) + new ValidateCases(cases) (duplicate-ID / duplicate-file + per-case checks over whatever set is passed). ValidateAll = ValidateEvalConfig + ValidateCases(all), so validate behavior is identical.
  • Add CaseConfig.SourceFile (loader-populated, yaml:"-" json:"-"). Duplicate-case detection now keys off ID + SourceFile, so it is correct for any subset — and this removes the fragile result.Cases ↔ Eval.Cases.Files index-alignment the Validate duplicate case IDs and duplicate case file references #123 check relied on.
  • run.go: eval-level validation in loadFromEvalYAML; ValidateCases over the filtered set in loadAndPrepareConfig.
  • Docs: run-vs-validate validation scope documented in the command help and cli-reference.md.

Note: the --auto / evals.json run path now also validates its cases (previously unvalidated). This is safe — converted cases carry prompts, and their empty SourceFile skips the file-duplicate check.

Verify (matches the issue's steps)

  • New internal/cli test: an eval with a valid smoke case + an invalid full case (script judge, no script_path). run --include-case-name smoke succeeds; unfiltered run fails with the script_path error.
  • New validator tests: ValidateCases scoped duplicate detection; ValidateCases([valid]) passes while ValidateCases([valid, invalid]) fails.
  • go test -race ./... green; gofmt / go vet clean.

🤖 Generated with Claude Code

…ite (#121)

Previously `skill-up run` validated the whole suite (eval + every case)
before applying --include-case-name / --exclude-case-name filters, so one
invalid unselected case blocked a filtered run — forcing smoke and full
suites into separate eval files.

Now run validates the eval-level config at load, then validates only the
cases left after filtering. `skill-up validate` is unchanged and still
checks the whole suite via ValidateAll.

- Split Validator.ValidateAll into ValidateEvalConfig + new ValidateCases
  (dup-ID/dup-file + per-case checks over a given set).
- Add CaseConfig.SourceFile (loader-populated, yaml/json "-"), keying
  duplicate-case detection off ID+SourceFile so it is correct for any
  subset. This also removes the fragile result.Cases↔Eval.Cases.Files
  index-alignment the #123 check relied on.
- run.go: eval-level validation in loadFromEvalYAML; ValidateCases over the
  filtered set in loadAndPrepareConfig.
- Document the run-vs-validate distinction (CLI help + cli-reference).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@zpzjzj zpzjzj requested a review from hittyt as a code owner July 6, 2026 07:48
@zpzjzj zpzjzj requested review from jwx0925 and roark47 July 6, 2026 08:22

@roark47 roark47 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zpzjzj zpzjzj merged commit 47bcb42 into main Jul 6, 2026
24 of 25 checks passed
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.

Allow run filters to validate only selected cases or support first-class eval profiles

2 participants