Add experimental pnpm lockfile invalidation - #1173
Draft
Christian Gonzalez (christiango) wants to merge 4 commits into
Draft
Add experimental pnpm lockfile invalidation#1173Christian Gonzalez (christiango) wants to merge 4 commits into
Christian Gonzalez (christiango) wants to merge 4 commits into
Conversation
Add an experimental, opt-in config option
`experimentalLockfileInvalidation: { packageManager: "pnpm" }` that makes
lage precisely determine which workspace packages are actually affected by a
pnpm lockfile change, instead of treating any `pnpm-lock.yaml` change as a
repo-wide invalidation.
- New `@lage-run/lockfile` package: Merkle-hashes the pnpm lockfile snapshot
DAG (lockfileVersion 9.x) to compute a stable per-package closure signature
in ~O(nodes + edges) once per run.
- `@lage-run/hasher`: `TargetHasher` uses the closure signature for cache-key
invalidation when enabled, so only affected packages get a new hash.
- `@lage-run/cli`: `--since` filtering diffs old vs new lockfile and only marks
affected packages as changed instead of the whole graph.
- `workspace-tools`: new `getMergeBase` git helper.
- Unsupported package managers / lockfile versions fall back safely to today's
blanket behavior (never under-invalidate).
- Docs + tests + beachball change file.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Address adversarial review findings for the experimental pnpm lockfile invalidation path: - Treat root/unmapped pnpm importers as global invalidation inputs for cache hashing and force safe blanket fallback for --since when they change. - Include pnpm package artifact and snapshot metadata in Merkle node hashes so integrity/tarball/patch metadata changes are not missed. - Replace placeholder cycle handling with SCC-based hashing so changes within cyclic dependency components propagate to all importers entering the component. - Pass experimental lockfile invalidation through the info command target graph path. - Add regression coverage for root importer changes, metadata-only lockfile changes, and cycle propagation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Member
Author
|
Not ready for review yet, this is the LLM's crack at it |
added 2 commits
July 11, 2026 10:22
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 48bff3c0-aa2a-4ffe-a638-160026f2c2d0
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 48bff3c0-aa2a-4ffe-a638-160026f2c2d0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an experimental opt-in config option for smarter pnpm lockfile invalidation:
When enabled, Lage analyzes
pnpm-lock.yaml(lockfileVersion9.x) and computes per-package external dependency closure signatures. This makes both cache hashing and--sincefiltering invalidate only the workspace packages whose lockfile closure actually changed, instead of treating every lockfile edit as a full-repo invalidation.Details
@lage-run/lockfilefor strict pnpm v9 schema validation and stable importer closure signatures.--since.pnpm-lock.yamlmatches from repo-wide and environment globs while precise analysis succeeds.--sinceselects all packages and cache keys include the complete raw lockfile.Validation
yarn checkchangeyarn syncpack:checkyarn format:checkyarn lage test --to @lage-run/lockfile --to @lage-run/hasher --to @lage-run/cliyarn ci