#[repr(C)]pub struct OntologicalContract {
pub contract_digest: [u8; 32],
pub schema_hash: u64,
pub precondition_quin_span: (u32, u32),
pub postcondition_quin_span: (u32, u32),
pub invariant_quin_span: (u32, u32),
}Expand description
Self-describing ontological contract attached to an extension function.
Combines a full 32-byte SHA-256 contract digest with a 64-bit q_hash schema
fingerprint and slice spans into the provider’s static_ontology_nquins() table.
Fields§
§contract_digest: [u8; 32]Full 32-byte SHA-256 digest of the canonical function contract.
schema_hash: u6464-bit q_hash of the parameter/return schema signature.
precondition_quin_span: (u32, u32)(start, len) span in static_ontology_nquins() encoding preconditions.
postcondition_quin_span: (u32, u32)(start, len) span in static_ontology_nquins() encoding postconditions.
invariant_quin_span: (u32, u32)(start, len) span in static_ontology_nquins() encoding conservation/invariants.
Implementations§
Source§impl OntologicalContract
impl OntologicalContract
Sourcepub const fn validate_spans(&self, total_ontology_quins: usize) -> bool
pub const fn validate_spans(&self, total_ontology_quins: usize) -> bool
Verifies that all (start, len) spans lie within total_ontology_quins.
Sourcepub const fn canonical_digest(
func_iri_hash: u64,
stable_id: StableFuncId,
schema_hash: u64,
effects: EffectSet,
determinism: DeterminismGuarantee,
reversibility: ReversibilityKind,
envelope: ResourceEnvelope,
pre_span: (u32, u32),
post_span: (u32, u32),
inv_span: (u32, u32),
) -> [u8; 32]
pub const fn canonical_digest( func_iri_hash: u64, stable_id: StableFuncId, schema_hash: u64, effects: EffectSet, determinism: DeterminismGuarantee, reversibility: ReversibilityKind, envelope: ResourceEnvelope, pre_span: (u32, u32), post_span: (u32, u32), inv_span: (u32, u32), ) -> [u8; 32]
Computes a deterministic 32-byte SHA-256 canonical contract digest at compile time from all fields of the function’s identity, schema hash, effects, envelope, and ontology spans.