Principle:AI QL Tuui Dependency Pinlocking
| Knowledge Sources | |
|---|---|
| Domains | Dependency_Management, Reproducibility |
| Last Updated | 2026-10-24 00:00 GMT |
Overview
A dependency management pattern that pins the exact version and integrity hash of every transitive dependency to guarantee reproducible installs across environments.
Description
Dependency Pinlocking records the full resolved dependency tree — direct and transitive — in a lockfile alongside each package's integrity hash. It addresses the problem of non-reproducible builds caused by floating semver ranges in package.json resolving to different versions over time or across registries. By committing a lockfile, a project ensures that npm ci installs the identical tree everywhere. In the broader Node.js ecosystem, this is the foundation of deterministic CI pipelines and reproducible builds.
Usage
Use this principle when a project must guarantee that every environment (developer machines, CI, production) installs the identical dependency tree, and when adding or updating dependencies requires regenerating the lockfile to keep it in sync.
Theoretical Basis
The lockfile is a snapshot of the dependency resolution graph:
- Resolve — Expand semver ranges from
package.jsoninto concrete versions - Pin — Record each package's exact version, integrity hash, and resolved URL
- Verify — On install, verify each package's hash matches the recorded integrity
- Reproduce —
npm ciinstalls exactly the pinned tree, no more, no less
package.json (ranges) → npm resolve → lockfile (pinned tree) → npm ci → identical node_modules/