Skip to content

test(pacquet): port the Stage 2 workspace subset and multi-importer suites - #13152

Merged
zkochan merged 4 commits into
mainfrom
stage-2
Jul 19, 2026
Merged

zkochan merged 4 commits into
mainfrom
stage-2

Conversation

@zkochan

@zkochan zkochan commented Jul 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Stage 2 of the TEST_PORTING plan — workspace subset installs (--filter) and multi-importer coverage. Related to #13146.

New ports (all "tested the test" by temporarily breaking the implementation path they pin):

  • New crates/cli/tests/multiple_importers.rs suite covering the open Support Workspaces items: subset preservation of other importers' materialization (multipleImporters.ts:438, :865), stale current-lockfile importers (:208), filtered current-lockfile contents (:730), headless-vs-resolve decisions with link: / workspace: / unlinked workspace packages (:540, :598, :656), subdependency-from-workspace with linkWorkspacePackages: deep and via a workspace:* override (:1427, :1563), the deps-restorer workspace cases (index.ts:789, :897), workspace bin links (monorepo/index.ts:1317), and the shared-lockfile custom virtualStoreDir round-trip (monorepo/index.ts:1514).
  • Promoted the three stale --filter known_failures stubs to real tests — filtered installs landed in fix(pacquet): honor workspace install filters #13030, so workspace_hoist_packages_in_selected_projects_tree + workspace_hoist_only_in_selected_projects_with_subdeps (hoist.ts:587 / :682) and skip_unsupported_optional_when_installing_a_workspace_subset (optionalDependencies.ts:470) now run for real.
  • Ported the hoisted-linker workspace-subset item (multipleImporters.ts:87) and the hoisted workspace lifecycle-scripts case (lifecycleScripts.ts:579, driven through the frozen path while fresh-path scripts remain blocked on pacquet: run lifecycle scripts (preinstall / install / postinstall) on the fresh-lockfile install path #11870).

Parity fix (changeset included): pacquet only announced Lockfile is up to date, resolution step is skipped on the no-op short-circuit. The TypeScript CLI emits it whenever the headless installer is entered — including cold materialization and --filter subset installs — and emits Importing packages to virtual store under ignorePackageManifest (pnpm fetch). The frozen materialization branch now emits the same logs (crates/package-manager/src/install.rs); the multipleImporters.ts:540/:598/:656 ports pin it.

New known_failures stubs at not-yet-implemented boundaries: install-time publishConfig.directory linking (:1768), buildIndex-ordered project lifecycle scripts + inter-group bin relinking (:1902, monorepo:734), and sharedWorkspaceLockfile: false (monorepo:1281, :1467).

Divergences surfaced by the port — each is pinned by a known_failures stub naming the divergence, and needs a cross-stack decision rather than a unilateral "fix":

  1. Subset closure over importer-level links. pnpm --filter project-1 install where project-1 has a link:/workspace-linked sibling: pacquet deep-installs the link target's own dependencies (deliberately pinned by install_filters.rs since fix(pacquet): honor workspace install filters #13030); the TypeScript CLI keeps importer-level link targets shallow — only --filter project-1... widens the selection. Snapshot-level links (subdependency-from-workspace) deep-install in both stacks.
  2. Hoisted-linker workspace duplication. In a hoisted-linker workspace, pacquet materializes every project's direct dep under the project's own node_modules even when the same version won the workspace-root slot; upstream nests a copy only for versions that lost the root slot.
  3. Registry-manifest link: deps (minor, noted in the plan): pacquet's resolver records them relative to the dependent importer; upstream's fixture lockfile records them relative to the lockfile dir. The headless materialization handles the upstream shape, which the port pins.

Also extracted the FilteredWorkspace fixture from install_filters.rs into the shared tests/_utils/mod.rs (renamed WorkspaceFixture) so the new suite reuses it instead of copy-pasting ~350 lines.

Post-review updates: rebased over main (resolving the TEST_PORTING.md overlap with #13149), scoped the fetch-specific log wording to non-full installs so install --ignore-manifest-check keeps the up-to-date message, replaced the raw-string lockfile edits with a structured repin_snapshot_dependency helper, and moved tests/_utils.rs to tests/_utils/mod.rs so it is no longer an auto-discovered test target.

Squash Commit Body

Stage 2 of pnpm/plans/TEST_PORTING.md (pnpm/pnpm#13146): port the workspace
subset install (--filter) and multi-importer suites.

Add crates/cli/tests/multiple_importers.rs covering the open "Support
Workspaces" items (subset preservation, stale current-lockfile importers,
filtered current-lockfile contents, headless-vs-resolve decisions,
subdependency-from-workspace, workspace bin links, custom virtualStoreDir),
promote the three --filter known_failures stubs in hoist.rs and
optional_dependencies.rs to real tests now that filtered installs exist
(pnpm/pnpm#13030), and port the hoisted-linker workspace-subset and
workspace lifecycle-script cases.

Fix a reporter parity gap the ports exposed: the TypeScript CLI announces
"Lockfile is up to date, resolution step is skipped" whenever the headless
installer is entered (cold materialization and subset installs included) and
"Importing packages to virtual store" under ignorePackageManifest; pacquet
only announced the no-op short-circuit. The frozen materialization branch
now emits the same logs.

Record two behavioral divergences the ports surfaced as known_failures
stubs pending a cross-stack decision: pacquet's subset closure deep-installs
importer-level link targets where upstream keeps them shallow, and pacquet's
hoisted workspace layout duplicates the root-winning version under consumer
projects. Not-yet-implemented boundaries (publishConfig.directory linking,
buildIndex-ordered project scripts, sharedWorkspaceLockfile: false) are
stubbed too.

The FilteredWorkspace fixture moves from install_filters.rs into the shared
tests/_utils/mod.rs as WorkspaceFixture so the new suite reuses it.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting. (Test
    porting is pacquet-only by design; the reporter fix aligns pacquet to the
    TypeScript CLI's existing behavior, so no TypeScript change is needed.)
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

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

Copilot AI review requested due to automatic review settings July 19, 2026 17:39

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds shared Rust workspace test utilities, ports filtered multi-importer, hoisting, linker, and optional-dependency scenarios, updates known-failure tracking, and emits pnpm-compatible frozen-install messages with corresponding release and porting documentation.

Changes

Workspace install coverage

Layer / File(s) Summary
Workspace fixture and shared test utilities
pnpm/crates/cli/tests/_utils/mod.rs, pnpm/crates/cli/tests/install_filters.rs
Adds reusable workspace, manifest, lockfile, artifact, logging, and assertion helpers, then migrates filtered-install tests to WorkspaceFixture.
Filtered multi-importer and headless install scenarios
pnpm/crates/cli/tests/multiple_importers.rs
Covers subset installation, retained materialization, workspace links, current lockfiles, dependency materialization, binary relinking, virtual store paths, and known failures.
Hoisting, linker, and optional dependency coverage
pnpm/crates/cli/tests/hoist.rs, pnpm/crates/cli/tests/hoisted_node_linker.rs, pnpm/crates/cli/tests/optional_dependencies.rs
Adds filtered hoisting, hoisted-linker lifecycle, and skipped optional-dependency tests while removing resolved known-failure gates.
Installer output and porting status
pnpm/crates/package-manager/src/install.rs, .changeset/hungry-donkeys-repeat.md, pnpm/plans/TEST_PORTING.md
Adds frozen-install informational messages and updates release notes and porting mappings.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

Possibly related PRs

  • pnpm/pnpm#13030 — Changes the filtered-install pipeline and related frozen-install behavior.
  • pnpm/pnpm#13145 — Updates related test-porting documentation.
  • pnpm/pnpm#13150 — Modifies the same frozen-lockfile installation path.

Suggested labels: product: pacquet

Suggested reviewers: copilot

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stage-2

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Port Stage 2 workspace subset and multi-importer test suites

🧪 Tests 🐞 Bug fix 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Add Stage 2 workspace --filter and multi-importer CLI test coverage.
• Promote prior known_failures stubs for subset installs to real tests.
• Align headless/frozen installer logs with upstream pnpm CLI behavior.
Diagram

graph TD
  T["CLI test suites"] --> U["WorkspaceFixture utils"] --> C["pnpm CLI (ndjson)"] --> D["Installer dispatch"] --> F["Frozen/headless branch"] --> R["Reporter logs"]
  U --> S["Read/write lockfile & state"]
  C --> S
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Match upstream shallow subset closure for workspace links
  • ➕ Closer behavioral parity with pnpm’s current --filter semantics
  • ➕ Avoids surprising installs of unselected link-target dependencies
  • ➕ Lets ports pin upstream tails without known_failures
  • ➖ May reduce ergonomics for users who expect linked targets to be fully usable
  • ➖ Could require additional flags/selection syntax to opt into deep closure
2. Keep deep closure, introduce an explicit shallow mode
  • ➕ Preserves current pacquet behavior for existing users
  • ➕ Provides a compatibility mode for upstream test parity
  • ➕ Makes the tradeoff explicit and configurable
  • ➖ Adds surface area/complexity to selection semantics
  • ➖ Requires careful docs and additional test matrix coverage
3. Align by expanding upstream-equivalent selection (`--filter ...`) only
  • ➕ Single conceptual model: selection expansion drives closure
  • ➕ Avoids special-casing link dependencies in the installer
  • ➖ May not map cleanly onto current pacquet selection implementation
  • ➖ Potentially more complex UX for common subset workflows

Recommendation: Keep this PR’s approach (pinning current behavior via ports plus explicit known_failures for divergences), but prioritize a cross-stack decision on subset materialization closure for importer-level link: / workspace: dependencies. The new suite makes the divergence concrete; resolving it will unlock removing the known_failures::subset_install_does_not_install_unselected_link_targets_dependencies stub and reduce long-term behavioral drift.

Files changed (9) +1319 / -448

Bug fix (1) +20 / -0
install.rsEmit upstream-parity headless installer logs on frozen/materialization path +20/-0

Emit upstream-parity headless installer logs on frozen/materialization path

• Changes the frozen/headless entry to announce itself whenever entered with a non-empty lockfile (including cold materialization and subset installs), matching the TypeScript CLI. Uses the 'ignorePackageManifest' wording for fetch-like paths, and stays silent for explicit rebuilds and empty-lockfile early returns.

pnpm/crates/package-manager/src/install.rs

Tests (6) +1256 / -412
_utils.rsIntroduce shared WorkspaceFixture and manifest/lockfile helpers +389/-1

Introduce shared WorkspaceFixture and manifest/lockfile helpers

• Adds a reusable workspace test harness that scaffolds 'packages/*' workspaces against the mocked registry, runs the 'pnpm' binary with NDJSON capture, and provides helpers to read/write lockfiles, '.modules.yaml', workspace state, and package maps. Consolidates common manifest mutation and lockfile inspection utilities used across subset and multi-importer tests.

pnpm/crates/cli/tests/_utils.rs

hoist.rsPromote '--filter' hoist subset stubs to real tests +92/-26

Promote '--filter' hoist subset stubs to real tests

• Ports and enables two upstream hoist tests that verify subset installs hoist from the selected project’s dependency tree (including transitive selection). Removes the prior 'known_failures' gating that existed before selected-project installs were supported.

pnpm/crates/cli/tests/hoist.rs

hoisted_node_linker.rsAdd hoisted node-linker subset and lifecycle script coverage +109/-0

Add hoisted node-linker subset and lifecycle script coverage

• Adds a '--filter' subset install test for 'nodeLinker=hoisted' and a frozen-path workspace lifecycle scripts test ensuring scripts run for each materialized copy. Introduces a new 'known_failures' stub documenting a divergence in hoisted workspace layout (duplicate nested materialization).

pnpm/crates/cli/tests/hoisted_node_linker.rs

install_filters.rsRefactor filter install tests to use shared test utilities +38/-369

Refactor filter install tests to use shared test utilities

• Replaces the file-local workspace harness with the shared '_utils' module and 'WorkspaceFixture'. Simplifies imports and removes duplicated helper functions while keeping the existing filter-focused assertions intact.

pnpm/crates/cli/tests/install_filters.rs

multiple_importers.rsAdd new multi-importer and workspace-subset ('--filter') test suite +599/-0

Add new multi-importer and workspace-subset ('--filter') test suite

• Introduces a large port of upstream multi-importer/workspace subset scenarios, covering subset preservation of other importers’ materialization, stale current-lockfile importers, filtered current-lockfile contents, headless-vs-resolve decisions for workspace/link protocols, workspace subdependency linking, deps-restorer workspace cases, workspace bin linking, and custom 'virtualStoreDir' round-trips. Adds targeted 'known_failures' stubs for not-yet-implemented boundaries (e.g., 'publishConfig.directory' linking, buildIndex-ordered scripts + bin relinking, and 'sharedWorkspaceLockfile: false') and explicitly pins a subset-closure semantic divergence.

pnpm/crates/cli/tests/multiple_importers.rs

optional_dependencies.rsPromote subset optional-dependency skip case to real test +29/-16

Promote subset optional-dependency skip case to real test

• Converts the prior 'known_failures' stub into a real '--filter' subset install test that asserts unsupported optional subtrees are recorded as skipped in '.modules.yaml' during subset installs.

pnpm/crates/cli/tests/optional_dependencies.rs

Documentation (2) +43 / -36
hungry-donkeys-repeat.mdAdd changeset for headless-installer log parity +5/-0

Add changeset for headless-installer log parity

• Documents the user-visible logging change: headless installer announcements now match the TypeScript CLI on cold and filtered installs, and 'pnpm fetch' uses the virtual-store import message on that path.

.changeset/hungry-donkeys-repeat.md

TEST_PORTING.mdUpdate Stage 2 porting plan with new ports and remaining gaps +38/-36

Update Stage 2 porting plan with new ports and remaining gaps

• Marks newly ported workspace subset and multi-importer cases as complete, documents new stubs for unsupported boundaries, and updates narrative notes to reflect that selected-project subset installs are now covered end-to-end. Adds explicit notes about the remaining semantic divergence around subset closure for workspace links.

pnpm/plans/TEST_PORTING.md

@qodo-code-review

qodo-code-review Bot commented Jul 19, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. allow_known_failure! skips new tests ✗ Dismissed 📘 Rule violation ☼ Reliability
Description
New tests were added under known_failures that exit early via allow_known_failure!, effectively
dismissing failing coverage rather than asserting and fixing the underlying behavior. This weakens
CI’s ability to catch regressions and can let unimplemented/incorrect behavior persist without a
strong signal.
Code

pnpm/crates/cli/tests/multiple_importers.rs[R499-599]

+mod known_failures {
+    //! Multi-importer cases blocked on features pacquet hasn't built
+    //! yet. Each entry stubs the not-yet-built subject under test
+    //! through [`pacquet_testing_utils::allow_known_failure`] so the
+    //! test exits early rather than masking a real bug.
+
+    use pacquet_testing_utils::{
+        allow_known_failure,
+        known_failure::{KnownFailure, KnownResult},
+    };
+
+    fn publish_config_directory_linking() -> KnownResult<()> {
+        Err(KnownFailure::new(
+            "Pacquet reads `publishConfig.directory` for the lockfile's \
+             `publishDirectory` field, freshness drift, and `pnpm pack`, \
+             but the install path never links a workspace package from \
+             that directory (`publishConfig.linkDirectory`).",
+        ))
+    }
+
+    fn build_index_ordered_project_scripts() -> KnownResult<()> {
+        Err(KnownFailure::new(
+            "Pacquet runs workspace projects' own lifecycle scripts \
+             root-first, not in `buildIndex` (workspace-topological) \
+             order, and does not re-link project bins between build \
+             groups — see the follow-up note on \
+             `run_projects_lifecycle_scripts` in \
+             `crates/package-manager/src/install.rs`.",
+        ))
+    }
+
+    fn per_project_workspace_lockfiles() -> KnownResult<()> {
+        Err(KnownFailure::new(
+            "`sharedWorkspaceLockfile: false` is not supported by \
+             pacquet's install family \
+             (`ERR_PNPM_RECURSIVE_SHARED_LOCKFILE_UNSUPPORTED`).",
+        ))
+    }
+
+    fn importer_level_link_closure_divergence() -> KnownResult<()> {
+        Err(KnownFailure::new(
+            "Pacquet's subset-install materialization closure follows \
+             importer-level `link:` / workspace-linked dependencies of \
+             the selected projects and installs the link targets' own \
+             dependencies (`materialization_closure` in \
+             `crates/package-manager/src/current_lockfile.rs`). The \
+             TypeScript CLI keeps those targets shallow — only \
+             `--filter <project>...` widens the selection — so the two \
+             stacks need a shared decision before this can be pinned.",
+        ))
+    }
+
+    /// TS: `symlink local package from the location described in its
+    /// publishConfig.directory when linkDirectory is true`
+    /// (`multipleImporters.ts:1768`).
+    #[test]
+    fn symlink_local_package_from_publish_config_directory() {
+        allow_known_failure!(publish_config_directory_linking());
+    }
+
+    /// TS: `link the bin file of a workspace project that is created by
+    /// a lifecycle script` (`multipleImporters.ts:1902`). Needs
+    /// `buildIndex` ordering plus bin re-linking between groups so a
+    /// dependent project's `prepare` can call the freshly-created bin.
+    #[test]
+    fn link_bin_of_workspace_project_created_by_lifecycle_script() {
+        allow_known_failure!(build_index_ordered_project_scripts());
+    }
+
+    /// TS: `recursive install with shared-workspace-lockfile builds
+    /// workspace projects in correct order`
+    /// (`pnpm/test/monorepo/index.ts:734`).
+    #[test]
+    fn recursive_install_builds_workspace_projects_in_correct_order() {
+        allow_known_failure!(build_index_ordered_project_scripts());
+    }
+
+    /// TS: `dependencies of workspace projects are built during
+    /// headless installation` (`pnpm/test/monorepo/index.ts:1281`) —
+    /// the upstream fixture turns off `sharedWorkspaceLockfile`.
+    #[test]
+    fn workspace_project_dependencies_built_during_headless_install_with_dedicated_lockfiles() {
+        allow_known_failure!(per_project_workspace_lockfiles());
+    }
+
+    /// TS: `custom virtual store directory in a workspace with not
+    /// shared lockfile` (`pnpm/test/monorepo/index.ts:1467`).
+    #[test]
+    fn custom_virtual_store_directory_with_dedicated_lockfiles() {
+        allow_known_failure!(per_project_workspace_lockfiles());
+    }
+
+    /// The tail of TS `headless install is used when package linked to
+    /// another package in the workspace` (`multipleImporters.ts:540`):
+    /// the unselected `link:` target's own dependencies must not be
+    /// installed by the subset install.
+    #[test]
+    fn subset_install_does_not_install_unselected_link_targets_dependencies() {
+        allow_known_failure!(importer_level_link_closure_divergence());
+    }
+}
Evidence
PR Compliance ID 2 forbids dismissing or skipping failing tests and requires that failing scenarios
be fixed rather than treated as acceptable. In the added known_failures modules, multiple
#[test] functions immediately call allow_known_failure!, including
hoisted_workspace_layout_does_not_duplicate_root_version, which explicitly allows an early exit
instead of enforcing the expected behavior, demonstrating the test suite is being made tolerant of
missing/incorrect functionality.

CLAUDE.md: Do not ignore or dismiss failing tests
pnpm/crates/cli/tests/multiple_importers.rs[499-599]
pnpm/crates/cli/tests/hoisted_node_linker.rs[586-605]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The test suite adds/extends `known_failures` stubs that call `allow_known_failure!`, causing tests to exit early rather than asserting the expected behavior and failing when it is missing or incorrect.

## Issue Context
PR Compliance (ID 2) requires that failing tests are not dismissed or skipped as acceptable; instead, behavior should be implemented/fixed and tests should enforce it. The current `known_failures` tests encode missing functionality as “allowed failures,” reducing CI’s ability to catch regressions and delaying parity work.

## Fix Focus Areas
- pnpm/crates/cli/tests/multiple_importers.rs[499-599]
- pnpm/crates/cli/tests/hoisted_node_linker.rs[586-605]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Test utils compiled repeatedly 🐞 Bug ➹ Performance ⭐ New
Description
Because each pnpm/crates/cli/tests/*.rs file is a separate integration-test crate, `pub mod
_utils; causes the (now 500+ line) tests/_utils/mod.rs` module to be compiled into each test crate
that includes it. This duplicates codegen work and increases clean-build cargo test cost as more
helpers are centralized into _utils.
Code

pnpm/crates/cli/tests/_utils/mod.rs[R1-20]

+use assert_cmd::prelude::*;
+use command_extra::CommandExtra;
+use pacquet_lockfile::{Lockfile, PkgName, ProjectSnapshot, SnapshotEntry};
+use pacquet_modules_yaml::{Host as ModulesHost, Modules, read_modules_manifest};
+use pacquet_store_dir::{CafsFileInfo, StoreDir, StoreIndex};
+use pacquet_testing_utils::{
+    bin::{AddMockedRegistry, CommandTempCwd},
+    fs::is_symlink_or_junction,
+};
+use pacquet_workspace_state::WorkspaceState;
+use serde_json::{Map, Value, json};
+use std::{
+    collections::{BTreeMap, BTreeSet},
+    ffi::OsStr,
+    fmt::Write as _,
+    fs,
+    path::{Path, PathBuf},
+    process::{Command, Output},
+};
+use tempfile::TempDir;
Evidence
The new _utils/mod.rs is a large module, and multiple integration tests include it via `pub mod
_utils;`, which in Rust means each test crate compiles that module into its own crate.

pnpm/crates/cli/tests/_utils/mod.rs[1-20]
pnpm/crates/cli/tests/_utils/mod.rs[134-253]
pnpm/crates/cli/tests/install.rs[1-2]
pnpm/crates/cli/tests/optional_dependencies.rs[5-6]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`pnpm/crates/cli/tests/_utils/mod.rs` has grown into a large helper module and is included via `pub mod _utils;` in many integration tests. In Rust, each integration test file is compiled as its own crate, so this module is compiled repeatedly, duplicating work.

### Issue Context
The PR expands `_utils` substantially (WorkspaceFixture, lockfile helpers, ndjson parsing, store index reads, etc.), and multiple integration tests include it.

### Fix Focus Areas
- pnpm/crates/cli/tests/_utils/mod.rs[1-253]
- pnpm/crates/cli/tests/install.rs[1-2]
- pnpm/crates/cli/tests/optional_dependencies.rs[5-6]

### Suggested approach
- Move the heavier shared helpers (e.g., `WorkspaceFixture`, lockfile helpers, ndjson parsing) into a shared dev-dependency crate (e.g., `pacquet-testing-utils`) or into `pacquet-cli`’s library under a `cfg(test)`-gated module that integration tests can import.
- Keep only truly tiny glue in `tests/_utils/*` if needed.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Lockfile rewritten via .replace() ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
Tests rewrite pnpm-lock.yaml using raw string .replace(), which is brittle (depends on exact
serialization/quoting) and can break with harmless formatting changes. The repo already has
structured lockfile parsing utilities that should be used instead.
Code

pnpm/crates/cli/tests/multiple_importers.rs[R266-272]

+    let lockfile_path = fixture.workspace.join("pnpm-lock.yaml");
+    let lockfile_text = fs::read_to_string(&lockfile_path).expect("read pnpm-lock.yaml");
+    let repinned =
+        lockfile_text.replace(&format!("'{DEP}': 100.1.0"), &format!("'{DEP}': 101.0.0"));
+    assert_ne!(repinned, lockfile_text, "expected the transitive pin in the snapshots section");
+    fs::write(&lockfile_path, repinned).expect("write pnpm-lock.yaml");
+
Evidence
PR Compliance ID 4 requires using established libraries/utilities for common tasks instead of
bespoke implementations. Here the test suite edits YAML lockfiles with string substitution even
though structured parsing/editing utilities already exist in the repo, making the test logic less
correct and less maintainable.

CLAUDE.md: Prefer established libraries over custom implementations for common functionality
pnpm/crates/cli/tests/multiple_importers.rs[266-272]
pnpm/crates/cli/tests/multiple_importers.rs[415-423]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The tests mutate `pnpm-lock.yaml` by doing text substitution with `.replace()`, which can make tests flaky if lockfile formatting changes.

## Issue Context
This repo already uses `pacquet_lockfile::Lockfile` + `serde_saphyr` parsing helpers (e.g. `read_lockfile`) elsewhere in the test suite; using them avoids coupling tests to YAML string formatting.

## Fix Focus Areas
- pnpm/crates/cli/tests/multiple_importers.rs[266-272]
- pnpm/crates/cli/tests/multiple_importers.rs[415-423]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Fetch log on install ✓ Resolved 🐞 Bug ◔ Observability
Description
The new headless-entry log chooses "Importing packages to virtual store" whenever
ignore_manifest_check is true, but that flag is also a user-facing install option for bypassing
the package.json↔lockfile freshness check, not specifically the fetch/manifest-ignored mode. As a
result, pnpm install --ignore-manifest-check will emit fetch-specific wording even though it is
still an install flow (is_full_install: true).
Code

pnpm/crates/package-manager/src/install.rs[R1544-1554]

+            if rebuild.is_none() && !lockfile.is_empty() {
+                let message = if ignore_manifest_check {
+                    "Importing packages to virtual store"
+                } else {
+                    "Lockfile is up to date, resolution step is skipped"
+                };
+                Reporter::emit(&LogEvent::Pnpm(PnpmLog {
+                    level: LogLevel::Info,
+                    message: message.to_string(),
+                    prefix: prefix.clone(),
+                }));
Evidence
The production log selection uses ignore_manifest_check to choose the fetch-style message;
repository code shows this flag is also user-facing on install and passed with `is_full_install:
true, while fetch uses the same flag with is_full_install: false`. That demonstrates the current
condition will mislabel some install runs as fetch-like in logs.

pnpm/crates/package-manager/src/install.rs[1536-1554]
pnpm/crates/package-manager/src/install.rs[171-181]
pnpm/crates/cli/src/cli_args/install.rs[115-121]
pnpm/crates/cli/src/cli_args/install.rs[454-474]
pnpm/crates/cli/src/cli_args/fetch.rs[27-55]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The headless-entry message selection currently keys off `ignore_manifest_check`, which is overloaded: it is set to `true` for `pnpm fetch`, but it is also exposed as `pnpm install --ignore-manifest-check`. This makes installs that use that flag print the fetch-specific message ("Importing packages to virtual store").

### Issue Context
- `ignore_manifest_check` is documented as skipping the per-importer package.json↔lockfile freshness gate, not as “ignore package manifest”.
- `pnpm fetch` sets `ignore_manifest_check: true` and also sets `is_full_install: false`.
- `pnpm install` sets `is_full_install: true` and passes through the CLI `--ignore-manifest-check`.

### Fix Focus Areas
- pnpm/crates/package-manager/src/install.rs[1536-1554]

### Suggested fix
Adjust the condition that selects the message so the fetch-specific wording is tied to an explicit fetch/manifest-ignored mode discriminator (e.g., `!is_full_install` in addition to `ignore_manifest_check`, or a dedicated boolean/enum passed into `Install`). Keep the "Lockfile is up to date..." wording for normal installs even when `--ignore-manifest-check` is used.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

5. Stale helper path comment 🐞 Bug ⚙ Maintainability ⭐ New
Description
CommandTempCwd::add_mocked_registry still references pnpm/crates/cli/tests/_utils.rs, but that
file was deleted and enable_gvs_in_workspace_yaml now lives in
pnpm/crates/cli/tests/_utils/mod.rs. This makes the comment misleading when tracking down why
tests pin enableGlobalVirtualStore: false.
Code

pnpm/crates/cli/tests/_utils/mod.rs[R22-42]

+/// Flip the `enableGlobalVirtualStore` key in the `pnpm-workspace.yaml`
+/// that [`pacquet_testing_utils::bin::CommandTempCwd::add_mocked_registry`]
+/// populated with `storeDir` / `cacheDir` / `enableGlobalVirtualStore: false`.
+/// The replacement is in-place rather than appended so the file stays
+/// valid YAML (pnpm rejects duplicate top-level mapping keys).
+pub fn enable_gvs_in_workspace_yaml(workspace: &Path, extra_yaml: &str) {
+    let yaml_path = workspace.join("pnpm-workspace.yaml");
+    let yaml = fs::read_to_string(&yaml_path).expect("read pnpm-workspace.yaml");
+    let flipped = yaml.replace("enableGlobalVirtualStore: false", "enableGlobalVirtualStore: true");
+    assert_ne!(
+        flipped, yaml,
+        "expected the default `enableGlobalVirtualStore: false` line written by \
+         `CommandTempCwd::add_mocked_registry` — has the helper changed?",
+    );
+    let mut yaml = flipped;
+    if !yaml.ends_with('\n') {
+        yaml.push('\n');
+    }
+    yaml.push_str(extra_yaml);
+    fs::write(&yaml_path, yaml).expect("write pnpm-workspace.yaml");
+}
Evidence
The helper function referenced by the comment now exists in the new _utils/mod.rs, while the
comment still points to the removed _utils.rs path.

pnpm/crates/testing-utils/src/bin.rs[70-77]
pnpm/crates/cli/tests/_utils/mod.rs[22-42]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
A comment in `CommandTempCwd::add_mocked_registry` points to a deleted file (`pnpm/crates/cli/tests/_utils.rs`) after this PR moved the helper into `pnpm/crates/cli/tests/_utils/mod.rs`.

### Issue Context
This PR deletes `pnpm/crates/cli/tests/_utils.rs` and introduces `pnpm/crates/cli/tests/_utils/mod.rs`, which now defines `enable_gvs_in_workspace_yaml`.

### Fix Focus Areas
- pnpm/crates/testing-utils/src/bin.rs[70-77]
- pnpm/crates/cli/tests/_utils/mod.rs[22-42]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit 7366227

Results up to commit 83b5d3a ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. allow_known_failure! skips new tests ✗ Dismissed 📘 Rule violation ☼ Reliability
Description
New tests were added under known_failures that exit early via allow_known_failure!, effectively
dismissing failing coverage rather than asserting and fixing the underlying behavior. This weakens
CI’s ability to catch regressions and can let unimplemented/incorrect behavior persist without a
strong signal.
Code

pnpm/crates/cli/tests/multiple_importers.rs[R499-599]

+mod known_failures {
+    //! Multi-importer cases blocked on features pacquet hasn't built
+    //! yet. Each entry stubs the not-yet-built subject under test
+    //! through [`pacquet_testing_utils::allow_known_failure`] so the
+    //! test exits early rather than masking a real bug.
+
+    use pacquet_testing_utils::{
+        allow_known_failure,
+        known_failure::{KnownFailure, KnownResult},
+    };
+
+    fn publish_config_directory_linking() -> KnownResult<()> {
+        Err(KnownFailure::new(
+            "Pacquet reads `publishConfig.directory` for the lockfile's \
+             `publishDirectory` field, freshness drift, and `pnpm pack`, \
+             but the install path never links a workspace package from \
+             that directory (`publishConfig.linkDirectory`).",
+        ))
+    }
+
+    fn build_index_ordered_project_scripts() -> KnownResult<()> {
+        Err(KnownFailure::new(
+            "Pacquet runs workspace projects' own lifecycle scripts \
+             root-first, not in `buildIndex` (workspace-topological) \
+             order, and does not re-link project bins between build \
+             groups — see the follow-up note on \
+             `run_projects_lifecycle_scripts` in \
+             `crates/package-manager/src/install.rs`.",
+        ))
+    }
+
+    fn per_project_workspace_lockfiles() -> KnownResult<()> {
+        Err(KnownFailure::new(
+            "`sharedWorkspaceLockfile: false` is not supported by \
+             pacquet's install family \
+             (`ERR_PNPM_RECURSIVE_SHARED_LOCKFILE_UNSUPPORTED`).",
+        ))
+    }
+
+    fn importer_level_link_closure_divergence() -> KnownResult<()> {
+        Err(KnownFailure::new(
+            "Pacquet's subset-install materialization closure follows \
+             importer-level `link:` / workspace-linked dependencies of \
+             the selected projects and installs the link targets' own \
+             dependencies (`materialization_closure` in \
+             `crates/package-manager/src/current_lockfile.rs`). The \
+             TypeScript CLI keeps those targets shallow — only \
+             `--filter <project>...` widens the selection — so the two \
+             stacks need a shared decision before this can be pinned.",
+        ))
+    }
+
+    /// TS: `symlink local package from the location described in its
+    /// publishConfig.directory when linkDirectory is true`
+    /// (`multipleImporters.ts:1768`).
+    #[test]
+    fn symlink_local_package_from_publish_config_directory() {
+        allow_known_failure!(publish_config_directory_linking());
+    }
+
+    /// TS: `link the bin file of a workspace project that is created by
+    /// a lifecycle script` (`multipleImporters.ts:1902`). Needs
+    /// `buildIndex` ordering plus bin re-linking between groups so a
+    /// dependent project's `prepare` can call the freshly-created bin.
+    #[test]
+    fn link_bin_of_workspace_project_created_by_lifecycle_script() {
+        allow_known_failure!(build_index_ordered_project_scripts());
+    }
+
+    /// TS: `recursive install with shared-workspace-lockfile builds
+    /// workspace projects in correct order`
+    /// (`pnpm/test/monorepo/index.ts:734`).
+    #[test]
+    fn recursive_install_builds_workspace_projects_in_correct_order() {
+        allow_known_failure!(build_index_ordered_project_scripts());
+    }
+
+    /// TS: `dependencies of workspace projects are built during
+    /// headless installation` (`pnpm/test/monorepo/index.ts:1281`) —
+    /// the upstream fixture turns off `sharedWorkspaceLockfile`.
+    #[test]
+    fn workspace_project_dependencies_built_during_headless_install_with_dedicated_lockfiles() {
+        allow_known_failure!(per_project_workspace_lockfiles());
+    }
+
+    /// TS: `custom virtual store directory in a workspace with not
+    /// shared lockfile` (`pnpm/test/monorepo/index.ts:1467`).
+    #[test]
+    fn custom_virtual_store_directory_with_dedicated_lockfiles() {
+        allow_known_failure!(per_project_workspace_lockfiles());
+    }
+
+    /// The tail of TS `headless install is used when package linked to
+    /// another package in the workspace` (`multipleImporters.ts:540`):
+    /// the unselected `link:` target's own dependencies must not be
+    /// installed by the subset install.
+    #[test]
+    fn subset_install_does_not_install_unselected_link_targets_dependencies() {
+        allow_known_failure!(importer_level_link_closure_divergence());
+    }
+}
Evidence
PR Compliance ID 2 forbids dismissing or skipping failing tests and requires that failing scenarios
be fixed rather than treated as acceptable. In the added known_failures modules, multiple
#[test] functions immediately call allow_known_failure!, including
hoisted_workspace_layout_does_not_duplicate_root_version, which explicitly allows an early exit
instead of enforcing the expected behavior, demonstrating the test suite is being made tolerant of
missing/incorrect functionality.

CLAUDE.md: Do not ignore or dismiss failing tests
pnpm/crates/cli/tests/multiple_importers.rs[499-599]
pnpm/crates/cli/tests/hoisted_node_linker.rs[586-605]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The test suite adds/extends `known_failures` stubs that call `allow_known_failure!`, causing tests to exit early rather than asserting the expected behavior and failing when it is missing or incorrect.

## Issue Context
PR Compliance (ID 2) requires that failing tests are not dismissed or skipped as acceptable; instead, behavior should be implemented/fixed and tests should enforce it. The current `known_failures` tests encode missing functionality as “allowed failures,” reducing CI’s ability to catch regressions and delaying parity work.

## Fix Focus Areas
- pnpm/crates/cli/tests/multiple_importers.rs[499-599]
- pnpm/crates/cli/tests/hoisted_node_linker.rs[586-605]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
2. Lockfile rewritten via .replace() ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
Tests rewrite pnpm-lock.yaml using raw string .replace(), which is brittle (depends on exact
serialization/quoting) and can break with harmless formatting changes. The repo already has
structured lockfile parsing utilities that should be used instead.
Code

pnpm/crates/cli/tests/multiple_importers.rs[R266-272]

+    let lockfile_path = fixture.workspace.join("pnpm-lock.yaml");
+    let lockfile_text = fs::read_to_string(&lockfile_path).expect("read pnpm-lock.yaml");
+    let repinned =
+        lockfile_text.replace(&format!("'{DEP}': 100.1.0"), &format!("'{DEP}': 101.0.0"));
+    assert_ne!(repinned, lockfile_text, "expected the transitive pin in the snapshots section");
+    fs::write(&lockfile_path, repinned).expect("write pnpm-lock.yaml");
+
Evidence
PR Compliance ID 4 requires using established libraries/utilities for common tasks instead of
bespoke implementations. Here the test suite edits YAML lockfiles with string substitution even
though structured parsing/editing utilities already exist in the repo, making the test logic less
correct and less maintainable.

CLAUDE.md: Prefer established libraries over custom implementations for common functionality
pnpm/crates/cli/tests/multiple_importers.rs[266-272]
pnpm/crates/cli/tests/multiple_importers.rs[415-423]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The tests mutate `pnpm-lock.yaml` by doing text substitution with `.replace()`, which can make tests flaky if lockfile formatting changes.

## Issue Context
This repo already uses `pacquet_lockfile::Lockfile` + `serde_saphyr` parsing helpers (e.g. `read_lockfile`) elsewhere in the test suite; using them avoids coupling tests to YAML string formatting.

## Fix Focus Areas
- pnpm/crates/cli/tests/multiple_importers.rs[266-272]
- pnpm/crates/cli/tests/multiple_importers.rs[415-423]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Fetch log on install ✓ Resolved 🐞 Bug ◔ Observability
Description
The new headless-entry log chooses "Importing packages to virtual store" whenever
ignore_manifest_check is true, but that flag is also a user-facing install option for bypassing
the package.json↔lockfile freshness check, not specifically the fetch/manifest-ignored mode. As a
result, pnpm install --ignore-manifest-check will emit fetch-specific wording even though it is
still an install flow (is_full_install: true).
Code

pnpm/crates/package-manager/src/install.rs[R1544-1554]

+            if rebuild.is_none() && !lockfile.is_empty() {
+                let message = if ignore_manifest_check {
+                    "Importing packages to virtual store"
+                } else {
+                    "Lockfile is up to date, resolution step is skipped"
+                };
+                Reporter::emit(&LogEvent::Pnpm(PnpmLog {
+                    level: LogLevel::Info,
+                    message: message.to_string(),
+                    prefix: prefix.clone(),
+                }));
Evidence
The production log selection uses ignore_manifest_check to choose the fetch-style message;
repository code shows this flag is also user-facing on install and passed with `is_full_install:
true, while fetch uses the same flag with is_full_install: false`. That demonstrates the current
condition will mislabel some install runs as fetch-like in logs.

pnpm/crates/package-manager/src/install.rs[1536-1554]
pnpm/crates/package-manager/src/install.rs[171-181]
pnpm/crates/cli/src/cli_args/install.rs[115-121]
pnpm/crates/cli/src/cli_args/install.rs[454-474]
pnpm/crates/cli/src/cli_args/fetch.rs[27-55]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The headless-entry message selection currently keys off `ignore_manifest_check`, which is overloaded: it is set to `true` for `pnpm fetch`, but it is also exposed as `pnpm install --ignore-manifest-check`. This makes installs that use that flag print the fetch-specific message ("Importing packages to virtual store").

### Issue Context
- `ignore_manifest_check` is documented as skipping the per-importer package.json↔lockfile freshness gate, not as “ignore package manifest”.
- `pnpm fetch` sets `ignore_manifest_check: true` and also sets `is_full_install: false`.
- `pnpm install` sets `is_full_install: true` and passes through the CLI `--ignore-manifest-check`.

### Fix Focus Areas
- pnpm/crates/package-manager/src/install.rs[1536-1554]

### Suggested fix
Adjust the condition that selects the message so the fetch-specific wording is tied to an explicit fetch/manifest-ignored mode discriminator (e.g., `!is_full_install` in addition to `ignore_manifest_check`, or a dedicated boolean/enum passed into `Install`). Keep the "Lockfile is up to date..." wording for normal installs even when `--ignore-manifest-check` is used.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

…tered installs

The TypeScript CLI logs "Lockfile is up to date, resolution step is
skipped" whenever the headless installer is entered — including installs
that materialize a cold node_modules from an up-to-date lockfile and
--filter subset installs — and "Importing packages to virtual store"
under ignorePackageManifest (pnpm fetch). Pacquet only announced the
no-op short-circuit. Emit the same logs from the frozen materialization
branch, staying silent for an empty lockfile (upstream returns before
the announcement) and for explicit rebuilds.
@greptile-apps

greptile-apps Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge: the change is purely additive test infrastructure plus a log-emission parity fix with no behavioral impact on install outcomes.

The reporter change is a single conditional emit inside an already-guarded branch, mutually exclusive with the no-op short-circuit that already emitted the same message. Tests follow established patterns and isolate unimplemented boundaries into clearly-labeled known_failures stubs.

No files require special attention.

Reviews (2): Last reviewed commit: "fix(pacquet): address automated review f..." | Re-trigger Greptile

zkochan added 2 commits July 19, 2026 19:47
…uites

Stage 2 of pnpm/plans/TEST_PORTING.md (#13146).

Add crates/cli/tests/multiple_importers.rs covering the open Support
Workspaces items: subset installs preserving other importers'
materialization, stale current-lockfile importers, filtered
current-lockfile contents, headless-vs-resolve decisions for link:,
workspace:, and unlinked workspace packages, subdependency-from-workspace
(linkWorkspacePackages: deep and a workspace:* override), the
deps-restorer workspace cases, workspace bin links, and the
shared-lockfile custom virtualStoreDir round-trip.

Promote the three --filter known_failures stubs to real tests now that
filtered installs exist (#13030): the selected-projects hoist
pair in hoist.rs and the workspace-subset optional-dependency skip in
optional_dependencies.rs. Port the hoisted-linker workspace-subset item
(multipleImporters.ts:87) and the hoisted workspace lifecycle-script
case (lifecycleScripts.ts:579, frozen path; fresh-path scripts stay
blocked on #11870).

Stub the not-yet-implemented boundaries (publishConfig.directory
linking, buildIndex-ordered project scripts, sharedWorkspaceLockfile:
false) and two divergences that need a cross-stack decision: pacquet's
subset closure deep-installs importer-level link targets where upstream
keeps them shallow, and the hoisted workspace layout duplicates the
root-winning version under consumer projects.

Move the FilteredWorkspace fixture from install_filters.rs into the
shared tests/_utils.rs as WorkspaceFixture so the new suite reuses it.

@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: 1

🤖 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 `@pnpm/crates/cli/tests/_utils.rs`:
- Around line 1-20: Move the helper-only module currently at the auto-discovered
test-root file into a nested test utility module such as tests/utils/mod.rs, and
update integration tests to import it from that module. Preserve all existing
helper APIs and behavior while ensuring Cargo does not compile the utility file
as a standalone integration-test target.
🪄 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: c79d40d0-eb10-4d34-bb5e-dcb5fc7c74b8

📥 Commits

Reviewing files that changed from the base of the PR and between 199c49b and 83b5d3a.

📒 Files selected for processing (9)
  • .changeset/hungry-donkeys-repeat.md
  • pnpm/crates/cli/tests/_utils.rs
  • pnpm/crates/cli/tests/hoist.rs
  • pnpm/crates/cli/tests/hoisted_node_linker.rs
  • pnpm/crates/cli/tests/install_filters.rs
  • pnpm/crates/cli/tests/multiple_importers.rs
  • pnpm/crates/cli/tests/optional_dependencies.rs
  • pnpm/crates/package-manager/src/install.rs
  • pnpm/plans/TEST_PORTING.md

Comment thread pnpm/crates/cli/tests/_utils/mod.rs Resolved
Keep the fetch-specific 'Importing packages to virtual store' wording off
regular installs: 'install --ignore-manifest-check' is a user-facing way
to skip the frozen freshness gate on a full install (the TypeScript shim
passes it too), so the wording now also requires the non-full install
that only 'pnpm fetch' combines with the flag.

Replace the raw string .replace() lockfile edits with a structured
repin_snapshot_dependency helper shared through tests/_utils, and move
tests/_utils.rs to tests/_utils/mod.rs so cargo stops compiling the
helper file as its own empty integration-test target.
Copilot AI review requested due to automatic review settings July 19, 2026 18:34

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.02     11.1±0.28ms    33.7 MB/sec    1.00     10.8±0.03ms    34.5 MB/sec
packument/parse                1.07     39.5±0.08µs  1678.6 MB/sec    1.00     36.9±0.09µs  1797.8 MB/sec
tarball/download_dependency    1.00      2.3±0.07ms  1927.0 KB/sec    1.01      2.3±0.06ms  1913.4 KB/sec

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 7366227

@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.

🧹 Nitpick comments (2)
pnpm/crates/cli/tests/_utils/mod.rs (2)

393-402: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Avoid intermediate String allocations when parsing NDJSON.

Creating an intermediate Vec<String> is unnecessary because serde_json::from_str can parse directly from the &str yielded by .lines(). By collecting the Value objects within the flat_map closure, you ensure the temporary Cow (from from_utf8_lossy) lives just long enough for the parse step, entirely avoiding the intermediate String copies.

⚡ Proposed fix
 #[must_use]
 pub fn ndjson_records(output: &Output) -> Vec<Value> {
     [&output.stderr[..], &output.stdout[..]]
         .into_iter()
         .flat_map(|stream| {
-            String::from_utf8_lossy(stream).lines().map(str::to_string).collect::<Vec<_>>()
-        })
-        .filter_map(|line| serde_json::from_str(&line).ok())
+            String::from_utf8_lossy(stream)
+                .lines()
+                .filter_map(|line| serde_json::from_str(line).ok())
+                .collect::<Vec<_>>()
+        })
         .collect()
 }
🤖 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/_utils/mod.rs` around lines 393 - 402, Update
ndjson_records to parse each &str directly from the lines yielded by
String::from_utf8_lossy, collecting parsed Value objects inside the flat_map
closure. Remove the intermediate Vec<String> and preserve filtering of invalid
JSON records across both stderr and stdout.

461-470: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Hoist string allocations outside of iterator closures.

Both of these helper functions recreate formatted strings for every key in the lockfile snapshots. Hoisting the format! calls outside the closures and minimizing to_string() calls avoids O(N) unnecessary allocations.

  • pnpm/crates/cli/tests/_utils/mod.rs#L461-L470: hoist format!("{name}@") out of the loop and use filter_map to avoid calling to_string() twice per item.
  • pnpm/crates/cli/tests/_utils/mod.rs#L472-L480: hoist both format! operations before the closure.
⚡ Proposed refactor for `snapshot_entries`
 #[must_use]
 pub fn snapshot_entries(lockfile: &Lockfile, name: &str) -> Vec<(String, SnapshotEntry)> {
+    let prefix = format!("{name}@");
     lockfile
         .snapshots
         .as_ref()
         .into_iter()
         .flatten()
-        .filter(|(key, _)| key.to_string().starts_with(&format!("{name}@")))
-        .map(|(key, snapshot)| (key.to_string(), snapshot.clone()))
+        .filter_map(|(key, snapshot)| {
+            let key_str = key.to_string();
+            if key_str.starts_with(&prefix) {
+                Some((key_str, snapshot.clone()))
+            } else {
+                None
+            }
+        })
         .collect()
 }
⚡ Proposed refactor for `has_snapshot`
 #[must_use]
 pub fn has_snapshot(lockfile: &Lockfile, name: &str, version: &str) -> bool {
+    let exact = format!("{name}@{version}");
+    let prefix = format!("{exact}(");
     lockfile.snapshots.as_ref().is_some_and(|snapshots| {
         snapshots.keys().any(|key| {
-            let key = key.to_string();
-            key == format!("{name}@{version}") || key.starts_with(&format!("{name}@{version}("))
+            let key_str = key.to_string();
+            key_str == exact || key_str.starts_with(&prefix)
         })
     })
 }
🤖 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/_utils/mod.rs` around lines 461 - 470, In
pnpm/crates/cli/tests/_utils/mod.rs lines 461-470, update snapshot_entries to
precompute the formatted name prefix before iterating and use filter_map so each
key is converted to a string at most once. In
pnpm/crates/cli/tests/_utils/mod.rs lines 472-480, update has_snapshot to
precompute both formatted strings before its iterator closure; preserve the
existing matching behavior while eliminating repeated formatting and
allocations.
🤖 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.

Nitpick comments:
In `@pnpm/crates/cli/tests/_utils/mod.rs`:
- Around line 393-402: Update ndjson_records to parse each &str directly from
the lines yielded by String::from_utf8_lossy, collecting parsed Value objects
inside the flat_map closure. Remove the intermediate Vec<String> and preserve
filtering of invalid JSON records across both stderr and stdout.
- Around line 461-470: In pnpm/crates/cli/tests/_utils/mod.rs lines 461-470,
update snapshot_entries to precompute the formatted name prefix before iterating
and use filter_map so each key is converted to a string at most once. In
pnpm/crates/cli/tests/_utils/mod.rs lines 472-480, update has_snapshot to
precompute both formatted strings before its iterator closure; preserve the
existing matching behavior while eliminating repeated formatting and
allocations.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3474d84e-86da-4634-9e37-441dcc010a5f

📥 Commits

Reviewing files that changed from the base of the PR and between 83b5d3a and 7366227.

📒 Files selected for processing (10)
  • .changeset/hungry-donkeys-repeat.md
  • pnpm/crates/cli/tests/_utils.rs
  • pnpm/crates/cli/tests/_utils/mod.rs
  • pnpm/crates/cli/tests/hoist.rs
  • pnpm/crates/cli/tests/hoisted_node_linker.rs
  • pnpm/crates/cli/tests/install_filters.rs
  • pnpm/crates/cli/tests/multiple_importers.rs
  • pnpm/crates/cli/tests/optional_dependencies.rs
  • pnpm/crates/package-manager/src/install.rs
  • pnpm/plans/TEST_PORTING.md
💤 Files with no reviewable changes (1)
  • pnpm/crates/cli/tests/_utils.rs
🚧 Files skipped from review as they are similar to previous changes (8)
  • .changeset/hungry-donkeys-repeat.md
  • pnpm/crates/package-manager/src/install.rs
  • pnpm/crates/cli/tests/optional_dependencies.rs
  • pnpm/crates/cli/tests/hoisted_node_linker.rs
  • pnpm/crates/cli/tests/multiple_importers.rs
  • pnpm/crates/cli/tests/hoist.rs
  • pnpm/plans/TEST_PORTING.md
  • pnpm/crates/cli/tests/install_filters.rs

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 19, 2026
@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan

zkochan commented Jul 19, 2026

Copy link
Copy Markdown
Member Author

Addressed the review feedback in 7366227 (and rebased over latest main, resolving the TEST_PORTING.md overlap with the Stage 4 patch port #13149):

  • Qodo, "Fetch log on install" (bug) — valid catch. install --ignore-manifest-check is a user-facing full-install flag (the TypeScript shim passes it too), so keying the fetch wording on the flag alone would mislabel those installs. The Importing packages to virtual store wording now also requires the non-full install that only pnpm fetch combines with the flag; regular installs keep Lockfile is up to date, resolution step is skipped.
  • Qodo, "Lockfile rewritten via .replace()" — both raw-string lockfile edits now go through a structured repin_snapshot_dependency helper in tests/_utils (parse → mutate the snapshot pin → save_to_path), which the promoted hoist.rs test reuses as well.
  • Qodo, "allow_known_failure! skips new tests" — intentional; this is the porting convention pnpm/plans/TEST_PORTING.md prescribes for not-yet-implemented boundaries (see the inline reply).
  • Greptile / CodeRabbit, tests/_utils.rs as an auto-discovered target — moved to tests/_utils/mod.rs, so cargo no longer builds the helper file as its own empty test binary.

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

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.87%. Comparing base (ebacfa6) to head (7366227).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13152      +/-   ##
==========================================
+ Coverage   85.85%   85.87%   +0.01%     
==========================================
  Files         505      505              
  Lines       84029    84057      +28     
==========================================
+ Hits        72147    72183      +36     
+ Misses      11882    11874       -8     

☔ 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: 736622739055

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

The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time).

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.532 ± 0.159 2.339 2.768 1.64 ± 0.19
pacquet@main 2.466 ± 0.143 2.347 2.755 1.59 ± 0.18
pnpr@HEAD 1.565 ± 0.177 1.344 1.789 1.01 ± 0.15
pnpr@main 1.548 ± 0.154 1.336 1.787 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.53193655208,
      "stddev": 0.15861752505895046,
      "median": 2.50879764518,
      "user": 1.48761372,
      "system": 1.2685971,
      "min": 2.33946649918,
      "max": 2.76771439618,
      "times": [
        2.76771439618,
        2.58045556118,
        2.33946649918,
        2.36951965618,
        2.6401349821799998,
        2.41334805318,
        2.74602881418,
        2.43713972918,
        2.62172918118,
        2.4038286481799997
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.46550417118,
      "stddev": 0.14317612703845542,
      "median": 2.40491176118,
      "user": 1.4504011199999998,
      "system": 1.2912215999999999,
      "min": 2.34727257718,
      "max": 2.75458370418,
      "times": [
        2.41945432918,
        2.34727257718,
        2.34964534118,
        2.47141263918,
        2.36029474318,
        2.57459422318,
        2.39036919318,
        2.63717245218,
        2.75458370418,
        2.35024250918
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.56461021638,
      "stddev": 0.17726844016741244,
      "median": 1.58065144418,
      "user": 1.03103182,
      "system": 1.1233722000000002,
      "min": 1.3441008241799999,
      "max": 1.78905001018,
      "times": [
        1.67579207118,
        1.45947446118,
        1.35567184418,
        1.3441008241799999,
        1.52430714118,
        1.72602376918,
        1.78905001018,
        1.3626289141799999,
        1.77205738118,
        1.6369957471799998
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.54790409308,
      "stddev": 0.15377885598091645,
      "median": 1.58631849618,
      "user": 1.02239182,
      "system": 1.1343847000000002,
      "min": 1.3361002581799999,
      "max": 1.7870190081800001,
      "times": [
        1.3620971391799999,
        1.7870190081800001,
        1.64326751118,
        1.33928403018,
        1.3361002581799999,
        1.54782071118,
        1.58040364518,
        1.59223334718,
        1.61695863718,
        1.67385664318
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 246.0 ± 4.3 236.7 253.7 1.00 ± 0.03
pacquet@main 244.9 ± 5.7 235.5 255.5 1.00
pnpr@HEAD 268.4 ± 6.0 258.7 277.9 1.10 ± 0.04
pnpr@main 259.3 ± 10.2 245.4 281.1 1.06 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.24603184578000006,
      "stddev": 0.004253457168812092,
      "median": 0.24589062618000002,
      "user": 0.22018010000000002,
      "system": 0.4808290599999999,
      "min": 0.23665874468000003,
      "max": 0.25374858568,
      "times": [
        0.24658980068000003,
        0.24487346668000004,
        0.23665874468000003,
        0.24811653068000003,
        0.24481811268000003,
        0.24485996068000002,
        0.24750886068000003,
        0.25374858568,
        0.24519145168000003,
        0.24795294368000004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.24490287058,
      "stddev": 0.005746520900328208,
      "median": 0.24475753918000004,
      "user": 0.2084379,
      "system": 0.4730263600000001,
      "min": 0.23552838668000003,
      "max": 0.25546037168,
      "times": [
        0.25546037168,
        0.24663748968000002,
        0.24634330868000004,
        0.23978597968000004,
        0.24063568168000002,
        0.24373105668000003,
        0.24355480668000004,
        0.23552838668000003,
        0.25156760268,
        0.24578402168000002
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.26839424858,
      "stddev": 0.006030550415050428,
      "median": 0.26929522318,
      "user": 0.2134223,
      "system": 0.53701596,
      "min": 0.25865586468,
      "max": 0.27785189068000005,
      "times": [
        0.27024669968000004,
        0.26879975068,
        0.27785189068000005,
        0.25865586468,
        0.26366655668000005,
        0.27127172868000005,
        0.27523983968000004,
        0.26774280068,
        0.26979069568,
        0.26067665868
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.25926915448000004,
      "stddev": 0.010198780847724173,
      "median": 0.25705818168000005,
      "user": 0.18895889999999999,
      "system": 0.53924426,
      "min": 0.24537457468000004,
      "max": 0.28109202268000005,
      "times": [
        0.25480854968000005,
        0.24537457468000004,
        0.25167770668,
        0.25930781368000005,
        0.26098059568000004,
        0.26808949768,
        0.26505796068000004,
        0.25348259668,
        0.25282022668000004,
        0.28109202268000005
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.697 ± 0.020 2.661 2.724 1.80 ± 0.15
pacquet@main 2.696 ± 0.016 2.675 2.728 1.80 ± 0.15
pnpr@HEAD 1.500 ± 0.121 1.368 1.676 1.00
pnpr@main 1.533 ± 0.152 1.372 1.807 1.02 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6968727170999998,
      "stddev": 0.019810634075981107,
      "median": 2.7054503773,
      "user": 1.5639317600000002,
      "system": 1.2780090200000003,
      "min": 2.6607802958,
      "max": 2.7239816548,
      "times": [
        2.6721396958,
        2.7075232278,
        2.7034212388,
        2.6607802958,
        2.7239816548,
        2.6880669078,
        2.7115528838,
        2.6842220088,
        2.7095597418,
        2.7074795158000002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6955586767,
      "stddev": 0.016021495068511152,
      "median": 2.6907675288000004,
      "user": 1.5605893599999998,
      "system": 1.26715822,
      "min": 2.6746099908,
      "max": 2.7281660208,
      "times": [
        2.7281660208,
        2.6746099908,
        2.6926563208000003,
        2.7092513228,
        2.6888787368,
        2.7107133498,
        2.6860727228,
        2.6877088368,
        2.6819093768,
        2.6956200888
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5003075329000002,
      "stddev": 0.12099759468243561,
      "median": 1.4675703098000001,
      "user": 0.9283010599999999,
      "system": 1.13084932,
      "min": 1.3683243917999999,
      "max": 1.6755809258,
      "times": [
        1.3980319248,
        1.6755809258,
        1.5905761048,
        1.3683243917999999,
        1.4611583448,
        1.6535945688,
        1.3924402058,
        1.3772332128,
        1.6121533748,
        1.4739822748
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5326031356999998,
      "stddev": 0.15183640997259532,
      "median": 1.5019816958,
      "user": 0.9601026600000001,
      "system": 1.10859442,
      "min": 1.3724317238000001,
      "max": 1.8066917868,
      "times": [
        1.4034555908,
        1.3966257528,
        1.7275068418,
        1.3724317238000001,
        1.6379331148,
        1.4721629378,
        1.5318004538,
        1.8066917868,
        1.4022483108000001,
        1.5751748438000002
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 549.2 ± 11.7 531.4 568.8 1.93 ± 0.06
pacquet@main 547.8 ± 10.8 526.1 563.8 1.92 ± 0.06
pnpr@HEAD 294.7 ± 8.0 283.1 312.1 1.03 ± 0.04
pnpr@main 285.1 ± 6.2 275.0 293.3 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.5492329883200001,
      "stddev": 0.011672544403765198,
      "median": 0.55031128492,
      "user": 0.6507013599999999,
      "system": 0.68204984,
      "min": 0.5314121364200001,
      "max": 0.5688305734200001,
      "times": [
        0.5488413024200001,
        0.5530282634200001,
        0.55324971842,
        0.5460995194200001,
        0.5517812674200001,
        0.5688305734200001,
        0.56280182442,
        0.5430148824200001,
        0.5314121364200001,
        0.5332703954200001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.5477844268200001,
      "stddev": 0.010800793274562362,
      "median": 0.5516926774200002,
      "user": 0.6713351599999998,
      "system": 0.65122014,
      "min": 0.52607251742,
      "max": 0.5638053434200001,
      "times": [
        0.5515428024200001,
        0.54161199542,
        0.5541573274200001,
        0.53731045042,
        0.5431657554200001,
        0.5541496424200001,
        0.5638053434200001,
        0.55418588142,
        0.5518425524200001,
        0.52607251742
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29467783402000003,
      "stddev": 0.008038606316085146,
      "median": 0.29219997242,
      "user": 0.18692876000000003,
      "system": 0.50407914,
      "min": 0.28314676442000003,
      "max": 0.31206749142,
      "times": [
        0.28876684942,
        0.29241210542,
        0.29686713642,
        0.29137049542,
        0.30020685242,
        0.30009586442,
        0.28314676442000003,
        0.28985694142,
        0.31206749142,
        0.29198783942
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.28506802381999996,
      "stddev": 0.006165578390980803,
      "median": 0.28603709742000005,
      "user": 0.19261066,
      "system": 0.4836479399999999,
      "min": 0.27497872942,
      "max": 0.29334292942,
      "times": [
        0.27497872942,
        0.28457285642,
        0.28877918142000003,
        0.28573302842000003,
        0.27667905442,
        0.28634116642,
        0.28872010042,
        0.29334292942,
        0.29172863442,
        0.27980455742
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.837 ± 0.008 1.828 1.852 6.51 ± 0.24
pacquet@main 1.837 ± 0.008 1.827 1.852 6.51 ± 0.24
pnpr@HEAD 0.284 ± 0.005 0.275 0.293 1.00 ± 0.04
pnpr@main 0.282 ± 0.011 0.265 0.297 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.83749429806,
      "stddev": 0.007545097310841784,
      "median": 1.83587535256,
      "user": 0.8613150199999999,
      "system": 0.73197788,
      "min": 1.82833508306,
      "max": 1.85199121006,
      "times": [
        1.85199121006,
        1.83863323706,
        1.84771286906,
        1.84027831706,
        1.83366665706,
        1.82833508306,
        1.8293008910600002,
        1.83584309206,
        1.83327401106,
        1.83590761306
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.83748236066,
      "stddev": 0.008122677778819792,
      "median": 1.8367694055600001,
      "user": 0.89185952,
      "system": 0.71650418,
      "min": 1.82688566906,
      "max": 1.85203814906,
      "times": [
        1.82688566906,
        1.8474782400599998,
        1.85203814906,
        1.83731040806,
        1.83622840306,
        1.83213557906,
        1.8375166060600001,
        1.83250584306,
        1.8288704650599998,
        1.8438542440599999
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.28367751696,
      "stddev": 0.004818380218519812,
      "median": 0.28395232656,
      "user": 0.17386622000000002,
      "system": 0.49612578,
      "min": 0.27471174906,
      "max": 0.29252452306000004,
      "times": [
        0.28627976006,
        0.28178191606,
        0.28389848106000004,
        0.29252452306000004,
        0.28400617206,
        0.27933340306000004,
        0.27471174906,
        0.28209082506,
        0.28793131306,
        0.28421702706
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.28227759366000005,
      "stddev": 0.010507407484487157,
      "median": 0.28010311956,
      "user": 0.17324402,
      "system": 0.48842127999999996,
      "min": 0.26457899506000004,
      "max": 0.29672800406,
      "times": [
        0.29543645606,
        0.28636226506,
        0.29672800406,
        0.27928160606,
        0.27254232506000003,
        0.26457899506000004,
        0.27747748806,
        0.27632024906,
        0.28092463306000004,
        0.29312391506
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 314.5 ± 8.5 307.0 329.5 3.74 ± 0.13
pacquet@main 316.2 ± 9.1 303.0 329.8 3.76 ± 0.14
pnpr@HEAD 84.2 ± 2.0 80.9 89.0 1.00
pnpr@main 84.3 ± 2.3 81.0 89.9 1.00 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.31447959672,
      "stddev": 0.008461775711370767,
      "median": 0.31333134612,
      "user": 0.30031105999999996,
      "system": 0.05867578,
      "min": 0.30701668862,
      "max": 0.32949459862,
      "times": [
        0.30709894062,
        0.31478081562,
        0.30701668862,
        0.30722014862,
        0.30813195562,
        0.31191857562,
        0.32949459862,
        0.31548585562,
        0.32890427162,
        0.31474411662
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.3162196227199999,
      "stddev": 0.009104851788496774,
      "median": 0.31333455111999997,
      "user": 0.30825945999999993,
      "system": 0.05342857999999999,
      "min": 0.30302764762,
      "max": 0.32982306062,
      "times": [
        0.31833528062,
        0.30302764762,
        0.31137748162,
        0.32813369762,
        0.32631738662,
        0.30986423862,
        0.30864833162,
        0.31269885562,
        0.31397024662,
        0.32982306062
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08416846604424244,
      "stddev": 0.002022535893228336,
      "median": 0.08397407062000001,
      "user": 0.01796831757575758,
      "system": 0.009986375757575756,
      "min": 0.08092789462,
      "max": 0.08899741562,
      "times": [
        0.08597125862,
        0.08407345662,
        0.08336831462000001,
        0.08535309162,
        0.08508974962,
        0.08899741562,
        0.08595050062000001,
        0.08755061662000001,
        0.08561260662,
        0.08188011862,
        0.08290945662,
        0.08349449262,
        0.08666820362000001,
        0.08191777862,
        0.08376229362,
        0.08496805062,
        0.08320168362000001,
        0.08527895262,
        0.08689679262,
        0.08692700862,
        0.08491552262,
        0.08103664862,
        0.08433153962,
        0.08237036762,
        0.08214905162,
        0.08092789462,
        0.08397407062000001,
        0.08137381062,
        0.08278242862,
        0.08290749262000001,
        0.08585798662,
        0.08293602662,
        0.08212469662
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08426528750235295,
      "stddev": 0.0023457796881723413,
      "median": 0.08380891012,
      "user": 0.021116265882352943,
      "system": 0.007155658823529412,
      "min": 0.08104141762,
      "max": 0.08989352362,
      "times": [
        0.08433139862,
        0.08248727662000001,
        0.08289464862,
        0.08236182062,
        0.08324835062000001,
        0.08989352362,
        0.08413127462,
        0.08213223062,
        0.08124915662,
        0.08216154562,
        0.08502665062,
        0.08711579262000001,
        0.08538592362,
        0.08184591362,
        0.08369840362,
        0.08952303962000001,
        0.08683414462,
        0.08645484462,
        0.08550552562000001,
        0.08391941662,
        0.08565628962,
        0.08321309562,
        0.08199890162000001,
        0.08142101962,
        0.08366008162,
        0.08741530262,
        0.08513550462,
        0.08104141762,
        0.08428454062,
        0.08756462262,
        0.08640921962,
        0.08279301862,
        0.08153609462,
        0.08268978462
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.500 ± 0.128 4.413 4.754 1.30 ± 0.04
pacquet@main 4.480 ± 0.098 4.403 4.681 1.29 ± 0.03
pnpr@HEAD 3.533 ± 0.076 3.451 3.681 1.02 ± 0.03
pnpr@main 3.473 ± 0.046 3.432 3.564 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.49972981168,
      "stddev": 0.1278844535272738,
      "median": 4.4420829694799995,
      "user": 1.65080656,
      "system": 1.3193704199999998,
      "min": 4.412726505979999,
      "max": 4.7543919599799995,
      "times": [
        4.71004983998,
        4.41406710598,
        4.7543919599799995,
        4.412726505979999,
        4.44204931198,
        4.44644115498,
        4.4185473449799995,
        4.53419012098,
        4.44211662698,
        4.42271814498
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.47990922448,
      "stddev": 0.09797701345445502,
      "median": 4.43619100698,
      "user": 1.64101236,
      "system": 1.36980632,
      "min": 4.40333880798,
      "max": 4.680926909979999,
      "times": [
        4.40740305798,
        4.43460387998,
        4.50998864398,
        4.40333880798,
        4.43315366498,
        4.437778133979999,
        4.629437676979999,
        4.41060589498,
        4.680926909979999,
        4.45185557398
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.53251206428,
      "stddev": 0.07609392130360884,
      "median": 3.51918076398,
      "user": 1.1507826600000002,
      "system": 1.21966932,
      "min": 3.4510349339800004,
      "max": 3.68072484898,
      "times": [
        3.4510349339800004,
        3.48222019098,
        3.55614133698,
        3.46339682698,
        3.56154935598,
        3.58578810298,
        3.68072484898,
        3.46653720898,
        3.6002137599800004,
        3.4775140769800004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.4732836125800004,
      "stddev": 0.0462985902992486,
      "median": 3.4536913244800003,
      "user": 1.1398448599999997,
      "system": 1.2199212200000003,
      "min": 3.43235818498,
      "max": 3.56417406198,
      "times": [
        3.4549936479800003,
        3.4614798659800003,
        3.56417406198,
        3.4491048489800002,
        3.44633306798,
        3.43235818498,
        3.5537488559800003,
        3.4523890009800002,
        3.47051220298,
        3.4477423879800004
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13152
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
2,660.78 ms
(-0.88%)Baseline: 2,684.43 ms
3,221.32 ms
(82.60%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,828.34 ms
(-0.77%)Baseline: 1,842.61 ms
2,211.13 ms
(82.69%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
531.41 ms
(-2.47%)Baseline: 544.87 ms
653.84 ms
(81.28%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
307.02 ms
(-6.09%)Baseline: 326.92 ms
392.30 ms
(78.26%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,339.47 ms
(-1.77%)Baseline: 2,381.63 ms
2,857.95 ms
(81.86%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,412.73 ms
(-0.91%)Baseline: 4,453.23 ms
5,343.88 ms
(82.58%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
236.66 ms
(-4.51%)Baseline: 247.83 ms
297.39 ms
(79.58%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13152
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
1,368.32 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
274.71 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
283.15 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
80.93 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,344.10 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,451.03 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
258.66 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit b25e845 into main Jul 19, 2026
39 checks passed
@qodo-code-review qodo-code-review Bot mentioned this pull request Aug 15, 2026
4 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants