0250. Record the source path in registry lock entries
- Status: Accepted (maintainer, 2026-11-16)
- Date: 2026-11-16
- Plan: M15.5; RG2.1 Task A
- Amends: 0240 §Decision (entry shape)
- Review: Data, schemas and wire formats
Context
An index lock entry's resolved source can be the
same for distinct manifest package paths when their hosts map to
the same root. Matching only the resolved root and path can reuse
a pin after the manifest changes its package identity.
Decision
Every v2 index+ entry records the manifest's
canonical
pkg = "<host>/<seg>/<name>"
immediately after source. It applies only when
pkg equals the manifest's pkg. The
pkg is package identity (0237), not
endpoint, mirror or credential data; 0240's exclusion of those
data still holds. source retains the resolved root
and package path.
Readers accept legacy v2 index entries without pkg
but treat them as stale, as they do entries with a different
pkg: offline and read-only operations report E0935;
online fetch re-resolves and rewrites them. A first online
re-fetch of a legacy entry skips the E1077 changed-hash guard
once; this is acceptable because RG1.2 is unreleased.
Alternatives considered
- Hash the host into
source—sourcerepresents the resolved root URL and package path, not a separate identity encoding. - Reject legacy entries as malformed (E0944) — recovery requires deleting the lock, losing unrelated pins such as git commits and hashes.
Consequences
Host changes re-resolve even when both hosts map to the same root. Existing unrelated pins survive legacy migration, at the cost of the one-time hash-guard exception.