Repository navigation
Description
Problem
validate_commit accepts full 40- or 64-character hexadecimal object IDs using is_ascii_hexdigit, including uppercase A through F. The lockfile parser then preserves the original spelling.
require_checkout_at compares that spelling directly with the output of git rev-parse HEAD. Git reports the canonical lowercase object ID, so an uppercase or mixed-case lock entry can be accepted by the parser and Git's object lookup but rejected by Vex as a different checkout.
checkout_commit uses the same case-sensitive comparison and can attempt an unnecessary checkout when HEAD already identifies the requested commit.
Code references:
- src/lockfile.rs — validate_commit and parse_package
- src/resolver.rs — require_checkout_at, checkout_commit, and git_has_commit
- src/commands/build.rs — dry-run dependency resolution
Regression scenario
Use a temporary application and a local Git library dependency with valid manifests and canonical source entries.
- Run
vex fetchto create a lockfile and managed checkout. - Confirm
vex check --dry-run --locked --offlinereaches the compiler planning path with an installed compatible wavec or the existing fake-wavec test setup. - Change only the hexadecimal letters in the dependency's
commitfield invex.lockto uppercase or mixed case. Keep the full ID length, all other fields, and the clean checkout unchanged. - Repeat the same dry-run command.
The current source accepts the edited lock entry but takes the checkout-mismatch error path because the two textual spellings differ. Expected: the same commit is recognized, planning proceeds, and the lockfile remains byte-for-byte unchanged.
The fixture's object ID must contain at least one hexadecimal letter so changing case actually exercises the comparison. This describes the Vex regression to execute; it does not claim a recorded end-to-end Vex result.
Expected behavior
Normalize validated object IDs in memory, preferably when parsing lockfile commit fields, and use a consistent representation for lookup, equality, and checkout decisions. Preserve the currently accepted uppercase and mixed-case input rather than introducing a new rejection rule.
Do not rewrite the lockfile merely to normalize its spelling during --locked or dry-run operations. Case-only changes must not be confused with a different selected commit.
Acceptance criteria
- Parser tests cover lowercase, uppercase, and mixed-case full IDs for both SHA-1 and SHA-256 lengths and produce one canonical internal representation.
- Invalid characters, abbreviated IDs, and unsupported lengths remain rejected.
- A local-Git integration test verifies dry-run locked/offline reuse with an uppercase or mixed-case lock entry and the same clean checkout.
- Normal locked/offline reuse does not request a checkout solely because of hexadecimal letter case.
- A genuinely different commit still triggers the existing mismatch or checkout behavior as appropriate.
-
--lockedand dry-run leave the original lockfile bytes unchanged and do not fetch from the network. - Preserve checkout-integrity checks and source-URL comparison semantics; only object IDs are normalized.
- Run
cargo test --locked. SHA-256 parsing coverage must not depend on local Git supporting SHA-256 repository creation.
Difficulty: easy. Related #79 covers broader lockfile compatibility fixtures; #19 covers dirty managed checkouts. This issue owns case normalization of otherwise valid full object IDs.
Activity
isaim0011 commentedon Sep 21, 2026
Hey @LunaStev, I'd like to take this up!
The approach is clear: normalize validated object IDs to lowercase in memory during lockfile parsing in
src/lockfile.rsso identity checks inrequire_checkout_atandcheckout_commitmatch Git's canonical lowercase representation, without rewriting the lockfile during--lockedor dry-run.I'll add the parser unit tests for SHA-1 and SHA-256 case variations and the local Git integration test covering the locked/offline dry-run scenario.
LunaStev commentedon Sep 21, 2026
Sounds good! Please go ahead and take this up. Thanks!
LunaStev commentedon Sep 21, 2026
We will assign it to you.
We will assign it to you.