Skip to content

fix(pnpm): restore the lockfile settings a dependency graph was resolved under - #10784

Merged
zkochan merged 6 commits into
teambit:masterfrom
zkochan:pnpm/restore-lockfile-settings
Oct 10, 2026
Merged

zkochan merged 6 commits into
teambit:masterfrom
zkochan:pnpm/restore-lockfile-settings

Conversation

@zkochan

@zkochan zkochan commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Proposed Changes

  • A lockfile Bit restores from a component's dependency graph carried no settings block. pnpm reads a missing block as resolved with dedupePeers and injectWorkspacePackages off, which Bit's installs never match, so it discarded every restored lockfile and resolved the whole graph again. In the ripple container that was about 85 seconds for a capsule of 5,500 packages.
  • The dependency graph now records the settings block of the lockfile it's created from, alongside the pnpmfileChecksum it already records. The restored lockfile carries it back.
  • Merging two graphs, or a graph lockfile into an existing one, keeps the settings only when both sides were resolved under the same ones. This is the same rule pnpmfileChecksum follows. A graph lockfile that adds no resolutions, from an empty or link-only graph, leaves the existing lockfile's checksum and settings in place; before, it dropped the checksum and forced the unrelated workspace dependencies to resolve again.
  • Graphs created before this change have no settings, so pnpm resolves them again, as it does today. The speedup applies to components snapped with a Bit that includes this change.
  • Measured in the ripple container, with a stand-in that stamps the restored lockfile with the checksum and the settings a new graph would carry: the component capsule's install went from 84–147 s to 27 s. The remaining resolution covers 54 dependencies of the capsule's root manifest that the component's graph doesn't contain.

🤖 Generated with Claude Code

…ved under

A lockfile Bit restores from a component's dependency graph carried no
`settings` block. pnpm reads a missing block as resolved with
`dedupePeers` and `injectWorkspacePackages` off, which Bit's installs
never match, so it discarded every restored lockfile and resolved the
whole graph again: about 85 seconds for a capsule of 5,500 packages.

The graph now records the `settings` block of the lockfile it is created
from, next to the `pnpmfileChecksum` it already records, and the restored
lockfile carries it back. Merges keep the settings only when both sides
were resolved under the same ones. Graphs created before this change
have no settings and are resolved again, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Preserve pnpm lockfile settings in dependency graphs

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Save pnpm resolution settings with dependency graphs so restored lockfiles can avoid unnecessary
 re-resolution.
• Retain settings across merges only when both sources agree; leave older graphs unchanged.
• Test round-tripping, legacy graphs, and both merge paths.
Diagram

graph TD
  A["pnpm lockfile"] --> B["Graph conversion"] --> C["Stored graph"] --> D["Graph restoration"] --> E["Restored lockfile"] --> F["pnpm install"]
  C --> G["Graph merge"] --> D
  E --> H["Lockfile merge"] --> F
Loading
High-Level Assessment

Preserving the settings recorded at resolution time is the appropriate approach. Stamping a restored lockfile with current install settings would incorrectly claim that older or differently resolved graphs match; leaving settings absent for legacy or incompatible graphs preserves pnpm's re-resolution safeguard.

Files changed (6) +177 / -3

Bug fix (3) +51 / -2
lockfile-deps-graph-converter.tsCarry resolution settings through lockfile conversion +8/-0

Carry resolution settings through lockfile conversion

• Copies the source lockfile's settings into the dependency graph and writes them back when restoring a lockfile. Graphs without recorded settings continue to produce lockfiles without a settings block.

scopes/dependencies/pnpm/lockfile-deps-graph-converter.ts

pnpm.package-manager.tsDiscard incompatible settings in merged lockfiles +10/-0

Discard incompatible settings in merged lockfiles

• Compares settings across the existing and graph-derived lockfiles, removing the merged settings block when they disagree.

scopes/dependencies/pnpm/pnpm.package-manager.ts

dependencies-graph.tsStore and reconcile lockfile settings in dependency graphs +33/-2

