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:
- Collection Phase: Gather all unique (source, version) pairs
- Resolution Phase: Batch resolve all versions to SHAs
This design minimizes Git operations and enables parallel resolution.
Structs§
- Prepared
Source Version - Represents a prepared source version with worktree information.
- Resolved
Version - Centralized version resolver for efficient SHA resolution
- Version
Entry - Version resolution entry tracking source and version to SHA mapping
- Version
Resolution Service - Service for version resolution and worktree management.
- Version
Resolver - Centralized version resolver for batch SHA resolution.
- Worktree
Manager - Manages worktree creation for resolved dependency versions.
Enums§
- Prepared
Version State - State of a prepared version in the concurrent preparation cache.
Functions§
- find_
best_ matching_ tag - Finds the best matching tag for a version constraint.
- is_
version_ constraint - Checks if a string represents a version constraint rather than a direct reference.
- parse_
tags_ to_ versions - Parses Git tags into semantic versions, filtering out non-semver tags.
- sort_
versions_ deterministic - Sorts tag-version pairs by semantic version (descending), with deterministic tie-breaking.