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 'fix/333-335-shacl-terms' into land/oo-2026-10-28

FABIOTESSa07dca3f9e6d
diff --cc CHANGELOG.md
index 635f649f,5a4c59f6..22888076
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -44,79 -44,31 +44,103 @@@ All notable changes to Open Ontologies
`tests/shacl_validation_report_w3c_test.rs` with their causes, which include
an `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.
++
+ - **A custom `sh:severity` keeps its namespace in the JSON report** (#334).
+ Every path set `severity` to the text after the last `#` of the declared
+ IRI, and every reader takes a bare name as `sh:`, so W3C
+ `core/misc/severity-002`'s `ex:MySeverity` read back as `sh:MySeverity`
+ (one in a slash namespace survived whole only because it has no `#`).
+ `sh:Violation`, `sh:Warning` and `sh:Info` are still `"Violation"`,
+ `"Warning"` and `"Info"`; any IRI outside the SHACL namespace is now written
+ whole, on node-shape, property-shape, qualified and `sh:sparql` results. The
+ RDF report already wrote the declared term. W3C full-tuple column 52 to 53
+ PASS; gated column unchanged at 61.
+ - **A value that is not a well-typed literal of D no longer satisfies a
+ `sh:datatype D` test anywhere in the SHACL engine** (#333). The test was
+ spliced as `DATATYPE(?v) = <D>`, a SPARQL type error for an IRI or blank
+ node, and FILTER drops a row whose test errors: an IRI value under `sh:or`
+ over datatypes matched no alternative and was never reported, and an IRI
+ passed a property shape's `sh:datatype` and a datatype nested under
+ `sh:node` or a node-level `sh:or`. Separately, the `sh:or`, `sh:not`,
+ `sh:qualifiedValueShape` and `sh:node` member tests lacked the lexical check
+ the direct constraints had, so `"none"^^xsd:boolean` counted as an
+ xsd:boolean. One helper, `datatype_conforms`, is now spliced at all eight
+ sites and cannot error. W3C `core/property/or-datatypes-001` reports 3 of 3
+ violations where it reported 1: full-tuple column 51 to 52 PASS, report
+ match 48 to 49 of 56, gated column unchanged at 61.
- **`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 limit
on `hash_n_degree_quads` calls, so the cost was factorial: a 7-node