Plan, apply and roll back changes to a production ontology, with a blast radius report and a proof an auditor can re-check.
Rust ai-nativedescription-logicsformal-verificationinfrastructure-as-codeisabelle-languageknowledge-graphleanlean4mcpmcp-serverontologyowlowl2reasoningrustshaclsparqltheorem-proving
Merge branch 'fix/340-sweep-phase-budget' into land/oo-2026-10-28
FABIOTESSfdf0bfcf532e
diff --cc CHANGELOG.mdindex ffa01b83,384b3f0e..635f649f--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -44,52 -44,35 +44,79 @@@ All notable changes to Open Ontologies`tests/shacl_validation_report_w3c_test.rs` with their causes, which includean `sh:or` false negative on IRI and ill-typed values.+- **`reason --phase-timeout-ms` and `--classify-timeout-ms`** (#339). They set+ the two `owl-dl` wall clocks for one run, in milliseconds, with `0` meaning+ no limit, as in `config.toml`. The precedence is the flag, then `[reasoner]`+ in `<data-dir>/config.toml`, then the default (10 000 and 180 000). No+ environment variable sets either clock. The `budget` block reports the+ values in force. A daemon fixes its clocks when it starts, and it serves+ every client from one process. For that reason a `reason` that carries+ either flag is never proxied. While a daemon is up, the command exits 1 and+ names `--no-connect`, because a local run would read a different store from+ the graph the daemon holds. In memory mode, that local store is empty.+### Fixed+- **MCP `onto_lint` and `onto_diff`, and CLI `diff`, read RDF/XML and+ relative-IRI Turtle** (#317, @vishalhabib99). They passed the raw file to+ the Turtle parser, so an RDF/XML `.owl` file failed with "Invalid IRI code+ point" and `<#Dog> a owl:Class .` failed with "No scheme found in an+ absolute IRI", while CLI `lint`, `onto_load` and `onto_validate` accepted+ the same files. They now read through `GraphStore::read_as_turtle`, as CLI+ `lint` does. A diff resolves both files against the old file's location, so+ `<#Dog>` is one IRI in both versions and adding a class reports `added: 1,+ removed: 0`, not every triple. A file CLI `diff` cannot read is reported as+ JSON naming it (`Cannot read <path>: …`), as `onto_diff` does.++- **One-shot CLI commands honour `[reasoner]` and the rest of+ `<data-dir>/config.toml`** (#339). `setup()` loaded the file and kept only+ `[storage]`. `runtime::init_from_config` ran only in `serve`, `serve-http`+ and `serve-unix`. So `reason --profile owl-dl` always ran with a 10 000 ms+ phase budget and a 180 000 ms ceiling, whatever the file said. Its `budget`+ block then reported those defaults as the configuration. `setup()` now calls+ `init_from_config` with the config it already loads. That function only+ stores atomics, and it overwrites them, so it loads no model and can safely+ run again. The same change applies `[cache]`, `[feedback]`, `[repo]`,+ `[imports]`, `[webhook]` and `[language]` to one-shot commands and `batch`.+ The servers already applied them. MEASURED with+ `tests/cli_reasoner_config_test.rs`: on main 9e73d951, a config of+ `tableaux_test_timeout_ms = 200` reported `phase_timeout_ms: 10000`. It now+ reports 200. A proxied run is unchanged, because `daemon start` passes+ `<data-dir>/config.toml` to `serve-http`. Measured on this branch, a+ proxied run reported 200 and 60 000 from the file. One committed artifact+ showed the bug: `docs/assets/hqdm/owl-dl.json` named+ `tableaux_test_timeout_ms = 120000` in its `source` while its `budget` block+ reported 10000 and 180000. Rerun with the fix, the same command reports+ 120000 and 900000 and every verdict field is unchanged (39 unsatisfiable,+ none undetermined), so only the `budget` block was replaced.++ - **The subsumption sweep stops at its phase budget, and `binding_bound`+ reports the clock that actually stopped the run** (#340). The sweep checked+ only the run's `classify_timeout_ms` ceiling before building each pair's+ tableau, so once its own phase deadline had passed every remaining pair+ still built a tableau that returned `Unknown` from its first step. A class+ whose satisfiability test ran out has no model to read and stood for a pair+ against every satisfiable class, and all `k x n` of those pairs were+ materialised. On the issue's 6,000-class ontology with a 200 ms phase+ budget (release build), the subsumption phase took 5,042 ms over 27.45M+ pairs. The sweep and the satisfiability phase now check the deadline they+ hand their tableaux (the phase budget folded under the ceiling). After it+ passes they build no further tableau, and those tableaux could only have+ returned `Unknown`, so no verdict changes. A class with no model is+ now a row with a count, not a list of pairs: its pairs are generated while+ the budget lasts, and whatever is not reached is counted as undetermined in+ bulk. Same ontology, same budget, three runs: 203 to 213 ms, 806 to 1,038+ tableaux built, and 29.2M to 30.8M pairs reported in the new+ `subsumption_agent.pairs_not_reached` and in `undetermined`, with no+ subsumption reported and `complete: false`. At a 10,000 ms budget the number+ of pairs decided is unchanged within run-to-run spread. `pairs_tested` now+ counts tableaux actually built, and the new `pairs_scheduled` is tested+ plus not reached. `budget.binding_bound` used to repeat what the settings+ predicted. It now names the clock that stopped a cut-short phase+ (`"global"`, `"phase"`, or `"none"`), and the prediction moves to the new+ `budget.configured_bound`. The note says which phases each clock stopped,+ and it no longer claims that the ceiling "cannot" fire, since that was+ arithmetic about the tableaux and not about the run.- **`diff` and `drift` no longer hang on a symmetric blank-node graph** (#293).Both canonicalised blank nodes through oxrdf's RDFC-1.0, which sets no limiton `hash_n_degree_quads` calls, so the cost was factorial: a 7-nodediff --cc src/main.rsindex 713b8d0a,bfc7f44e..b23e4932--- a/src/main.rs+++ b/src/main.rs@@@ -139,12 -139,10 +139,13 @@@ data_dir = "~/.open-ontologies# classify_timeout_ms = 180000 # ceiling for the WHOLE run (ORE's 180s)# A run has five phases (consistency, satisfiability, subsumption, ABox,# explanation), each opening one phase budget, so at these defaults the ceiling- # cannot be the bound that fires: 5 x 10000 = 50000, well under 180000. Lower it- # below that to make it the binding one. Every `owl-dl` run reports which of the- # two is binding, in `budget.binding_bound`, with a sentence saying why.+ # is not expected to be the bound that fires: 5 x 10000 = 50000, well under+ # 180000. Lower it below that to make it the expected one. Every `owl-dl` run+ # reports the bound that actually stopped it in `budget.binding_bound`, the one+ # these settings predict in `budget.configured_bound`, and a sentence saying why.+# One-shot CLI commands read this section from <data-dir>/config.toml, and+# `reason --phase-timeout-ms` / `--classify-timeout-ms` override it for one run+# (CLI > config > default; no env var). A daemon reads it once, at start.# [feedback]# Lint / enforce self-calibration thresholds (number of dismissals before