0208. Exact registry artifact identity and semantic metadata
- Status: Superseded by ADR-0241 (accepted 2026-11-15)
- Date: 2026-11-08
- Plan: M15.5; R2, R5, R6; H6
- Review: Data, schemas and wire formats
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
- Semantic hashes as sole storage keys — conflates different source bytes, loses comments and fails exact provenance; contradicts ADR-0161.
- Flat file blob manifest only — simpler new reader, but duplicates existing tree/module storage and discards item dedup; viable if reuse costs prove larger.
- Tar/zip or git archives — imports format/extraction/dependency machinery; native objects already supply bounded exact content and path validation.
- Only package tree_hash — reuses current lock hash, but omits mode identity and does not provide per-object acquisition; retain it as a second check.
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.