On this page

0241. One pack per release, identified by its tree hash

Context

ADR-0208 proposed storing release payloads as exact hvc objects (objects/<2hex>/<62hex>) with three digest domains (semantic, hvc object, package tree hash). Static hosting then needs one GET per object through a curl subprocess. crates/harness/src/sha256.rs:215 tree_hash already hashes a tree as relpath NUL decimal-length NUL bytes per regular file in bytewise path order; git dependencies are locked by it today. It does not cover modes or empty directories.

Decision

A release is one file, releases/<tree-hash>.hvp. Its format is the header line harness-pack 1\n followed by exactly the tree_hash framing stream, entries in strictly ascending path order. The sha256 of the body equals tree_hash of the extracted tree, so the file name, the index hash and the lock hash are one value, and git and index sources pin the same digest for the same files.

Extraction rejects absolute paths, .., empty or duplicate components, non-ascending order, ASCII-case collisions, .git and .harness components and oversized totals; it writes to private staging and renames into .harness/deps. Modes are not carried, matching tree_hash; process packages keep exec_hash. Packing includes a declared file set and never .harness/ or the package's lock. Semantic item hashes may ship as an optional file inside the pack; they are never identity.

Alternatives considered

Consequences

One GET per package, cacheable forever by name. No new hash domain. Packs do not deduplicate across versions; measure before adding deltas. The VCS host can produce packs from hvc trees by materializing them (0244).