Expand description
Portable session bundle format (hh export --bundle / hh import).
A bundle is a single zstd-compressed tar containing:
manifest.json—format_version, thehhversion that wrote it, a redacted session block, and integrity hashes.events.ndjson— one compact JSON object per event, in original(ts_ms, id)order, position-indexed byseq(DB row ids do not survive import, socorrelatesis expressed ascorrelates_seqinstead).blobs/<hash[0..2]>/<hash>— raw content for every blob any event or file_change references. Only the outer tar is zstd-compressed; blobs are stored raw inside it (no double compression).
Tar entries are added in a fixed order (manifest, events, then blobs sorted ascending by hash) with fixed mtime/uid/gid/mode, so two exports of an unchanged session produce byte-identical bundles.
export is the trusted-data path (built from a live crate::store::Store).
parse is the untrusted-input path (hh import file.hh): it must never
panic on malformed input, and every failure mode reports precisely what
is wrong (v1.0.0 addendum).
Structs§
- Bundle
- A parsed, validated bundle — the output of
parseand the input tocrate::store::Store::import.
Constants§
- FORMAT_
VERSION - The bundle format version this build of
hhwrites, and the highest version it will read. Bumped only for a breaking change to the manifest/ events/blob layout; new optional fields do not require a bump.
Functions§
- export
- Build a portable bundle for
session_id(the trusted-data path). - parse
- Parse and validate an untrusted bundle (
hh import file.hh). Never panics: every malformed-input path returns a preciseBundleError.