Skip to content

fix(pacquet): napi resolveDependency resolver chain + root-component member reachability - #12849

Merged
zkochan merged 8 commits into
mainfrom
fix/napi-resolver-and-version
Jul 9, 2026
Merged

zkochan merged 8 commits into
mainfrom
fix/napi-resolver-and-version

Conversation

@zkochan

@zkochan zkochan commented Jul 7, 2026 •

Copy link
Copy Markdown
Member

Two fixes to the @pnpm/napi binding / pacquet, both needed by programmatic
consumers (Bit) and both gated so existing behavior is unchanged.

1. resolveDependency resolves non-npm specifiers

resolveDependency built a bare NpmResolver, so any non-npm specifier — a
folder path, file: / link: / workspace: spec, git URL, http(s) tarball
URL, or <alias>: named-registry spec — errored with "the specifier was not
claimed by the npm resolver"
. It now mirrors the install path's
DefaultResolver chain (npm → git → tarball → localScheme → node → deno → bun →
namedRegistry → localPath), so a folder path resolves to its manifest, file: /
link: resolve locally, and git URLs are claimed. Normal npm specs unchanged.

Deliberate deviations from the install chain (documented in the module doc): the
tarball resolver runs with no fetch context (no install store on a single
resolve), and pnpmfile custom resolvers are omitted.

2. Root-component member reachability (installConfig.hoistingLimits: "workspaces")

Bit's "root components" create per-root importers whose manifests inject sibling
components as file: deps and carry installConfig: { hoistingLimits: "workspaces" }. The isolated linker materializes each injected member into the
shared global virtual store, where a member's slot node_modules holds only its
own lockfile deps — so a realpath walk from one member (e.g. resolveFrom,
preserveSymlinks: false) can't reach a sibling member, failing with
Cannot find module.

This parses installConfig.hoistingLimits from the manifest and, after the
isolated symlink pass, cross-links every one of a root's injected members into
every other member's slot node_modules so the upward walk finds its siblings.
The pass is gated on hoistingLimits: "workspaces" — a shape no non-Bit
install produces — and is purely additive (never clobbers an existing entry), so
ordinary installs are untouched. Each root's peer context is folded into its
members' slot hashes, so two roots get distinct member slots and cross-linking
one root can never leak a sibling into another's chain. Wired into the fresh and
frozen isolated paths.

Known limitation for a future PR: the pass cross-links all members
all-to-all (matching pnpm's root-component hoisting, where siblings are
mutually visible), which is broader than each component's declared dependency
set. The fully-scoped long-term fix is a per-root local virtual store
(.bit_roots/<id>/node_modules/.pnpm).

Verification

  • resolveDependency: repro resolves folder path / file: / link: / npm /
    git; 3 new offline tests.
  • Root components: repro against the real captured Bit install args flips
    MODULE_NOT_FOUND → comp3-root reaches react 16.x, comp4-root 17.x
    (comp2 reachable from comp3); 6 new tests.
  • Full pacquet-package-manager suite (665) + pacquet-napi (10) +
    pacquet-package-manifest (42) green; fmt --check, clippy -D warnings,
    cargo doc -D warnings, cargo dylint all clean.

Ref: #12822, #12844.


Written by an agent (Claude Code, claude-fable-5), on behalf of @zkochan.

Summary by CodeRabbit

  • New Features

    • Improved dependency resolution to handle more package sources, including local paths, git URLs, tarballs, and named registries.
    • Added support for linking related workspace components so they can resolve each other during installs.
  • Bug Fixes

    • Install flows now surface clearer errors when a dependency source is unsupported.
    • Improved Windows symlink detection for more reliable filesystem behavior.
  • Tests

    • Added coverage for offline resolution and root-component linking behavior.

`resolveDependency` in the `@pnpm/napi` binding built a bare `NpmResolver`,
so any non-npm specifier (a folder path, git URL, `file:` / `link:` /
`workspace:` spec, `http(s)` tarball URL, or `<alias>:` named-registry
spec) errored with "the specifier was not claimed by the npm resolver".
Bit's `resolveRemoteVersion` passes exactly these shapes and expects a
manifest back.

Mirror the install path's `DefaultResolver` chain
(`install_with_fresh_lockfile.rs`): npm -> git -> tarball -> localScheme
-> node -> deno -> bun -> namedRegistry -> localPath. The single-resolve
path runs the tarball resolver without a fetch context (there is no
install store to extract into), and omits the pnpmfile custom resolvers
(an install-time concern); everything else matches the install chain, so
a folder path resolves to its manifest, a `file:` / `link:` spec resolves
to its directory, a git URL pins a commit, and a normal npm spec still
resolves as before. An unclaimed spec now surfaces the chain's
`SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER` diagnostic.

Adds offline unit tests covering the `file:` / `link:` directory cases and
the no-resolver-claimed error.
Copilot AI review requested due to automatic review settings July 7, 2026 22:13

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 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR expands N-API dependency resolution from npm-only to a multi-resolver install chain (git, tarball, local, node/deno/bun runtimes, named-registry) via DefaultResolver, adds a link_root_component_members helper to cross-link Bit root-component packages during non-hoisted installs, adds a manifest hoisting-limits getter, refines Windows symlink/junction detection, and adds an Arc<dyn Resolver> impl.

Changes

Resolver chain implementation

Layer / File(s) Summary
Resolver dependencies and supporting base changes
pacquet/crates/napi/Cargo.toml, pacquet/crates/resolving-resolver-base/src/resolve.rs, pacquet/crates/testing-utils/src/fs.rs
Adds engine-runtime and resolving crate dependencies, implements Resolver for Arc<dyn Resolver>, and refines Windows junction vs symlink detection with explicit error mapping.
Resolver chain wiring
pacquet/crates/napi/src/resolve.rs
Rebuilds run_resolve_blocking to construct git, tarball, local, node/deno/bun, and named-registry resolvers into an ordered chain wrapped by DefaultResolver, sharing the npm resolver via Arc, deriving RetryOpts from config, and surfacing unclaimed specs as SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER.
Offline resolver tests
pacquet/crates/napi/src/resolve/tests.rs
Adds offline-forced test helpers and tests for file:/link: resolution and unsupported-spec errors.

Root-component cross-linking

Layer / File(s) Summary
Hoisting limits manifest access
pacquet/crates/package-manifest/src/lib.rs
Adds install_config_hoisting_limits() reading installConfig.hoistingLimits.
Root-component linking helper
pacquet/crates/package-manager/src/link_root_component_members.rs, pacquet/crates/package-manager/src/link_root_component_members/tests.rs
Adds link_root_component_members, HOISTING_LIMITS_WORKSPACES, injected-member detection, sibling symlink cross-linking, LinkRootComponentMembersError, and unit/integration tests.
Install pipeline hooks
pacquet/crates/package-manager/src/install_frozen_lockfile.rs, pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs, pacquet/crates/package-manager/src/lib.rs
Adds LinkRootComponentMembers error variants, invokes cross-linking for workspace-hoisted root components in non-hoisted paths, and removes the ArcResolver adapter in favor of directly boxing the shared npm resolver.

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

Sequence Diagram(s)

sequenceDiagram
  participant resolveDependency
  participant DefaultResolver
  participant ProtocolResolvers as Git/Tarball/Local/Runtime resolvers
  participant NpmResolver

  resolveDependency->>DefaultResolver: build ordered resolver chain
  DefaultResolver->>ProtocolResolvers: attempt claim on wanted spec
  ProtocolResolvers->>NpmResolver: reuse shared npm resolver metadata (node/deno/bun)
  DefaultResolver-->>resolveDependency: resolved manifest or SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER
Loading
sequenceDiagram
  participant InstallFlow as install flow
  participant PackageManifest
  participant LinkRootComponentMembers as link_root_component_members
  participant VirtualStoreLayout
  participant FileSystem as filesystem

  InstallFlow->>PackageManifest: read installConfig.hoistingLimits
  InstallFlow->>LinkRootComponentMembers: pass root component importer ids
  LinkRootComponentMembers->>VirtualStoreLayout: collect member slot paths
  LinkRootComponentMembers->>FileSystem: create sibling symlinks (skip existing/self)
  LinkRootComponentMembers-->>InstallFlow: return success or symlink error
Loading

Possibly related issues

  • Rust Roadmap #11633: Implements the resolution chain and root-component linking roadmap items referenced by this issue.

Possibly related PRs

  • pnpm/pnpm#11773: Overlaps in adding and wiring pacquet-resolving-tarball-resolver into the resolver chain.
  • pnpm/pnpm#11778: Overlaps in wiring the local-scheme resolver (file:/link:/workspace:) via pacquet-resolving-local-resolver.
  • pnpm/pnpm#12041: Both implement/consume hoistingLimits "workspaces" semantics used by link_root_component_members.

Suggested labels: product: pacquet

Suggested reviewers: qodo-code-review

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/napi-resolver-and-version

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

Fix NAPI resolveDependency to support non-npm specifiers via DefaultResolver chain

🐞 Bug fix 🧪 Tests ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Route NAPI resolveDependency through the full DefaultResolver protocol chain.
• Support git, tarball URL claiming, local paths, file/link/workspace, runtimes, and named
 registries.
• Add offline unit tests for file:/link: manifests and unclaimed-spec error behavior.
Diagram

graph TD
A["resolveDependency (napi)"] --> B["DefaultResolver"] --> C["NpmResolver"] --> D["GitResolver"] --> E["TarballResolver (no ctx)"] --> F["Local resolvers"] --> G["Runtime resolvers"] --> H["NamedRegistryResolver"]
subgraph Legend
  direction LR
  _mod["Module"] ~~~ _svc["Resolver"]
end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Extract a shared 'single-resolve' chain builder
  • ➕ Avoids drift between install resolver ordering and NAPI resolver ordering
  • ➕ Centralizes deviations (e.g., tarball no-fetch-context, omit pnpmfile resolvers)
  • ➖ Requires additional refactor/abstractions across crates
  • ➖ May complicate dependency boundaries for the napi crate
2. Implement minimal non-npm handling with targeted resolvers only
  • ➕ Smaller dependency surface in the napi crate
  • ➕ Less initialization and fewer moving parts
  • ➖ Easy to miss protocols/edge cases that install already supports
  • ➖ Harder to maintain consistent behavior and error semantics with install

Recommendation: The chosen approach (mirroring the install path's DefaultResolver chain) is the most robust way to ensure protocol coverage and consistent claiming semantics across pacquet entrypoints. If this pattern is expected to evolve, consider a follow-up refactor to share a single chain-construction helper to reduce ordering/behavior drift; otherwise, the current explicit wiring (with documented deviations) is a pragmatic fix.

Files changed (3) +258 / -26

Bug fix (1) +157 / -26
resolve.rsReplace standalone NpmResolver with full DefaultResolver chain in NAPI resolve +157/-26

Replace standalone NpmResolver with full DefaultResolver chain in NAPI resolve

• Updates module docs and implementation to mirror the install resolver chain so non-npm specifiers (git, tarball URLs, local schemes/paths, runtimes, named registries) are claimed and handled. Introduces shared npm resolver wiring via an Arc adapter, configures retry/offline behavior, and changes unclaimed-spec behavior to surface DefaultResolver's SPEC_NOT_SUPPORTED diagnostic.

pacquet/crates/napi/src/resolve.rs

Tests (1) +94 / -0
tests.rsAdd offline unit tests for file/link local directory resolution and unclaimed specs +94/-0

Add offline unit tests for file/link local directory resolution and unclaimed specs

• Adds offline tests that create local package directories and verify 'file:' and 'link:' specifiers return manifests and resolve via local-filesystem. Adds a test ensuring an unclaimed spec errors with the new chain-level message rather than the previous npm-only error string.

pacquet/crates/napi/src/resolve/tests.rs

Other (1) +7 / -0
Cargo.tomlAdd resolver/runtime dependencies needed for DefaultResolver chain +7/-0

Add resolver/runtime dependencies needed for DefaultResolver chain

• Extends the napi crate dependencies to include the default resolver and additional protocol/runtime resolvers (git, tarball, local, node/deno/bun, named registry support). This enables building the same multi-protocol resolver chain used by install.

pacquet/crates/napi/Cargo.toml

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (7) 📘 Rule violations (0) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 51 rules

Grey Divider


Action required

1. Bun/Deno offline behavior diverges ✓ Resolved 📘 Rule violation ⌂ Architecture
Description
Pacquet now fails fast for bun@runtime: and deno@runtime: when offline is enabled, emitting
new user-visible errors. The corresponding pnpm TypeScript runtime resolvers do not implement an
equivalent offline guard/error, creating pnpm↔pacquet behavior drift.
Code

pacquet/crates/napi/src/resolve.rs[R188-191]

+    let mut deno_resolver = DenoResolver::new(Arc::clone(&http_client), Arc::clone(&npm_resolver));
+    deno_resolver.offline = config.offline;
+    let mut bun_resolver = BunResolver::new(Arc::clone(&http_client), Arc::clone(&npm_resolver));
+    bun_resolver.offline = config.offline;
Evidence
Pacquet explicitly wires config.offline into the Bun/Deno runtime resolvers, and those resolvers
now throw dedicated offline errors. The pnpm TypeScript implementations accept an offline flag in
the runtime-resolver context but do not check it or throw equivalent NO_OFFLINE_*_RESOLUTION
errors, so the same offline input yields different observable behavior.

Rule 713428: Keep pnpm TypeScript and pacquet Rust user-visible behavior changes in sync
pacquet/crates/napi/src/resolve.rs[186-191]
pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[22-28]
pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[86-88]
pacquet/crates/engine-runtime-deno-resolver/src/deno_resolver.rs[24-30]
pacquet/crates/engine-runtime-deno-resolver/src/deno_resolver.rs[92-94]
pnpm11/engine/runtime/bun-resolver/src/index.ts[24-52]
pnpm11/engine/runtime/deno-resolver/src/index.ts[34-62]

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

## Issue description
Pacquet introduces new offline fail-fast behavior (and new user-visible error codes/messages) for Bun/Deno runtime resolution, but pnpm TypeScript does not have the corresponding behavior.

## Issue Context
This PR sets `deno_resolver.offline` / `bun_resolver.offline` from `config.offline` and the runtime resolvers now return `Offline * resolution is not supported`. To keep pnpm/pacquet user-visible behavior in sync, either pnpm must implement the same offline contract (same codes/messages), or pacquet must avoid introducing a divergence.

## Fix Focus Areas
- pacquet/crates/napi/src/resolve.rs[186-191]
- pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[22-28]
- pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[46-50]
- pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[86-88]
- pacquet/crates/engine-runtime-deno-resolver/src/deno_resolver.rs[24-30]
- pacquet/crates/engine-runtime-deno-resolver/src/deno_resolver.rs[52-56]
- pacquet/crates/engine-runtime-deno-resolver/src/deno_resolver.rs[92-94]
- pnpm11/engine/runtime/bun-resolver/src/index.ts[24-52]
- pnpm11/engine/runtime/deno-resolver/src/index.ts[34-62]

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


2. Bit cross-linking added ✓ Resolved 📘 Rule violation ⌂ Architecture
Description
Pacquet now performs additional install-time cross-linking for Bit “root components” based on
installConfig.hoistingLimits: "workspaces", creating symlinks between member slots. This is a new
user-visible install/linking behavior in pacquet that appears pnpm-specific and must either be
implemented equivalently in pnpm TypeScript or explicitly called out as an intentional divergence to
avoid pnpm/pacquet behavior drift.
Code

pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs[R1735-1755]

+            // Bit "root components": make each root's injected members
+            // mutually reachable. Gated on
+            // `installConfig.hoistingLimits: "workspaces"`, so it is a
+            // no-op for every non-Bit install. See
+            // [`link_root_component_members`].
+            let root_component_importers: std::collections::HashSet<String> = importer_manifests
+                .iter()
+                .filter(|(_, manifest)| {
+                    manifest.install_config_hoisting_limits()
+                        == Some(crate::HOISTING_LIMITS_WORKSPACES)
+                })
+                .map(|(id, _)| id.clone())
+                .collect();
+            link_root_component_members(
+                &layout,
+                &built_lockfile.importers,
+                &root_component_importers,
+                &dependency_groups,
+                &skipped,
+            )
+            .map_err(InstallWithFreshLockfileError::LinkRootComponentMembers)?;
Evidence
The diff adds a new install-time step that detects importers whose manifests declare
installConfig.hoistingLimits: "workspaces" and then calls link_root_component_members, which
symlinks each injected member into every other member’s virtual-store slot. This is a user-visible
change to pacquet’s install/linking behavior that must be kept in sync with pnpm TypeScript or
explicitly documented as a known divergence per the checklist.

Rule 713428: Keep pnpm TypeScript and pacquet Rust user-visible behavior changes in sync
Rule 713429: Pacquet must not introduce new user-visible behavior beyond pnpm
pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs[1735-1755]
pacquet/crates/package-manager/src/install_frozen_lockfile.rs[1032-1056]
pacquet/crates/package-manager/src/link_root_component_members.rs[20-195]
pacquet/crates/package-manifest/src/lib.rs[266-284]

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

## Issue description
Pacquet’s install path now performs Bit root-component member cross-linking (extra symlinks) gated by `installConfig.hoistingLimits: "workspaces"`, introducing a new user-visible behavior beyond pnpm unless pnpm has an equivalent implementation.

## Issue Context
This behavior is invoked from both fresh-lockfile and frozen-lockfile install flows and is implemented by the new `link_root_component_members` module. The compliance requirement is to keep pnpm TypeScript and pacquet Rust user-visible behavior in sync, and to avoid introducing pacquet-only behaviors without an explicit alignment plan.

## Fix Focus Areas
- pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs[1735-1755]
- pacquet/crates/package-manager/src/install_frozen_lockfile.rs[1032-1056]
- pacquet/crates/package-manager/src/link_root_component_members.rs[13-195]
- pacquet/crates/package-manifest/src/lib.rs[266-284]

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


3. Offline option bypassed 🐞 Bug ⛨ Security
Description
resolveDependency accepts offline: true but the added git/tarball/deno/bun resolvers can still
perform network access because they are not gated by config.offline and their implementations
don’t consult ResolveOptions for offline behavior. This can trigger unexpected outbound
requests/timeouts in offline CI/air-gapped environments and breaks the unit-test assumption that
offline: true prevents any network escape.
Code

pacquet/crates/napi/src/resolve.rs[R169-237]

+    let git_resolver = GitResolver::new(
+        Arc::new(RealGitProbe::new(Arc::clone(&http_client))),
+        Arc::new(RealGitRunner::new()),
+    );
+
+    // No fetch context on the single-resolve path: there's no install
+    // store to extract into, so an `http(s)` tarball is claimed with its
+    // normalized URL but no bundled manifest / integrity (see the module
+    // docs). The install path wires the full [`TarballFetchContext`].
+    let tarball_resolver =
+        TarballResolver { http_client: Arc::clone(&http_client), fetch_context: None };
+
+    // `preserveAbsolutePaths` isn't exposed by pacquet's `Config` yet, so
+    // the local-resolver context defaults to `false` here — same as the
+    // install path.
+    let local_ctx = LocalResolverContext { preserve_absolute_paths: false };
+    let local_scheme_resolver = LocalSchemeResolver::new(local_ctx);
+    let local_path_resolver = LocalPathResolver::new(local_ctx);
+
+    let mut node_resolver = NodeResolver::new(Arc::clone(&http_client));
+    node_resolver.offline = config.offline;
+    let deno_resolver = DenoResolver::new(Arc::clone(&http_client), Arc::clone(&npm_resolver));
+    let bun_resolver = BunResolver::new(Arc::clone(&http_client), Arc::clone(&npm_resolver));
+
+    // User-supplied named-registry aliases from
+    // `pnpm-workspace.yaml#namedRegistries`, merged with pacquet's
+    // built-ins (today: `gh:` → GitHub Packages). A malformed URL here
+    // fails fast with `ERR_PNPM_INVALID_NAMED_REGISTRY_URL`, matching the
+    // install path.
+    let user_named_registries: HashMap<String, String> =
+        config.named_registries.iter().map(|(name, url)| (name.clone(), url.clone())).collect();
+    let merged_named_registries =
+        merge_named_registries(&user_named_registries).map_err(|error| to_napi_error(&error))?;
+    let named_registry_aliases: HashSet<String> = merged_named_registries.keys().cloned().collect();
+    let named_registry_resolver = NamedRegistryResolver {
+        named_registries: merged_named_registries,
+        registry_names: named_registry_aliases,
+        http_client: Arc::clone(&http_client),
+        auth_headers: Arc::clone(&config.auth_headers),
+        meta_cache: shared_in_memory_cache(),
+        fetch_locker: shared_packument_fetch_locker(),
+        picked_manifest_cache: shared_picked_manifest_cache(),
+        cache_dir: Some(config.cache_dir.clone()),
+        offline: config.offline,
+        prefer_offline: config.prefer_offline,
+        ignore_missing_time_field: config.minimum_release_age_ignore_missing_time,
+        full_metadata,
+        filter_metadata: full_metadata,
+        retry_opts,
    };

+    // Chain order mirrors the install path
+    // (`install_with_fresh_lockfile.rs`): npm → git → tarball →
+    // localScheme → node → deno → bun → namedRegistry → localPath. The
+    // local-resolver split (scheme before the runtimes, path last) lets a
+    // `<alias>:@scope/pkg` named-registry specifier reach the
+    // named-registry resolver instead of being claimed by the path-shape
+    // detector on the strength of its embedded `/`.
+    let chain: Vec<Box<dyn Resolver>> = vec![
+        Box::new(ArcResolver(Arc::clone(&npm_resolver))),
+        Box::new(git_resolver),
+        Box::new(tarball_resolver),
+        Box::new(local_scheme_resolver),
+        Box::new(node_resolver),
+        Box::new(deno_resolver),
+        Box::new(bun_resolver),
+        Box::new(named_registry_resolver),
+        Box::new(local_path_resolver),
+    ];
Evidence
The NAPI chain constructs GitResolver, TarballResolver(fetch_context: None), DenoResolver, and
BunResolver without any offline gating, while those resolver implementations perform HTTP requests
and/or run git regardless of offline settings.

pacquet/crates/napi/src/resolve.rs[137-239]
pacquet/crates/resolving-tarball-resolver/src/tarball_resolver.rs[83-159]
pacquet/crates/resolving-git-resolver/src/git_resolver.rs[58-71]
pacquet/crates/resolving-git-resolver/src/runners.rs[38-71]
pacquet/crates/engine-runtime-deno-resolver/src/deno_resolver.rs[74-126]
pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[68-119]

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

## Issue description
`resolveDependency` exposes an `offline` option, but the new resolver chain still performs outbound network and git subprocess operations for non-npm specifiers (git URLs, http(s) tarball URLs, deno/bun runtime specs). This violates the implied contract that `offline: true` prevents any network access and can cause unexpected SSRF-like outbound calls and flaky failures in offline environments.

## Issue Context
- In `run_resolve_blocking`, `config.offline` is applied to `NpmResolver`, `NamedRegistryResolver`, and `NodeResolver` only.
- `TarballResolver` (with `fetch_context: None`) still issues an HTTP `HEAD`.
- `GitResolver` probes via HTTP and runs `git ls-remote`.
- `DenoResolver`/`BunResolver` fetch runtime assets over HTTP and do not check offline.

## Fix Focus Areas
- pacquet/crates/napi/src/resolve.rs[137-238]
- pacquet/crates/resolving-tarball-resolver/src/tarball_resolver.rs[83-159]
- pacquet/crates/resolving-git-resolver/src/git_resolver.rs[58-71]
- pacquet/crates/resolving-git-resolver/src/runners.rs[38-71]
- pacquet/crates/engine-runtime-deno-resolver/src/deno_resolver.rs[74-126]
- pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[68-119]

## What to change
1. Ensure `offline: true` prevents *all* outbound network/subprocess activity from `resolveDependency`.
  - Option A (localized to NAPI): pre-parse the wanted dependency in `run_resolve_blocking` and if `config.offline` is true and the specifier is one of {git, http(s) tarball, deno@runtime, bun@runtime}, return a structured offline error before invoking the chain.
  - Option B (more correct / reusable): add an `offline` flag (or a richer policy) into `ResolveOptions`, and update git/tarball/deno/bun resolvers to honor it.
  - Option C: extend the resolver structs to carry an `offline` boolean and early-error/decline when offline.
2. Add tests in `pacquet/crates/napi/src/resolve/tests.rs` asserting that with `offline: true`, git/tarball/runtime specs fail without making requests (or at least fail fast deterministically).

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



Remediation recommended

4. Unbounded manifest read 🐞 Bug ⛨ Security ⭐ New
Description
link_declared_siblings reads and JSON-parses each injected member’s package.json via
PackageManifest::from_path, which uses fs::read_to_string with no size limit. A repo-controlled
(injected) member can provide an extremely large package.json to cause install-time memory/CPU
exhaustion and slow or fail installs.
Code

pacquet/crates/package-manager/src/link_root_component_members.rs[R189-196]

+        let manifest_path = host.package_dir.join("package.json");
+        let manifest = PackageManifest::from_path(manifest_path.clone()).map_err(|source| {
+            LinkRootComponentMembersError::ReadManifest {
+                member: host.name.clone(),
+                path: manifest_path,
+                source,
+            }
+        })?;
Evidence
The new pass invokes PackageManifest::from_path per member; that function reads the entire file
into a String and then parses JSON, which is unbounded in size/time.

pacquet/crates/package-manager/src/link_root_component_members.rs[188-197]
pacquet/crates/package-manifest/src/lib.rs[122-127]

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 root-component sibling-linking pass reads each member’s `package.json` with `fs::read_to_string` (via `PackageManifest::from_path`), which has no size cap. A very large manifest can force high memory usage and expensive JSON parsing during install.

### Issue Context
This new pass is on the install path for Bit root components and runs once per injected member, so the cost scales with member count.

### Fix Focus Areas
- pacquet/crates/package-manager/src/link_root_component_members.rs[189-205]
- pacquet/crates/package-manifest/src/lib.rs[122-127]

### Suggested fix
- Add a bounded read for manifests in this path (e.g., open + `metadata.len()` guard + capped `read_to_end`), returning a structured error when exceeding a reasonable limit.
- Alternatively, introduce a `PackageManifest::from_path_with_limit(...)` helper and use it here.
- Consider parsing only the dependency maps needed for sibling detection rather than full-manifest parsing.

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


5. Runtime opts dropped 🐞 Bug ⛨ Security
Description
resolveDependency now enables deno@runtime: / bun@runtime: resolution, but the Deno/Bun
runtime resolvers delegate version selection to the shared npm resolver using
ResolveOptions::default(), dropping the caller’s ResolveOptions. This bypasses install-time
policy controls carried via ResolveOptions (e.g. minimumReleaseAge cutoff, trust policy,
package-version guard) and can lead to different/less constrained version picks for runtime
specifiers than the surrounding resolution context.
Code

pacquet/crates/napi/src/resolve.rs[R188-189]

+    let deno_resolver = DenoResolver::new(Arc::clone(&http_client), Arc::clone(&npm_resolver));
+    let bun_resolver = BunResolver::new(Arc::clone(&http_client), Arc::clone(&npm_resolver));
Evidence
The new NAPI chain constructs the Deno/Bun runtime resolvers, making runtime specs reachable from
resolveDependency. Those resolvers’ version-selection path calls into the shared npm resolver with
ResolveOptions::default(), which drops policy/context fields that the install path explicitly sets
on ResolveOptions (e.g. published_by, trust_policy, package_version_guard).

pacquet/crates/napi/src/resolve.rs[186-189]
pacquet/crates/engine-runtime-deno-resolver/src/deno_resolver.rs[74-95]
pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[68-89]
pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs[1159-1177]

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

## Issue description
`DenoResolver` and `BunResolver` call the shared npm resolver with `ResolveOptions::default()` during `resolve()` (runtime spec resolution), which drops the caller’s `ResolveOptions` and therefore drops policy/context fields (e.g. `published_by`, `trust_policy`, `package_version_guard`, `dry_run`, preferred versions).

Now that `resolveDependency` wires these runtime resolvers into its resolver chain, runtime specs can be resolved under weaker/different constraints than the rest of the system.

## Issue Context
- The NAPI resolve path now constructs `DenoResolver`/`BunResolver` (new change).
- The runtime resolvers internally call `npm_resolver.resolve(..., &ResolveOptions::default())` for version selection.
- The install path populates security/policy fields in `ResolveOptions`, demonstrating these fields are expected to flow through normal resolution.

## Fix Focus Areas
- pacquet/crates/napi/src/resolve.rs[186-189]
- pacquet/crates/engine-runtime-deno-resolver/src/deno_resolver.rs[74-95]
- pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[68-89]
- pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs[1159-1177]

## Suggested fix
1. In `DenoResolver::resolve_impl` and `BunResolver::resolve_impl`, accept/use the incoming `opts: &ResolveOptions` (remove the `_opts` ignore) and pass it through to `self.npm_resolver.resolve(...)` instead of `ResolveOptions::default()`.
2. If some fields truly must be overridden for runtime version selection, clone `opts` and only adjust the minimal necessary fields (document why), rather than defaulting everything.
3. Add/update unit tests ensuring runtime version selection respects at least `published_by` (minimumReleaseAge) and `package_version_guard` when those options are set in `ResolveOptions`.

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


6. Offline not enforced in latest 🐞 Bug ☼ Reliability
Description
BunResolver/DenoResolver now fail fast with an Offline error in resolve(), but
resolve_latest_impl() does not check self.offline and can still proceed into latest-version
picking, yielding inconsistent offline behavior across entrypoints. This can break offline flows
that call resolve_latest (e.g., update/outdated-style paths) by returning a different error shape
and potentially doing extra work before failing.
Code

pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[R86-88]

+        if self.offline {
+            return Err(Box::new(BunResolverError::Offline) as ResolveError);
+        }
Evidence
The new offline flag is introduced and enforced in resolve_impl, but resolve_latest_impl for
both bun and deno performs version selection via npm_resolver.resolve(...) without an offline
guard, creating an inconsistency between the two entrypoints.

pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[43-56]
pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[77-101]
pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[133-158]
pacquet/crates/engine-runtime-deno-resolver/src/deno_resolver.rs[49-62]
pacquet/crates/engine-runtime-deno-resolver/src/deno_resolver.rs[84-107]
pacquet/crates/engine-runtime-deno-resolver/src/deno_resolver.rs[140-165]

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

### Issue description
`BunResolver` and `DenoResolver` added an `offline` flag and an early return in `resolve_impl`, but `resolve_latest_impl` does not check `self.offline`. This makes offline behavior inconsistent between `resolve()` and `resolve_latest()`.

### Issue Context
The install and napi call-sites now set `deno_resolver.offline = config.offline` / `bun_resolver.offline = config.offline`, so the expectation is that *all* resolver entrypoints respect that flag consistently.

### Fix Focus Areas
- pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[133-178]
- pacquet/crates/engine-runtime-deno-resolver/src/deno_resolver.rs[140-185]

### Suggested fix
Add the same `if self.offline { return Err(Box::new(...::Offline) as ResolveError); }` guard near the top of each `resolve_latest_impl` (after the `bare_runtime_spec` check), so offline behavior is consistent across both entrypoints.

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


View more (5)
7. Quadratic sibling symlinks ✓ Resolved 🐞 Bug ➹ Performance
Description
cross_link_members performs a nested loop over members and does a filesystem metadata check per
ordered pair, leading to O(m²) syscalls and symlink attempts per root component. This runs directly
on the install path and can noticeably slow installs with many injected members.
Code

pacquet/crates/package-manager/src/link_root_component_members.rs[R169-193]

+    for host in members {
+        for sibling in members {
+            // A member's own package directory already exists in its
+            // slot; never link a member into itself.
+            if host.name == sibling.name {
+                continue;
+            }
+            let symlink_path = host.slot_modules_dir.join(&sibling.name);
+            // Purely additive. `symlink_metadata` doesn't follow the
+            // final component, so an existing symlink — dangling or not
+            // — counts as present and is left untouched; only a genuinely
+            // missing sibling is filled in. This never clobbers a real
+            // dependency a member resolves for itself.
+            if std::fs::symlink_metadata(&symlink_path).is_ok() {
+                continue;
+            }
+            symlink_package(&sibling.package_dir, &symlink_path).map_err(|source| {
+                LinkRootComponentMembersError::Symlink {
+                    member: host.name.clone(),
+                    sibling: sibling.name.clone(),
+                    source,
+                }
+            })?;
+        }
+    }
Evidence
The implementation is explicitly a nested loop with a filesystem check per pair, and it is invoked
from the install flows, so the extra work lands on the install hot path.

pacquet/crates/package-manager/src/link_root_component_members.rs[167-193]
pacquet/crates/package-manager/src/install_frozen_lockfile.rs[1032-1056]
pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs[1735-1755]

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

### Issue description
`cross_link_members` does an O(m²) double loop and calls `symlink_metadata` for every (host, sibling) pair. For large member sets this becomes a significant install-time cost.

### Issue Context
This function is called during both frozen and fresh installs.

### Fix Focus Areas
- pacquet/crates/package-manager/src/link_root_component_members.rs[167-195]
- pacquet/crates/package-manager/src/install_frozen_lockfile.rs[1032-1057]
- pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs[1735-1756]

### Suggested change
- For each `host`, replace per-sibling `symlink_metadata` calls with a single `read_dir(host.slot_modules_dir)` (when it exists) to collect existing entry names into a `HashSet`, then only create symlinks for missing siblings.
- Keep the current “don’t overwrite real deps” behavior by treating existing non-symlink entries as present.
- (Optional) If member counts can be large, consider linking only the subset of siblings actually referenced by each member rather than full clique linking.

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


8. Generic gate triggers linking ✓ Resolved 🐞 Bug ⚙ Maintainability
Description
The install paths treat any importer with installConfig.hoistingLimits == "workspaces" as a Bit
root component and run the cross-linker, but this field is documented as a general pnpm per-package
setting. Projects using hoistingLimits for non-Bit reasons may unexpectedly get extra virtual-store
cross-links between file: deps, changing module reachability semantics.
Code

pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs[R1740-1747]

+            let root_component_importers: std::collections::HashSet<String> = importer_manifests
+                .iter()
+                .filter(|(_, manifest)| {
+                    manifest.install_config_hoisting_limits()
+                        == Some(crate::HOISTING_LIMITS_WORKSPACES)
+                })
+                .map(|(id, _)| id.clone())
+                .collect();
Evidence
The new gate is based solely on installConfig.hoistingLimits == "workspaces", while the manifest
API documents this as a general pnpm per-package setting (not Bit-specific). This means the trigger
condition is broader than the feature’s stated Bit-only intent.

pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs[1735-1755]
pacquet/crates/package-manager/src/install_frozen_lockfile.rs[1032-1056]
pacquet/crates/package-manifest/src/lib.rs[266-277]
pacquet/crates/package-manager/src/link_root_component_members.rs[13-18]

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

### Issue description
Root-component cross-linking is gated only by `installConfig.hoistingLimits: "workspaces"`, which is a general pnpm manifest knob. This makes Bit-specific behavior potentially trigger in non-Bit installs.

### Issue Context
The new behavior is invoked from both fresh and frozen install flows and uses `PackageManifest::install_config_hoisting_limits()`.

### Fix Focus Areas
- pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs[1740-1755]
- pacquet/crates/package-manager/src/install_frozen_lockfile.rs[1039-1056]
- pacquet/crates/package-manager/src/link_root_component_members.rs[53-75]
- pacquet/crates/package-manager/src/link_root_component_members.rs[91-135]

### Suggested change
- Add an additional Bit-specific predicate before adding an importer to `root_component_importers` (e.g., importer id/path starts with `node_modules/.bit_roots/`, or another Bit-only marker).
- Optionally further narrow “members” to the Bit-injected shape by requiring `spec.specifier` to be `workspace:*` (or `workspace:`) in `collect_injected_members`, so generic `file:` deps don’t get cross-linked just because hoistingLimits is set.

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


9. Dangling links never repaired 🐞 Bug ☼ Reliability
Description
The cross-link pass skips any existing path (including a dangling or stale symlink) and will not
recreate it, which can leave root-component member reachability broken after partial
cleanup/reinstall. This undermines the feature’s goal of ensuring members are mutually reachable.
Code

pacquet/crates/package-manager/src/link_root_component_members.rs[R176-184]

+            let symlink_path = host.slot_modules_dir.join(&sibling.name);
+            // Purely additive. `symlink_metadata` doesn't follow the
+            // final component, so an existing symlink — dangling or not
+            // — counts as present and is left untouched; only a genuinely
+            // missing sibling is filled in. This never clobbers a real
+            // dependency a member resolves for itself.
+            if std::fs::symlink_metadata(&symlink_path).is_ok() {
+                continue;
+            }
Evidence
The code comment and condition explicitly state that dangling symlinks are treated as present and
left untouched, so stale/broken links won’t be fixed on subsequent runs.

pacquet/crates/package-manager/src/link_root_component_members.rs[176-184]
pacquet/crates/package-manager/src/link_root_component_members.rs[185-193]
pacquet/crates/package-manager/src/symlink_package.rs[28-63]
pacquet/crates/fs/src/symlink_dir.rs[194-206]

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 code intentionally treats any existing symlink as “present” even if it’s dangling or points elsewhere, so stale cross-links are never repaired.

### Issue Context
`symlink_package` (via `force_symlink_dir`) can safely update stale symlinks, but the current early-continue prevents reaching it.

### Fix Focus Areas
- pacquet/crates/package-manager/src/link_root_component_members.rs[176-192]

### Suggested change
- Replace the `symlink_metadata().is_ok()` skip with logic that:
 - If the path does not exist: create the symlink.
 - If it exists and `file_type().is_symlink()`: call `symlink_package(sibling.package_dir, symlink_path)` to repair stale/dangling symlinks (it’s already idempotent for up-to-date links).
 - If it exists and is not a symlink (dir/file): keep current additive behavior and skip to avoid clobbering real deps.

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


10. Duplicate ArcResolver implementation ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
ArcResolver is reimplemented in pacquet-napi even though an identical helper already exists in
pacquet-package-manager, increasing maintenance burden and drift risk between resolver-chain call
paths.
Code

pacquet/crates/napi/src/resolve.rs[R287-314]

+/// [`Resolver`] adapter that delegates to a shared `Arc<dyn Resolver>`.
+///
+/// [`DefaultResolver::new`] takes `Vec<Box<dyn Resolver>>` — one owner
+/// per chain slot. The npm resolver, however, is also handed to the deno
+/// / bun runtime resolvers (which reuse it for version picking) via
+/// `Arc<dyn Resolver>`, so the same instance owns its metadata cache
+/// across both call paths. This wrapper bridges the two, forwarding
+/// every call to the shared backing resolver. Mirrors the identically
+/// named helper in `install_with_fresh_lockfile.rs`.
+struct ArcResolver(Arc<dyn Resolver>);
+
+impl Resolver for ArcResolver {
+    fn resolve<'a>(
+        &'a self,
+        wanted_dependency: &'a WantedDependency,
+        opts: &'a ResolveOptions,
+    ) -> ResolveFuture<'a> {
+        self.0.resolve(wanted_dependency, opts)
+    }
+
+    fn resolve_latest<'a>(
+        &'a self,
+        query: &'a LatestQuery,
+        opts: &'a ResolveOptions,
+    ) -> ResolveLatestFuture<'a> {
+        self.0.resolve_latest(query, opts)
+    }
+}
Evidence
Rule 713439 requires avoiding duplicated implementations when an equivalent utility already exists.
The PR adds a new ArcResolver in pacquet-napi, while an existing ArcResolver with the same
purpose and nearly identical implementation already exists in pacquet-package-manager, indicating
a reimplementation instead of reuse/extraction.

Rule 713439: Avoid reimplementing existing functionality; extract and reuse shared modules
pacquet/crates/napi/src/resolve.rs[287-314]
pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs[2227-2254]

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

## Issue description
`pacquet/crates/napi/src/resolve.rs` adds an `ArcResolver` adapter that is effectively duplicated from `pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs`. This creates avoidable duplication and makes it easy for the two versions to drift.

## Issue Context
Both locations adapt `Arc<dyn Resolver>` into a `Box<dyn Resolver>` chain slot for `DefaultResolver::new`, and both are described as the same helper.

## Fix Focus Areas
- pacquet/crates/napi/src/resolve.rs[287-314]
- pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs[2227-2254]

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


11. Local path reads arbitrary files 🐞 Bug ⛨ Security
Description
The new local-scheme/local-path resolvers read <path>/package.json from caller-controlled
filesystem paths, including absolute paths and relative paths that can escape options.dir via
... If resolveDependency is reachable with untrusted specifiers (e.g., in a service/plugin
scenario), this enables local filesystem probing and disclosure of any readable package.json
content.
Code

pacquet/crates/napi/src/resolve.rs[R181-187]

+    // `preserveAbsolutePaths` isn't exposed by pacquet's `Config` yet, so
+    // the local-resolver context defaults to `false` here — same as the
+    // install path.
+    let local_ctx = LocalResolverContext { preserve_absolute_paths: false };
+    let local_scheme_resolver = LocalSchemeResolver::new(local_ctx);
+    let local_path_resolver = LocalPathResolver::new(local_ctx);
+
Evidence
Local spec parsing explicitly accepts absolute paths and resolves arbitrary relative specs; the
resolver then reads package.json from that resolved directory, which makes filesystem reads
dependent on the user-provided specifier.

pacquet/crates/napi/src/resolve.rs[181-237]
pacquet/crates/resolving-local-resolver/src/parse_bare_specifier.rs[225-234]
pacquet/crates/resolving-local-resolver/src/local_resolver.rs[234-248]
pacquet/crates/package-manifest/src/lib.rs[578-586]

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

## Issue description
`resolveDependency` now accepts and resolves `file:`/`link:`/bare-path specifiers and reads `package.json` from the resolved directory. Because absolute paths are accepted and relative paths are lexically normalized, callers can point resolution outside `options.dir` (e.g. `file:/etc` or `file:../../..`). This expands the NAPI surface from registry-only to arbitrary local filesystem reads (limited to `package.json`), which is risky if specifiers are attacker-controlled.

## Issue Context
- `LocalSchemeResolver`/`LocalPathResolver` are added to the chain.
- Local parsing accepts absolute specs and resolves relative specs against `project_dir` without enforcing confinement.
- The directory branch reads `safe_read_package_json_from_dir(fetch_spec)` where `fetch_spec` is the resolved path.

## Fix Focus Areas
- pacquet/crates/napi/src/resolve.rs[181-237]
- pacquet/crates/resolving-local-resolver/src/parse_bare_specifier.rs[225-234]
- pacquet/crates/resolving-local-resolver/src/local_resolver.rs[234-248]
- pacquet/crates/package-manifest/src/lib.rs[578-586]

## What to change
1. Decide and enforce an explicit trust boundary for NAPI `resolveDependency` local paths:
  - If local resolution is intended only within the project, reject absolute paths and reject any resolved path that is not under `options.dir` (after canonicalization / symlink-aware checks as appropriate for your threat model).
  - If local resolution is intended but should be opt-in, add an explicit option (e.g. `allow_local_paths` / `allow_absolute_paths`) defaulting to `false` for NAPI callers.
2. Add tests demonstrating that `file:/abs/path` and `file:../escape` are rejected (or require opt-in) under the chosen policy.
3. Document the behavior in the module docs / TypeScript types so consumers understand the security implications.

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



Informational

12. Skip single-member roots 🐞 Bug ➹ Performance ⭐ New
Description
link_declared_siblings builds its lookup table and proceeds to read/parse member manifests even
when members.len() < 2, where no sibling links can possibly be created. Adding an early return
avoids unnecessary filesystem I/O and JSON parsing in this degenerate case.
Code

pacquet/crates/package-manager/src/link_root_component_members.rs[R181-187]

+fn link_declared_siblings(members: &[Member]) -> Result<(), LinkRootComponentMembersError> {
+    // Within one root importer each member name is unique (one peer
+    // context per root), so a declared name identifies at most one
+    // sibling slot.
+    let by_name: HashMap<&str, &Member> =
+        members.iter().map(|member| (member.name.as_str(), member)).collect();
+
Evidence
There is no early return guarding the function work for members.len() < 2, so the function still
sets up for per-member processing despite having no possible sibling pairs.

pacquet/crates/package-manager/src/link_root_component_members.rs[171-187]

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

### Issue description
When there are 0 or 1 injected members in a root component, sibling linking cannot create any edges, but the function still proceeds toward per-member manifest reads.

### Issue Context
This is an install-path optimization; it reduces unnecessary local I/O and JSON parsing for degenerate roots.

### Fix Focus Areas
- pacquet/crates/package-manager/src/link_root_component_members.rs[171-187]

### Suggested fix
Add at the top of `link_declared_siblings`:
- `if members.len() < 2 { return Ok(()); }`
This avoids building `by_name` and avoids entering the per-member work in cases that cannot produce links.

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


Grey Divider

Qodo Logo

Comment on lines +169 to +237
let git_resolver = GitResolver::new(
Arc::new(RealGitProbe::new(Arc::clone(&http_client))),
Arc::new(RealGitRunner::new()),
);

// No fetch context on the single-resolve path: there's no install
// store to extract into, so an `http(s)` tarball is claimed with its
// normalized URL but no bundled manifest / integrity (see the module
// docs). The install path wires the full [`TarballFetchContext`].
let tarball_resolver =
TarballResolver { http_client: Arc::clone(&http_client), fetch_context: None };

// `preserveAbsolutePaths` isn't exposed by pacquet's `Config` yet, so
// the local-resolver context defaults to `false` here — same as the
// install path.
let local_ctx = LocalResolverContext { preserve_absolute_paths: false };
let local_scheme_resolver = LocalSchemeResolver::new(local_ctx);
let local_path_resolver = LocalPathResolver::new(local_ctx);

let mut node_resolver = NodeResolver::new(Arc::clone(&http_client));
node_resolver.offline = config.offline;
let deno_resolver = DenoResolver::new(Arc::clone(&http_client), Arc::clone(&npm_resolver));
let bun_resolver = BunResolver::new(Arc::clone(&http_client), Arc::clone(&npm_resolver));

// User-supplied named-registry aliases from
// `pnpm-workspace.yaml#namedRegistries`, merged with pacquet's
// built-ins (today: `gh:` → GitHub Packages). A malformed URL here
// fails fast with `ERR_PNPM_INVALID_NAMED_REGISTRY_URL`, matching the
// install path.
let user_named_registries: HashMap<String, String> =
config.named_registries.iter().map(|(name, url)| (name.clone(), url.clone())).collect();
let merged_named_registries =
merge_named_registries(&user_named_registries).map_err(|error| to_napi_error(&error))?;
let named_registry_aliases: HashSet<String> = merged_named_registries.keys().cloned().collect();
let named_registry_resolver = NamedRegistryResolver {
named_registries: merged_named_registries,
registry_names: named_registry_aliases,
http_client: Arc::clone(&http_client),
auth_headers: Arc::clone(&config.auth_headers),
meta_cache: shared_in_memory_cache(),
fetch_locker: shared_packument_fetch_locker(),
picked_manifest_cache: shared_picked_manifest_cache(),
cache_dir: Some(config.cache_dir.clone()),
offline: config.offline,
prefer_offline: config.prefer_offline,
ignore_missing_time_field: config.minimum_release_age_ignore_missing_time,
full_metadata,
filter_metadata: full_metadata,
retry_opts,
};

// Chain order mirrors the install path
// (`install_with_fresh_lockfile.rs`): npm → git → tarball →
// localScheme → node → deno → bun → namedRegistry → localPath. The
// local-resolver split (scheme before the runtimes, path last) lets a
// `<alias>:@scope/pkg` named-registry specifier reach the
// named-registry resolver instead of being claimed by the path-shape
// detector on the strength of its embedded `/`.
let chain: Vec<Box<dyn Resolver>> = vec![
Box::new(ArcResolver(Arc::clone(&npm_resolver))),
Box::new(git_resolver),
Box::new(tarball_resolver),
Box::new(local_scheme_resolver),
Box::new(node_resolver),
Box::new(deno_resolver),
Box::new(bun_resolver),
Box::new(named_registry_resolver),
Box::new(local_path_resolver),
];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. Offline option bypassed 🐞 Bug ⛨ Security

resolveDependency accepts offline: true but the added git/tarball/deno/bun resolvers can still
perform network access because they are not gated by config.offline and their implementations
don’t consult ResolveOptions for offline behavior. This can trigger unexpected outbound
requests/timeouts in offline CI/air-gapped environments and breaks the unit-test assumption that
offline: true prevents any network escape.
Agent Prompt
## Issue description
`resolveDependency` exposes an `offline` option, but the new resolver chain still performs outbound network and git subprocess operations for non-npm specifiers (git URLs, http(s) tarball URLs, deno/bun runtime specs). This violates the implied contract that `offline: true` prevents any network access and can cause unexpected SSRF-like outbound calls and flaky failures in offline environments.

## Issue Context
- In `run_resolve_blocking`, `config.offline` is applied to `NpmResolver`, `NamedRegistryResolver`, and `NodeResolver` only.
- `TarballResolver` (with `fetch_context: None`) still issues an HTTP `HEAD`.
- `GitResolver` probes via HTTP and runs `git ls-remote`.
- `DenoResolver`/`BunResolver` fetch runtime assets over HTTP and do not check offline.

## Fix Focus Areas
- pacquet/crates/napi/src/resolve.rs[137-238]
- pacquet/crates/resolving-tarball-resolver/src/tarball_resolver.rs[83-159]
- pacquet/crates/resolving-git-resolver/src/git_resolver.rs[58-71]
- pacquet/crates/resolving-git-resolver/src/runners.rs[38-71]
- pacquet/crates/engine-runtime-deno-resolver/src/deno_resolver.rs[74-126]
- pacquet/crates/engine-runtime-bun-resolver/src/bun_resolver.rs[68-119]

## What to change
1. Ensure `offline: true` prevents *all* outbound network/subprocess activity from `resolveDependency`.
   - Option A (localized to NAPI): pre-parse the wanted dependency in `run_resolve_blocking` and if `config.offline` is true and the specifier is one of {git, http(s) tarball, deno@runtime, bun@runtime}, return a structured offline error before invoking the chain.
   - Option B (more correct / reusable): add an `offline` flag (or a richer policy) into `ResolveOptions`, and update git/tarball/deno/bun resolvers to honor it.
   - Option C: extend the resolver structs to carry an `offline` boolean and early-error/decline when offline.
2. Add tests in `pacquet/crates/napi/src/resolve/tests.rs` asserting that with `offline: true`, git/tarball/runtime specs fail without making requests (or at least fail fast deterministically).

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

@github-actions

github-actions Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
tarball/download_dependency    1.05      4.5±0.42ms   967.9 KB/sec    1.00      4.3±0.11ms  1019.9 KB/sec

@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

🧹 Nitpick comments (1)
pacquet/crates/napi/src/resolve/tests.rs (1)

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

Missing pre-assertion log per style guide.

Both assert! calls (line 57 and lines 89-93) lack a log statement beforehand. Per the style guide, non-assert_eq! assertions should be preceded by an eprintln!/dbg! so failures are diagnosable.

Suggested fix
-    assert!(result.normalized_bare_specifier.is_some());
+    dbg!(&result.normalized_bare_specifier);
+    assert!(result.normalized_bare_specifier.is_some());
-    assert!(
+    eprintln!("resolve error: {}", error.reason);
+    assert!(
         error.reason.contains("isn't supported by any available resolver"),
         "unexpected error message: {}",
         error.reason,
     );

As per path instructions, pacquet/CODE_STYLE_GUIDE.md states: "Test logging guidance: log before non-assert_eq! assertions; use eprintln! for multi-line strings and dbg! for complex structures."

Also applies to: 89-93

🤖 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 `@pacquet/crates/napi/src/resolve/tests.rs` at line 57, The test assertions in
the resolve tests are missing the required pre-assertion logging for
non-`assert_eq!` checks. Update the affected `assert!` calls in the resolve test
module to emit an `eprintln!` or `dbg!` immediately before each assertion, using
`dbg!` for the structured result being inspected and `eprintln!` for any
multi-line diagnostic text. Keep the assertion logic in place, and apply the
same pattern to both the `normalized_bare_specifier` check and the other
`assert!` block noted in the review.

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 `@pacquet/crates/napi/src/resolve.rs`:
- Around line 188-191: The runtime resolvers are ignoring offline state, so
`resolve_impl` and the `DenoResolver`/`BunResolver` setup still allow network
fetches for GitHub release metadata. Thread `config.offline` (or the relevant
`ResolveOptions` offline/prefer-offline state) into the `DenoResolver` and
`BunResolver` paths in `resolve_impl`, and make their metadata fetch logic
short-circuit with the same offline error behavior used by the npm resolver when
offline is enabled.

---

Nitpick comments:
In `@pacquet/crates/napi/src/resolve/tests.rs`:
- Line 57: The test assertions in the resolve tests are missing the required
pre-assertion logging for non-`assert_eq!` checks. Update the affected `assert!`
calls in the resolve test module to emit an `eprintln!` or `dbg!` immediately
before each assertion, using `dbg!` for the structured result being inspected
and `eprintln!` for any multi-line diagnostic text. Keep the assertion logic in
place, and apply the same pattern to both the `normalized_bare_specifier` check
and the other `assert!` block noted in the review.
🪄 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: e76f9cae-b6e8-491e-9e70-48fe765a24ab

📥 Commits

Reviewing files that changed from the base of the PR and between 6fbbebf and 8f2d381.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !Cargo.lock
📒 Files selected for processing (3)
  • pacquet/crates/napi/Cargo.toml
  • pacquet/crates/napi/src/resolve.rs
  • pacquet/crates/napi/src/resolve/tests.rs

Comment thread pacquet/crates/napi/src/resolve.rs Resolved
@qodo-code-review

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

Copy link
Copy Markdown

PR Code Suggestions ✨

Latest suggestions up to 8b7739e

Warning

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

CategorySuggestion                                                                                                                                    Impact
Possible issue
Create scoped symlink parents

Create the parent directory of the symlink path before creating the symlink.

pacquet/crates/package-manager/src/link_root_component_members.rs [208-223]

 let symlink_path = host.slot_modules_dir.join(&sibling.name);
 // Additive. `symlink_metadata` doesn't follow the final
 // component, so an existing symlink — dangling or not —
 // counts as present and is left untouched; only a genuinely
 // missing declared sibling is filled in. This never clobbers
 // a dependency the member already resolves for itself.
 if std::fs::symlink_metadata(&symlink_path).is_ok() {
     continue;
 }
+if let Some(parent) = symlink_path.parent() {
+    std::fs::create_dir_all(parent).map_err(|source| {
+        LinkRootComponentMembersError::CreateSymlinkParent {
+            member: host.name.clone(),
+            sibling: sibling.name.clone(),
+            path: parent.to_path_buf(),
+            source,
+        }
+    })?;
+}
 symlink_package(&sibling.package_dir, &symlink_path).map_err(|source| {
     LinkRootComponentMembersError::Symlink {
         member: host.name.clone(),
         sibling: sibling.name.clone(),
         source,
     }
 })?;
  • Apply / Chat
Suggestion importance[1-10]: 9

__

Why: Failing to create the parent directory for a scoped package symlink will result in a runtime ENOENT error, causing the installation to abort.

High
General
Report parent creation failures

Add the CreateSymlinkParent error variant to LinkRootComponentMembersError.

pacquet/crates/package-manager/src/link_root_component_members.rs [243-252]

+/// A sibling symlink's parent directory could not be created.
+#[display("Failed to create parent directory {path:?} while linking root-component sibling {sibling:?} into member {member:?}: {source}")]
+#[diagnostic(code(pacquet_package_manager::root_component_symlink_parent_create_failed))]
+CreateSymlinkParent {
+    member: String,
+    sibling: String,
+    path: PathBuf,
+    #[error(source)]
+    source: std::io::Error,
+},
+
 /// A sibling-into-member symlink failed (e.g. permission denied,
 /// disk full, an existing non-symlink file squatting the path).
 #[display("Failed to link root-component sibling {sibling:?} into member {member:?}: {source}")]
 #[diagnostic(code(pacquet_package_manager::root_component_symlink_failed))]
 Symlink {
     member: String,
     sibling: String,
     #[error(source)]
     source: SymlinkPackageError,
 },
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: Adding the specific CreateSymlinkParent error variant provides better context for directory creation failures and is required if the previous suggestion is applied.

Medium
  • More

Previous suggestions

Suggestions up to commit 7c8fd4f
CategorySuggestion                                                                                                                                    Impact
Possible issue
Create scoped package parents

Add a step to create the parent directory of the symlink path before creating
the symlink to avoid errors with scoped packages.

pacquet/crates/package-manager/src/link_root_component_members.rs [176-191]

 let symlink_path = host.slot_modules_dir.join(&sibling.name);
 // Purely additive. `symlink_metadata` doesn't follow the
 // final component, so an existing symlink — dangling or not
 // — counts as present and is left untouched; only a genuinely
 // missing sibling is filled in. This never clobbers a real
 // dependency a member resolves for itself.
 if std::fs::symlink_metadata(&symlink_path).is_ok() {
     continue;
 }
+if let Some(parent) = symlink_path.parent() {
+    std::fs::create_dir_all(parent).map_err(|source| {
+        LinkRootComponentMembersError::CreateParentDir {
+            member: host.name.clone(),
+            sibling: sibling.name.clone(),
+            path: parent.to_path_buf(),
+            source,
+        }
+    })?;
+}
 symlink_package(&sibling.package_dir, &symlink_path).map_err(|source| {
     LinkRootComponentMembersError::Symlink {
         member: host.name.clone(),
         sibling: sibling.name.clone(),
         source,
     }
 })?;
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies that linking scoped packages could fail if the parent @scope directory does not exist, though the suggested error variant will need to be added to the enum.

Medium
Suggestions up to commit 5bbed3a
CategorySuggestion                                                                                                                                    Impact
Possible issue
Ensure scoped link parents

Create the parent directory of the symlink path before invoking symlink_package
to avoid errors with scoped packages.

pacquet/crates/package-manager/src/link_root_component_members.rs [176-191]

 let symlink_path = host.slot_modules_dir.join(&sibling.name);
 // Purely additive. `symlink_metadata` doesn't follow the
 // final component, so an existing symlink — dangling or not
 // — counts as present and is left untouched; only a genuinely
 // missing sibling is filled in. This never clobbers a real
 // dependency a member resolves for itself.
 if std::fs::symlink_metadata(&symlink_path).is_ok() {
     continue;
 }
+if let Some(parent) = symlink_path.parent() {
+    std::fs::create_dir_all(parent).map_err(|source| {
+        LinkRootComponentMembersError::Symlink {
+            member: host.name.clone(),
+            sibling: sibling.name.clone(),
+            source: source.into(),
+        }
+    })?;
+}
 symlink_package(&sibling.package_dir, &symlink_path).map_err(|source| {
     LinkRootComponentMembersError::Symlink {
         member: host.name.clone(),
         sibling: sibling.name.clone(),
         source,
     }
 })?;
Suggestion importance[1-10]: 9

__

Why: Ensuring the parent directory exists before symlinking prevents ENOENT errors for scoped packages, fixing a critical edge case.

High
Avoid moved retry options

Construct RetryOpts via a closure to prevent move errors when assigning it to
multiple resolvers.

pacquet/crates/napi/src/resolve.rs [136-218]

-let retry_opts = RetryOpts {
+let retry_opts = || RetryOpts {
     retries: config.fetch_retries,
     factor: config.fetch_retry_factor,
     min_timeout: std::time::Duration::from_millis(config.fetch_retry_mintimeout),
     max_timeout: std::time::Duration::from_millis(config.fetch_retry_maxtimeout),
 };
 ...
-    retry_opts,
+    retry_opts: retry_opts(),
 });
 ...
-    retry_opts,
+    retry_opts: retry_opts(),
 };
Suggestion importance[1-10]: 6

__

Why: Using a closure prevents a potential compilation error caused by moving retry_opts if it does not implement Copy or Clone.

Low
Suggestions up to commit 2565cf1
CategorySuggestion                                                                                                                                    Impact
Possible issue
Avoid moved retry options

Use a closure to create fresh RetryOpts instances.

pacquet/crates/napi/src/resolve.rs [136-217]

-let retry_opts = RetryOpts {
+let retry_opts = || RetryOpts {
     retries: config.fetch_retries,
     factor: config.fetch_retry_factor,
     min_timeout: std::time::Duration::from_millis(config.fetch_retry_mintimeout),
     max_timeout: std::time::Duration::from_millis(config.fetch_retry_maxtimeout),
 };
 ...
-    retry_opts,
+    retry_opts: retry_opts(),
 });
 ...
-    retry_opts,
+    retry_opts: retry_opts(),
Suggestion importance[1-10]: 8

__

Why: This suggestion prevents a severe compilation error (use of moved value) by ensuring RetryOpts is instantiated for each resolver.

Medium
Suggestions
CategorySuggestion                                                                                                                                    Impact
Possible issue
Create scoped package parents

Create the parent directory for scoped packages before symlinking them. This
prevents failures when cross-linking sibling components from different scopes.

pacquet/crates/package-manager/src/link_root_component_members.rs [176-191]

 let symlink_path = host.slot_modules_dir.join(&sibling.name);
 // Purely additive. `symlink_metadata` doesn't follow the
 // final component, so an existing symlink — dangling or not
 // — counts as present and is left untouched; only a genuinely
 // missing sibling is filled in. This never clobbers a real
 // dependency a member resolves for itself.
 if std::fs::symlink_metadata(&symlink_path).is_ok() {
     continue;
 }
+if let Some(parent) = symlink_path.parent() {
+    std::fs::create_dir_all(parent).map_err(|source| {
+        LinkRootComponentMembersError::CreateParentDir {
+            member: host.name.clone(),
+            sibling: sibling.name.clone(),
+            path: parent.to_path_buf(),
+            source,
+        }
+    })?;
+}
 symlink_package(&sibling.package_dir, &symlink_path).map_err(|source| {
     LinkRootComponentMembersError::Symlink {
         member: host.name.clone(),
         sibling: sibling.name.clone(),
         source,
     }
 })?;
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies a potential ENOENT error when symlinking cross-scope packages without their parent directory, but the proposed fix uses an undefined error variant LinkRootComponentMembersError::CreateParentDir.

Medium

@codecov-commenter

codecov-commenter commented Jul 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.59794% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.31%. Comparing base (6fbbebf) to head (8b7739e).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...package-manager/src/link_root_component_members.rs 80.89% 17 Missing ⚠️
...quet/crates/resolving-resolver-base/src/resolve.rs 50.00% 7 Missing ⚠️
...tes/package-manager/src/install_frozen_lockfile.rs 88.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12849      +/-   ##
==========================================
- Coverage   85.84%   85.31%   -0.53%     
==========================================
  Files         448      451       +3     
  Lines       69558    70701    +1143     
==========================================
+ Hits        59709    60318     +609     
- Misses       9849    10383     +534     

☔ 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

