Repository navigation
fix(rules): a pseudo-attribute in a rule body reads the stored fact (#661) - #666
Merged
Merged
Conversation
…661) Backport of the v3 fix. RecursiveEvaluator copied the base facts into its working storage with transact, one fact per call, so a positive rule body's :db/valid-from, :db/valid-to, :db/tx-count and :db/tx-id read the copy's metadata (evaluation time, forever, new counters). The base facts are now loaded as stored, as the mixed-rule pass already did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019kY61Y11gcRD91Y6b7jbGT
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Oct 20, 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 #665 (v3) for a v2.0.x patch. #661 is data-integrity / known-issue and stays open until the patch is published (no closing keyword).
RecursiveEvaluator::evaluate_recursive_rulescopied the base facts into its workingFactStoragewithtransact, one fact per call, so a positive rule body's:db/valid-from,:db/valid-to,:db/tx-countand:db/tx-idread the copy's metadata (evaluation time, forever, new counters). The base facts are now loaded as stored (load_facts+restore_tx_counter), as the mixed-rule pass already did. Same code onmainas onv3; applied by hand.Test:
tests/recursive_rules_test.rs(same as on v3) — each pseudo-attribute through a positive and a recursive rule equals the pattern in a query body. Fails onmainwithout the fix (checked). 1,318 tests (1,309 passing, 9 ignored). CHANGELOG Unreleased → Fixed.🤖 Generated with Claude Code
https://claude.ai/code/session_019kY61Y11gcRD91Y6b7jbGT