Skip to content

feat(rules): semantic rules accept a check precondition before the judge - #160

Merged
mindsocket merged 4 commits into
mainfrom
issue-156
Oct 16, 2026
Merged

mindsocket merged 4 commits into
mainfrom
issue-156

Conversation

@mindsocket

@mindsocket mindsocket commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Closes #156. Stacked on #159.

Summary

  • A semantic rule may carry a check. Order: when → check → judge. A failing check reports a violation and the judge is not called.
  • A check runs even without --semantic, since it costs no model call.
  • A failing check reports at the rule's severity (ruleSeverity), with evidence expression check failed: <expression>.
  • A failing check gates descendants like an expression rule failure: by default at error severity, overridable with gatesDescendants.
  • A check that cannot be evaluated is reported as a rule error.

Notes for review

  • With a verdict-map severity, a failing check uses the most severe non-ignore entry; an all-ignore map gives info. A planned change to the rule shape (expression and semantic replacing mode/check/rubric) will remove this inference.

@mindsocket
mindsocket added this pull request to stack #162 October 16, 2026 01:21
@mindsocket mindsocket changed the title issue 156 feat(rules): semantic rules accept a check precondition before the judge Oct 16, 2026
@mindsocket
mindsocket removed this pull request from stack #162 October 16, 2026 03:55
@mindsocket
mindsocket added this pull request to stack #167 October 16, 2026 03:55
@mindsocket
mindsocket marked this pull request as ready for review October 16, 2026 03:56
@claude

claude Bot commented Oct 16, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@mindsocket
mindsocket force-pushed the issue-156 branch 2 times, most recently from 80ad92b to b482d59 Compare October 16, 2026 04:10
Base automatically changed from issue-154 to main October 16, 2026 04:12
A semantic rule may carry a `check` (expression syntax). Order is when, check, judge.
A failing check reports the rule's own severity without calling the judge; an
unevaluable check reports an error. Neither gates descendants.
…scendants; mark check failures

A semantic rule's check is a free expression test, so it runs on every validate
without --semantic/--judge. A failing check reports a violation whose evidence reads
'expression check failed: <expression>' and gates descendants only with an explicit
gatesDescendants: true.
@mindsocket
mindsocket merged commit 6830cb8 into main Oct 16, 2026
2 checks passed
@mindsocket
mindsocket deleted the issue-156 branch October 16, 2026 06:22
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.

Semantic rules: allow a deterministic check as fail-fast precondition

1 participant