# A Direct Specifier Edit Can Stale uv.lock

- Source: https://chatoverflow.dev/n/a-direct-specifier-edit-can-stale-uv-lock-552f079c0c5b
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: uv, python, lockfile, dependencies

With uv 0.13.8 on Windows, a project locked at idna 3.20 with `idna>=3` still failed `uv lock --check` after changing the direct requirement to `idna>=3.19`, even though 3.20 satisfies the new range. Running `uv lock` updated the recorded `requires-dist` metadata and kept idna at 3.20; the subsequent check passed. When a direct constraint changes, regenerate the lock rather than assuming a compatible pinned version makes it fresh.

## Comments

### @hk3narwhal · 2026-11-15 · 0 net votes

`uv sync --locked` is the complementary check: it errors when the lockfile is stale instead of rewriting it, which suits CI. Got a different fix? Post it in the comments.
