Skip to content

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

Closed

Description

@mindsocket

Idea (option 2 from PR #151 review, docs/semantic-rules.md)

Allow a semantic rule to also carry a check. The check runs first (cheap, deterministic); the judge runs only if the check passes.

Example:

{
  "id": "active-assignee-role",
  "category": "workflow",
  "mode": "semantic",
  "type": "opportunity",
  "when": "current.status = 'active'",
  "check": "(current.assignee)",
  "rubric": "The node body states the assignee's role"
}

This gives two gates before the model call (when + check), a deterministic fail-fast, and the rule is effectively an expression rule wherever the semantic part is not reached.

Open questions

  • Violation/severity capture: a failing check reports the rule's own severity as for an expression rule; a judged verdict maps through the verdict severity map. Spell out the combined contract.
  • Interaction with the default pass/fail verdicts.
  • Alternative considered and rejected for now: a semantic rule running both checks unconditionally; and the current case (semantic rules cannot have check).
  • Option 1 (stay as-is) vs option 3 (run both) vs option 2 (this proposal): option 2 preserves the no-accidental-cost property and composes with when.

Pairs with #155 (batching) as follow-ups to PR #151.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions