Skip to content

feat(judge): semantic.scope and semantic.includeContent - #165

Merged
mindsocket merged 6 commits into
mainfrom
issue-152-scope
Oct 16, 2026
Merged

mindsocket merged 6 commits into
mainfrom
issue-152-scope

Conversation

@mindsocket

@mindsocket mindsocket commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Part of #152. Stacked on #164.

Summary

  • semantic.scope sends related nodes with the evaluated node, following the edges of the main hierarchy only. It takes any of parent, siblings, children, ancestors, descendants, and branch.
    • branch means ancestors + descendants.
    • ancestors implies parent, and descendants implies children. So equal node sets give equal input, and a direct parent or child keeps its relation label.
  • A related node carries all its schema data. It appears once in the input, listed with every relation it has. The model provider gets the related nodes as a flat list, with each node's relation.
  • Selection is independent. Scope sends node data only, never other rules' verdicts. Gating never changes which nodes it selects.
  • semantic.includeContent is nodeOnly or fullScope (true means fullScope). Without it no body is sent, not even the evaluated node's. This is a behaviour change for existing semantic rules.
  • Separate inputs per context: on one node, rules asking for different scope or content get separate provider inputs. Grouping by identical rule set (Jev batching: one call per node; consider fewer, larger calls (per space) #155) is unchanged.
  • Docs: docs/semantic-rules.md documents the feature, and recommends attaching wide-scope rules where parent, children or ancestors covers what they need. docs/concepts.md adds the terms "evaluated node" and "related nodes".

Tests

lint and typecheck clean; bun run test 757 pass, 15 skip, 0 fail.

@mindsocket
mindsocket added this pull request to stack #167 October 16, 2026 03:55
@mindsocket mindsocket changed the title issue 152 scope feat(judge): semantic.scope and semantic.includeContent Oct 16, 2026
@mindsocket
mindsocket force-pushed the issue-152-scope branch 4 times, most recently from c16c93c to f9bbc79 Compare October 16, 2026 04:34
@mindsocket
mindsocket marked this pull request as ready for review October 16, 2026 04:34
@claude

claude Bot commented Oct 16, 2026

Copy link
Copy Markdown

Code review

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

Base automatically changed from rule-shape to main October 16, 2026 04:43
A semantic rule can add related nodes (parent, siblings, children, ancestors,
descendants; main-hierarchy edges only) and choose which node bodies are sent.
Providers receive related nodes as a flat list with their relations. Without
includeContent no body is sent, including the evaluated node's own.
Also recommend attaching wide-scope rules at a level where parent, children
or ancestors covers what they need.
Equal node sets now give equal inputs, and a direct parent or child keeps
its relation label.
Per-rule providers take the whole judge input, so new input fields need no
signature change. Related nodes keep nearest-first selection order instead of
an alphabetical re-sort. Drop the judgeNode wrapper, the body fallback and the
includeContent oneOf.

@mindsocket mindsocket left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Docs issues

Comment thread docs/semantic-rules.md Resolved
Comment thread docs/semantic-rules.md Resolved
Comment thread docs/semantic-rules.md Resolved
@mindsocket
mindsocket merged commit 7dd2bc9 into main Oct 16, 2026
2 checks passed
@mindsocket
mindsocket deleted the issue-152-scope 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.

1 participant