Skip to main content

Module reconstruct

Module reconstruct 

Source
Expand description

Verification-grade inverse of crate::translate (SPEC-GIT-BRIDGE §9).

Not an import path. Every function here is defined only on git objects the v1 mapping can emit. Two mechanisms enforce that, and it matters which catches what: a handful of parse-time rejections (the reserved mkit-remix-source carrier, a malformed mkit-object-type) surface as BridgeError::NotBridgeObject; EVERYTHING ELSE — header order, duplicate or unknown mkit-* headers, foreign modes (160000), any off-spec shape — fails closed through the re-translation equality check (rebuild the mkit object, translate it forward, require byte equality with the input), surfacing as BridgeError::Integrity. There is NO header whitelist: the equality check IS the load-bearing guard, so do not weaken it expecting one.

Structs§

Reconstructed
A reconstructed mkit object: its serialized v1 bytes and BLAKE3 hash. extras carries the chunk blobs a large flattened blob re-chunks into (empty for everything else).

Functions§

reconstruct
Dispatch on git type.
reconstruct_blob
§9 blob rule: ≤ 1 MiB → plain blob; larger → pinned-FastCDC chunk blobs + manifest (mirrors worktree::store_file_object).
reconstruct_commit
§9 commit rule: self-contained (everything rides in headers).
reconstruct_tag
§9 tag rule: self-contained like commits.
reconstruct_tree
§9 tree rule. resolve maps a child git id back to the BLAKE3 of the already-reconstructed child (bottom-up order is the caller’s job).