Repository navigation
v2.0.8 — 2026-10-20
Release Notes
Patch release on the v2.x line under the support policy: seven data-integrity fixes for queries that silently returned too few or too many rows — :db/valid-at in not-join bodies (#615) and rule definitions (#617), or / or-join branches (#620, #625, #637), and rules that call or recurse through a rule with not, not-join, or or or-join (#628, #633). File format is unchanged (v7). No API changes. Stored data was never affected. Upgrading is recommended for every v2.x user who uses or, not-join, :db/valid-at or rules with negation or disjunction.
Fixed
- A
:db/valid-atpattern in anot-joinbody binds the query's valid time on every path (#615). When the body also held an expression, sat in anorbranch, or ran in a query that invokes a rule, the body boundnil, so(not-join [?e] [?e :db/valid-at ?t] [(> ?t 0)])never matched and excluded nothing; without the expression the same body excluded every entity. It now binds the query's:valid-atvalue (or the current time) as the other paths do. Present since v0.13.1. - A
:db/valid-atpattern in a rule definition binds the query's valid time (#617). The rule evaluators never received it, so in a rule body the pattern boundniland the query failed withINT-022; in a rule'snot/not-joinbody it boundnil, so the negation never matched on it; and in a rule'sorbranch it bound the current time instead of the query's:valid-at. Rule bodies, their negation bodies andorbranches now bind the query's:valid-atvalue, the current time without one, andnilunder:any-valid-time, as patterns outside rules do. - An expression reading a variable only an
orbinds keeps its rows (#625). The planner places expressions among the patterns andnots, andor/or-joinrun after them, so an expression such as[(> ?x 1)]in[?e :n _] (or [?e :n ?x] [?e :ok ?x]) [(> ?x 1)]ran before?xwas bound and dropped every row, in queries and in rule bodies. Such an expression now runs after theors, before thenots that wait for them, as thosenots already did. - A rule calling a rule with
not,not-join,ororor-joingets all its rows (#628). Stratification put a rule in the same stratum as the rules it calls, and within a stratum the rules without those clauses run first, so(rule [(st ?m ?s) [?m :msg/actor ?a] (cur ?a ?s)])ran before anycurrow existed whencurhad anot-join, and returned nothing; a caller that had anotororof its own ran before or after its callee depending on the query. A rule now sits in a stratum above any rule with such a clause it calls, unless the two call each other. - Recursion through a rule with
not,not-join,ororor-joinreturns all its rows (#633). Within a stratum such a rule ran once, after the rules without those clauses had reached their fixpoint, so its rows never fed back into the recursion:(rule [(reach ?x ?y) [?x :e ?z] (reach ?z ?y) (not [?y :blocked true])])stopped after one step and returned 7 of 10 pairs on a four-edge chain, with no error. A stratum whose rules call such a rule in it now repeats until that rule derives nothing new, bounded by the rule limits (INT-020), and the rule no longer adds a row it already derived.max_resultsnow counts every fact the rules derive in one evaluation, across strata and repeated passes, as documented; it used to count each stratum's rules without those clauses separately and not the rules with them at all. - An
or/or-joinbranch meets a keyword value as the entity it names (#637). Unless a branch held anotor an expression reading an outer variable, the executor ran each branch alone and joined its rows to the outer rows by exact value, so a keyword never met the ref of the entity it names: with[:alice :friend :bob] [:bob :name "B"],[:find ?e ?n :where [?e :friend ?f] (or [?f :name ?n] [?f :alias ?n])]returned no rows instead of:alice "B", with no error, in queries and in rule bodies. The join now compares them as a join between patterns and anot-joinalready did. - An
or/or-joinbranch whose expression reads an outer variable matches (#620). A branch such as[(> ?v 1)]in[?e :n ?v] (or [(> ?v 1)] [(< ?v 0)])was evaluated on its own from an empty binding and joined back afterwards, so its expression saw?vunbound and the branch matched nothing: theorsilently dropped rows it should keep, in queries and in rule bodies. A branch whose expression reads a variable the branch does not bind itself is now seeded with each incoming row (anor-joinbranch with the row's join variables).
Tests
tests/not_join_test.rschecks:db/valid-atinnot-joinbodies on the per-row path (#615), rules calling a rule withnot,not-joinoror(#628), and recursion through such a rule (#633);tests/recursive_rules_test.rschecks:db/valid-atin rule definitions, their negation bodies andorbranches (#617);tests/disjunction_test.rschecksorbranches whose expressions read an outer variable (#620), expressions reading a variable only anorbinds (#625), and keyword values meeting the entity they name (#637). Stratification, evaluator and optimizer unit tests cover the new strata, the repeated passes and their limits, and expression placement.
Known issues
- Same-transaction multi-valued facts can read back as one value (#371, #287), a fact retracted and re-asserted in one
WriteTransactionis lost at commit (#477), a later assertion does not replace an earlier valid-time window (#435),save()is not crash-atomic (#374), and a.walfrom a later checkpoint is replayed onto an older.graph(#535); all are fixed in v3.0.0. All v2.x known issues, with affected versions and workarounds, are listed in the pinned issue #421.
Download minigraf 2.0.8
| File | Platform | Checksum |
|---|---|---|
| minigraf-aarch64-apple-darwin.tar.xz | Apple Silicon macOS | checksum |
| minigraf-x86_64-apple-darwin.tar.xz | Intel macOS | checksum |
| minigraf-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| minigraf-aarch64-unknown-linux-gnu.tar.xz | ARM64 Linux | checksum |
| minigraf-x86_64-unknown-linux-gnu.tar.xz | x64 Linux | checksum |