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
docs(changelog): backfill the missing 1.0.0 section
FABIOTESS578e16d816bd
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex cbdb1696..d71b7f87 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,11 @@# Changelog+All notable changes to Open Ontologies are documented here.++## [Unreleased]++_Nothing yet._+## 1.1.1 — 2026-08-03Correctness and reporting. No new features. Two of these change output, so@@ -62,6 +68,7 @@ results produced with 1.1.0 or earlier are not directly comparable.sound disjointness-propagation rules (restriction, functional, union,data-value, counting, dueling-universal idioms), `DisjointnessMatrix`,`ClaimConsistency`, `PairOracle`, `VetDisjointness`, `StripDisjointness`.+- **`onto_vocab_check` — closed-world vocabulary check for generated DATA graphs.** Verifies that every predicate and every `rdf:type` class used in a Turtle data graph is actually **declared** in the loaded ontology, flagging hallucinated/undeclared terms. This is the gate open-world SHACL structurally cannot provide: SHACL silently ignores predicates it has no shape for, so a graph full of invented terms (an LLM emitting `ies:hasDeparturePort` when the ontology only defines `ies:scheduledDeparturePort`) still reports `conforms=true`. Only IRIs whose namespace belongs to the ontology (plus any passed via `namespaces`) are policed — standard `rdf`/`rdfs`/`owl`/`xsd`/`sh` vocabulary and the caller's own instance-data IRIs are never flagged. Returns `{conforms, hallucinated_terms, checked_namespaces, predicates_checked, types_checked, ontology_terms}`. **Vacuous-pass guard:** when no ontology vocabulary is present (0 declared terms and no `namespaces`), the tool returns `conforms=false` with an explanatory `warning` rather than silently passing — a closed-world check with nothing to check against must never green-light. New module `src/vocab_check.rs` (SPARQL over Oxigraph, mirroring the term-existence logic of `onto_shacl_check`) with 3 unit tests (clean conforms / hallucinated predicate caught / instance + standard namespaces never flagged). Exposed as MCP tool `onto_vocab_check` (+ `OntoVocabCheckInput`), CLI subcommand `vocab-check`, and batch command `vocab_check`. Verified end-to-end against the real IES4 ontology (714 terms): it flags the non-ontology terms IES4's *own* published sample data uses — `movement.ttl` → `isScheduledDeparturePort`/`isScheduledArrivalPort`/`seatNumber`, `events.ttl` → `happensIn` — every one of which plain SHACL reports as conforming. Companion to `onto_shacl` (open-world data validation) and `onto_shacl_check` (checks proposed shapes); this checks generated data. Follows the MCP-native validation-primitive convention.### Changed- OWL-DL reasoner: satisfiability is now three-valued — resource exhaustion@@ -72,13 +79,9 @@ results produced with 1.1.0 or earlier are not directly comparable.- RDF loading content-sniffs `.owl` files, so Turtle published under `.owl`parses correctly.--All notable changes to Open Ontologies are documented here.--## [Unreleased]+## 1.0.0 — 2026-06-13### Added-- **`onto_vocab_check` — closed-world vocabulary check for generated DATA graphs.** Verifies that every predicate and every `rdf:type` class used in a Turtle data graph is actually **declared** in the loaded ontology, flagging hallucinated/undeclared terms. This is the gate open-world SHACL structurally cannot provide: SHACL silently ignores predicates it has no shape for, so a graph full of invented terms (an LLM emitting `ies:hasDeparturePort` when the ontology only defines `ies:scheduledDeparturePort`) still reports `conforms=true`. Only IRIs whose namespace belongs to the ontology (plus any passed via `namespaces`) are policed — standard `rdf`/`rdfs`/`owl`/`xsd`/`sh` vocabulary and the caller's own instance-data IRIs are never flagged. Returns `{conforms, hallucinated_terms, checked_namespaces, predicates_checked, types_checked, ontology_terms}`. **Vacuous-pass guard:** when no ontology vocabulary is present (0 declared terms and no `namespaces`), the tool returns `conforms=false` with an explanatory `warning` rather than silently passing — a closed-world check with nothing to check against must never green-light. New module `src/vocab_check.rs` (SPARQL over Oxigraph, mirroring the term-existence logic of `onto_shacl_check`) with 3 unit tests (clean conforms / hallucinated predicate caught / instance + standard namespaces never flagged). Exposed as MCP tool `onto_vocab_check` (+ `OntoVocabCheckInput`), CLI subcommand `vocab-check`, and batch command `vocab_check`. Verified end-to-end against the real IES4 ontology (714 terms): it flags the non-ontology terms IES4's *own* published sample data uses — `movement.ttl` → `isScheduledDeparturePort`/`isScheduledArrivalPort`/`seatNumber`, `events.ttl` → `happensIn` — every one of which plain SHACL reports as conforming. Companion to `onto_shacl` (open-world data validation) and `onto_shacl_check` (checks proposed shapes); this checks generated data. Follows the MCP-native validation-primitive convention.- **Causal (v0.5): `certify_action` × PyWhy integration.** Wires the #48 PyWhy scaffold into the live `certify_action` path. New `ActionFrame.identification_mode` field (`Structural` | `DoCalculusBackdoor`, default `Structural` for back-compat) selects which identifiability proof to attempt. New helper `build_causal_dag(graph, target_iris)` extracts a causal DAG from the loaded RDF graph: nodes = target IRIs + their one-hop structural neighbours (same slice CIVeX already hashes); edges = `rdfs:subClassOf` / `rdfs:subPropertyOf` / `rdfs:domain` / `rdfs:range` triples among slice members (treated as cause → effect); plus a synthetic `__utility__` sink downstream of every node. When `DoCalculusBackdoor` is requested AND the `causal-pywhy` Cargo feature is enabled, the verifier calls `civex_pywhy::run_pywhy_backdoor` and on success stamps the certificate's `identification_proof` with DoWhy's adjustment estimand + tags assumptions with `"do_calculus_backdoor"`. On any failure path (Python unavailable / DoWhy unavailable / DoWhy runtime error / target unidentifiable) the verifier **silently falls back to the structural proxy** and records the reason in assumptions as `"do_calculus_unavailable:<kind>"`. When the feature is off, the marker is `"do_calculus_unavailable:feature_disabled"`. The certificate's `identification_proof` field is never empty regardless of branch taken. MCP tool `onto_certify_action` gains `identification_mode: Option<String>` accepting `"structural"` (default) or `"do_calculus_backdoor"`. Two new integration tests in `tests/civex_test.rs`: `structural_mode_records_structural_only_assumption` (back-compat) and `do_calculus_mode_falls_back_to_structural_when_feature_disabled` (verifies the fallback path doesn't crash and records the marker). All 9 civex integration tests pass in both default and `causal-pywhy` build configurations; clippy clean across `--lib --tests --examples` in both configs.- **Causal: PyWhy/DoWhy backdoor identification subprocess scaffold (#48).** Scaffolds the Causal flagship's substantive v0.5 work without pulling Python into the default build. New optional Cargo feature `causal-pywhy` (off by default) enables a `src/civex_pywhy.rs` module that wraps DoWhy v0.13 as a subprocess — same pattern as `src/plan_classical.rs` does for Fast Downward. The wrapper embeds a self-contained Python driver (`PYWHY_PYTHON_DRIVER`) that reads `{nodes, edges, treatment, outcome}` from stdin, builds a `networkx` DiGraph, runs DoWhy's `identify_effect` for backdoor adjustment, and emits `{identifiable, adjustment_set, estimand_expression}` to stdout. Per the May 2026 roadmap memo: **Pearl–Shpitser ID is not ported to Rust** — DoWhy is a 15-year-stable Python implementation, so we wrap it. Honest behaviour when Python or DoWhy is missing: structured errors with `kind = "python_unavailable"` / `"pywhy_unavailable"` / `"dowhy_runtime_failed"` that the caller (eventually `certify_action` in v0.5) dispatches on to fall back to the structural proxy. Binary resolution order: explicit `python_override` → `PYTHON_BIN` env var → `python3` on PATH. **NOT yet integrated into `certify_action`** — the structural proxy (`"structural_only"` assumption) remains the only identifier in shipped certificates; integration tracks as the v0.5 ship. 9 unit tests cover parser cases (identifiable, unidentifiable, both error kinds, invalid JSON), python resolver (override + default + env var), embedded-driver sanity check, and `python_unavailable` behaviour on missing binary. Zero additional Rust dependencies — the entire feature is embedded Python + subprocess plumbing.- **Dynamics: non-deterministic outcomes for ActionSchema (#49).** `ActionSchema` gains an additive `outcomes: Vec<Outcome>` field. Each `Outcome` carries a categorical `probability` in `[0, 1]`, its own `effects: Vec<EffectSpec>` list, and an optional human-readable `label` (e.g. `"success"` / `"degraded"` / `"failure"`). When `outcomes` is non-empty, `apply()` samples one outcome and executes its effects; the deterministic `effects` field is ignored. When empty (the default), the schema behaves exactly as before — full back-compat with v0.4 base. Probabilities are validated: the sum must equal `1.0 ± 1e-6` or `apply()` returns an error; negative probabilities are also rejected. Sampling uses an inline xorshift64 PRNG keyed by a seed — **zero new dependencies**, no `rand`/`fastrand` pulled in. New method `ActionSchema::apply_with_seed(graph, db, bindings, seed)` exposes the seed for reproducible sampling; the default `apply()` derives a seed from `SystemTime::now()`. `ApplyResult` gains `sampled_outcome: Option<usize>` and `sampled_outcome_label: Option<String>` so callers can see which branch fired. `onto_action_apply` gains an optional `seed: Option<u64>` parameter — pass it when you need reproducible runs (CIVeX certification, replay-from-audit-log, controlled experiments). Tests (4 new): `nondeterministic_apply_with_seed_is_reproducible`, `nondeterministic_apply_distribution_matches_probabilities` (1000-call smoke check that a 70/30 split lands within `[0.60, 0.80]`), `nondeterministic_apply_rejects_invalid_probability_sum`, `deterministic_schema_still_works_when_outcomes_is_empty` (back-compat).