Module backtracking

Module backtracking 

Source
Expand description

Automatic version backtracking for SHA conflict resolution.

This module implements automatic resolution of version conflicts by finding alternative versions that satisfy all constraints and resolve to the same commit SHA.

§Algorithm

When SHA conflicts are detected (multiple requirements for the same resource resolving to different commits), the backtracking resolver attempts to find compatible versions:

  1. Query available versions: Fetch all tags from the Git repository
  2. Filter by constraints: Find versions satisfying all requirements
  3. Try alternatives: Test versions in preference order (latest first)
  4. Verify SHA match: Check if alternative version resolves to same SHA as other requirements
  5. Handle transitive deps: Re-resolve transitive dependencies after version changes
  6. Iterate if needed: Continue until all conflicts resolved or limits reached

§Performance Limits

To prevent excessive computation:

  • Maximum 100 version resolution attempts per conflict
  • 10-second timeout for entire backtracking process
  • Early termination if no progress made

Structs§

BacktrackingIteration
State of a single backtracking iteration.
BacktrackingResolver
Automatic version backtracking resolver.
BacktrackingResult
Result of a backtracking attempt.
ResourceParams
Parameters for adding or updating a resource in the registry.
VersionUpdate
Record of a version update made during backtracking.

Enums§

TerminationReason
Reason for termination of backtracking.

Functions§

parse_resource_id_string
Convert a resource_id string (format: “source:path”) into components.
resource_id_to_string
Convert a ResourceId to the legacy string format “source:name”.