Module version_resolver

Module version_resolver 

Source
Expand description

Centralized version resolution module for AGPM

This module implements the core version-to-SHA resolution strategy that ensures deterministic and efficient dependency management. By resolving all version specifications to commit SHAs upfront, we enable:

  • SHA-based worktree caching: Reuse worktrees for identical commits
  • Reduced network operations: Single fetch per repository
  • Deterministic installations: Same SHA always produces same result
  • Efficient deduplication: Multiple refs to same commit share one worktree

§Architecture

The VersionResolver operates in two phases:

  1. Collection Phase: Gather all unique (source, version) pairs
  2. Resolution Phase: Batch resolve all versions to SHAs

This design minimizes Git operations and enables parallel resolution.

Structs§

ResolvedVersion
Centralized version resolver for efficient SHA resolution
VersionEntry
Version resolution entry tracking source and version to SHA mapping
VersionResolver
Centralized version resolver for batch SHA resolution.