Store and reconcile lockfile settings in dependency graphs

• Adds optional lockfile settings to the graph's constructor and serialized form. Graph merges retain them when resolved inputs agree, or use the settings of the sole input with resolutions.

scopes/scope/objects/models/dependencies-graph.ts

Tests (3) +126 / -1
lockfile-deps-graph-converter.spec.tsTest lockfile settings round-tripping +56/-1

Test lockfile settings round-tripping

• Verifies settings survive lockfile-to-graph conversion, serialization, and lockfile restoration. Also confirms a source lockfile without settings produces a restored lockfile without them.

scopes/dependencies/pnpm/lockfile-deps-graph-converter.spec.ts

pnpm.package-manager.spec.tsTest settings compatibility during lockfile merges +20/-0

Test settings compatibility during lockfile merges

• Checks that merging an existing lockfile with a graph lockfile preserves equal settings and removes differing or one-sided settings.

scopes/dependencies/pnpm/pnpm.package-manager.spec.ts

dependencies-graph.spec.tsTest graph settings persistence and merge behavior +50/-0

Test graph settings persistence and merge behavior

• Covers serialization, graphs saved before the new field existed, and merges with matching, conflicting, or missing settings.

scopes/scope/objects/models/dependencies-graph.spec.ts

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Lint fails on settings comparisons 📘 Rule violation ≡ Correctness
Description
Both sameLockfileSettings helpers index the typed settings objects with a string from
Object.keys, which TypeScript cannot use as a key of LockfileSettings. Running the repository's
lint script reaches these comparisons in the graph and lockfile merge paths and reports
type-checking errors.
Code

scopes/scope/objects/models/dependencies-graph.ts[R340-341]

+  const keys = new Set([...Object.keys(settings1), ...Object.keys(settings2)]);
+  return [...keys].every((key) => settings1[key] === settings2[key]);
Evidence
The new helpers both derive string keys with Object.keys and use them to index typed settings
objects. The repository enables strict TypeScript checking and runs tsc --noEmit as part of
lint.

CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean: CLAUDE.md: Keep Changes Lint- and Type-Check Clean
scopes/scope/objects/models/dependencies-graph.ts[338-341]
scopes/dependencies/pnpm/pnpm.package-manager.ts[665-668]
tsconfig.json[1-10]
package.json[21-25]

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 two settings comparison helpers index `LockfileSettings` with untyped string keys, causing TypeScript errors.
## Fix Focus Areas
- scopes/scope/objects/models/dependencies-graph.ts[338-342]
- scopes/dependencies/pnpm/pnpm.package-manager.ts[665-669]
## Recommended Fix
Use keys typed as `keyof LockfileSettings` in both helpers while retaining the comparison across keys from both objects. Run `npm run lint` to verify the changes.

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



Remediation recommended

2. Empty imports re-resolve the workspace ✓ Resolved
Description
mergeGraphLockfileIntoExisting deletes the existing lockfile's settings whenever the graph
lockfile lacks them, even if the graph contributes no resolved packages. Importing a component whose
older graph is empty or link-only therefore invalidates settings for unrelated dependencies already
in the workspace lockfile, making pnpm resolve them again.
Code

scopes/dependencies/pnpm/pnpm.package-manager.ts[R651-652]

+  if (!sameLockfileSettings(existing.settings, graph.settings)) {
+    delete merged.settings;
Evidence
Older graphs deserialize without settings; link references are excluded from graph neighbours, but
restoration still creates importer entries for them. The package manager merges that graph-derived
lockfile into the existing one, and the new comparison deletes the existing settings despite the
absence of graph package resolutions.

scopes/scope/objects/models/dependencies-graph.ts[90-103]
scopes/dependencies/pnpm/lockfile-deps-graph-converter.ts[77-85]
scopes/dependencies/pnpm/lockfile-deps-graph-converter.ts[375-376]
scopes/dependencies/pnpm/lockfile-deps-graph-converter.ts[378-388]
scopes/dependencies/pnpm/pnpm.package-manager.ts[114-122]
scopes/dependencies/pnpm/pnpm.package-manager.ts[650-652]

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

## Issue description
Merging an older empty or link-only graph deletes valid settings from an existing workspace lockfile despite adding no package resolutions, causing an unnecessary re-resolution.
## Fix Focus Areas
- scopes/dependencies/pnpm/pnpm.package-manager.ts[650-652]
- scopes/dependencies/pnpm/pnpm.package-manager.spec.ts[97-115]
## Recommended Fix
When the graph-derived lockfile contributes no resolved packages or snapshots, retain the existing lockfile settings. Continue dropping settings for incompatible graphs that contribute resolutions, and add a regression test for the resolution-free case.

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


Grey Divider

Tip of the day
💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

…s no resolutions

Merging a graph lockfile that adds no packages, from an empty or
link-only graph, dropped the existing lockfile's pnpmfileChecksum and
settings whenever the graph lacked matching ones, and pnpm then resolved
the unrelated workspace dependencies again. Such a graph mixes nothing in,
so the existing lockfile now keeps its own, the rule DependenciesGraph.merge
already follows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 36ad6f9

@zkochan
zkochan enabled auto-merge (squash) October 9, 2026 15:00
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 0006f6d

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 6a2ebfd

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

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

@zkochan
zkochan merged commit 59e9b98 into teambit:master Oct 10, 2026
18 of 19 checks passed
zkochan added a commit that referenced this pull request Oct 10, 2026
## Proposed Changes

- **No readPackage hook.** Every dependency manifest the engine resolved
used to go through a JavaScript callback. Its jobs now use static
options that `@pnpm/napi` has supported since v12.0.0 (pnpm/pnpm#13492):
- `@teambit/legacy` and `@teambit/harmony` are removed with
`"@teambit/legacy@*": "-"` style overrides, which cover registry
packages. The `@*` selector matches only semver ranges, so the `link:`
dependencies Bit's linker adds stay, as the hook kept them. A workspace
project can also declare them with `workspace:`, `file:` or `npm:`
specs, so they are removed from the workspace manifests before the
install as well.
- An injected component gets its raw manifest through
`projects[].dependencyManifest`. Before, the hook swapped it in by
directory.
- The stripping of never-built packages' scripts is removed. It did
nothing: those packages are already denied with `allowBuilds: false`.
- **Graph-restored lockfiles carry the overrides.** Without a hook there
is no `pnpmfileChecksum` to record. pnpm instead compares the lockfile's
`overrides` with the install's, so the dependency graph now records
them, like the settings from #10784. A graph resolved with the old hooks
(checksum `bit-1`) is read as having the two removal overrides, so
existing graphs keep being reused.
- **Measured** (single runs):
- Ripple container, `bit sign` of a component with about 5,500
dependencies: the component capsule's install took 34 s instead of 72 s.
The env capsules reused their restored lockfiles either way.
- This repo: a repeat `bit install` spends 5 s in the engine instead of
12 s.
- With `@pnpm/napi` 12.12.0 (below), a repeat `bit install` in this repo
is "Already up to date" and the engine call takes under a second (926
ms).
- **`@pnpm/napi` 12.12.0.** It includes two engine fixes this PR builds
on:
- pnpm/pnpm#16815: lockfile freshness compares an injected project with
its `dependencyManifest`. Before, every repeat install resolved again.
- pnpm/pnpm#16813: `allowBuilds` denials outrank
`dangerouslyAllowAllBuilds`. With `dangerouslyAllowAllScripts` and
`neverBuiltDependencies` both set, Bit now passes the allow-all flag
together with the denials. Before, it passed only the denials, so no
other package was built.
- **This repo's `pnpm-lock.yaml`:** it gains the `@teambit/legacy@*`
override and drops `pnpmfileChecksum: bit-1`. The resolutions are
identical. This workspace forces a harmony version, so there is no
harmony removal here.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants