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 verdict-by-construction

Fabio Rovaia3a932f2b20f
diff --cc CHANGELOG.md
index edf77bb5,68ddb149..70f2ef48
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -4,48 -4,66 +4,107 @@@ 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
+- **A certified verdict is now unconstructible without the evidence, so laundering one is a
+ compile error rather than a test failure.** The discipline that `model_checked` requires
+ `checker_exit == 0`, that `preserved_checked` requires an accepted `oo-cert` run, and that
+ `checked` requires a zero exit code off a Lean binary, used to be carried by comments saying
+ "the ONE place this word is produced" and by tests that walked a serialised report looking for
+ a checked word with nothing behind it. Those tests were right and they still run. They were
+ also incomplete by construction: a new module that formatted `"model_checked"` in a new place
+ passed every one of them until somebody noticed and pointed a guard at it. `src/verdict.rs`
+ now holds the whole certified vocabulary. `Certified` has a private field and no constructor,
+ `CheckerRun` has private fields and one constructor that SPAWNS the checker and reads its exit
+ status, and `CheckerRun::accepted` is the only function in the crate that returns a `Certified`
+ and returns `None` on any non-zero exit. Every certified variant carries one:
+ `FolVerdict::ModelChecked`, `GoalVerdict::PreservedChecked`,
+ `GoalVerdict::PreservedUnderSuppliedRulesChecked`, `ClosureVerdict::Checked`,
+ `Warrant::Checked`, `CheckerStatus::Accepted` and `OwlReading`. The theorem name travels
+ inside the token rather than beside it, so `OOCert.certificate_sound`,
+ `OOCert.horn_certificate_sound` and `Fol.satisfiable_of_check` are unspeakable on a path that
+ did not run a checker either. Six `compile_fail` doctests run under `cargo test` and fail if
+ any of that stops being true; the induced error is E0451, "field `theorem` of struct
+ `Certified` is private". None of these types implements `Deserialize`, because parsing
+ `"preserved_checked"` out of somebody else's JSON is not the same act as earning it and a
+ derive would be a public constructor for the certified state; reports are read back as
+ `serde_json::Value`, which is what every caller already did. The WIRE FORMAT is unchanged:
+ `Serialize` is hand-written to emit the same bare string the derive emitted, verified
+ byte-for-byte against a binary built from the previous commit over `preserve`, `fol-model`,
+ `closure-diff`, `reason`, `reason --rules`, `rules-import` and three MCP `tools/call`
+ responses.
+- **The MCP server no longer advertises eight tools it cannot serve.** `onto_plugin_list`,
+ `onto_plugin_call`, `onto_embed`, `onto_hnsw_build`, `onto_search`, `onto_similarity`,
+ `onto_import_schema` and `onto_sql_ingest` each have a body that is
+ `#[cfg(not(feature = ...))] { return "Compiled without X feature" }`, so on a default build
+ every call to one of them fails for every input. They were listed in `tools/list` anyway: a
+ client read a description about embeddings or a Postgres URL, called the tool, and got an
+ error that had nothing to do with what it asked. `toolfilter::remove_unavailable` now drops
+ their routes before the operator's own filter and independently of its mode, so a default
+ build advertises 106 of the 114 registered tools and says which eight are missing and which
+ Cargo feature brings each one back. The server's instructions string used to state two
+ hand-typed totals, 114 and 112, neither of which was the number the router advertised, and to
+ promise that the eight WERE advertised; it is formatted from `tool_router.list_all()` now, so
+ there is no literal left to go stale.
+
- **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