Repository navigation
Description
Problem
Path dependency identity is compared using its resolved location, but the LockedSource::Path.requested field retains the path spelling from the first dependency declaration visited. When the same package is reached again, the resolver reuses the completed package without reconciling that field.
Two declarations can correctly resolve to the same package while using different relative paths. Reordering otherwise unchanged root dependencies can therefore change the generated lockfile, and --locked can reject an unchanged dependency graph.
Code references:
- src/resolver.rs — resolve_manifest_dependencies and resolve_dependency
- src/lockfile.rs — LockedSource equality, normalized, and render_package
Regression scenario
Create a temporary project with this layout:
app/
vex.ws
src/main.wave
libs/
alpha/vex.ws
alpha/src/lib.wave
nested/beta/vex.ws
nested/beta/src/lib.wave
shared/vex.ws
shared/src/lib.wave
Use valid manifests with matching package names and version 0.1.0. Set lib = true for alpha, beta, and shared, and give each a minimal canonical library entry. shared has no dependencies.
The root initially declares:
dependencies = [
{ name = "alpha", path = "libs/alpha" },
{ name = "beta", path = "libs/nested/beta" }
]
alpha declares { name = "shared", path = "../shared" }; beta declares { name = "shared", path = "../../shared" }. Both resolve to app/libs/shared.
- Run
vex fetchfromappand savevex.lock. - Reverse only the two root dependency entries. Keep every package, version, path target, and graph edge unchanged.
- Run
vex fetch --locked --offline.
Tracing the current code: alpha-first stores shared with path = "../shared"; beta-first stores path = "../../shared". Both use resolved = "libs/shared". Because derived equality includes requested, the final lock comparison rejects the reordered graph. A normal fetch can rewrite the lockfile solely to change that spelling. This is a source-derived failure scenario, not a recorded Vex execution.
Expected behavior
The same resolved package graph must have a stable lock representation independent of dependency declaration traversal order. Separate package source identity from requester-relative path spelling, or apply another deterministic representation that preserves the existing resolution contract.
This is not randomness across identical runs; it is dependence on the order of semantically equivalent input declarations.
Acceptance criteria
- The diamond fixture resolves to the same package identities and byte-for-byte canonical lock output with either root dependency order.
- Reordering the declarations succeeds with an existing lockfile under
--locked --offlineand leaves that file unchanged. - Cover shared path dependencies reached through more than one nesting depth and equivalent relative spellings.
- Do not reinterpret requester-relative paths as root-relative paths when reading or comparing existing lockfiles.
- Continue rejecting genuinely changed resolved sources, versions, or graph edges under
--locked. - Preserve relocatable project-relative locking and existing cycle/source-conflict checks.
- Keep format-version compatibility explicit; do not silently assign new semantics to an existing serialized field.
- Add local path-only integration tests and run
cargo test --locked; the core reproducer needs neither a network nor wavec.
Related: #79 covers general lockfile compatibility fixtures, and #94 covers conflict diagnostics. This issue owns the first-visited path spelling leaking into package lock identity.
Activity