pub fn validate_provenance(
view: &ProvenanceSidecarView<'_>,
) -> Result<(), ProvenanceSectionError>Expand description
The validate-before-use gate: return Ok only if the sidecar can be
trusted as the asset’s provenance. Two independent checks:
- Self-authenticating source — the carried
source_byteshash to the declaredsource_digest(the bytes really are the attested source; a swapped source is rejected). - Context present — a non-empty licence (a provenance record with no licence is a stripped context, not an attestation).
A consumer runs this before treating an asset as citable/attested (mirroring
the renderer’s has_attestation governance gate).