Skip to content

The Drift Log · Model independence and repeatable builds

Locking Dependency Resolution Order for Repeatable CI

18 November 2026 · 3 min read · 722 words · established

Two identical sealed archive crates with matching checksum plates

Concurrent network fetching can dictate dependency resolution order. Here is how to isolate your CI solver from socket timing jitter.

A clean CI run fails on an unchanged commit. The error is a TypeError deep inside a transitive utility package, thrown because a runtime helper method is missing. You re-run the pipeline immediately without touching the code. The build passes.

The source code did not change. The container image was the same. The difference was the sequence in which the build runner pulled metadata from the package registry.

When a package manager discovers dependencies concurrently over the network, socket responses arrive out of order. If the resolver does not sort candidate nodes before evaluating constraints, arrival order becomes resolution order. That race condition decides which version of a transitive dependency gets hoisted, which peer dependency wins a conflict, and whether your integration test suite passes or fails.

How Network Arrival Order Pollutes the Resolver

Modern package resolvers evaluate a dependency graph as a constraint satisfaction problem. When two packages declare overlapping but non-identical ranges for a shared dependency—say, ^2.1.0 and ^2.3.0—the solver must pick a concrete version.

Resolvers download manifest documents concurrently to save time. If package A finishes downloading first, the solver processes A’s constraints first and might pin the shared package to 2.1.4. If network latency delays A and package B arrives first, the solver processes B’s constraints first and resolves the shared package to 2.3.1.

Run 1: Manifest A (arrives 12ms) -> resolves foo@2.1.4 -> hoists foo@2.1.4
Run 2: Manifest B (arrives 11ms) -> resolves foo@2.3.1 -> hoists foo@2.3.1

If the lockfile is absent, loosely constrained, or ignored during partial workspace updates, the solver emits a different physical layout to disk. On disk, that layout changes the directory hierarchy or module resolution lookup path.

Tests that inadvertently depend on hoisted module paths will now pass or fail depending on network jitter. This directly breaks CI reproducibility. Network-level timing has leaked into your application's execution environment.

Enforcing Deterministic Dependency Order

Fixing this requires isolating the solver from the network arrival order. You achieve this through three constraints:

  1. Topological sorting before evaluation. If you write custom resolution scripts or build plugins, sort candidate package identifiers lexicographically before feeding them to the resolution solver. Never iterate directly over concurrent fetch promises as they resolve. Applying deterministic scheduling to your constraint queue ensures that the solver evaluates candidate nodes in an invariant sequence.
  1. Strict lockfile enforcement. A committed lockfile records the resolved graph, but standard install commands often fall back to dynamic resolution if an entry is missing or ambiguous. Always execute package managers in CI with explicit immutability flags:
## npm
npm ci

## pnpm
pnpm install --frozen-lockfile

## Yarn (v2+)
yarn install --immutable

These flags instruct the tool to abort immediately if the physical tree on disk cannot be constructed strictly from the committed graph, preventing silent on-the-fly re-resolvings.

  1. Pre-fetching into a local content-addressable cache. Separate downloading from graph construction. Fetch all required archives into an immutable store before computing the build layout. When the resolver queries packages from a local disk cache, network race conditions are removed entirely from the resolution phase.

As explored in our foundation post on model independence and repeatable software builds, variance in your software supply chain compounds. If your environment cannot guarantee identical inputs, testing cannot establish software correctness.

How SHPBL Handles Build Artifacts

At SHPBL, every software capability is model-independent and owned outright. Because no AI model runs inside our software at runtime, our code contains no runtime variance or hallucination surface.

We treat build reproducibility as a mechanical property. Every release archive is sealed by published checksums verified through our root of trust. When components pass through our certification harness, the runner builds and tests the artifact under rigid invariants, recording verifiable verdicts (CERTIFIED, PROVISIONAL, INCONCLUSIVE, or FAILED). The output does not shift between executions.

What to Do on Monday

Do not let package managers resolve dependency order dynamically on your CI runners. Verify these three points in your current configuration:

  1. Audit your CI install step. Ensure your workflows use --frozen-lockfile, --immutable, or npm ci. If an installation step modifies package-lock.json, pnpm-lock.yaml, or yarn.lock during a pipeline run, configure the step to fail the build.
  2. Eliminate ambient network resolution. Block network requests during the build and test stages. Only the pre-fetch step should have external network access.
  3. Verify hoist parity across platforms. Run a diff on the generated dependency trees across two distinct operating systems using your committed lockfile. The graph topology must match down to the leaf nodes.

This post supports the longer argument in Model Independence and Repeatable Software Builds.

Keep reading

Next in the log

The Strategic Master Library · written and reviewed under the house's own epistemic rules: nothing claimed that we cannot show.