On this page

0203. Registry sources in versioned locks

Context

packages.rs strictly reads lock_version=1, validates table shapes and hashes, and writes sorted package tables including the root/direct edges. ADR-0099 added exec_hash without replacing package tree hashes. Registry sources also need immutable release identity and verifiable trust metadata.

Decision

Recommended default, not adopted: read v1 and v2; write v2 for graphs that contain registry dependencies. Preserve v1 byte output for unchanged legacy-only graphs. Older toolchains reject v2 rather than accidentally skip signature checks. Never migrate a lock during build/check/run/interp; fetch is the sole lock writer.

Keep tables keyed by import/package name. Registry entry fields: version, source="registry://", sorted deps, release, tree, hash, signatures and trust. All digest fields use sha256: plus 64 hex. release/signatures/trust identify exact verified metadata documents; tree is an hvc tree object; hash retains existing package tree framing. Keep exec_hash for process packages. Root/direct edges and root-version informational semantics remain.

Path and edition entries retain their current identities. v2 must permit legacy git entries if the mixed graph uses them explicitly; this does not make registry payloads git based. Published package runtime dependencies are registry/edition. Local registry aliases resolve to stable IDs before writing the lock. Endpoint locations and credentials stay outside it; moving a checkout preserves bytes.

Cache verified signatures/trust alongside project-local payloads. Offline loading checks pinned documents, graph, content and ceilings without writes or network. An explicit trust refresh can reject revoked pins; no silent replacement version. add edits only the manifest and tells the user to fetch, preserving one lock writer.

Alternatives considered

Consequences

R1 tests old/new parsing and unknown fields; R5 tests disconnected loading and tamper detection. Interrupted writes preserve an old or new whole lock. Registry plan contains a concrete example. Artifact identity distinguishes digest domains. Maintainer chooses selective v2, universal migration or additive-v1 policy.