Skip to content

Plan, apply and roll back changes to a production ontology, with a blast radius report and a proof an auditor can re-check.

Merge remote-tracking branch 'origin/main' into verdict-by-construction

FABIOTESS4ee026ec227d
diff --cc python/src/open_ontologies_lite/horn/reason.py
index 046d7aa6,cbc58ad1..6cd3c7dd
--- a/python/src/open_ontologies_lite/horn/reason.py
+++ b/python/src/open_ontologies_lite/horn/reason.py
@@@ -245,9 -245,10 +245,10 @@@ def _facts(store, graphs) -> tuple[list
The default is the DEFAULT GRAPH ALONE, which is where `OntologyEngine.load()`
puts everything, so this package's own users lose nothing by it. The Rust
- engine flattens every named graph here (`src/reason.rs:2178`,
- `graph.all_triples()`), which is the defect above: a store holding a prior
- materialisation turns derived triples into assertions.
+ engine flattens every named graph here EXCEPT the inferred one
- (`src/reason.rs:1105`, `graph.triples_outside(&[INFERRED_GRAPH])`). Before
++ (`src/reason.rs:2695`, `graph.triples_outside(&[INFERRED_GRAPH])`). Before
+ 15 September 2026 it excepted nothing, which was the defect above: a store
+ holding a prior materialisation turned derived triples into assertions.
"""
if graphs == "default":
quads = list(store.quads_for_pattern(None, None, None, ox.DefaultGraph()))
diff --cc python/tests/test_horn_differential.py
index ac033f15,3a2828e0..450aedb7
--- a/python/tests/test_horn_differential.py
+++ b/python/tests/test_horn_differential.py
@@@ -26,7 -26,7 +26,7 @@@ WHAT IS COMPARED, AND WHAT IS NOT
The assertion is SET EQUALITY OF DERIVED TRIPLES against the Rust `run_horn`, over
the same `builtin_rules.tsv`. Byte identity of the two `horn.tsv` files is NOT a
goal and must not be asserted: the Rust emitter sorts interned `u32` triples
- (`src/reason.rs:2248`, `all.sort_unstable()` over `Vec<(u32,u32,u32)>`), so its
-(`src/reason.rs:2757`, `all.sort_unstable()` over `Vec<(u32,u32,u32)>`), so its
++(`src/reason.rs:2765`, `all.sort_unstable()` over `Vec<(u32,u32,u32)>`), so its
line order is first-appearance order in the store, not lexicographic order.
Reproducing it from Python would mean reimplementing the interner and betting on
identical store-iteration order across two bindings, to buy nothing the set
diff --cc python/tests/test_horn_fixpoint_and_scope.py
index cd762eb0,5f9ad720..424f9f56
--- a/python/tests/test_horn_fixpoint_and_scope.py
+++ b/python/tests/test_horn_fixpoint_and_scope.py
@@@ -18,13 -18,20 +18,20 @@@ at the top of each round for exactly th
graph through two interpreters with different `PYTHONHASHSEED` and demands
identical bytes.
- SCOPE. This is the one that matters most. The Rust `run_horn` flattens every named
- graph into `asserted.tsv` (`src/reason.rs:2178`, `graph.all_triples()`), so a store
- that holds a previous materialisation in the inferred graph turns derived triples
- into ASSERTIONS. The checker cannot detect it: the soundness theorem is
- conditional on the assertions, and it is TOLD what they are. The result is a green
- absolute verdict about a graph nobody asserted. This package defaults to the
- default graph alone and refuses the inferred graph outright.
+ SCOPE. This is the one that matters most. Until 15 September 2026 the Rust
+ `run_horn` flattened every named graph into `asserted.tsv`, so a store holding a
+ previous materialisation in the inferred graph turned derived triples into
+ ASSERTIONS. The checker could not detect it: the soundness theorem is conditional
+ on the assertions, and it is TOLD what they are, so the result was a green
+ absolute verdict about a graph nobody asserted. It now reads
-`src/reason.rs:1105`, `graph.triples_outside(&[INFERRED_GRAPH])`, and the
++`src/reason.rs:2695`, `graph.triples_outside(&[INFERRED_GRAPH])`, and the
+ inferred graph is out of scope.
+
+ The two engines still differ in HOW, and the difference is deliberate. Rust
+ EXCLUDES the inferred graph; this package REFUSES a run that would read it. Both
+ keep a derived triple out of the asserted set, and refusing is the stricter of
+ the two, so a graph this package accepts is one the Rust engine would also have
+ scoped correctly.
"""
import os