geno_lewm.provenance.manifest¶
manifest
¶
Manifest schema for GenoLeWM artifacts (RFC-0011).
A manifest is the trust anchor: every byte downstream of the model
file is identified by content hash, and model_id = SHA-256(
canonical_json(manifest)).
This module ships the strict, JSON-native dataclass mirror of the
schema, write_manifest / load_manifest (round-trip stable),
and the model_id derivation.
The schema is intentionally narrow — every field is required and the
loader rejects unknown top-level keys. Adding a field is a MINOR
schema bump (handled by raising :data:SCHEMA_VERSION to 1.1.0
and accepting both); removing or renaming is MAJOR.
ManifestArtifact
dataclass
¶
A single artifact file referenced by the manifest.
ManifestEncoder
dataclass
¶
Carbon encoder identity.
ManifestTraining
dataclass
¶
Training config + data-snapshot identifiers.
Manifest
dataclass
¶
Manifest(schema_version: str, model_name: str, model_version: str, release_id: str, encoder: ManifestEncoder, predictor: ManifestArtifact, action_encoder: ManifestArtifact, calibration: ManifestArtifact, training: ManifestTraining, eval: ManifestArtifact)
Top-level manifest (RFC-0011 §3.7).
to_canonical_dict
¶
Return the dict mirror used for canonical JSON.
Dataclass asdict walks nested frozen dataclasses and is
deterministic, so the result is byte-stable when fed to the
canonical JSON encoder (which also sorts keys).
Source code in geno_lewm/provenance/manifest.py
write_manifest
¶
Write a manifest to disk as canonical JSON.
The on-disk bytes are byte-stable across platforms.
Source code in geno_lewm/provenance/manifest.py
load_manifest
¶
Load and validate a manifest from disk.