Repository navigation
fix(config): reject rule_based matchers with no values - #409
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 972e52bf27
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
1f04f76 to
9871920
Compare
|
Review of |
zpzjzj
left a comment
There was a problem hiding this comment.
Requesting changes on 9871920: the whitespace-matcher regression remains. validateNonBlankMatcherValues uses TrimSpace, although a newline or two spaces is a meaningful literal/regex matcher, not an empty one. Please reject the actual empty string, preserve valid whitespace-only checks, and add regression coverage. No new runtime test was run in this pass.
|
Fixed in I checked the runtime before changing the check, and it confirms your reading: Coverage now shows a whitespace matcher distinguishing matching from non-matching output, at both layers:
Negative control: putting Also updated: the CLI: |
|
Please move this changelog entry to the current |
e4074a8 to
bb8cf69
Compare
|
Moved it in
|
|
Please move this changelog entry to |
bb8cf69 to
1b86c02
Compare
|
You were right, and my previous I had edited
|
alibaba#409 landed the empty output/turn-response matcher checks, so this change keeps the remaining gaps and addresses the review on the path grammar: - tool_called requires a non-whitespace tool name; an empty name never matches an invocation, so a success rule failed silently and a failure rule became a no-op. - files_exist/files_not_exist reject the workspace root (".", "/", "\", ".\"); the root always exists, so files_exist passed without checking anything and files_not_exist failed for the wrong reason. - Both judge rule_based checks and expect checks share one host-independent path grammar (both "/" and "\" are separators), and validateExpect now rejects root aliases too, so validation and execution agree. - post_condition must_contain_any/all/must_not_contain reject the empty entry, which is a substring of every response; whitespace matchers stay valid. Tests cover the shared grammar, root aliases in both file directions, tool_called names, expect alignment, and post_condition entries. Co-Authored-By: Claude Code <[email protected]>
Summary
skill-up validateaccepted arule_basedmatcher that names a matcher and gives it nothing to match:validateprinted✓ eval.yaml is valid, and a run then reported a full pass with one expectation and zero checks:{"text": "output_contains", "passed": true, "evidence": "output satisfies all contains checks ()"}So a half-filled or template-generated rule silently passed every case.
validateRecognizableRules(added for #294) rejects rules that name no matcher at all, but a matcher that is present and empty slips through and the runtime evaluates it as "nothing to check, passed". Unlike an unknown matcher key, this one is not caught by strict YAML decoding becauseallis a real field.Related issues
Same class as #294 (unknown matcher names silently dropped) and #365 (zero checks pass). No separate issue opened for this edge; say the word if you would rather track it there.
Changes
internal/config/validator.go: newvalidateNonVacuousRules, run overjudge.successandjudge.failurenext tovalidateRecognizableRules. It rejects:output_containswith noall/any/not,output_matcheswith noall/any/not,turn_response_containswith nocontains_all/contains_any,turn_response_not_containswith nonot_contains.The error names the field, e.g.
judge.success[0].output_contains must include at least one of all, any, or not.validateJudgeTypeAndLocalFields.docs/guide/writing-evals.mdanddocs/zh/guide/writing-evals.md: one sentence after theoutput_containsexplanation;CHANGELOG.mdentry under Fixed.Test plan
not,any,contains_all,not_contains) are still accepted.validateNonVacuousRulescalls turns the five new tests red with exactly those messages; restoring them makes them green.mainprints✓ eval.yaml is valid; the branch printsvalidation failed: ... judge.success[0].output_contains must include at least one of all, any, or not.make testandmake verify(0 issues).Notes
successrules is unchanged; this only rejects matchers that are present but vacuous.tool_calledwith an emptynamefails at runtime instead of passing vacuously, and an unknownreport.artifactsentry is a separate gap I found while probingvalidate.