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 modules-and-conservativity

FABIOTESSfb2b270f98c4
diff --cc CHANGELOG.md
index 23be423d,68ddb149..bdf03e30
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -4,46 -4,64 +4,104 @@@ All notable changes to Open Ontologies
## [Unreleased]
+### Added
+- **A module carries a theorem; a slice carries a measurement.** `onto_module_extract` computes a
+ syntactic locality module over a signature: `⊥`, `⊤` or the iterated `⊥⊤*`, the standard OWL API
+ algorithm. Unlike `onto_segment_retrieve`, whose loss then has to be measured by
+ `onto_closure_diff`, a locality module CANNOT lose an entailment over its signature, and the
+ difference is a theorem rather than a metric (Cuenca Grau, Horrocks, Kazakov and Sattler, JAIR 31,
+ 2008). That theorem is CITED and is not machine-checked, nothing under `lean/` being about
+ locality, so the report names a paper and never a Lean theorem, and
+ `the_module_report_never_names_a_lean_theorem` asserts that over the serialised report. What can
+ be checked is the consequence: `verify_out_dir` reasons the ontology and the module to a fixpoint
+ through the existing closure diff and reports every conclusion over the signature the module does
+ not reach, which must be none. Measured on `benchmark/reference/pizza-reference.owl`: 238 of 1,345
+ axioms and 510 of 2,332 triples, nothing unclassified, and zero of the 2,583 differences lost
+ over the signature. The locality test is written per
+ axiom type and an axiom that cannot be classified is INCLUDED rather than dropped, since any `M'`
+ with `M ⊆ M' ⊆ O` keeps the coverage property; the kinds and counts are in the payload so a small
+ module and an unreadable one cannot render the same. The negative test is the one that matters:
+ a naive slice keeping every triple that MENTIONS a signature term is five triples against the
+ module's four and has lost `Cat ⊑ LivingThing`, because the chain runs through an axiom that
+ mentions neither signature term. Running the verification found two places where the OWL 2 direct
+ semantics and this engine's rule table disagree, both now resolved towards the rule table, and one
+ of them (`X rdf:type owl:Thing`, a tautology the table does not regenerate) was not predicted.
+- **`onto_conservative_check`, and the same check inside `onto_plan`.** Does adding these axioms
+ change anything the ontology already said, over the names it already used? It is
+ `closure_diff` run in the extension direction: source `base ∪ extension`, projection `base`, and
+ the difference restricted to the old signature, with the rule and the premises the base lacked
+ already attached by the existing code. A non-conservative extension is a FINDING and never an
+ error, and every plan now carries a `conservativity` block that either has the answer or says it
+ did not look, because a missing block and a clean block read the same to a dashboard. This is the
+ only part of a plan that is about MEANING: one `rdfs:domain` triple retypes every existing
+ individual of that property while adding no class, removing nothing, and scoring `low` risk.
+ THE FRAGMENT IS NAMED IN THE PAYLOAD. What is computed is conservativity with respect to the Horn
+ rule table the engine evaluates. It is not deductive conservativity in a description logic
+ (ExpTime-complete for `EL`, 2ExpTime-complete for `ALC`, undecidable for `ALCQIO`) and not model
+ conservativity (undecidable already for `EL`), so the verdict field is `conservativity_verdict`
+ with four words, the boolean beside it is `conservative_under_rule_table` and is null when
+ undecided, and there is deliberately no field called `conservative`. See decision 0011.
+- `projection_entailment::skolemise_with_prefix`, so two graphs that are about to be merged can be
+ skolemised without `_:b0` on both sides becoming one IRI naming two different existentials.
+ `skolemise` is unchanged for every existing caller.
+ ### Fixed
+ - **A front-page claim was gated by a test that ran nowhere, and now runs in CI.** `README.md`
+ reported that the cross-kernel differential "reports zero divergent rows", and
+ `tests/cross_kernel_differential_test.rs` does require exactly that and fails on any row at
+ all. No workflow ran it. Its `skip()` wants lake AND Poly/ML: the `build` job has neither, so
+ it skipped there, and the `lean` job, which has lake, invoked the file from no leg. A skipped
+ test reports `ok`. `docs/ci-gates.md` listed this under "What is still open" and decision 0008
+ carried a "Not run in CI" bullet, so it was known, written down, and unable to fail.
+
+ What CI installs is NOT Isabelle, and the old reasoning that it would have to be is what kept
+ this open. `isabelle/driver/oo_horn_generated.ML` is committed, so the missing piece was a
+ compiler for it: Isabelle publishes Poly/ML as a 39 MB component, pinned here by SHA-256,
+ cached, and the same 5.9.2-2 build that generated that file, so CI and the developer machine
+ run one compiler and not two. Not `apt-get install polyml`, which was checked rather than
+ assumed because `prover9` having no apt candidate on noble broke this job once already: Ubuntu
+ noble carries 5.7.1 and ships `/usr/bin/poly` and `libpolymain.a` with no `libpolyml.a`, so
+ there is nothing to link against, and both `poly_dir()` and `build_native.sh` now say so by
+ name rather than failing in the linker. `isabelle/build_native.sh` was macOS-only, looking for
+ `libgmp.dylib` and an app bundle under `/Applications`; it now takes `POLYDIR`, finds gmp in
+ either shape or as the bundled versioned copy, adds `-lpthread -lm -ldl` on Linux only because
+ macOS has no libdl to pass, and prints the linker's stderr on failure instead of discarding it.
+
+ - **The `build` job could not fail on a failing test, and this branch proved it by accident.**
+ `cargo test -- --nocapture 2>&1 | tee cargo-test.log` in a `run:` block is `bash -e` without
+ `pipefail`, so the step's exit status was `tee`'s. The first CI run of this work carried a test
+ that failed: the Linux leg printed `test result: FAILED. 2 passed; 1 failed` in its own log and
+ reported SUCCESS, while the Windows leg, whose default shell keeps cargo's exit code, failed on
+ the same test. The job that runs the whole suite on two platforms was not a gate on one of them.
+ `shell: bash` and `set -o pipefail`, which is what the skip-counter step below it already does
+ and for the same reason.
+
+ - **A skip in CI is now a failure even in a file no job invokes.** `common::skip_unless` already
+ panicked under `OO_REQUIRE_FIXTURES=1` and twenty legs already set it, so no second variable is
+ added: a second name for an existing mechanism is a second thing to forget. What that mechanism
+ cannot see is a test file that runs nowhere, which is what this defect was.
+ `tests/ci_gate_coverage_test.rs` requires every `tests/*.rs` with a skip path to be strict in
+ some workflow or on a written exception list with its reason, refuses an exception for a file
+ that no longer skips or that is strict after all, holds `docs/ci-gates.md`'s table against what
+ the workflows actually say, and fails on any test printing the `SKIPPED_FIXTURE:` marker by hand
+ rather than through the helper. Five files are excepted, each because CI deliberately does not
+ carry what they need. It does NOT make every file strict: a contributor without Poly/ML must
+ still be able to run `cargo test` and get a pass, and can.
+
+ - **The corpus figures in the documents are derived rather than typed.** Three documents quoted
+ this corpus and none of them had measured the tree they were committed to. The 47-of-1,718 and
+ the zero that replaced it were measured on the shallow corpus; the 54-of-2,075 was measured on a
+ branch cut before the binding fix. The two were authored eleven minutes apart and merged
+ separately, so the combination nobody ran was the deep corpus under the fixed checker, which is
+ the combination the README asserted a result for. Measured now, in CI: **2,075 certificates, 402
+ accepted by both, 1,134 rejected by both, 539 unparseable on both, and ZERO divergent**, with 332
+ rows carrying a binding decision 0008 refuses and both kernels refusing every one. The shape of
+ the shallow result repeats exactly: 1,080 plus 54 is 1,134, and the accepted and unparseable
+ counts did not move. `the_corpus_exercises_prefix_visibility_at_depth` now formats the corpus
+ size, its depth, its fan-out and its prefix-visibility count out of the measurement and fails if
+ `README.md` or `docs/reasoning-systems-inventory.md` says anything else, so a growing corpus
+ fails until the prose is corrected and a correction that reaches one document out of two fails
+ as well. `isabelle/README.md`'s per-bucket counts are deleted rather than corrected: that file
+ already said the numbers belong in the test output, three sections before writing them out.
### Changed
- **A binding is data, and a certificate that admits two readings is refused.** Running the