github-actions Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 8b7739eb000b

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.825 ± 0.181 3.607 4.182 1.80 ± 0.14
pacquet@main 3.730 ± 0.099 3.617 3.910 1.76 ± 0.12
pnpr@HEAD 2.147 ± 0.159 1.972 2.357 1.01 ± 0.10
pnpr@main 2.123 ± 0.135 1.936 2.310 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.8245643145000003,
      "stddev": 0.18107134584651505,
      "median": 3.8566136288,
      "user": 3.52318548,
      "system": 3.3860282400000004,
      "min": 3.6071815073,
      "max": 4.1818723833,
      "times": [
        3.8616480993,
        3.9618100223,
        3.8610058573,
        3.7129116913,
        4.1818723833,
        3.8522214003,
        3.6071815073,
        3.6110916813,
        3.6593876883,
        3.9365128143
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.7303363126,
      "stddev": 0.0991680122242239,
      "median": 3.7276072193000003,
      "user": 3.5369316799999995,
      "system": 3.37113114,
      "min": 3.6169244283,
      "max": 3.9104485833,
      "times": [
        3.8266741353000002,
        3.9104485833,
        3.6366253183,
        3.7276818693,
        3.6169244283,
        3.7275325693,
        3.6566187783,
        3.8082532833,
        3.6211144962999997,
        3.7714896642999998
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.1469274788999995,
      "stddev": 0.1593884730216839,
      "median": 2.0767536232999997,
      "user": 2.6513191799999998,
      "system": 2.9748191399999997,
      "min": 1.9718198412999999,
      "max": 2.3565487413,
      "times": [
        2.0141638123,
        2.3402292433,
        1.9718198412999999,
        2.3565487413,
        2.3390479953,
        2.0715347182999997,
        2.0819725282999997,
        2.0249270732999998,
        1.9984255172999998,
        2.2706053183
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.1227925497999998,
      "stddev": 0.1346539520975523,
      "median": 2.1092618493,
      "user": 2.6410122799999995,
      "system": 3.0040893399999993,
      "min": 1.9364168373,
      "max": 2.3101655973,
      "times": [
        2.0960411163,
        2.2902899283,
        1.9907754663,
        1.9364168373,
        2.2892132683,
        1.9937950173,
        2.3101655973,
        2.0701511512999997,
        2.1285945333,
        2.1224825823
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 661.1 ± 9.0 642.5 673.5 1.00
pacquet@main 671.8 ± 36.5 641.0 771.3 1.02 ± 0.06
pnpr@HEAD 732.8 ± 70.0 682.6 920.9 1.11 ± 0.11
pnpr@main 701.5 ± 31.7 668.0 780.5 1.06 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.66105155516,
      "stddev": 0.00899851448664815,
      "median": 0.6637859008600001,
      "user": 0.37363403999999995,
      "system": 1.34858264,
      "min": 0.64252765986,
      "max": 0.6735353418600001,
      "times": [
        0.6554979498600001,
        0.6644510668600001,
        0.6528970928600001,
        0.6735353418600001,
        0.6638614018600001,
        0.6703991568600001,
        0.6588708068600001,
        0.6637103998600001,
        0.6647646748600001,
        0.64252765986
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.6718240568600001,
      "stddev": 0.036487891733412645,
      "median": 0.66430082836,
      "user": 0.39800793999999995,
      "system": 1.3381294400000001,
      "min": 0.6409610788600001,
      "max": 0.7712747248600001,
      "times": [
        0.6650943798600001,
        0.6450743688600001,
        0.6596094108600001,
        0.6689213008600001,
        0.6409610788600001,
        0.6611010478600001,
        0.7712747248600001,
        0.6635072768600001,
        0.6756073278600001,
        0.6670896518600001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.73277657666,
      "stddev": 0.07003615218892793,
      "median": 0.7154925913600001,
      "user": 0.38662944,
      "system": 1.37835354,
      "min": 0.6825817298600001,
      "max": 0.9208986598600001,
      "times": [
        0.7435478888600001,
        0.68853310186,
        0.7227035218600001,
        0.7088573358600001,
        0.7221278468600001,
        0.6825817298600001,
        0.7006568758600001,
        0.6876207708600001,
        0.9208986598600001,
        0.7502380348600001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.7014584449599999,
      "stddev": 0.03174677894412457,
      "median": 0.6955248903600001,
      "user": 0.40646924,
      "system": 1.35806044,
      "min": 0.6679614878600001,
      "max": 0.7804623828600001,
      "times": [
        0.7205689918600001,
        0.6794942378600001,
        0.69561336786,
        0.69910706186,
        0.6679614878600001,
        0.6954364128600001,
        0.6784011688600001,
        0.7804623828600001,
        0.6878756748600001,
        0.70966366286
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.187 ± 0.027 4.123 4.211 1.89 ± 0.09
pacquet@main 4.205 ± 0.035 4.136 4.258 1.90 ± 0.09
pnpr@HEAD 2.211 ± 0.106 2.078 2.419 1.00
pnpr@main 2.226 ± 0.142 2.004 2.389 1.01 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.18690668358,
      "stddev": 0.027109855208369,
      "median": 4.1976728444799996,
      "user": 3.71468262,
      "system": 3.3872453399999998,
      "min": 4.123353391479999,
      "max": 4.21083415548,
      "times": [
        4.202783023479999,
        4.20998704548,
        4.123353391479999,
        4.19977075048,
        4.192721393479999,
        4.19710946648,
        4.198236222479999,
        4.1686617544799995,
        4.21083415548,
        4.16560963248
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.205160815879999,
      "stddev": 0.03545847379201703,
      "median": 4.2133735859799994,
      "user": 3.7225622199999995,
      "system": 3.3878625399999995,
      "min": 4.13640368848,
      "max": 4.25819889148,
      "times": [
        4.21269102948,
        4.21719737748,
        4.20346481748,
        4.13640368848,
        4.16059298948,
        4.21405614248,
        4.25819889148,
        4.18894169048,
        4.228420789479999,
        4.23164074248
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.21074026178,
      "stddev": 0.10558975098381557,
      "median": 2.2422108119799997,
      "user": 2.46780892,
      "system": 2.9323983399999998,
      "min": 2.07816412648,
      "max": 2.4188128754799996,
      "times": [
        2.0804774624799998,
        2.2425281764799996,
        2.07816412648,
        2.24211966748,
        2.4188128754799996,
        2.2770980124799998,
        2.1303994024799997,
        2.1332641714799996,
        2.24230195648,
        2.2622367664799996
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.22578932328,
      "stddev": 0.142015315811669,
      "median": 2.2196950174799994,
      "user": 2.4412812199999996,
      "system": 2.9257697400000007,
      "min": 2.00421905148,
      "max": 2.3893661524799996,
      "times": [
        2.2344594074799997,
        2.08667689848,
        2.38041519048,
        2.00421905148,
        2.2049306274799996,
        2.3893661524799996,
        2.3427543044799997,
        2.09781799048,
        2.13681006848,
        2.38044354148
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.334 ± 0.014 1.319 1.358 2.03 ± 0.04
pacquet@main 1.367 ± 0.022 1.342 1.401 2.08 ± 0.05
pnpr@HEAD 0.688 ± 0.102 0.644 0.978 1.05 ± 0.16
pnpr@main 0.658 ± 0.011 0.646 0.684 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.3338935416600002,
      "stddev": 0.014353998670491978,
      "median": 1.33069635706,
      "user": 1.29280746,
      "system": 1.6847811799999999,
      "min": 1.31920513456,
      "max": 1.35793721656,
      "times": [
        1.33567538156,
        1.35793721656,
        1.34702224556,
        1.33120857256,
        1.31973903056,
        1.32436606656,
        1.3201258235600002,
        1.3534718035600002,
        1.31920513456,
        1.33018414156
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.36701020336,
      "stddev": 0.021533229205900506,
      "median": 1.35956790356,
      "user": 1.34125696,
      "system": 1.6998545799999998,
      "min": 1.34199140056,
      "max": 1.4009655035600002,
      "times": [
        1.3444526485600001,
        1.35933421756,
        1.3583494255600002,
        1.39740387256,
        1.4009655035600002,
        1.38435894756,
        1.3761928705600002,
        1.34199140056,
        1.34725155756,
        1.35980158956
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.68791300716,
      "stddev": 0.10220293007780396,
      "median": 0.65800470306,
      "user": 0.33234825999999995,
      "system": 1.28975308,
      "min": 0.6441083675600001,
      "max": 0.9783234445600001,
      "times": [
        0.6591375315600001,
        0.6634741375600001,
        0.6589227025600001,
        0.9783234445600001,
        0.6531710765600001,
        0.65447738856,
        0.66123727856,
        0.6570867035600001,
        0.6491914405600001,
        0.6441083675600001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.6582565912600001,
      "stddev": 0.010609023771664696,
      "median": 0.6572604720600002,
      "user": 0.34319046,
      "system": 1.2852425799999998,
      "min": 0.64562344656,
      "max": 0.68372626156,
      "times": [
        0.6579485875600001,
        0.66261934856,
        0.6507509155600001,
        0.6565723565600001,
        0.65351512556,
        0.6600923925600001,
        0.6625299695600001,
        0.6491875085600001,
        0.64562344656,
        0.68372626156
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.999 ± 0.021 2.960 3.030 4.54 ± 0.06
pacquet@main 3.017 ± 0.025 2.976 3.064 4.57 ± 0.07
pnpr@HEAD 0.665 ± 0.010 0.654 0.685 1.01 ± 0.02
pnpr@main 0.660 ± 0.008 0.652 0.678 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.99868428176,
      "stddev": 0.021057689891860167,
      "median": 3.0027243396600003,
      "user": 1.7397140199999999,
      "system": 1.9867304800000003,
      "min": 2.96040615566,
      "max": 3.03007734666,
      "times": [
        2.98155127566,
        2.97631924866,
        3.00070076166,
        3.01688702966,
        3.00564572166,
        3.00474791766,
        2.96040615566,
        3.01619472966,
        3.03007734666,
        2.99431263066
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.01720397566,
      "stddev": 0.024619568256299414,
      "median": 3.0156533856600003,
      "user": 1.78258202,
      "system": 2.0121011799999993,
      "min": 2.97627479866,
      "max": 3.06419939566,
      "times": [
        3.00689520766,
        2.99453413566,
        3.00587918466,
        3.06419939566,
        3.02691717466,
        3.01728820066,
        3.02256850066,
        3.04346458766,
        2.97627479866,
        3.0140185706600002
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6650776634600002,
      "stddev": 0.01038180176657687,
      "median": 0.6650274091600001,
      "user": 0.33118572,
      "system": 1.2972548799999999,
      "min": 0.6535029926600001,
      "max": 0.68485110766,
      "times": [
        0.6535029926600001,
        0.6662067586600001,
        0.6570781946600001,
        0.65377707466,
        0.67428535966,
        0.66384805966,
        0.6552792476600001,
        0.67060630166,
        0.68485110766,
        0.67134153766
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.6599391643600001,
      "stddev": 0.007834176310177427,
      "median": 0.65710487866,
      "user": 0.34655241999999997,
      "system": 1.28810758,
      "min": 0.6522254616600001,
      "max": 0.67832010466,
      "times": [
        0.6568521246600001,
        0.65735763266,
        0.6532595196600001,
        0.66694201366,
        0.6593452146600001,
        0.65505117566,
        0.6522254616600001,
        0.6632517666600001,
        0.67832010466,
        0.6567866296600001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 616.2 ± 13.4 602.9 645.4 5.71 ± 0.13
pacquet@main 615.9 ± 6.4 602.1 622.1 5.71 ± 0.07
pnpr@HEAD 108.2 ± 0.9 107.0 112.0 1.00 ± 0.01
pnpr@main 107.9 ± 0.6 106.2 108.8 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.61619367642,
      "stddev": 0.01344339320935483,
      "median": 0.61088867172,
      "user": 0.5857873199999999,
      "system": 0.14930645999999997,
      "min": 0.60289108122,
      "max": 0.64542503522,
      "times": [
        0.62306748322,
        0.61532263222,
        0.60289108122,
        0.60402287122,
        0.60995776822,
        0.6118195752200001,
        0.60989860422,
        0.60802304222,
        0.63150867122,
        0.64542503522
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.6158753924200001,
      "stddev": 0.00637340432386225,
      "median": 0.61785569722,
      "user": 0.5810068199999999,
      "system": 0.15262406,
      "min": 0.60210323022,
      "max": 0.62211260022,
      "times": [
        0.6167000272200001,
        0.61785356822,
        0.6220161122200001,
        0.61919134322,
        0.60210323022,
        0.6178578262200001,
        0.61488764322,
        0.60742786322,
        0.62211260022,
        0.61860371022
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10815080794000004,
      "stddev": 0.000941254064056101,
      "median": 0.10798565722000002,
      "user": 0.026499999999999996,
      "system": 0.020019259999999997,
      "min": 0.10698138922000001,
      "max": 0.11200407822000001,
      "times": [
        0.10745911322000001,
        0.10819500822000001,
        0.10783518622,
        0.10788355622000001,
        0.10831670622000002,
        0.10753776022000001,
        0.10852714922000001,
        0.10867935422000001,
        0.10797444622,
        0.10698138922000001,
        0.10834553922000001,
        0.10744651922000001,
        0.10847954222000002,
        0.10703782522000001,
        0.10792709822000002,
        0.11200407822000001,
        0.10912936322000001,
        0.10798565722000002,
        0.10829134922000001,
        0.10763757722000002,
        0.10789402622000001,
        0.10832038322000001,
        0.10799389322000001,
        0.10768198922000001,
        0.10820568822000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.10787624102000003,
      "stddev": 0.0005895690859351588,
      "median": 0.10786800722,
      "user": 0.02600728,
      "system": 0.02005086,
      "min": 0.10617635522,
      "max": 0.10880662122000001,
      "times": [
        0.10753215022000001,
        0.10745214022,
        0.10790563622000002,
        0.10617635522,
        0.10786800722,
        0.10767058822000002,
        0.10825409922000001,
        0.10841890722000001,
        0.10779408022,
        0.10776157822000001,
        0.10880662122000001,
        0.10762507222,
        0.10801521222,
        0.10771803922,
        0.10879084222000002,
        0.10666332622000001,
        0.10859843022000001,
        0.10842521922000001,
        0.10783522622000001,
        0.10775956522,
        0.10822413222,
        0.10788469922,
        0.10834385422000001,
        0.10794283722,
        0.10743940622
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 6.574 ± 0.128 6.438 6.837 1.33 ± 0.04
pacquet@main 6.552 ± 0.082 6.432 6.696 1.33 ± 0.03
pnpr@HEAD 4.985 ± 0.077 4.869 5.130 1.01 ± 0.02
pnpr@main 4.938 ± 0.092 4.787 5.121 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 6.57432638642,
      "stddev": 0.12780062016228283,
      "median": 6.54216840832,
      "user": 3.70340574,
      "system": 3.6907499799999997,
      "min": 6.43802016682,
      "max": 6.83731246782,
      "times": [
        6.4913119978200005,
        6.55891058282,
        6.53159541682,
        6.7382361608200005,
        6.55274139982,
        6.43802016682,
        6.47837965482,
        6.63978485082,
        6.83731246782,
        6.47697116582
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 6.55224611542,
      "stddev": 0.08179242340985231,
      "median": 6.568373062820001,
      "user": 3.74598214,
      "system": 3.68387818,
      "min": 6.431820080820001,
      "max": 6.69593249582,
      "times": [
        6.61881151782,
        6.59153581982,
        6.48816274382,
        6.44582709482,
        6.431820080820001,
        6.69593249582,
        6.56652183382,
        6.51752675182,
        6.570224291820001,
        6.59609852382
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 4.98503009552,
      "stddev": 0.07716899914328386,
      "median": 4.97496281032,
      "user": 2.775297840000001,
      "system": 3.2536248800000003,
      "min": 4.8690827928200004,
      "max": 5.13013109382,
      "times": [
        5.04510440182,
        4.8690827928200004,
        5.03654840782,
        5.13013109382,
        4.97269268782,
        4.93150386082,
        4.97723293282,
        5.02766548282,
        4.96114685982,
        4.89919243482
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 4.9378137972200005,
      "stddev": 0.09167866230691354,
      "median": 4.94603246582,
      "user": 2.76048014,
      "system": 3.2825144799999997,
      "min": 4.7871926588200004,
      "max": 5.121449885820001,
      "times": [
        4.9488208058200005,
        4.7871926588200004,
        4.89125379482,
        4.95835486182,
        4.93156924982,
        4.82767873882,
        5.121449885820001,
        4.94324412582,
        4.98238782882,
        4.98618602182
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12849
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,186.91 ms
(-1.39%)Baseline: 4,245.78 ms
5,094.93 ms
(82.18%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
2,998.68 ms
(-1.19%)Baseline: 3,034.89 ms
3,641.87 ms
(82.34%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
1,333.89 ms
(-1.31%)Baseline: 1,351.59 ms
1,621.91 ms
(82.24%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
616.19 ms
(-3.66%)Baseline: 639.58 ms
767.49 ms
(80.29%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
3,824.56 ms
(-4.27%)Baseline: 3,994.99 ms
4,793.99 ms
(79.78%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
6,574.33 ms
(-3.62%)Baseline: 6,821.35 ms
8,185.62 ms
(80.32%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
661.05 ms
(+3.20%)Baseline: 640.57 ms
768.69 ms
(86.00%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12849
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,210.74 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
665.08 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
687.91 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
108.15 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,146.93 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
4,985.03 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
732.78 ms
🐰 View full continuous benchmarking report in Bencher

…gLimits: workspaces

Bit's root-components install writes one importer per root under
node_modules/.bit_roots/<id> whose manifest injects the root's sibling
components as workspace deps and carries
installConfig: { hoistingLimits: "workspaces" }. Under nodeLinker:
isolated those injected members are materialized as file: deps, each in
its own global-virtual-store slot whose node_modules only holds that
member's own deps. A realpath-based resolution (Node default) that lands
in a member's slot never reaches a sibling, so require of a sibling
component throws MODULE_NOT_FOUND even though peer resolution is correct.

Parse installConfig.hoistingLimits from the manifest and, after the
isolated symlink pass, cross-link every one of a root's injected members
into every other member's slot node_modules so the upward walk from any
member finds its siblings. The pass is gated on hoistingLimits:
"workspaces" (a shape no non-Bit install produces) and is purely
additive, so ordinary installs are untouched. Because each root's peer
context is folded into its members' slot hashes, two roots get distinct
member slots and cross-linking one root can never leak a wrong sibling
into another. Wired into both the fresh and frozen isolated paths.
@zkochan zkochan changed the title fix(pacquet): resolve non-npm specifiers in the @pnpm/napi resolveDependency fix(pacquet): napi resolveDependency resolver chain + root-component member reachability Jul 7, 2026
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 10e686a

@qodo-code-review

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

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

CategorySuggestion                                                                                                                                    Impact
Possible issue
Create scoped package parents

Create the parent directory for scoped packages before symlinking them. This
prevents failures when cross-linking sibling components from different scopes.

pacquet/crates/package-manager/src/link_root_component_members.rs [176-191]

 let symlink_path = host.slot_modules_dir.join(&sibling.name);
 // Purely additive. `symlink_metadata` doesn't follow the
 // final component, so an existing symlink — dangling or not
 // — counts as present and is left untouched; only a genuinely
 // missing sibling is filled in. This never clobbers a real
 // dependency a member resolves for itself.
 if std::fs::symlink_metadata(&symlink_path).is_ok() {
     continue;
 }
+if let Some(parent) = symlink_path.parent() {
+    std::fs::create_dir_all(parent).map_err(|source| {
+        LinkRootComponentMembersError::CreateParentDir {
+            member: host.name.clone(),
+            sibling: sibling.name.clone(),
+            path: parent.to_path_buf(),
+            source,
+        }
+    })?;
+}
 symlink_package(&sibling.package_dir, &symlink_path).map_err(|source| {
     LinkRootComponentMembersError::Symlink {
         member: host.name.clone(),
         sibling: sibling.name.clone(),
         source,
     }
 })?;
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies a potential ENOENT error when symlinking cross-scope packages without their parent directory, but the proposed fix uses an undefined error variant LinkRootComponentMembersError::CreateParentDir.

Medium
  • More

Addresses review feedback on the napi resolver-chain PR.

- The resolve chain wired NodeResolver's offline flag but left the deno
  and bun runtime resolvers fetching GitHub release metadata
  unconditionally, so an offline resolve could still reach the network
  for their `runtime:` specifiers. Add an `offline` field (with matching
  NO_OFFLINE_DENO_RESOLUTION / NO_OFFLINE_BUN_RESOLUTION errors) to both
  resolvers, short-circuit before any fetch, and set it in both the napi
  and fresh-install paths so the node/deno/bun trio all fail fast offline.
- Replace the two duplicated ArcResolver adapters (napi and
  package-manager) with a single `impl Resolver for Arc<dyn Resolver>` in
  resolving-resolver-base.
- Add offline unit tests for the deno/bun runtime specifiers and the
  pre-assertion logging the style guide requires.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 8, 2026 23:22

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 github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 8, 2026
Comment thread pacquet/crates/napi/src/resolve.rs Resolved
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 2565cf1

zkochan and others added 2 commits July 9, 2026 01:51
`is_symlink_or_junction` propagated `junction::exists`'s
ERROR_NOT_A_REPARSE_POINT (4390) for a plain directory instead of
returning `false`, so the `injected_members_are_cross_linked` test
panicked on Windows where it asserts a member's own package dir is not
a symlink. Check `Path::is_symlink` first, then map the
not-a-reparse-point error from `junction::exists` back to `false`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The deno and bun runtime resolvers accepted an `offline` flag but
ignored it, reaching out to GitHub for release assets even when offline.
Fail fast with NO_OFFLINE_DENO_RESOLUTION / NO_OFFLINE_BUN_RESOLUTION
instead, matching the Node.js runtime resolver and the pacquet engine.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 8, 2026 23:52

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.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 5bbed3a

Reverts the deno/bun offline fail-fast added earlier in this PR. It
diverged from the tested behavior: the e2e tests
test/install/denoRuntime.ts and test/install/bunRuntime.ts assert that
an offline runtime install fails downstream (the "in package mirror"
error), and the runtime resolvers intentionally do not short-circuit on
`offline` — only the node resolver does, because it reaches the mirror
at resolve time. The ArcResolver dedup and test-logging changes are
kept.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 9, 2026 00:32

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.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 7c8fd4f

Replace the all-to-all cross-link of a root component's injected members
with pnpm's per-package child linking: each member's slot `node_modules/`
gains symlinks only to the siblings it declares in its own manifest, so a
transitive sibling resolves through the chain (comp3 -> comp2 -> comp1)
instead of a clique. This mirrors how pnpm's isolated linker wires an
injected package's own children and drops the "broader than the declared
dependency set" caveat.

The member's manifest is the source of truth — it survives Bit's
`excludeLinksFromLockfile` / `dedupeInjectedDeps`, where the lockfile
edges do not — so the function signature and both install call sites are
unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 9, 2026 08:37

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.

@qodo-code-review

Copy link
Copy Markdown

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

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

Auto-approved notes - no code suggestions found
- 'approve_pr_on_self_review' flag enabled

Satisfies the `perfectionist::macro-trailing-comma` dylint lint on the
three multi-line `assert!` invocations in the root-component tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 9, 2026 08:57

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.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 8b7739e

@zkochan
zkochan merged commit 388001c into main Jul 9, 2026
32 checks passed
@zkochan
zkochan deleted the fix/napi-resolver-and-version branch July 9, 2026 09:47
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