Skip to content

fix(install): validate every workspace importer under --frozen-lockfile - #13028

Closed
sensei-woo wants to merge 1 commit into
pnpm:mainfrom
sensei-woo:fix/frozen-lockfile-workspace-importers
Closed

sensei-woo wants to merge 1 commit into
pnpm:mainfrom
sensei-woo:fix/frozen-lockfile-workspace-importers

Conversation

@sensei-woo

@sensei-woo sensei-woo commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #13025.

Problem

check_lockfile_freshness still carried its pre-workspaces TODO ("once workspaces land this becomes a per-project loop over lockfile.importers") and only ran check_importer_satisfies for the root importer. Consequences:

  • A stale workspace project package.json (dependency added/removed without regenerating the lockfile) passed pnpm install --frozen-lockfile with exit 0, and the drifted dependency was silently ignored — defeating the CI/Docker integrity gate.
  • A workspace project added after the last lockfile write was silently omitted instead of failing frozen installs.
  • The auto-frozen fast path (preferFrozenLockfile) short-circuited to frozen materialization in both situations instead of falling through to a fresh resolve.

Root-manifest drift was already correctly rejected with ERR_PNPM_OUTDATED_LOCKFILE.

Fix

Loop over the already-built project_manifests list (root + every workspace project) and run check_importer_satisfies per importer, deriving each importer id with the existing pacquet_workspace::importer_id_from_root_dir. This mirrors JS pnpm's allProjectsAreUpToDate and the per-project loop optimistic_repeat_install already does. All three check_lockfile_freshness call sites (explicit frozen, auto-frozen dispatch, synthesized-lockfile) get the behavior.

A project absent from lockfile.importers surfaces as the existing NoImporter error — fatal under --frozen-lockfile, fall-through to fresh resolve in the auto-frozen state. The --no-prefer-frozen-lockfile workaround (and its bug-documenting comment) in the lockfile_only test is removed accordingly.

Tests

New integration coverage in workspace_install.rs:

  • frozen_install_rejects_a_stale_workspace_project_manifest — sibling drift fails frozen with the outdated-lockfile error.
  • frozen_install_rejects_a_workspace_project_missing_from_the_lockfile — new project with no importers entry fails frozen, naming the importer.
  • auto_frozen_path_falls_through_on_a_stale_workspace_project_manifest — default install resolves fresh, installs the drifted dep, and updates the lockfile.

cargo test -p pacquet-package-manager (717 passed), -p pacquet-cli --test workspace_install --test lockfile_only (13 passed), cargo fmt --check clean.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes

    • pnpm install --frozen-lockfile now validates every workspace project against the lockfile.
    • Installations fail with an outdated-lockfile error when a workspace manifest changes or a project is missing from the lockfile.
    • Automatic frozen installs now re-resolve dependencies when workspace changes make the lockfile stale.
  • Tests

    • Added coverage for changed workspace manifests, newly added projects, and automatic lockfile updates.

check_lockfile_freshness still carried the pre-workspaces TODO and only
ran the manifest specifier check for the root importer, so a stale
workspace project package.json passed `pnpm install --frozen-lockfile`
with exit 0 while the drifted dependency was silently ignored; the
auto-frozen fast path likewise short-circuited to the frozen
materialization instead of falling through to a fresh resolve.

Loop over the already-built project_manifests list (root plus every
workspace project) and run check_importer_satisfies for each importer,
mirroring pnpm allProjectsAreUpToDate and the per-project loop in
optimistic_repeat_install. A project missing from lockfile.importers
now surfaces as NoImporter — fatal under --frozen-lockfile,
fall-through in the preferFrozenLockfile path — so the
--no-prefer-frozen-lockfile workaround in the lockfile_only test is no
longer needed.

Fixes pnpm#13025
@sensei-woo
sensei-woo requested a review from zkochan as a code owner July 15, 2026 10:40
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Workspace lockfile freshness

Layer / File(s) Summary
Per-importer freshness validation
pnpm/crates/package-manager/src/install.rs
check_lockfile_freshness now validates every workspace manifest against its corresponding lockfile importer.
Frozen and auto-frozen path wiring
pnpm/crates/package-manager/src/install.rs
Synthesized-lockfile, frozen, and auto-frozen paths now provide the workspace root and all project manifests.
Workspace regression coverage and release notes
pnpm/crates/cli/tests/workspace_install.rs, pnpm/crates/cli/tests/lockfile_only.rs, .changeset/frozen-lockfile-workspace-importers.md
Tests cover stale manifests, missing importers, and auto-frozen resolution; related test comments and release notes are updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Install
  participant FreshnessCheck
  participant Lockfile
  User->>Install: run install
  Install->>FreshnessCheck: validate workspace manifests
  FreshnessCheck->>Lockfile: check every importer
  Lockfile-->>FreshnessCheck: fresh or stale
  FreshnessCheck-->>Install: frozen error or fresh-resolve path
  Install-->>User: installation result
Loading

Assessment against linked issues

Objective Addressed Explanation
Detect stale workspace project manifests and reject frozen installs with an outdated-lockfile error [#13025] ✅
Reject newly added workspace projects without lockfile importer entries during frozen installs [#13025] ✅
Fall through to fresh resolution for stale manifests on the auto-frozen path [#13025] ✅

Possibly related PRs

  • pnpm/pnpm#11905: Implements related fresh-resolve workspace importer handling.
  • pnpm/pnpm#12046: Covers related importer freshness and lockfile-only behavior.

Suggested labels: product: pacquet

Suggested reviewers: zkochan

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge. The change is a targeted correctness fix to the freshness gate; single-project installs are unaffected (root-only list), workspace installs get the intended per-importer validation, and all three dispatch paths are updated consistently.

The loop in check_lockfile_freshness replaces a single hard-coded call; the root importer is always first in the list so prior behavior is preserved. importer_id_from_root_dir returns . for the root and a POSIX relative path for siblings. Three regression tests directly exercise each bug scenario. No logic edge cases were found.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(install): validate every workspace i..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
pnpm/crates/cli/tests/workspace_install.rs (1)

398-407: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Extract pacquet_at to a shared test utility.

This exact pacquet_at helper is duplicated across test files (e.g., it is defined identically in pnpm/crates/cli/tests/lockfile_only.rs). As per path instructions, focus on missed reuse or duplication across the monorepo. Consider extracting this helper into a shared testing module (such as the one providing CommandTempCwd) to eliminate the duplication.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/workspace_install.rs` around lines 398 - 407, Extract
the duplicated pacquet_at helper into the shared CLI test utility module
alongside CommandTempCwd, then update workspace_install.rs and lockfile_only.rs
(and any other identical definitions) to import and reuse it. Preserve its
existing command construction and current-directory behavior.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/frozen-lockfile-workspace-importers.md:
- Line 2: Remove the "pnpm": patch entry from the changeset so it only records
the pacquet Rust-only fix; leave the rest of the changeset unchanged.

In `@pnpm/crates/package-manager/src/install.rs`:
- Around line 1803-1820: Update the frozen-lockfile validation around the
per-project loop in install.rs to build the current workspace importer-ID set
and compare it with lockfile.importers keys before calling
check_importer_satisfies. Reject any lockfile importer absent from the current
projects, while preserving the existing per-project validation and error
behavior for mismatches.

---

Nitpick comments:
In `@pnpm/crates/cli/tests/workspace_install.rs`:
- Around line 398-407: Extract the duplicated pacquet_at helper into the shared
CLI test utility module alongside CommandTempCwd, then update
workspace_install.rs and lockfile_only.rs (and any other identical definitions)
to import and reuse it. Preserve its existing command construction and
current-directory behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 60c87c3f-3282-495b-b47d-2cbb54047364

📥 Commits

Reviewing files that changed from the base of the PR and between d5b4b7b and b55cd0c.

📒 Files selected for processing (4)
  • .changeset/frozen-lockfile-workspace-importers.md
  • pnpm/crates/cli/tests/lockfile_only.rs
  • pnpm/crates/cli/tests/workspace_install.rs
  • pnpm/crates/package-manager/src/install.rs

@@ -0,0 +1,6 @@
---
"pnpm": patch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove pnpm from the Rust-only changeset.

Based on learnings, in changesets, pnpm always refers to the TypeScript CLI package. You should not add "pnpm": patch to a changeset for a Rust-only bug fix unless that same bug also affects the TypeScript CLI. The PR summary explicitly states this PR restores parity with pnpm's per-project freshness validation, which implies the TypeScript CLI already has this correct behavior and this is a pacquet-only fix.

🐛 Proposed fix
- "pnpm": patch
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"pnpm": patch
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.changeset/frozen-lockfile-workspace-importers.md at line 2, Remove the
"pnpm": patch entry from the changeset so it only records the pacquet Rust-only
fix; leave the rest of the changeset unchanged.

Source: Learnings

Comment on lines +1803 to +1820
// Every importer must satisfy the lockfile, not just the root: a
// stale workspace project manifest would otherwise pass the frozen
// gate silently (exit 0) with the drifted dependency ignored.
// Mirrors pnpm's `allProjectsAreUpToDate` and the per-project loop
// in [`crate::optimistic_repeat_install`]. A project absent from
// `lockfile.importers` surfaces as `NoImporter` — fatal under
// `--frozen-lockfile`, fall-through to fresh-resolve in state 2.
for (project_dir, project_manifest) in project_manifests {
let importer_id = pacquet_workspace::importer_id_from_root_dir(workspace_root, project_dir);
check_importer_satisfies(
lockfile,
project_manifest,
&importer_id,
config,
parsed_overrides_opt.as_deref(),
)?;
}
Ok(())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find the variants of StalenessReason
ast-grep outline pnpm/crates --match StalenessReason --type enum
rg 'enum StalenessReason' -A 10

Repository: pnpm/pnpm

Length of output: 207


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- install.rs outline ---'
ast-grep outline pnpm/crates/package-manager/src/install.rs --view expanded | sed -n '1,220p'

echo
echo '--- freshness.rs outline ---'
ast-grep outline pnpm/crates/lockfile/src/freshness.rs --view expanded | sed -n '1,220p'

echo
echo '--- relevant install.rs slice ---'
sed -n '1760,1855p' pnpm/crates/package-manager/src/install.rs

echo
echo '--- freshness.rs slice ---'
sed -n '1,260p' pnpm/crates/lockfile/src/freshness.rs

Repository: pnpm/pnpm

Length of output: 22589


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- StalenessReason enum ---'
sed -n '1,240p' pnpm/crates/lockfile/src/freshness.rs | nl -ba | sed -n '1,240p'

echo
echo '--- usages of StalenessReason ---'
rg -n "StalenessReason" pnpm/crates -A 4 -B 4

echo
echo '--- importer/project count comparisons ---'
rg -n "importers\.len\(|project_manifests\.len\(|NoImporter|allProjectsAreUpToDate|freshness" pnpm/crates/package-manager/src pnpm/crates/lockfile/src -A 4 -B 4

Repository: pnpm/pnpm

Length of output: 216


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- symbols around freshness in install.rs ---'
rg -n "fresh|stale|lockfile\.importers|project_manifests|check_importer_satisfies|allProjectsAreUpToDate|NoImporter" pnpm/crates/package-manager/src/install.rs -A 8 -B 8

echo
echo '--- freshness module details ---'
rg -n "enum StalenessReason|struct .*Fresh|fn .*fresh|NoImporter|allProjectsAreUpToDate" pnpm/crates/lockfile/src/freshness.rs -A 40 -B 10

echo
echo '--- lockfile importers len comparisons elsewhere ---'
rg -n "importers\.len\(\).*project|project.*importers\.len\(\)|len\(\).*importers" pnpm/crates -A 4 -B 4

Repository: pnpm/pnpm

Length of output: 50365


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show the exact freshness logic and any explicit handling for extra/missing importers.
sed -n '1,260p' pnpm/crates/lockfile/src/freshness.rs | nl -ba | sed -n '1,260p'

echo
rg -n "importers\.len\(|project_manifests\.len\(|NoImporter|StalenessReason" pnpm/crates -A 3 -B 3

Repository: pnpm/pnpm

Length of output: 187


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- install.rs freshness helpers ---'
sed -n '1880,1985p' pnpm/crates/package-manager/src/install.rs

echo
echo '--- project manifest list builder ---'
sed -n '2470,2525p' pnpm/crates/package-manager/src/install.rs

echo
echo '--- optimistic repeat install gate ---'
sed -n '2390,2470p' pnpm/crates/package-manager/src/install.rs

echo
echo '--- any exact importer-set comparison in package-manager ---'
rg -n "importers.*==|==.*importers|importers\.len\(|project_manifests\.len\(|NoImporter|Stale" pnpm/crates/package-manager/src -A 3 -B 3

Repository: pnpm/pnpm

Length of output: 33800


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- allProjectsAreUpToDate / workspace importer checks in TypeScript ---'
rg -n "allProjectsAreUpToDate|importers.*length|workspace projects|NoImporter|outdated lockfile|frozen-lockfile" . -g '!pnpm/crates/**' -g '!target/**' -g '!node_modules/**' -A 3 -B 3

echo
echo '--- lockfile importer handling in TypeScript install flow ---'
rg -n "lockfile\.importers|importers\[|projectManifests|workspaceProjects|package.json" . -g 'pnpm/**' -g '!pnpm/crates/**' -A 3 -B 3

Repository: pnpm/pnpm

Length of output: 50368


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- allProjectsAreUpToDate references ---'
rg -n "allProjectsAreUpToDate" pnpm11/pnpm -A 30 -B 10

echo
echo '--- workspace project freshness checks ---'
rg -n "project.*lockfile.*importers|lockfile.*project.*importers|importers.*workspace.*project|upToDate" pnpm11/pnpm/packages pnpm11/pnpm/src pnpm11/pnpm/test -A 6 -B 6 | head -n 300

Repository: pnpm/pnpm

Length of output: 189


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- allProjectsAreUpToDate ---'
rg -n --max-count 20 "allProjectsAreUpToDate" pnpm11/pnpm -A 20 -B 10

echo
echo '--- length comparison in workspace install freshness ---'
rg -n --max-count 20 "importers\.length|projects\.length|workspace projects|partial install|fully resolved" pnpm11/pnpm/packages pnpm11/pnpm/src -A 10 -B 10

Repository: pnpm/pnpm

Length of output: 178


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- workspace project removal / subset lockfile freshness ---'
rg -n --max-count 50 "subset of workspace projects|removed from workspace|shared-workspace-lockfile|fully resolved \(non-partial\) lockfile|NoImporter|allProjectsAreUpToDate" pnpm11/pnpm pnpm11/exec -A 8 -B 8

Repository: pnpm/pnpm

Length of output: 29294


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n "allProjectsAreUpToDate" pnpm11/pnpm | head -n 20

Repository: pnpm/pnpm

Length of output: 147


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n "state\.projects\.length|importers\.length|allProjectsAreUpToDate|NoImporter" pnpm11/pnpm -g '*.ts' -g '*.tsx' -g '*.js' -g '*.mjs' -A 6 -B 6

Repository: pnpm/pnpm

Length of output: 147


Reject orphaned workspace importers in frozen installs pnpm/crates/package-manager/src/install.rs:1803-1820 This loop only checks current projects, so a removed workspace project can leave extra lockfile.importers entries and still pass --frozen-lockfile. Compare the current importer-id set against lockfile.importers keys before the per-project checks.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/package-manager/src/install.rs` around lines 1803 - 1820, Update
the frozen-lockfile validation around the per-project loop in install.rs to
build the current workspace importer-ID set and compare it with
lockfile.importers keys before calling check_importer_satisfies. Reject any
lockfile importer absent from the current projects, while preserving the
existing per-project validation and error behavior for mismatches.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.53%. Comparing base (e36df0a) to head (b55cd0c).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13028      +/-   ##
==========================================
- Coverage   85.53%   85.53%   -0.01%     
==========================================
  Files         496      496              
  Lines       79405    79418      +13     
==========================================
+ Hits        67917    67928      +11     
- Misses      11488    11490       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: b55cd0c89db1

Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD.

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.867 ± 0.223 3.651 4.250 1.80 ± 0.15
pacquet@main 3.844 ± 0.182 3.619 4.093 1.79 ± 0.14
pnpr@HEAD 2.144 ± 0.136 1.949 2.326 1.00
pnpr@main 2.167 ± 0.160 2.016 2.519 1.01 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.8666931053199995,
      "stddev": 0.22279035391298846,
      "median": 3.75081142462,
      "user": 3.60510004,
      "system": 3.42009414,
      "min": 3.65118695112,
      "max": 4.2500395181199995,
      "times": [
        4.2500395181199995,
        4.06119520312,
        3.9229036341200003,
        3.73211901712,
        3.69563168012,
        3.68342280312,
        3.71820286512,
        3.65118695112,
        4.18272554912,
        3.7695038321200003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.84360756522,
      "stddev": 0.1824295003653519,
      "median": 3.74611388762,
      "user": 3.6229917400000007,
      "system": 3.4176795399999995,
      "min": 3.6186741751200002,
      "max": 4.09260100512,
      "times": [
        3.6186741751200002,
        3.75566154912,
        4.09260100512,
        3.70501941312,
        3.7365662261200003,
        3.71099202112,
        4.00833435512,
        4.0649631051199995,
        3.7084722941200003,
        4.03479150812
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.1442003894200004,
      "stddev": 0.13553980726737253,
      "median": 2.1598524666200003,
      "user": 2.6568641399999997,
      "system": 3.01159514,
      "min": 1.94904553712,
      "max": 2.32633713912,
      "times": [
        2.32633713912,
        2.00132420512,
        2.2491503121200003,
        2.24703720712,
        2.09936212712,
        2.28370442112,
        2.22034280612,
        2.03068891912,
        1.94904553712,
        2.03501122012
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.16730681802,
      "stddev": 0.16040545132969217,
      "median": 2.11841332312,
      "user": 2.69764034,
      "system": 3.04957604,
      "min": 2.0160590961200002,
      "max": 2.51915670712,
      "times": [
        2.02469585712,
        2.11074392012,
        2.12608272612,
        2.13696429612,
        2.09406479512,
        2.04200293612,
        2.0160590961200002,
        2.27357259512,
        2.51915670712,
        2.32972525112
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 672.0 ± 11.6 655.9 689.2 1.01 ± 0.05
pacquet@main 663.4 ± 31.7 629.6 728.4 1.00
pnpr@HEAD 738.8 ± 44.4 710.4 861.4 1.11 ± 0.09
pnpr@main 745.8 ± 15.5 725.9 767.4 1.12 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.67198044764,
      "stddev": 0.01160940544387097,
      "median": 0.6737676382400001,
      "user": 0.3935942799999999,
      "system": 1.34693456,
      "min": 0.6558673197400001,
      "max": 0.68915358274,
      "times": [
        0.6856006107400001,
        0.6718396387400001,
        0.6796843227400001,
        0.6756956377400001,
        0.68915358274,
        0.65971000974,
        0.6558673197400001,
        0.6648180027400001,
        0.6593203737400001,
        0.6781149777400001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.66344479344,
      "stddev": 0.03165786125199333,
      "median": 0.6516748342400001,
      "user": 0.39160947999999995,
      "system": 1.3290504600000002,
      "min": 0.6296157397400001,
      "max": 0.7283962237400001,
      "times": [
        0.6296157397400001,
        0.6403013887400001,
        0.6441584627400001,
        0.6549069317400001,
        0.68457233374,
        0.64537920674,
        0.6511038307400001,
        0.6522458377400001,
        0.7283962237400001,
        0.7037679787400001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.7387811509400001,
      "stddev": 0.04444563701692832,
      "median": 0.7245160722400001,
      "user": 0.40897868,
      "system": 1.37153206,
      "min": 0.7104405127400001,
      "max": 0.8614224467400001,
      "times": [
        0.7498209577400001,
        0.7129177467400001,
        0.7252554567400001,
        0.7219072997400001,
        0.7231407217400001,
        0.7250173007400001,
        0.7104405127400001,
        0.8614224467400001,
        0.7338742227400001,
        0.7240148437400001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.74583130494,
      "stddev": 0.015451480642614123,
      "median": 0.7497555842400001,
      "user": 0.40845718,
      "system": 1.39995366,
      "min": 0.7258502177400001,
      "max": 0.7674027567400001,
      "times": [
        0.7262204347400001,
        0.7529193927400001,
        0.7484341507400001,
        0.7258502177400001,
        0.7408730047400001,
        0.7510770177400001,
        0.7674027567400001,
        0.72603052574,
        0.7620736757400001,
        0.7574318727400001
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.283 ± 0.026 4.247 4.331 1.90 ± 0.10
pacquet@main 4.308 ± 0.050 4.214 4.398 1.91 ± 0.10
pnpr@HEAD 2.254 ± 0.117 2.086 2.415 1.00
pnpr@main 2.260 ± 0.157 2.013 2.468 1.00 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.28347436046,
      "stddev": 0.025978175388537136,
      "median": 4.27666155106,
      "user": 3.8074609200000005,
      "system": 3.4151877000000006,
      "min": 4.24672662756,
      "max": 4.33147941556,
      "times": [
        4.27074323156,
        4.29606460356,
        4.24672662756,
        4.27920634456,
        4.27411675756,
        4.31345841656,
        4.29735629656,
        4.33147941556,
        4.25802164956,
        4.2675702615599995
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.3081742709599995,
      "stddev": 0.049926618723161655,
      "median": 4.30574827456,
      "user": 3.8035578200000004,
      "system": 3.4273556999999997,
      "min": 4.21367936256,
      "max": 4.39813555256,
      "times": [
        4.31542079256,
        4.27095106456,
        4.29694403456,
        4.29946421256,
        4.31203233656,
        4.21367936256,
        4.28413826356,
        4.35952952956,
        4.33144756056,
        4.39813555256
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.25366300506,
      "stddev": 0.1174969821140158,
      "median": 2.25743727906,
      "user": 2.53548642,
      "system": 2.9263006000000003,
      "min": 2.08600780656,
      "max": 2.41500948956,
      "times": [
        2.16593088056,
        2.27590878956,
        2.26817018556,
        2.12445938256,
        2.41499602056,
        2.41500948956,
        2.08600780656,
        2.17375135856,
        2.3656917645599997,
        2.24670437256
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.2603513576600003,
      "stddev": 0.1573009117262275,
      "median": 2.27616314356,
      "user": 2.54982112,
      "system": 2.9712145,
      "min": 2.01325049156,
      "max": 2.46766650656,
      "times": [
        2.41817065556,
        2.31775502556,
        2.20184618656,
        2.40081764356,
        2.2345712615599997,
        2.01325049156,
        2.01687780856,
        2.20593091756,
        2.3266270795599997,
        2.46766650656
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.410 ± 0.021 1.382 1.451 2.10 ± 0.04
pacquet@main 1.413 ± 0.022 1.386 1.453 2.10 ± 0.04
pnpr@HEAD 0.683 ± 0.018 0.664 0.730 1.02 ± 0.03
pnpr@main 0.672 ± 0.007 0.662 0.684 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.4099911345999998,
      "stddev": 0.021180304395543536,
      "median": 1.4075886037,
      "user": 1.3683560799999999,
      "system": 1.7310557800000002,
      "min": 1.3819520861999999,
      "max": 1.4508145972,
      "times": [
        1.4179376402,
        1.4336113332,
        1.4508145972,
        1.4054040882,
        1.4097731192,
        1.3819520861999999,
        1.4162810842,
        1.3844892852,
        1.4046151052,
        1.3950330072
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.4128960193,
      "stddev": 0.021933845997771092,
      "median": 1.4067772587,
      "user": 1.3654565799999998,
      "system": 1.7241664799999998,
      "min": 1.3860630482,
      "max": 1.4525358972,
      "times": [
        1.4525358972,
        1.4050994401999999,
        1.4014842271999999,
        1.4501539622,
        1.3860630482,
        1.4084550772,
        1.4169342012,
        1.4114480922,
        1.3989179362,
        1.3978683111999999
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6827487563,
      "stddev": 0.018310396530804275,
      "median": 0.6814082867000001,
      "user": 0.35005337999999997,
      "system": 1.28278748,
      "min": 0.6640423712000001,
      "max": 0.7298275462000001,
      "times": [
        0.6872908492,
        0.6722064482000001,
        0.6827901962,
        0.7298275462000001,
        0.6818070022000001,
        0.6690688462000001,
        0.6723077852000001,
        0.6640423712000001,
        0.6810095712,
        0.6871369472000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.6722037200000001,
      "stddev": 0.0067627538682494635,
      "median": 0.6712253057000002,
      "user": 0.34823787999999994,
      "system": 1.28712248,
      "min": 0.6615827012000001,
      "max": 0.6837597692,
      "times": [
        0.6725332862000001,
        0.6696097042000001,
        0.6709297262000001,
        0.6831955722,
        0.6665313432000001,
        0.6719854512000001,
        0.6837597692,
        0.6715208852000001,
        0.6703887612000001,
        0.6615827012000001
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.132 ± 0.060 3.064 3.280 4.62 ± 0.10
pacquet@main 3.117 ± 0.062 3.035 3.256 4.60 ± 0.10
pnpr@HEAD 0.678 ± 0.005 0.671 0.688 1.00
pnpr@main 0.681 ± 0.007 0.668 0.691 1.00 ± 0.01
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.13229358344,
      "stddev": 0.06027889088743227,
      "median": 3.12939492944,
      "user": 1.84866924,
      "system": 2.0175607199999996,
      "min": 3.06376083194,
      "max": 3.27987682794,
      "times": [
        3.27987682794,
        3.06376083194,
        3.10355476694,
        3.14862131394,
        3.08240184294,
        3.08747876094,
        3.15374964994,
        3.12814070794,
        3.13064915094,
        3.14470198094
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.11744603484,
      "stddev": 0.06207107276350513,
      "median": 3.10347834644,
      "user": 1.8145577400000001,
      "system": 1.9902744199999998,
      "min": 3.03500988994,
      "max": 3.2563681289399997,
      "times": [
        3.14549937294,
        3.16706806594,
        3.12573500794,
        3.06380881094,
        3.03500988994,
        3.08704982694,
        3.09505044794,
        3.11190624494,
        3.2563681289399997,
        3.08696455194
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6776771883399999,
      "stddev": 0.005331067228384714,
      "median": 0.67723541594,
      "user": 0.35572564,
      "system": 1.2897429200000001,
      "min": 0.67086509094,
      "max": 0.68754217094,
      "times": [
        0.68222186094,
        0.67838596194,
        0.68754217094,
        0.6760848699399999,
        0.68056969894,
        0.67137780594,
        0.68110179094,
        0.67258894394,
        0.67603368894,
        0.67086509094
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.6809179298400002,
      "stddev": 0.006530024738246969,
      "median": 0.6818764609400001,
      "user": 0.34806854,
      "system": 1.29652572,
      "min": 0.66794376394,
      "max": 0.69092839094,
      "times": [
        0.68154715194,
        0.67569534594,
        0.67677198394,
        0.69092839094,
        0.6879746329399999,
        0.66794376394,
        0.68220576994,
        0.6789199849399999,
        0.68413445094,
        0.68305782294
      ]
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 660.6 ± 7.5 646.9 671.7 6.11 ± 0.10
pacquet@main 663.1 ± 5.4 657.4 676.8 6.13 ± 0.09
pnpr@HEAD 108.5 ± 1.3 107.0 111.8 1.00 ± 0.02
pnpr@main 108.2 ± 1.4 106.5 112.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6605931182200001,
      "stddev": 0.007516390966497185,
      "median": 0.65928016502,
      "user": 0.6300747,
      "system": 0.14985808,
      "min": 0.64694320402,
      "max": 0.6716810360200001,
      "times": [
        0.65698855002,
        0.64694320402,
        0.65844352602,
        0.6709055030200001,
        0.65475825002,
        0.6648491870200001,
        0.6640030760200001,
        0.6716810360200001,
        0.6601168040200001,
        0.65724204602
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.66310413702,
      "stddev": 0.005434833450721759,
      "median": 0.6618128535200001,
      "user": 0.6314841999999999,
      "system": 0.15229968,
      "min": 0.65741152102,
      "max": 0.67679758802,
      "times": [
        0.66394421902,
        0.66176641302,
        0.66052831802,
        0.65741152102,
        0.66176545202,
        0.66185929402,
        0.67679758802,
        0.66580511602,
        0.65799058202,
        0.66317286702
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10854755306,
      "stddev": 0.0013206093714494232,
      "median": 0.10813429202000001,
      "user": 0.029664479999999997,
      "system": 0.01943798,
      "min": 0.10701324002,
      "max": 0.11176623302000001,
      "times": [
        0.10714855902,
        0.10806258402,
        0.10765488402000001,
        0.10833527602,
        0.10803872902,
        0.10785308302,
        0.10707936002,
        0.10879757502000001,
        0.10736816202,
        0.11044745502,
        0.10701324002,
        0.10853926702,
        0.10923123802,
        0.11117588402,
        0.10811855202000001,
        0.10840346302000001,
        0.10875178002000001,
        0.11150425002,
        0.10829074402,
        0.11176623302000001,
        0.10788067802000001,
        0.10813429202000001,
        0.10767212002,
        0.10844423002,
        0.10797718802
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.10815952042000002,
      "stddev": 0.001379205006328495,
      "median": 0.10795250202000001,
      "user": 0.02842292,
      "system": 0.019930299999999998,
      "min": 0.10652693302,
      "max": 0.11242412202,
      "times": [
        0.10809966002,
        0.10753250602,
        0.10803033802,
        0.10673703802000001,
        0.10825670002,
        0.10822708202,
        0.10742975802,
        0.10865721702,
        0.10786931002,
        0.10723846102000001,
        0.10710256102,
        0.10795250202000001,
        0.10830048802,
        0.10699741102,
        0.10839512802000001,
        0.10719448902,
        0.10884055902,
        0.11242412202,
        0.10652693302,
        0.10846375602,
        0.10975684902,
        0.11161015502,
        0.10683150202,
        0.10784917002,
        0.10766431502
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 6.679 ± 0.158 6.491 6.941 1.34 ± 0.04
pacquet@main 6.636 ± 0.141 6.443 6.977 1.34 ± 0.04
pnpr@HEAD 4.970 ± 0.087 4.861 5.117 1.00
pnpr@main 5.024 ± 0.073 4.926 5.168 1.01 ± 0.02
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 6.679278493139999,
      "stddev": 0.15800729277388903,
      "median": 6.64091923574,
      "user": 3.8229721999999997,
      "system": 3.70542358,
      "min": 6.49097904174,
      "max": 6.94095900974,
      "times": [
        6.79464596874,
        6.568902229740001,
        6.62664841774,
        6.91682247674,
        6.512143386740001,
        6.59343345374,
        6.69306089274,
        6.94095900974,
        6.49097904174,
        6.65519005374
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 6.636146458840001,
      "stddev": 0.14082753448839633,
      "median": 6.606888893740001,
      "user": 3.8453504999999994,
      "system": 3.72883808,
      "min": 6.44343201574,
      "max": 6.977331413740001,
      "times": [
        6.567227878740001,
        6.5856804787400005,
        6.68346645074,
        6.53516689274,
        6.44343201574,
        6.977331413740001,
        6.603087680740001,
        6.68086107774,
        6.610690106740001,
        6.67452059274
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 4.970423104940001,
      "stddev": 0.08677921849241083,
      "median": 4.94954406374,
      "user": 2.8206416000000005,
      "system": 3.23750218,
      "min": 4.86133116674,
      "max": 5.11729239774,
      "times": [
        5.11729239774,
        4.9428535487400005,
        4.95623457874,
        4.86133116674,
        4.983406046740001,
        5.09639261674,
        5.0202755767400005,
        4.86220228174,
        4.941468377740001,
        4.92277445774
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 5.023553614240001,
      "stddev": 0.07291875472057589,
      "median": 5.02051539074,
      "user": 2.8234076000000004,
      "system": 3.2949230799999993,
      "min": 4.926424426740001,
      "max": 5.16811131674,
      "times": [
        4.926424426740001,
        5.005318899740001,
        5.04824984774,
        5.00222804974,
        5.03571188174,
        4.93090335074,
        5.04911846474,
        4.977767394740001,
        5.09170250974,
        5.16811131674
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13028
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
4,283.47 ms
(+0.27%)Baseline: 4,272.06 ms
5,126.47 ms
(83.56%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
3,132.29 ms
(+3.86%)Baseline: 3,015.84 ms
3,619.01 ms
(86.55%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
1,409.99 ms
(+4.79%)Baseline: 1,345.58 ms
1,614.70 ms
(87.32%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
660.59 ms
(+4.69%)Baseline: 630.97 ms
757.17 ms
(87.25%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
3,866.69 ms
(+0.51%)Baseline: 3,847.23 ms
4,616.68 ms
(83.75%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
6,679.28 ms
(-4.72%)Baseline: 7,009.93 ms
8,411.92 ms
(79.40%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
671.98 ms
(+4.30%)Baseline: 644.27 ms
773.13 ms
(86.92%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13028
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,253.66 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
677.68 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
682.75 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
108.55 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,144.20 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
4,970.42 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
738.78 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan

zkochan commented Jul 16, 2026

Copy link
Copy Markdown
Member

Thanks for this, and sorry it sat long enough to be overtaken.

This is fixed on main by #13081 (merged as d8dfa85), which landed the same fix in the same place: check_lockfile_freshness now takes the project_manifests list and loops over every importer, deriving each id with pacquet_workspace::importer_id_from_root_dir, across all three call sites (explicit --frozen-lockfile, the auto-frozen preferFrozenLockfile dispatch, and the synthesized-lockfile path). Your diagnosis in #13025 was right and matches what shipped.

Your test scenarios are covered too — changed_workspace_importer_invalidates_lockfile covers the stale sibling manifest under both frozen and auto-frozen, and missing_workspace_importer_is_not_accepted_by_frozen_install covers a project absent from importers. #13081 also ported the rest of the TypeScript freshness matrix (aliases, dependenciesMeta, publishDirectory, dist-tags, broken semver resolutions) and persists dependenciesMeta / publishDirectory into fresh importer snapshots.

So I'm closing this as superseded rather than for any problem with it. One loose end you spotted that #13081 did not: the stale --no-prefer-frozen-lockfile workaround and its now-incorrect comment in lockfile_only.rs. I'm fixing the comment in a follow-up — worth noting the flag itself has to stay, for a reason that only became true with #13081: a dependency-free missing importer is now deliberately tolerated on the auto-frozen path (allow_missing_dependency_free_importers, matching TypeScript's allProjectsAreUpToDate), and project-2 in that test has no dependencies. Dropping the flag makes the run short-circuit to frozen and never record the new importer.

Sorry for the duplicated effort here, and thank you for the report and the fix.


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--frozen-lockfile does not detect a stale workspace project manifest (12.0.0-alpha)

3 participants