Skip to content

Decide install freshness in one place, from recorded install inputs #219

Open

Description

@zkochan

Found by a defect-hotspot pass over the 90 days to 2026-10-26.

Property

When any check says "up to date" (the install fast path, the frozen-tree check, the run/exec check from verifyDepsBeforeRun), a full install of the same selection would change nothing. When a check refuses, that install would change something.

Fixes in the loop

pnpm/pnpm#16324, pnpm/pnpm#16211, pnpm/pnpm#16268, pnpm/pnpm#16404, pnpm/pnpm#16992, pnpm/pnpm#16996, pnpm/pnpm#17019, pnpm/pnpm#17017, pnpm/pnpm#17030, pnpm/pnpm#17034, pnpm/pnpm#17025, pnpm/pnpm#17150, pnpm/pnpm#17174, pnpm/pnpm#17179, pnpm/pnpm#17325, pnpm/pnpm#17373, pnpm/pnpm#17328, pnpm/pnpm#16558.

Issues: pnpm/pnpm#17324, pnpm/pnpm#17322, pnpm/pnpm#17127, pnpm/pnpm#17011, pnpm/pnpm#17007, pnpm/pnpm#16705. Related: #45.

Design flaw

Proposed change (3–4 PRs)

  1. One input set, InstallInputs, holding:

    • digests of the hooked manifests;
    • a snapshot of the settings that affect the lockfile;
    • patch, pnpmfile and bin digests;
    • registry routes.

    The full install records it per importer in the workspace state.

  2. One decide(scope, GatePolicy). The checks differ only by a small policy table.

  3. Port to v11 with shared golden vectors that pin identical digests in both stacks.

  4. Oracle extensions (below).

Tests that would have caught the loop

pnpm/crates/cli/tests/suite/repeat_install_oracle.rs already compares the checks with a full install. Its Layout varies only hoisted × sharedWorkspaceLockfile × injectWorkspacePackages. Its snapshot leaves out .bin and re-imports, and its scenarios are written by hand.

Fixes the change makes redundant

These are replaced by recorded inputs:


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

Activity

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

    @zkochan
    MemberAuthor

    pnpm/pnpm#17383 covers the first part of this task, the "every setting classified" test, for v12. It also removes the dedupe_peers pass-through that let one gate hard-code the value (the pnpm/pnpm#17322 shape). It does not cover InstallInputs, the single decide(), the v11 port, or the oracle axes.

    The classification found three confirmed gaps where the fast path reports up to date and a full install changes the tree: virtualStoreDirMaxLength, globalVirtualStoreDir, and turning on dangerouslyAllowAllBuilds. For six more (symlink, enableModulesDir, extendNodePath, hoistingLimits, externalDependencies, nodePackageMap), only an install into an empty node_modules applies the change. The PR description lists them all. v11 has not been checked for any of them.


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

  3. zkochan commented on Oct 26, 2026

    @zkochan
    MemberAuthor

    pnpm/pnpm#17391 fixes the five fast-path gaps from pnpm/pnpm#17383 by recording them in the workspace state. virtualStoreDirMaxLength, dangerouslyAllowAllBuilds and trustLockfile are fixed in both CLIs. globalVirtualStoreDir and skipRuntimes are fixed in v12 only, because v11 does not have these settings. The six settings that neither the fast path nor a full install applies are still open, along with InstallInputs, decide(), the v11 port and the oracle axes.


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

  4. zkochan commented on Oct 26, 2026

    @zkochan
    MemberAuthor

    Correction to my last comment: pnpm/pnpm#17391 no longer records skipRuntimes. fresh_install_with_no_runtime_resolves_but_does_not_fetch_the_runtime pins that a plain install after --no-runtime keeps the runtime absent, which matches v11. Recording the setting would change that, so it stays a known gap until someone decides which behavior is intended.


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

  5. zkochan commented on Oct 26, 2026

    @zkochan
    MemberAuthor

    pnpm/pnpm#17398 adds oracle axes to repeat_install_oracle.rs: overrides, a pnpmfile hook, patchedDependencies, dedupePeers, a workspace bin, and a scoped registry route. Each is edited after an install and checked against a full install, in every layout and with both CLIs. The snapshot now records .bin entries and the files of each registry dependency. A selection's view includes the lockfile snapshots it reaches.

    The new axes found two gate bugs, both fixed in that PR:

    • With dedicated lockfiles, v12's gates read patch files from the project directory and missed an edited patch.
    • v11 and v12 record patchedDependencies paths in different forms, so each CLI took the other's record for a changed setting.

    They also found install bugs, now filed as #224: a renamed workspace command is not relinked with dedicated lockfiles in v12, and both CLIs keep the old command.

    Still open here:

    • The run gate compares workspace-wide inputs, so an edit outside the manifests refuses every selection. The oracle allows this refusal for now. Per-importer InstallInputs would remove it.
    • Re-import detection in the snapshot.
    • Generated sequences.
    • InstallInputs, decide() and the v11 port.

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

  6. zkochan commented on Nov 3, 2026

    @zkochan
    MemberAuthor

    Another concrete case for the "every setting classified" test: extendNodePath.

    It changes the NODE_PATH written into bin shims, but neither CLI records it in the workspace state (it is not in WorkspaceStateSettings in v12 or in the settings key list in pnpm11/workspace/state/src/types.ts). If only PNPM_CONFIG_EXTEND_NODE_PATH changes between installs, with no manifest, lockfile or pnpm-workspace.yaml change, the fast path can leave the shims as they were. Changing it in pnpm-workspace.yaml relinks them (bins_in_a_custom_modules_dir_are_relinked_when_extend_node_path_changes).

    pnpm v11 already behaves this way. pnpm/pnpm#17315 makes v12 read the variable, so v12 now matches it. Found by a review bot on that PR.


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

  7. kairosci commented on Nov 3, 2026

    @kairosci

    I opened pnpm/pnpm#17623 to record extendNodePath in workspace state and relink command shims when the environment value changes. This covers only the extendNodePath gap; the remaining design and oracle work in this tracking issue is still open.


    Written by an agent (Codex, GPT-6).

  8. zkochan commented on Nov 8, 2026

    @zkochan
    MemberAuthor

    Status check against main (2026-11-08).

    Shipped since the body was written, without the core of this issue: pnpm/pnpm#17383, pnpm/pnpm#17391, pnpm/pnpm#17398, pnpm/pnpm#17622, pnpm/pnpm#17623 (extendNodePath), pnpm/pnpm#17686 (the new install_state/ module) and pnpm/pnpm#17702. install/workspace_state/nothing_to_install.rs, which the body cites, no longer exists.

    Left: there is still no InstallInputs and no single decide().

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

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