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 branch 'main' into prove-the-bridge

Fabio Rovai1b7919e5fe91
diff --cc CHANGELOG.md
index 10645918,68ddb149..859d73dc
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -4,58 -4,66 +4,117 @@@ All notable changes to Open Ontologies
## [Unreleased]
+ ### 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
+- **The bridge to the specification was prose. It is a theorem.** `lean/OOCert/Conforming.lean`
+ formalises an OWL 2 RDF-Based interpretation in core Lean as `OOCert.Interpretation`: the parts
+ of RBS Table 5.1, with `IR` as the carrier type so that the table's `IP ⊆ IR`, `IC ⊆ IR`,
+ `ICEXT(x) ⊆ IR` and `IEXT(x) ⊆ IR × IR` hold by typing, plus `IS`, `IL`, the blank-node
+ assignment of RDF 1.1 Semantics section 5.1, and `ICEXT` and `IC` as definitions per section 9.
+ Truth is section 5's clause with its `I(p) is in IP` conjunct, stated as the specification
+ states it. `OOCert.Conforming` collects thirty fields, twenty-nine of them a quoted cell and the
+ thirtieth Table 5.1's `IR ≠ ∅`: Table 5.8 in both directions, Tables 5.9, 5.12 and 5.13 forward only, Table 5.6's
+ three restriction rows with the outer `if-then` and the consequent equality, the typing rows of
+ Tables 5.2 and 5.3, Tables 5.4 and 5.5 forward, and five axiomatic triples.
+ `OOCert.Conforming.toW3C` proves that every such interpretation carries `W3C` at full strength,
+ `OOCert.Conforming.toW3CModel` carries that to `W3CModel` including proving that every `Chain G`
+ list is a semantic sequence in the specification's sense, and
+ `OOCert.certificate_conforming_sound` is the sentence `certificate_w3c_sound`'s docstring says
+ of itself that it is not: a checked certificate's conclusions hold in every conforming
+ interpretation of the asserted graph. Its statement mentions no structure of this repository's
+ invention.
+ **The five `IP` memberships the old bridge assumed are discharged, not moved.** Each is a field
+ asserting one axiomatic triple whose own predicate is the wanted term, so the truth clause hands
+ the fact back as the triple's first conjunct: `rdf:type rdf:type rdf:Property .`,
+ `rdfs:Datatype rdfs:subClassOf rdfs:Class .`,
+ `rdfs:isDefinedBy rdfs:subPropertyOf rdfs:seeAlso .`,
+ `rdf:type rdfs:domain rdfs:Resource .` and `rdf:type rdfs:range rdfs:Class .`. Taking them at all
+ is licensed by RBS Definition 4.2, RBS section 4.2 and RDF 1.1 section 9, quoted in the file.
+ **One of the five was previously sourced to the wrong triple.** `W3C.lean`'s table gave
+ `I(rdfs:range) ∈ IP` the source `rdfs:range rdfs:domain rdf:Property .` "whose truth puts its own
+ predicate in `IP`"; that triple's predicate is `rdfs:domain`, so its truth gives
+ `I(rdfs:domain) ∈ IP` and reaching `rdfs:range` from it needs a further step the entry omits. The
+ fact is true and the route was wrong; the correction is recorded at both files rather than
+ applied silently.
+ `lean/OOCert/ConformingWitness.lean` exhibits a two-element interpretation satisfying every one
+ of those conditions, every RDF axiom of RDF 1.1 section 8 and every RDFS axiomatic triple of
+ section 9 (fifty-four, checked by `decide`), and three identity rows of RBS Table 5.2 that
+ `W3CWitness.lean`'s `live` records itself as violating. Table 5.8 is alive there in both
+ directions and CONSTRAINING: `IEXT(I(rdfs:subClassOf))` holds three of four possible pairs, the
+ missing one excluded by the forward direction and one of the present ones forced by the backward
+ direction, both checked. The eleven OWL-vocabulary extensions are empty there and
+ `two_dead_fields` says so as a theorem; `two_violates_these_known_rows` records the Table 5.2 row
+ it breaks. The file also carries one non-entailment and one entailment (`rdfs9` at an instance),
+ so `ConformingEntails` is neither empty nor everything.
+ **What is still not a theorem**, stated at the top of the file rather than at the bottom: that
+ `Conforming`'s field list is a SUBSET of the Recommendation's conditions. A subset is the safe
+ direction, which is why it is allowed, and a reader checks it cell by cell. One modelling
+ decision does NOT run in the safe direction and is named at its field: `IL` is total, following
+ RBS section 4.2's wording rather than RDF 1.1 section 5's, so interpretations in which a literal
+ fails to denote are outside the claim; closing that needs a term-occurrence lemma about
+ `checkStep` that nobody has written. One reading is load-bearing and flagged: RBS Table 5.4 at
+ `n = 0`, which `Rules.lean`'s `takeChain` and `Semantics.lean`'s `Model.int` already depend on.
+ `Conditions`, `Interp`, `Model`, `Entails` and `certificate_sound` are untouched, and
+ `Conforming.lean` pins all twenty-three fields of `Conditions` and all five of `Model` with
+ `#guard_msgs` on their constructors, so a change to any of them breaks the build.
- **A binding is data, and a certificate that admits two readings is refused.** Running the
Lean checker in `lean/OOCert/Horn.lean` and the independent Isabelle/HOL one in `isabelle/`
over 1,718 certificates found 47 rows where the two disagreed, always in the same direction