mixle.reproduction module¶
Installed, fail-closed reproduction receipt for Mixle’s release claims.
- installed_content_provenance()[source]
Digest the installed distribution’s RECORD identities and verify hashed files.
- wheel_provenance(path, *, expected_commit=None, expected_content_sha256=None)[source]
Verify a Mixle wheel’s identity, RECORD self-consistency, and provenance record shape.
VERIFIED, fail-closed. A wheel that cannot be identified at all raises
ValueError(unreadable archive, wrong METADATA/provenance member count, name/version differing from the installed distribution, ill-shaped or dirty provenance record). Every check past identification lands in the returnedproblemslist instead, and any entry makesverifiedFalse – a tampered-but-identifiable wheel gets a receipt naming the tampering rather than no receipt:RECORD self-consistency: every hashed RECORD claim is recomputed from the archived member it names, every member must be claimed, duplicate and root-escaping names are refused, and exactly one unhashed self-referencing RECORD row is allowed. This is
_wheel_record_hashes, the same checksubject_bindingbuilds on.expected_commit=/expected_content_sha256=, when given, are compared against the record’ssource_commit/source_content_sha256(case-insensitively).
NOT verified, stated so this record cannot be presented as more than it is:
Provenance field VALUES are shape-validated only: a well-formed but false
source_commit/source_tree/source_content_sha256– 40 zeros is a valid shape – passes unless the caller supplies the matchingexpected_*argument.RECORD self-consistency proves the archive matches its own manifest, not that the manifest is the released one: a wheel rebuilt with an internally consistent RECORD, including an extra module listed with a correct hash, still self-verifies here. Binding to the bytes that actually execute is
subject_binding’s job, andbuild_receiptANDs the two verdicts.The reported wheel
sha256is an identity for external comparison, not a check.
source_content_sha256is one key name over two populations (T3-05). The digest covers whatever tree the build ran from, and the sibling fieldssource_content_file_count/source_content_universedeclare that population: a wheel built from a git checkout – and an sdist’s embedded copy of this record – digest the full checkout (~2,000 files), while a wheel built from an unpacked sdist digests only the packaged subset (~800 files). Two records disagreeing on this key while their file counts differ is therefore a POPULATION difference, not tampering. The cross-artifact check is the sdist record’ssdist_content_sha256: the digest of the packaged subset, present in every sdist-embedded record (and carried into wheels whose record was adopted through the sdist, besidesource_content_carried_through_sdist), which equals thesource_content_sha256a wheel built from that sdist derives for itself.expected_content_sha256is compared against THIS record’s declared population, so draw the expectation from the same universe the record names.
- subject_binding(path, build)[source]
Bind the receipt’s SUBJECT wheel to the distribution that is actually executing.
Name/version equality is not identity: any clean
mixle==Xwheel matches the installed version string, so the adversarial review presented an older 0.8.0 wheel as the subject while a newer 0.8.0 build executed, and the receipt reportedpassedfor bytes that never ran (SYS-RR7-3). Two comparisons close that: the installed package’s embedded build provenance must equal the subject wheel’s (source commit, tree, and content digest), and every hashed entry in the subject wheel’s RECORD must appear in the installed RECORD with the same digest. The installed RECORD may carry extra installer-written files (INSTALLER, direct_url.json); the wheel’s own entries are the code, and those are what must match.
- source_tree_provenance()[source]
Identify an explicitly requested development checkout by its own repository root.
- claim_checks()[source]
Run deterministic, seeded measurements backing the release claims.
- evaluate_claims(observed)[source]
Bind every observed measurement to a required value/tolerance and pass state.