0203. Registry sources in versioned locks
- Status: Superseded by ADR-0240 (accepted 2026-11-15)
- Date: 2026-11-08
- Plan: M15.5; R1, R5, R6
- Review: Data, schemas and wire formats
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:
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
- Add fields to v1 — smaller version count but strict old readers reject them anyway and the format version no longer explains required verification.
- Migrate every lock immediately — uniform format but unrelated fixture and edition churn; unnecessary for the first registry dependency.
- Store only URL/version — allows replacement and loses offline verification.
- Store every item hash inline — bloats locks; content-addressed release/item sidecars retain audit detail with small per-package entries.
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.