Skip to content

Rename remaining Registry identifiers to Index for consistency with new index protocol #293

@consideRatio

Description

@consideRatio

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:

  1. 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.
  2. 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 (HTTPIndexEnvironmentIndexEnvironment, IndexedRemoteProjectIndexEntryProject, 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

  • (A) all Registry* identifiers in core/src/resolve/combined.rs renamed to Index*
  • doc comments and log messages in the same file updated
  • decision recorded on (B): defer (with one-line doc on the variant) or bundle (with lockfile version bump)
  • cargo test --workspace --all-features --exclude sysand-py clean

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions