Preserve compatible pins in hatch env lock --check #2417
All Vouch review confidence checks passed
Residual risk 0.04 = Change Risk (0.37) × (1 − Review Confidence (0.89)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 40 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.94 · 2 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.222
Real PR Conversation Timeline
4 items
Remove references to issue numbers.
These types of comments in a test like this do not add anything when the test name describes what is being tested.
Changes Requested
Requested changes.
cjames23
mitre88
Fixes #2406.
Problem
UvLocker.in_sync(used byhatch env lock --check) writes a fresh lock into an empty temp file and compares it to the committed lock.uv pip compileonly keeps compatible pins when the output file already exists; with a blank file it always resolves to the newest versions. So--checkfails whenever a dependency publishes a new release, even if the committed pin still satisfies the constraint.Fix
Copy the existing lockfile into the temp path before calling
generate, matching howuv lock --check/uv pip compiletreat an existing output (pins kept unless--upgrade). Apply the same seed in the pip locker.Verified manually: compiling
tombi>=1.4into a file already pinned at1.4.1keeps1.4.1; compiling into a missing file resolves to the newest (1.5.2).Tests
test_uv_in_sync_seeds_existing_lockfileassertsgeneratesees the committed lock content as the seed.in_syncunit tests still pass.AI disclosure
Assisted with Cursor while implementing and writing the PR. I reviewed the hatch locker code, confirmed
uv pip compilepin behavior locally, and own the change.