Repository navigation
fix(rules): bind the query's valid time for :db/valid-at in rule definitions (#617, backport) - #621
Merged
Merged
Conversation
…nitions (#617, backport) Backport of #619 from v3. The rule evaluators were built without the query's valid time, so a :db/valid-at pattern in a rule body bound nil (INT-022 on the head), in a rule's not / not-join body bound nil, and in a rule's or branch bound the current time. StratifiedEvaluator and RecursiveEvaluator now take it via with_valid_at and use it for rule bodies, negation bodies and or branches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Uh oh!
There was an error while loading. Please reload this page.
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 #619 (merged on
v3) for the next v2.0.x patch. Issue #617; it stays open until that patch is published.Problem
StratifiedEvaluatorandRecursiveEvaluatorwere built without the query's valid time, so inside a rule definition a:db/valid-atpattern boundnilin the rule body (INT-022on the head) and innot/not-joinbodies, and bound the current time inorbranches instead of the query's:valid-at.Fix
Same as #619:
with_valid_atbuilders on both evaluators, set from the rules query path's existing valid-at value, and used for rule bodies,not/not-joinbodies (replacing theValue::Nullfrom #618) andorbranches. The source cherry-picked cleanly; only docs conflicted (resolved tomain, then the CHANGELOG entry and test counts were added).Tests
The five #619 regression tests in
tests/recursive_rules_test.rs. Full suite: 1274 passed, 9 ignored (the doc counts were 5 behind after #618; now corrected).cargo clippy --all-features -- -D warningsand fmt are clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz