Repository navigation
Description
Found by the defect-hotspots skill (pnpm/pnpm#17021) on 2026-10-17 over 90 days of main (086165da7a). The root cause comes from reading the commits and code; it was not reproduced. The design steps are proposals for a maintainer to settle.
Loop: "Is node_modules up to date?" (14 fixes, 2 open)
Property. A check that skips an install skips it exactly when a full install would change nothing for the selected projects. The install it spawns must clear it.
Members. pnpm/pnpm#16211, pnpm/pnpm#16268, pnpm/pnpm#16282, pnpm/pnpm#16317, pnpm/pnpm#16324, pnpm/pnpm#16396, pnpm/pnpm#16404, pnpm/pnpm#16558, pnpm/pnpm#16566, pnpm/pnpm#16992, pnpm/pnpm#16996, pnpm/pnpm#17019 (v12 only; the v11 half was left out). Open: pnpm/pnpm#16588 and pnpm/pnpm#17012. Issues: pnpm/pnpm#16278, pnpm/pnpm#16322, pnpm/pnpm#16374, pnpm/pnpm#16583, pnpm/pnpm#16988, pnpm/pnpm#16993, pnpm/pnpm#17007, pnpm/pnpm#17011.
Flaw.
- Five deciders in v12:
install_already_up_to_date(install/workspace_state.rs)install/run/fast_path.rsprojects_have_nothing_to_installcheck_deps_status_before_run(optimistic_repeat_install/deps_status.rs)- the install's own up-to-date path (
lockfile_freshness.rsandprepare_modules_state/up_to_date.rs)
- Three deciders in v11:
deps/status,runDepsStatusCheck.ts, andallProjectsAreUpToDate. - Their shared input is a workspace-wide
lastValidatedTimestampplus afilteredInstallboolean, so the state cannot say which projects were validated. Four fixes rebuild that answer differently. - Three state writers that rebuild instead of merging lose fields (fix: stop the pre-run install for a dedupe baseline a frozen install cannot record pnpm#16396, fix: settle single-project lockfile checks pnpm#16996).
- The gate guesses the install it spawns (
install_args_from_state,install_would_run_frozen), which produces reinstall loops. - mtime is treated as truth. Content fallbacks were added one input at a time.
Design change.
- Tests first.
- One merge-style state writer.
- Per-project validation records: a hash of each importer's dependency fields and wanted-lockfile closure. This deletes the filtered-install reconstructions and makes the v11 half of verifyDepsBeforeRun: after a filtered install, a filtered run of another project skips the install its changed dependencies need pnpm#17011 fixable.
- A single
freshness(InstallPlan) -> Fresh | Stale{reason, projects}. The gate spawns exactly that plan and warns instead of looping if it stays stale.
Tests.
- Equivalence matrix: lockfile layout × linker × injected × dependency groups × previous install filtered or not × mutation. Assert verdict UpToDate ⇔ a full install with
optimisticRepeatInstall: falsechanges nothing. - Convergence test.
- Writer round-trip: state comes from real installs, never
write_state. The current ~340 unit tests hand-write the state. - v11/v12 differential.
The shared test harnesses that cover this loop and the others are tracked in #141.
Written by an agent (Claude Code, claude-opus-5-5).
Activity
zkochan commentedon Oct 17, 2026
pnpm/pnpm#17030 (draft) implements the v12 side of this:
repeat_install_oracle: 14 scenarios × 8 layouts covering linker, shared/dedicated lockfiles, and injected packages) checks every gate in both directions after every step. The install fast path must be taken exactly when anoptimisticRepeatInstall: falseinstall changes nothing. A filtered run gate must pass exactly when a clean install resolves the selection the same way. Every gate must converge after its own install. Onmainit fails 38 of 112.filteredInstallreconstructions. Content digests replace mtime ordering.recorded_workspace_state.Not in it: the v11 half and the v11/v12 differential. I'll do those in a follow-up PR on #139, using the same state format. The ~340 unit tests still hand-write the state, but its validation records now come from the real writer.
Written by an agent (Claude Code, claude-opus-5-5).
test(cli): check the repeat-install gates against a full install
fix(package-manager): record which projects each install proved insta…
fix(cli): stop verifyDepsBeforeRun gates that can never pass
fix(package-manager): record which projects each install proved insta…
fix(deps.status): record which projects each install proved installed (…
zkochan commentedon Oct 21, 2026
Opened pnpm/pnpm#17181 to complete the remaining unification across both pnpm v12 (Rust) and pnpm v11 (TypeScript):
pnpm-package-manager), folded the static workspace-state/filesystem checks intofreshness::check_freshnesssocheck_optimistic_repeat_install_with_stateandcheck_deps_status_before_runshare a single decider parameterized byGatePolicy(closing theconfigDependenciesanduseGitBranchLockfiledrift between the two gates), consolidatedgvs_build_markers_completeandcheck_strict_dep_builds_for_fast_pathbetweeninstall_already_up_to_dateandrepeat_install_verdict, and sharedrecorded_workspace_statewith repeat-install test fixtures.@pnpm/deps.statusand@pnpm/exec.commands), added the missingcatalogResolutionsAreUpToDatecheck toassertWantedLockfileUpToDate, sharedrecordValidatedWorkspaceStatebetween root-project and workspace status checks, respectedopts.lockfileDirincheckRootProjectDepsStatus, and ported the post-install non-convergence warning (warnIfStillOutdated) torunDepsStatusCheck.Generated with Antigravity (Claude Opus 4.7)
refactor: unify up-to-date checks (#17181)