AI generated thing I figure we should do, but I don't want to bundle into another PR but instead do in isolation.
Background
After landing the index protocol (#288), the codebase uses three different names for what is now consistently called "the index" in ARCHITECTURE.md:
index — used in ARCHITECTURE.md, the new env::index::IndexEnvironment{,Async}, the new project::index_entry::IndexEntryProject, and the index_resolver field name.
Registry — used as the public type-parameter name and several enum variants/types in core/src/resolve/combined.rs.
registry — used in the lockfile wire format (Source::Registry { registry } → [sources] registry = "...").
Three names for one concept is a comprehension trap, and the gap is widening as new code adopts Index*.
Inventory
A. core/src/resolve/combined.rs — pure rename, no wire-format impact
RegistryResolver (type param) → IndexResolver
RegistryProjectStorage (type param) → IndexProjectStorage
RegistryError (type param) → IndexError
CombinedResolverError::Registry (variant) → ::Index
CombinedProjectStorage::RegistryProject(_) → ::IndexProject
CombinedProjectStorage::CachedRegistryProject(_) → ::CachedIndexProject
CombinedIteratorState::ResolvedRegistry(_) → ::ResolvedIndex
field `index_resolver` (already correct, no change)
Plus matching updates in:
- doc comments (
/// - registry_resolver is what will typically be hit when using non-resolvable IRIs, /// A resolver for whatever is considered a central project registry, // Finally try the centralised registry if neither file/remote gave anything useful, "registry-project checksum_canonical_hex failed; …")
B. Lockfile wire format — core/src/lock.rs:560, core/src/lock_tests.rs:304
Source::Registry { registry: String }
serializes to TOML as:
[[projects.sources]]
registry = "..."
Renaming this variant + key would be a lockfile schema break — every existing sysand-lock.toml containing such a source would fail to parse. Two options:
- Defer. Keep
Source::Registry { registry } as-is for now; do (A) only. The naming inconsistency between combined.rs and lock.rs becomes "registry is the wire word, index is the conceptual word" and gets a one-line doc-comment to that effect on the variant.
- Bundle with a lockfile-version bump. Rename to
Source::Index { index }, increment LockfileVersion, and add a deserializer migration (or a hard error pointing at sysand lock --upgrade).
Recommend option 1 unless a lockfile-version bump is on the near roadmap for an unrelated reason.
Why now
ARCHITECTURE.md is now the authoritative vocabulary source and uses "index" exclusively. Recent renames (HTTPIndexEnvironment → IndexEnvironment, IndexedRemoteProject → IndexEntryProject, file moves to env/index.rs / project/index_entry.rs) reinforce that. combined.rs is the only remaining surface where a reader sees "Registry" and has to mentally translate to "index".
Out of scope
- Pre-existing direct-HTTP types in
resolve/reqwest_http.rs (HTTPProjectAsync etc.) — separate cleanup, kept as-is per recent review.
- The
commands/lock.rs lockfile writer logic — only the variant name changes if (B) is taken.
Acceptance
AI generated thing I figure we should do, but I don't want to bundle into another PR but instead do in isolation.
Background
After landing the index protocol (#288), the codebase uses three different names for what is now consistently called "the index" in
ARCHITECTURE.md:index— used inARCHITECTURE.md, the newenv::index::IndexEnvironment{,Async}, the newproject::index_entry::IndexEntryProject, and theindex_resolverfield name.Registry— used as the public type-parameter name and several enum variants/types incore/src/resolve/combined.rs.registry— used in the lockfile wire format (Source::Registry { registry }→[sources] registry = "...").Three names for one concept is a comprehension trap, and the gap is widening as new code adopts
Index*.Inventory
A.
core/src/resolve/combined.rs— pure rename, no wire-format impactPlus matching updates in:
/// - registry_resolver is what will typically be hit when using non-resolvable IRIs,/// A resolver for whatever is considered a central project registry,// Finally try the centralised registry if neither file/remote gave anything useful,"registry-project checksum_canonical_hex failed; …")B. Lockfile wire format —
core/src/lock.rs:560,core/src/lock_tests.rs:304serializes to TOML as:
Renaming this variant + key would be a lockfile schema break — every existing
sysand-lock.tomlcontaining such a source would fail to parse. Two options:Source::Registry { registry }as-is for now; do (A) only. The naming inconsistency betweencombined.rsandlock.rsbecomes "registry is the wire word, index is the conceptual word" and gets a one-line doc-comment to that effect on the variant.Source::Index { index }, incrementLockfileVersion, and add a deserializer migration (or a hard error pointing atsysand lock --upgrade).Recommend option 1 unless a lockfile-version bump is on the near roadmap for an unrelated reason.
Why now
ARCHITECTURE.mdis now the authoritative vocabulary source and uses "index" exclusively. Recent renames (HTTPIndexEnvironment→IndexEnvironment,IndexedRemoteProject→IndexEntryProject, file moves toenv/index.rs/project/index_entry.rs) reinforce that.combined.rsis the only remaining surface where a reader sees "Registry" and has to mentally translate to "index".Out of scope
resolve/reqwest_http.rs(HTTPProjectAsyncetc.) — separate cleanup, kept as-is per recent review.commands/lock.rslockfile writer logic — only the variant name changes if (B) is taken.Acceptance
Registry*identifiers incore/src/resolve/combined.rsrenamed toIndex*cargo test --workspace --all-features --exclude sysand-pyclean