Skip to main content

Module gate

Module gate 

Source
Expand description

The re-validation gate (docs/06-repair.md §8).

A repair is sound only if it does not trade one violation for another, so the gate is whole-graph, not focus-local: it re-validates G ⊕ ΔG and diffs the violation set against G’s. It decides nothing and applies nothing — it returns a RepairOutcome the driver reads.

The verdict is a set difference over the existing [validate] oracle, keyed by (focus, statement). Because the contract is this delta (not a bare v ⊨ φ), a cheaper affected-set re-validation can replace the implementation later with identical semantics.

Structs§

RepairOutcome
The gate’s verdict on a candidate ΔG.

Functions§

apply
G ⊕ ΔG: deletes first, then adds (so a re-add wins on conflict).
gate
Validate data ⊕ delta against schema and diff the violations against data’s. Paths and the class hierarchy are evaluated against context, which should contain data; pass data again when there is no separate shapes/ontology graph. For split inputs context = data ∪ shapes, so the re-validation sees (data ⊕ δ) for focus and (context ⊕ δ) for evaluation — letting the gate discharge a constraint like sh:class C against a value typed with a subclass of C when the hierarchy lives in the shapes graph. The gate dual of crate::validate_with_context. Errors only if the schema is not stratifiable.
outcome_index
A driver-friendly key index, should a driver wish to look outcomes up.