Repository navigation
fix(rules): recursion through a rule with not / not-join / or (#633, backport) - #636
Merged
Merged
Conversation
Backport of #635 from v3. StratifiedEvaluator ran each rule with not/not-join/or/or-join once per stratum, after the positive rules' fixpoint, so recursion through such a rule stopped after one step. A stratum whose rules call one of its mixed predicates now repeats until the mixed pass derives nothing new; the mixed pass skips heads already in the store; max_iterations, max_derived_facts and max_results bound the loop (INT-020), with max_results counting every derived fact. The or test reads a variable an entity pattern binds: on v2.x an or branch compares a keyword and a ref exactly (changed on v3 by #546). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #635 (v3) to v2.x. Refs #633 — stays open until the v2.0.x patch ships.
Change
Same as #635, applied by hand to main's
StratifiedEvaluator(its mixed-rule pass differs from v3's, so not a cherry-pick):not/not-join/or/or-joinrule of the same stratum repeats (positive fixpoint, then mixed rules) until the mixed pass derives nothing new. Other strata run once, as before.max_iterations, new mixed facts per pass bymax_derived_facts, every fact the rules derive bymax_results(matches the documented "in total" meaning since v2.0.5; before, it was per stratum and positive rules only).Tests
Same tests as #635 (3 integration in
tests/not_join_test.rs, 4 evaluator unit tests). One difference: theortest'sorreads?x(bound by an entity pattern) instead of binding?z, because on v2.x anorbranch compares a keyword and a ref exactly — case (1) of v3's #546 CHANGELOG entry, not part of this fix. All three integration tests fail without the fix.1307 tests (1298 passing, 9 ignored). Docs: CHANGELOG (Unreleased), CLAUDE.md, README, TEST_COVERAGE.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz