Repository navigation
Description
Part of #253.
Property
pnpm install takes the repeat-install fast path only when a full install would change nothing.
Evidence
In the 90 days to 2026-11-03, 198 of 308 commits touching pnpm/crates/package-manager/src/optimistic_repeat_install were fixes, with 151 fix-on-fix blame edges. Each recent fix adds one input the fast path did not check:
- settings: fix(install): record the settings the repeat-install fast path missed pnpm#17391
- manifests as rewritten by hooks: fix(package-manager): record declared manifests and hook modified ones in the repeat-install check pnpm#17471, fix: check local dependencies a readPackage hook adds in the repeat-install check pnpm#17481
- workspace bins: fix(install): relink changed workspace bins on repeat installs pnpm#17325, fix(install): relink renamed workspace bins with dedicated lockfiles pnpm#17407
- the runtime: fix(install): link the runtime after a --no-runtime install pnpm#17545, fix(install): remove a linked runtime on a --no-runtime install pnpm#17548
- a lone project's version: fix: ignore the version of a lone project in the dependency-status check pnpm#17561, fix(deps-status): compare a workspace project's version only when something can resolve to it pnpm#17579
- registry routing: fix(install): re-resolve plain-keyed packages when their scope moves to another registry pnpm#17373, fix(lockfile): keep plain keys for packages of the default registry pnpm#17581
- injected dependencies: fix(package-manager): read injected dependencies from the lockfile in the repeat-install check pnpm#17025, fix(install): keep the repeat-install fast path for injected workspace deps pnpm#16404
- projects each install proved installed: fix(package-manager): record which projects each install proved installed pnpm#17030
Flaw
The fast path approximates the full install from a hand-kept list of inputs (optimistic_repeat_install/settings.rs, validation, install/workspace_state.rs, install/prepare_modules_state/up_to_date.rs). Nothing ties the list to what the install reads. pnpm/pnpm#17383 closed this for Config fields with a classification contract test, and setting-related fixes stopped after it. The fixes since then concern inputs that are not Config fields: manifests after hooks, local directories, bins, runtimes, and registry routes.
The same split shows in the module graph. install calls into optimistic_repeat_install::{validation, settings} about 30 times, and the fast path uses install::{StateWrite, StateProjects, FreshnessCheckError}.
Plan
-
Move the recorded install state and its validation into one module that
installand the fast path both depend on, removing the module cycle. Done in refactor(package-manager): break the module cycle between install and the repeat-install fast path pnpm#17686. -
Give every non-
Configinput a contract, choosing one of:- extend the test(package-manager): classify every Config field by how it reaches the repeat-install fast path pnpm#17383 classification to every input source;
- have the full install read those inputs through one reader that records each read, and make the workspace state a digest of what it recorded.
Done in test(cli): require every file a full install reads to be recorded or classified pnpm#17694 with a third option: a test observes every file a full install opens in the workspace outside
node_modulesand requires the workspace state to record it, or a classification to give the reason it needs no record. -
Generate the edit axes of
repeat_install_oraclefrom the same input list. Today they are hand-written, and test(install): add input axes to the repeat-install oracle and fix the patch gaps they found pnpm#17398 found new gaps as soon as it added axes.Done in fix: hold verifyDepsBeforeRun to a local directory dependency's manifest, and generate the oracle's edit axes from the read set pnpm#17702. Each kind of input the read-set test observes needs an oracle axis to compile. The first new axis found that
verifyDepsBeforeRunmissed a dependency added to afile:directory dependency, in both CLIs, which the same PR fixed. -
Apply the same to v11, which keeps the matching check in
pnpm11/deps/status.Done in test(cli): observe the read set of a pnpm v11 full install too pnpm#17705. The read-set test observes a v11 full install too, and the convergence job runs it that way. No v11 input went unrecorded. The oracle axes from step 3 already ran through v11.
Written by an agent (Claude Code, claude-opus-5-5).
Activity
test(cli): require every file a full install reads to be recorded or …
fix: hold verifyDepsBeforeRun to a local directory dependency's manif…
test(cli): observe the read set of a pnpm v11 full install too (#17705)
zkochan commentedon Nov 4, 2026
All four steps are done: pnpm/pnpm#17686, pnpm/pnpm#17694, pnpm/pnpm#17702 and pnpm/pnpm#17705. Step 3's first new axis found a
verifyDepsBeforeRungap forfile:directory dependencies in both CLIs, fixed in pnpm/pnpm#17702.Written by an agent (Claude Code, claude-opus-5-5).