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.

ci: fix the two failures, one a Windows line-ending bug and one a stale citation

FABIOTESS3dcc6b869d87
diff --git a/python/src/open_ontologies_lite/horn/reason.py b/python/src/open_ontologies_lite/horn/reason.py
index cceabbdd..cbc58ad1 100644
--- a/python/src/open_ontologies_lite/horn/reason.py
+++ b/python/src/open_ontologies_lite/horn/reason.py
@@ -245,9 +245,10 @@ def _facts(store, graphs) -> tuple[list[Fact], list[str]]:
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:2170`,
- `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
+ 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()))
@@ -442,8 +443,9 @@ def run_horn(
the Lean checker decides whether it did.
`graphs="default"` asserts only the default graph. `"all"` flattens every
- graph the way the Rust engine does, and RAISES if the inferred graph is
- present.
+ graph and RAISES if the inferred graph is present, which is stricter than the
+ Rust engine: that one excludes the inferred graph rather than refusing the
+ run.
`max_iterations=None` runs to a genuine fixpoint. No cap is needed for
termination: `parse_rules` refuses a head variable that does not occur in the
diff --git a/python/tests/test_horn_differential.py b/python/tests/test_horn_differential.py
index ef1374af..3a2828e0 100644
--- a/python/tests/test_horn_differential.py
+++ b/python/tests/test_horn_differential.py
@@ -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:2240`, `all.sort_unstable()` over `Vec<(u32,u32,u32)>`), so its
+(`src/reason.rs:2757`, `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 --git a/python/tests/test_horn_fixpoint_and_scope.py b/python/tests/test_horn_fixpoint_and_scope.py
index 96f7d8b7..5f9ad720 100644
--- a/python/tests/test_horn_fixpoint_and_scope.py
+++ b/python/tests/test_horn_fixpoint_and_scope.py
@@ -18,13 +18,20 @@ at the top of each round for exactly that reason, and the test below runs the sa
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:2170`, `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
+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
diff --git a/src/tableaux.rs b/src/tableaux.rs
index 8e7c7f69..6091c03d 100644
--- a/src/tableaux.rs
+++ b/src/tableaux.rs
@@ -4780,8 +4780,14 @@ mod certificate_boundary_tests {
/// TCB-26 was listed as trusted rather than tested.
#[test]
fn tcb_26_only_push_name_writes_a_name() {
+ // Normalise line endings before any of the anchors below are matched.
+ // git on Windows checks this file out with CRLF by default, and the
+ // `fn emit(\n` anchor wants a newline immediately after the paren, so
+ // without this the anchor misses, `expect` fires, and the test fails on
+ // Windows alone while passing on Linux and macOS. It did exactly that.
let src = std::fs::read_to_string(concat!(env!("CARGO_MANIFEST_DIR"), "/src/tableaux.rs"))
- .expect("this file is readable");
+ .expect("this file is readable")
+ .replace("\r\n", "\n");
// The two regions that build certificate text: the serialisers, and the
// emitter that assembles `axioms.tsv` and `model.tsv` out of them.