A lockfile records the exact versions that a resolver picked for every direct and transitive dependency, which is what makes a build reproducible and what integrity hashes are checked against. A study of lockfiles across seven package managers (npm, pnpm, Cargo, Poetry, Pipenv, Gradle and Go) describes them as a record of the resolved set, used to reduce build times, verify integrity and support reproducibility (Gamage et al., The Design Space of Lockfiles Across Package Managers). Pants' documentation makes the same point for Python: a lockfile pins transitive versions plus the expected SHA256 of each artifact, and the resolver only changes them when you deliberately ask it to (Pants docs, Lockfiles).
What the lockfile does not record is registry state. It tells you which version was resolved and what its hash was, not whether that version is still installable, whether its maintainers are the same people, or whether an advisory now covers it. That gap is exactly where a dependency bump can go wrong while every local check passes.
A second gap is drift between manifest and lockfile. If someone edits the manifest without regenerating the lockfile, CI that runs npm install silently fixes the mismatch while CI that runs npm ci fails on it, and deploys can run versions nobody tested (sbomify, What Is Lock File Drift). An agent that bumps a dependency should treat "lockfile still matches the manifest" as a precondition, not a bonus.
A third gap is provenance inside the lockfile itself. Liran Tal showed that a pull request which looks like an ordinary version bump can point one locked entry at a tarball hosted on a personal GitHub repository instead of the official registry, and a folded diff of several hundred lines hides it (Snyk, Why npm lockfiles can be a security blindspot). The registry check described here is the cheap way to catch that class of change before a human reads the file.



