Repository navigation
Description
Found by the defect-hotspots skill on 2026-10-19 over 90 days of main (c43ba554b7), following up on #142, #139, #148, and #157.
Loop: verifyDepsBeforeRun & repeat-install fast path (12 fixes, 2 regressions)
Property. A pre-run check (verifyDepsBeforeRun) or repeat-install fast path skips an install if and only if running that command's install would change nothing for the covered project selection, and any install spawned by the gate receives the same flags/selection and writes a validation state that immediately satisfies the gate.
Recent members. pnpm/pnpm#15112, pnpm/pnpm#16211 (pnpm/pnpm#11865), pnpm/pnpm#16268 (#45), pnpm/pnpm#16317 (pnpm/pnpm#16313), pnpm/pnpm#16324 (pnpm/pnpm#16322), pnpm/pnpm#16396 (pnpm/pnpm#16374), pnpm/pnpm#16566 (pnpm/pnpm#16545), pnpm/pnpm#16558 (pnpm/pnpm#16583), pnpm/pnpm#16992 (pnpm/pnpm#16988), pnpm/pnpm#16996 (pnpm/pnpm#16993), pnpm/pnpm#17019 (pnpm/pnpm#17011), pnpm/pnpm#17030 (#142), pnpm/pnpm#17034 (#139).
Remaining Flaws after pnpm/pnpm#17030 & pnpm/pnpm#17034
- Four v11 parity gaps in
@pnpm/deps.statusandrunDepsStatusCheck.ts:autoDedupe+CI=trueinfinite install loop in v11:5eaad67e6b(fix: stop the pre-run install for a dedupe baseline a frozen install cannot record pnpm#16396) made v12'sdeps_status.rs:143-145ignoreautoDedupewheninstall_would_run_frozenis true. v11'spnpm11/exec/commands/src/runDepsStatusCheck.ts:35-48andpnpm11/deps/status/src/checkDepsStatus.ts:72-86still do not ignoreautoDedupewhen frozen, soverifyDepsBeforeRunon CI still triggers a frozen install on everypnpm runwhenautoDedupeis set.sharedWorkspaceLockfile: falsein v11 bypassesvalidationProof: Inpnpm11/deps/status/src/checkWorkspaceDepsStatus.ts:72-77,opts.sharedWorkspaceLockfile === falsesetsproof = undefined, falling back to legacy mtime checks instead of using the per-project validation digests added in9204d64b8c(fix(deps.status): record which projects each install proved installed pnpm#17034).- Non-recursive
pnpm run/pnpm execinside a workspace project ignores{.}...workspace dependencies (tracked in verifyDepsBeforeRun: hold the workspace dependencies of the project a non-recursive command runs in #157). - Four separate state writers in v11: Unlike v12's single
recorded_workspace_state(pnpm/crates/package-manager/src/install/workspace_state/write.rs), v11 callsupdateWorkspaceStatefrom 4 places (installDeps.ts:363,reportAlreadyUpToDate.ts,checkWorkspaceDepsStatus.ts:160-175,checkRootProjectDepsStatus.ts:133-146).
- Spawned
pnpm installdrops first-class CLI flags (verify_deps.rsandrunDepsStatusCheck.ts).pnpm/crates/cli/src/cli_args/verify_deps.rs:256-306andpnpm11/exec/commands/src/runDepsStatusCheck.ts:263-332forward only--filterand--config.<k>=<v>(raw_cli_config). First-class CLI flags passed topnpm run/exec(--lockfile-dir,--modules-dir,--store-dir,--offline,--prefer-offline,--frozen-lockfile,--ignore-scripts) are used by the gate check on the parentConfigbut dropped when spawningpnpm install. - Divergent empty-project predicates and
GatePolicyin v12.manifest_has_runtime_deps(optimistic_repeat_install.rs:369-378),no_project_has_dependencies(install/run/dispatch.rs:344-357), andproject_has_something_to_install(install/workspace_state/nothing_to_install.rs:76-129) check different subsets ofpeerDependencies(auto_install_peers), lifecycle scripts, and pnpmfiles; anddeps_status.rs:84hardcodesdedupe_peers: falseinGatePolicywhileoptimistic_repeat_install.rs:189usescheck.config.dedupe_peers.
Design Change
- Port
install_would_run_frozen(autoDedupeexemption) topnpm11/deps/status/src/checkDepsStatus.ts, enablevalidationProofforsharedWorkspaceLockfile: falseincheckWorkspaceDepsStatus.ts, and centralize v11's 4updateWorkspaceStatecallers into one merge helper in@pnpm/installing.workspace-state. - Forward effective CLI flags when
verifyDepsBeforeRun: installspawnspnpm installin bothverify_deps.rsandrunDepsStatusCheck.ts, and alignGatePolicy::dedupe_peersand the empty-project predicate in v12.
Tests
- Run the
repeat_install_oracle.rsscenarios across v11 and mixed v11↔v12 writers (Test the repeat-install gates across pnpm v11 and v12 with a differential harness #148), plus aCI=true+autoDedupe: truetest in v11. - Add a sequence test for
pnpm --lockfile-dir=... --config.verify-deps-before-run=install run testasserting that the spawned install writes the lockfile/state inlockfile-dirand converges on the first run.
Written by an agent (Antigravity, Gemini 4 Argon).
Activity
zkochan commentedon Oct 20, 2026
Opened pnpm/pnpm#17150 covering the full scope of this issue:
verifyDepsBeforeRunparity:@pnpm/workspace.state(preserveWorkspaceStateSettings) and@pnpm/installing.commands(workspaceStateUpdate.ts), preserving carrieddev/optional/productionsettings whenignoredWorkspaceStateSettingsignores them and preserving v12-recordedautoDedupe.selectProjectsToVerify.tsso non-recursivepnpm run,pnpm exec, andpnpm restartinside a workspace project hold{.}...(the target project and its transitive workspace dependencies), matching v12'sReachableWorkspaceDeps(verifyDepsBeforeRun: hold the workspace dependencies of the project a non-recursive command runs in #157).checkRecordedWorkspace) and legacy unrecorded validation (checkModifiedSinceLastValidation) in@pnpm/deps.statuswith v12'scheck_freshness, including empty-project handling,dedupeDirectDeps,dedupePeerDependents,autoInstallPeers,excludeLinksFromLockfile, catalog/override config comparison, andopts.lockfileDirresolution.verifyDepsBeforeRun: install:--lockfile-dir,--modules-dir,--virtual-store-dir,--store-dir,--dir,--workspace-root,--prod,--dev,--no-optional,--filter,--filter-prod,--test-pattern,--changed-files-ignore-pattern, and--config.*) whenverifyDepsBeforeRun: installspawnspnpm installin both v11 (runDepsStatusCheck.ts) and v12 (verify_deps.rs).GatePolicy::dedupe_peersand empty-project predicates:GatePolicy::dedupe_peersand empty-project checks acrossoptimistic_repeat_installandnothing_to_install.rs.repeat_install_oracle.rsto run all scenarios acrossV12,V11, andMixedv11↔v12 drivers (Test the repeat-install gates across pnpm v11 and v12 with a differential harness #148), addedci_and_auto_dedupe_gate_converges_across_v11_and_v12andverify_deps_install_forwards_lockfile_dir_and_converges, and enabledrepeat_install_oraclein the CIconvergencejob.Generated by Antigravity (Claude Opus 4.6)
fix: finish repeat-install and verifyDepsBeforeRun unification across…
fix: finish repeat-install and verifyDepsBeforeRun unification across…
fix: finish repeat-install and verifyDepsBeforeRun unification across…
fix: finish repeat-install and verifyDepsBeforeRun unification across…
fix: finish repeat-install and verifyDepsBeforeRun unification across…