mixle.reason.receipt module¶
E7 — cross-chain provenance receipt (work-plan §5, IC-2 / IC-5 / IC-13).
decision_receipt walks a data -> posterior -> claim -> decision chain and emits an
mixle.task.trace_record (IC-5) whose every step carries a content hash for its own output and
its parent’s hash as result["parent_hash"] – a hashed, re-derivable lineage edge from raw data
through an inversion, an interpretation, and a decision. The posterior is ingested into a
Substrate (via ingest_artifacts()) rather
than copied: the substrate item’s payload references the artifact (an IC-13-shaped
{artifact_ref, schema, grid, crs, units} record), the array bytes stay wherever the IC-2 artifact
already lives.
Repo-boundary note (see the PR body for the full explanation): this PR only touches the core mixle
repository. mixle-pde (E2’s io/artifacts.py – IC-2) and mixle-mlops (E3/E4/E5) had not
landed on release/0.8.0 as of this PR, so decision_receipt does not import either package.
Instead it verifies an on-disk posterior artifact directly and, when present,
checks its {posterior_ref}.json sidecar against a streaming SHA-256 of the
artifact bytes. claim and decision accept a plain dictionary or
dataclass and are encoded through a strict versioned canonical schema.
- class ContentDigest(algorithm, hexdigest)[source]
Bases:
objectA validated digest value, distinct from an ordinary 64-character string.
- decision_receipt(*, dataset_ref, posterior_ref, claim, decision, substrate)[source]
Build an IC-5 trace record for one data -> posterior -> claim -> decision chain.
dataset_refis canonically fingerprinted.posterior_refmust resolve to an accessible file whose bytes are hashed and checked against any declared sidecar digest.claimanddecisionare canonical dictionaries or dataclasses. The posterior is ingested intosubstrateas a referenced (not copied) artifact.Returns a dict that satisfies
mixle.task.trace_record.validate_trace_record(): every scalar output (the posterior, the claim, the decision) resolves to a hashed lineage edge whosecontent_hashis independently re-derivable viacontent_edge_hash(), and whoseparent_hashchains back to the previous edge.