Skip to main content

Module prepared

Module prepared 

Source
Expand description

The attested, profile-parameterized dataset a consumer must present before canonical splits are exposed.

Implemented by plan 02-06. The attested, profile-parameterized dataset a consumer must present before canonical splits are exposed.

The profile is a TYPE PARAMETER, not a runtime field: PreparedDataset<Canonical> and PreparedDataset<Compatibility> are distinct types with distinct constructors, and only the canonical one exposes a validation witness. Selection consumes &PreparedDataset<Canonical>, so a compatibility dataset cannot be passed at all — which is what makes DATA-06’s “cannot be constructed” provable by trybuild rather than merely rejected at runtime.

§PreparedDataset<Compatibility> has no validation_witness method

A compatibility-profile selection run is not rejected at runtime. It does not compile. There is no value of type PreparedDataset<Compatibility> that can be passed where &PreparedDataset<Canonical> is expected, and there is no validation_witness to call on it — rustc reports “no method named”, which is a non-compiling program rather than an error value a caller could ignore.

The profile also selects which splits EXIST, through [DatasetProfile::Splits]. That is stronger than an optional field: a compatibility dataset does not merely leave its validation split empty, it has no place to put one (D-19).

§This is where the typestate meets the hashes

hash.rs is a leaf that knows nothing about split roles. The constructors here are the single point of assembly: they build one SplitFingerprintInput per split from that split’s own accessors, hand them to DatasetFingerprint::compute in ascending role order, and build the witness’s SplitFingerprint from the SAME per-split value that went into the dataset input. That shared value is what makes the two digests provably describe the same bytes under different domain tags.

Structs§

Canonical
The canonical three-split profile: train, validation, test.
CanonicalDeclarations
Per-split declarations for the canonical profile.
CanonicalSplits
The canonical profile’s splits.
Compatibility
The merged SetFit compatibility profile: train and a compatibility test split, and NO validation split at all (D-19).
CompatibilityDeclarations
Per-split declarations for the compatibility profile.
CompatibilitySplits
The compatibility profile’s splits. There is no validation field.
PreparedDataset
A validated, fingerprinted dataset of exactly one profile.
PreparedJsonl
Canonical JSONL bytes for every split of a prepared dataset, keyed by role.
ValidationWitness
An opaque proof that a canonical validation split exists in THIS dataset.

Traits§

DatasetProfile
A dataset profile. Implemented only by Canonical and Compatibility.