8000 fix(rules): a pseudo-attribute in a rule body reads the stored fact (#661) by adityamukho · Pull Request #666 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

fix(rules): a pseudo-attribute in a rule body reads the stored fact (#661) - #666

Merged
adityamukho merged 1 commit into
mainfrom
fix/661-rule-pseudo-attrs-v2
Oct 20, 2026
Merged

adityamukho merged 1 commit into
mainfrom
fix/661-rule-pseudo-attrs-v2

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

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_rules copied the base facts into its working FactStorage 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 (load_facts + restore_tx_counter), as the mixed-rule pass already did. Same code on main as on v3; 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 on main without the fix (checked). 1,318 tests (1,309 passing, 9 ignored). CHANGELOG Unreleased → Fixed.

🤖 Generated with Claude Code

https://claude.ai/code/session_019kY61Y11gcRD91Y6b7jbGT

…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
codecov Bot commented Oct 20, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit cb8756e into main Oct 20, 2026
22 checks passed
@adityamukho
adityamukho deleted the fix/661-rule-pseudo-attrs-v2 branch October 20, 2026 16:21
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

0