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 integrate/335-oxigraph-pin

FABIOTESS01d3bec7ba7d
diff --cc CHANGELOG.md
index 52aef1c7,86312115..0e9178c1
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -76,80 -44,28 +76,100 @@@ 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 datatype the store cannot tell apart is refused inside `sh:or`,
+ `sh:not` and `sh:qualifiedValueShape`, as it already was on its own.** The
+ store widens xsd:int, xsd:nonNegativeInteger and the other integer-derived
+ types (and xsd:dateTimeStamp) to the type they derive from, and the direct
+ `sh:datatype` constraint refuses to decide them. A member naming one did
+ not: `sh:or` and a qualified minimum reported every conforming value, and
+ `sh:not [ sh:datatype xsd:nonNegativeInteger ]` returned `conforms: true`
+ over values of exactly that type. Each now records the constraint in
+ `skipped_constraints` with the direct path's reason and suppresses the
+ verdict. W3C columns unchanged (61, 53).
+ - **`sh:node` to a shape whose own `sh:datatype` the store cannot tell apart
+ is refused rather than answered.** The shape compiler refused such a
+ datatype on a property inside the referenced shape and not on the shape
+ itself, so every value the store had widened was reported. The `sh:node` is
+ now recorded as not evaluated. W3C columns unchanged.
+ - **A node-level `sh:or` result carries the node shape's `sh:severity`.** It
+ was written `"Violation"` whatever the shape declared, and the RDF report
+ followed it with `sh:resultSeverity sh:Violation`; it now uses the declared
+ term, through the same `severity_name` as every other path (#334). W3C
+ columns unchanged.
- **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