On this page

0208. Exact registry artifact identity and semantic metadata

Context

ADR-0075 semantic hashes omit comments/layout and do not identify original bytes. ADR-0161 deliberately stores formatted text chunks and raw/generated blobs instead. Existing package tree hashes cover path/length/bytes, not executable modes. Registry releases need exact reproducible content and inspectable API identity.

Decision

Recommended default, not adopted: use existing hvc 1 blob/chunk/module/tree object encodings for package payloads. SHA-256 covers the existing kind/length envelope and payload. Preserve comments, raw sources, generated files and modes. No VC init, branch history, git metadata or new hvc object kind is required.

Canonical release documents are separately SHA-256-addressed UTF-8 TOML with release_version, registry/namespace/name/version, edition, tree, existing package tree hash, item-report digest, capabilities, dependency constraints and provenance. Their signatures bind exact document digest with a versioned signing domain. Canonical output uses fixed field order, sorted tables/arrays where unordered, LF, no comments and deterministic string escaping within the existing TOML subset. Reject unknown/duplicate fields and malformed references before admission.

Record semantic item sig/body pairs as an optional bounded review sidecar produced by existing checked canonical loading/hashes; they are not payload object IDs. The initial library-root report does not claim to cover unimported source files; label its entry root and toolchain identity. Exact tree identity covers all shipped files regardless of whether they participate in that semantic report.

Publish snapshots an explicit reviewed include list into private staging before checking/signing. Reject unsafe paths/file kinds and administrative directories. Root manifest bytes must match release metadata; no implicit dependency rewrite. Root runtime deps must be registry/edition; fixture-local test paths may remain. Keep generator outputs committed/fresh and process exec_hash verification intact.

Alternatives considered

Consequences

Registry plan names all three digest domains. R2 tests comment-only changes, modes, exact roundtrips and stable-copy snapshots. Maintainer chooses hvc object reuse versus a file-only artifact representation.