8000 fix(rules): bind the query's valid time for :db/valid-at in rule definitions (#617, backport) by adityamukho · Pull Request #621 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

fix(rules): bind the query's valid time for :db/valid-at in rule definitions (#617, backport) - #621

Merged
adityamukho merged 1 commit into
mainfrom
fix/617-rule-valid-at-main
Oct 18, 2026
Merged

adityamukho merged 1 commit into
mainfrom
fix/617-rule-valid-at-main

Conversation

@adityamukho
@adityamukho 8000 adityamukho commented Oct 16, 2026
Copy link
Copy Markdown
Collaborator

Backport of #619 (merged on v3) for the next v2.0.x patch. Issue #617; it stays open until that patch is published.

Problem

StratifiedEvaluator and RecursiveEvaluator were built without the query's valid time, so inside a rule definition a :db/valid-at pattern bound nil in the rule body (INT-022 on the head) and in not / not-join bodies, and bound the current time in or branches instead of the query's :valid-at.

Fix

Same as #619: with_valid_at builders on both evaluators, set from the rules query path's existing valid-at value, and used for rule bodies, not / not-join bodies (replacing the Value::Null from #618) and or branches. The source cherry-picked cleanly; only docs conflicted (resolved to main, 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 warnings and fmt are clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz

…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
codecov Bot commented Oct 16, 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 f8306cb into main Oct 18, 2026
22 checks passed
@adityamukho
adityamukho deleted the fix/617-rule-valid-at-main branch October 18, 2026 07: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