Skip to content

verifyDepsBeforeRun: current-lockfile check is skipped when the state records a validation but the wanted lockfile is missing #180

Closed
pnpm/pnpm
#17174

Description

@zkochan

Context

Follow-up from pnpm/pnpm#17150.

findModulesDirIssue (v11, pnpm11/deps/status/src/findModulesDirIssue.ts) skips findProjectMissingFromCurrentLockfile whenever workspaceState.validation is set, on the assumption that the recorded-validation path proves the project. That path is not taken when the wanted lockfile is missing and the current lockfile stands in for it (validationProof returns undefined), so the legacy check runs and only compares the manifest against the current importer. The current lockfile keeps the importers of unselected projects with no packages, so a project a filtered install skipped can be reported up to date.

Trigger: a filtered install that excluded project b, b has a node_modules directory, pnpm-lock.yaml is deleted, then pnpm run --filter b <script>.

The review of the PR reported the same gap in the v12 freshness check (pnpm/crates/package-manager/src/optimistic_repeat_install), so verify it there too.

Task

Gate the skip on the recorded proof actually being used (or keep the current-lockfile check when the wanted lockfile is missing), with a test for the trigger above in both stacks.


Written by an agent (Claude Code, claude-fable-5-1).

Activity

  1. self-assigned this
    on Oct 20, 2026
  2. zkochan commented on Oct 20, 2026

    @zkochan
    MemberAuthor

    Opened pnpm/pnpm#17174 to resolve this issue across both pnpm v11 and v12:

    • pnpm v11 (@pnpm/deps.status): findModulesDirIssue now gates the skip of findProjectMissingFromCurrentLockfile on a usable validation proof (proof != null in checkWorkspaceDepsStatus) rather than workspaceState.validation != null, and readCurrentLockfileAsWanted also verifies that the current lockfile records the direct dependencies of every checked project when workspaceState.filteredInstall is set.
    • pnpm v12 (pnpm-package-manager): held_projects_match_lockfile now checks require_recorded_in_current both when comparing against a wanted lockfile and when the current lockfile stands in for a missing wanted lockfile, and current_records_importer verifies that the current lockfile records both the importer and a snapshot for each of its direct non-link dependencies (covering current lockfiles written by pnpm v11 filtered installs as well as pnpm v12).
    • Added regression tests covering the deleted-pnpm-lock.yaml filtered-install trigger in both stacks.

    Written by an agent (Antigravity, Gemini 4 Argon).

  3. added a commit that references this issue on Oct 20, 2026
    3813392
  4. added a commit that references this issue on Oct 20, 2026
    9dc367c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions