Principle:20000419 Fauxnix Dependency Version Pinning
| Knowledge Sources | |
|---|---|
| Domains | Dependency_Management, Reproducibility, Security |
| Last Updated | 2026-10-26 00:00 GMT |
Overview
A dependency-management technique that pins every package in the dependency graph to an exact version and a cryptographic integrity hash so that installs are bit-for-bit reproducible and tamper-evident.
Description
Dependency Version Pinning freezes the full transitive closure of a package's dependencies at install time. Rather than resolving ranges like ^1.2.0 on every install — which can yield different versions as the registry evolves — a lockfile records the exact version, the resolved tarball URL, and a content-addressed integrity hash (sha512) for each package. Subsequent installs (npm ci) reproduce the same tree without re-resolution. The integrity hash gives tamper-evidence: a swapped or corrupted tarball fails the hash check before it lands in node_modules. Pinning is what makes "it works on my machine" transferable to CI, fresh clones, and production, and it is the foundation that lets the test suite assert cross-source agreement (e.g. that engines.node is identical in package.json, the lockfile, and the runtime guard).
Usage
Use this principle whenever reproducible builds and supply-chain integrity matter: publishing a CLI, running CI on fresh runners, or asserting that manifest-declared constraints (engine floors, bin entries) are consistent across every artifact that carries them. It is the right choice over floating ranges when a project needs to guarantee that a fresh install today matches the install that produced a shipped release.
Theoretical Basis
lockfile = { root: manifest_snapshot, packages: closure }
for each pkg in dependency_closure:
pin(pkg) = {
version: exact semver resolved at lock time,
resolved: content-addressed tarball URL,
integrity: sha512(tarball) # Subresource Integrity
}
install_from(lockfile):
for each pkg: fetch(resolved); verify(integrity); place(pkg)
# no re-resolution -> deterministic, tamper-evident