Repository navigation
Hosted and vendored pnpm 11/12 refuse a standalone project nested under an unrelated pnpm-workspace.yaml (not in its packages: globs) as a "workspace member", and the suggested fix doesn't work (regression from #888) #1006
Description
Activity
- addedbugSomething isn't workingSomething isn't workingbughuntFound by a scheduled package-manager bug-hunt agentFound by a scheduled package-manager bug-hunt agentpm:pnpmpnpmpnpm
on Oct 7, 2026 mikolalysenko commented
on Oct 7, 2026 CollaboratorAuthorMore actions[agent] Claiming this issue as part of the pnpm open-issue sweep in draft PR #1007. Branch: agent/fix-pnpm-open-issues. Claim-ID: 2026-10-07T12:44:29Z-pnpm07
mikolalysenko commented
on Oct 7, 2026 CollaboratorAuthorMore actions- added 4 commits that reference this issue
on Oct 7, 2026 mikolalysenko commented
on Oct 7, 2026 CollaboratorAuthorMore actionsmikolalysenko commented
on Oct 8, 2026 CollaboratorAuthorMore actions[agent] New variant from the pnpm bug-hunt routine (ledger #303), main
cf8b164, Linux, reproduced twice: a settings-only parentpnpm-workspace.yamlwith nopackages:key gives the same wrong refusal. PR #1007's regression tests use parents that do havepackages:globs, so this shape may need its own case.Layout:
parent/pnpm-workspace.yamlcontains onlyminimumReleaseAge: 0, andparent/child/is a standalone project depending onleft-pad@1.3.0. Runningpnpm installinchild/on pnpm 11.28.5 and 12.10.1 writeschild/pnpm-lock.yaml, not a lock at the parent, so pnpm treats the child as its own root.pnpm scan --mode hostedinchild/scan --mode vendoredSuggested fix ( trustLockfile: truein the parent file) → fresh--frozen-lockfiletrustLockfile: trueinchild/pnpm-workspace.yaml→ fresh--frozen-lockfile11.28.5 exit 1, redirect_pnpm_settings_elsewherenot run ERR_PNPM_TARBALL_URL_MISMATCHpass, patched bytes 12.10.1 exit 1, redirect_pnpm_settings_elsewhereexit 1, vendor_pnpm_settings_elsewhereERR_PNPM_TARBALL_URL_MISMATCHpass, patched bytes So, as in the original report, the refusal sends the user to a file pnpm doesn't read for this project. A parent file with no
packages:key should probably count as "not a member" for pnpm ≥ 11, just like a parent whose globs don't match.On pnpm 10.34.6 the same layout installs nothing in
child/(no lock, nonode_modules). Hosted and vendored then exit 0 with nothing to do, so pnpm 10 isn't affected.
Generated by Claude Code
mikolalysenko commented
on Oct 9, 2026 CollaboratorAuthorMore actions[agent] pnpm bug-hunt, another variant on main
03b9418: a project excluded by a negated glob.# pnpm-workspace.yaml at the root packages: - 'packages/*' - '!packages/excluded'
packages/excluded(left-pad@1.3.0) gets its ownpnpm-lock.yamlfrompnpm installrun inside it, and the root lock has noleft-pad. pnpm treats it as outside the workspace.pnpm scan --mode hostedfrompackages/excludedscan --mode vendored11.28.5 exit 1, redirect_pnpm_settings_elsewhere, nothing writtennot run 12.10.1 exit 1, redirect_pnpm_settings_elsewhere, nothing writtenexit 1, vendor_pnpm_settings_elsewhereThe refusal's remedy is wrong here too (12.10.1, pinned with
--no-trust-lockfile-config, then a frozen install with an empty store):trustLockfile: trueappended to the rootpnpm-workspace.yaml, as the message suggests:ERR_PNPM_TARBALL_URL_MISMATCH.trustLockfile: truein a newpackages/excluded/pnpm-workspace.yaml, which the message says "would be ignored": the install succeeds andleft-padis patched.
So the membership check needs to honour
!patterns inpackages:as well as plain globs.
Generated by Claude Code
[agent] Found by the scheduled pnpm bug-hunt routine (ledger #303).
Summary
Since #888 (fix for #880 / #881), hosted and vendored modes refuse any pnpm project with its own v9
pnpm-lock.yamland nopnpm-workspace.yamlof its own whenever any ancestor directory has apnpm-workspace.yaml.governing_workspace_filetakes the nearest ancestor file without checking that the project matches that file'spackages:globs.pnpm 11 and 12 don't treat such a directory as a workspace project. Running
pnpm installinexamples/demo(not matched by the root'spackages: [packages/*]) writesexamples/demo/pnpm-lock.yamland reads only apnpm-workspace.yamlinexamples/demo, never the root one. This is a common layout:examples/,e2e/ordocs/apps outside the globs, or a checkout inside a parent folder that happens to hold apnpm-workspace.yaml.So on main:
redirect_pnpm_settings_elsewhere. Its remedy ("addtrustLockfile: trueto /pnpm-workspace.yaml") does nothing: the frozen install still fails withERR_PNPM_TARBALL_URL_MISMATCH.vendor_pnpm_settings_elsewhereand tells the user to use--mode hosted, which also refuses. Neither mode can patch the project.pnpm-workspace.yamlit creates (which the new refusal says "would be ignored") is exactly the file pnpm reads, and a fresh frozen install lands patched bytes.Impact
Every pnpm 11/12 project nested below an unrelated workspace file stops being patchable in hosted and vendored modes, and both error messages point at remedies that don't work.
Repro (pnpm 12.10.1, Node 22, mock patch API as in the pnpm compatibility e2e)
Expected vs actual
CLI_CONTRACT.md scopes both codes to "a pnpm workspace member with its own …
pnpm-lock.yaml(sharedWorkspaceLockfile: false)".examples/demoisn't a member: pnpm doesn't list it as a workspace project, gives it its own lock, and reads its ownpnpm-workspace.yaml. Expected: hosted pins the lock and createsexamples/demo/pnpm-workspace.yamlwithtrustLockfile: true, and vendored wires the override there, as 4.0.0 does. Actual: both modes refuse, and nothing is written.OS × version
examples/demoexamples/demodemo)macOS and Windows weren't probed. The logic is path-only and OS-independent.
First bad commit
8e8daf0(#888). Release 4.0.0 is good.Suspect code
crates/socket-patch-core/src/utils/pnpm_workspace.rs:27(governing_workspace_file): any ancestor file is treated as governing; the project isn't matched against itspackages:globs (or the root itself).crates/socket-patch-core/src/hosted/governing_root.rs:139(pnpm_settings_elsewhere)crates/socket-patch-core/src/vendor/pnpm_lock.rs:594(vendored refusal)No probe runs; Linux only.
Backlog review — 2026-10-08
Priority: P1 → P2. An unrelated ancestor workspace causes a false refusal. Real pnpm usability regression with a narrow nesting trigger.