0202. Registry versions and deterministic resolution
- Status: Superseded by ADR-0239 (accepted 2026-11-15)
- Date: 2026-11-08
- Plan: M15.5; R1, R4, R5
- Review: Data, schemas and wire formats
Context
M9 manifests validate three decimal version components without leading zeros, and whole-program package loading permits one version/source per package name. Registry releases introduce choosing a version; the existing import graph loader is not a version solver. Build-time fetching would violate ADR-0072.
Decision
Recommended default, not adopted: accept exact x.y.z and caret requirements. No prerelease/build labels, OR, wildcard, latest or multiple versions in v0. ^1.2.3 is >=1.2.3,<2.0.0; ^0.2.3 is >=0.2.3,<0.3.0; ^0.0.3 is exactly 0.0.3. Requirements include explicit registry and namespace. Compare decimal components by digit count and lexical order; do not overflow u64 or tighten the current manifest validator accidentally.
Resolve only during explicit fetch. Intersect incoming requirements per name, reject mixed providers and cycles, and backtrack deterministically over verified snapshot candidates in descending numeric order, names in bytewise order. A candidate's transitive edges participate in solving before it is committed. Retain compatible existing pins unless explicitly unlocked by fetch --update. Bound nodes/candidates/search work by operator policy; report budget exhaustion separately from an unsatisfiable graph and show a compact requirer chain.
Coordinate (registry, namespace, name, version) is immutable. Identical publish retries succeed idempotently; conflicting bytes fail. Yanks exclude new selection, but preserve exact existing locks. Key revocation is a separate trust failure. Explicit lock updates show removed/changed/added pins; offline builds never solve. Edition dependencies keep exact embedded-source behavior.
Alternatives considered
- Exact-only requirements — smallest and a viable Maintainer choice; consumers manually update every transitive edge, limiting registry convenience.
- Full semver/SAT solver dependency — broad compatibility but expands syntax, dependencies and conflict explanations before a measured need.
- Greedy highest version — small but falsely reports failure for satisfiable diamond graphs; deterministic backtracking is required with range support.
- Multiple versions of one import name — changes compiler identity and whole-program coherence; outside distribution scope.
Consequences
R4 has dedicated diamond/backtracking, zero-major and
deterministic-order tests. Bounded work makes hostile dependency
graphs predictable but may refuse a large solvable graph
explicitly. No performance claim precedes benchmark evidence. Lock proposal captures
exact chosen releases. Registry plan gives CLI and
task evidence. Maintainer chooses exact-only versus this
deliberately limited range surface.