On this page

0202. Registry versions and deterministic resolution

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

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.