You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3a09e9d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cross-ledger): use encode_iri_strict for IRI-to-Sid translation
`encode_iri` falls back to the EMPTY namespace (code 0) for IRIs whose
prefix is not registered, so it always returns Some(...). Every
cross-ledger materializer wrote code as if encode_iri returned None on
miss — `if let Some` guards, `let Some(...) else { return Ok(empty) }`,
`filter_map`, and the `(Some, Some, Some) = ... else { continue; }`
schema-bundle pattern — all of which were unreachable, causing
unregistered well-known IRIs to silently translate to EMPTY-Sids that
match nothing in M's flakes. The observable effect is a silent
governance downgrade rather than the loud failure or correct skip the
surrounding code intended.
Switch every cross_ledger snapshot.encode_iri(...) site to
encode_iri_strict so the Option semantics the existing code is
written against actually hold:
- types.rs ConstraintsArtifactWire::translate_to_sids — drops
unresolvable property IRIs as documented.
- types.rs SchemaArtifactWire::translate_to_schema_bundle_flakes —
drops whitelist triples whose s/p/o IRI is unknown to D, instead
of admitting EMPTY-namespace Sids into the schema bundle.
- policy_materializer — strict encode for f:AccessPolicy structural
baseline scan; missing class IRI now correctly skips the scan.
- shapes_materializer — strict encode for SHACL predicates and
rdf:first/rdf:rest; absent predicates correctly skipped.
- rules_materializer — strict encode for f:rule; the documented
"no f:rule on M → empty rule set" early return is now reachable.
- schema_materializer — strict encode for schema predicate / class
IRIs and rdf:type; only registered terms drive PSOT/OPST scans.
Hoist the duplicate `encode_system_iri` helper out of
policy_materializer.rs and constraints_materializer.rs into
cross_ledger/mod.rs as `pub(crate) fn encode_system_iri`, also
switched to encode_iri_strict so a missing system IRI on a model
ledger surfaces as TranslationFailed instead of silently degrading
to an EMPTY-Sid that matches nothing.
Update the SchemaArtifactWire docstring and WireObject::Ref doc to
describe the actual (strict) encoding semantics.
0 commit comments