Repository navigation
fix(update): verify pnpm global-store installs against the store pnpm names - #8331
Merged
Merged
Conversation
Install detection routes a package whose realpath lies under pnpm's `store/v<N>/links/` tree to the pnpm updater, but `verifyPnpmInstallTree` only trusted an enclosing node_modules that carries `.pnpm` or `.modules.yaml`. A global virtual-store group has neither, so its sibling `bun` and `zod` links were never probed and `ocx update` aborted with "sentinel dependency missing" on a working install. Treat the package's realpath group as pnpm-owned when it sits inside a `store/v<N>/links/` tree. The lexical (exposed) group still needs pnpm metadata, so no ancestor install is newly trusted. The store-layout spelling moves to a dependency-free leaf module shared by detection and the verifier so the two cannot drift again. Closes #8183 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Caution Review failedThe pull request is closed.
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. |
Contributor
|
✅ Deterministic PR hygiene checks passed. |
added 6 commits
November 13, 2026 12:26
… the pnpm guide The store check also runs after pnpm add, and a failure there stops without a rollback. Say so instead of claiming the update never changes anything, and stop saying the hint is the end of the message.
…fied install A symlinked global group or an unsafe Windows path refused a store-like install without saying how to update. Every refusal of a classified owner now keeps its reason as the prefix and appends the hint. The guide notes that the store query may create an empty store folder and lists the Windows cmd.exe cause.
An unbound global group or a command-shim mismatch returned before store classification, so a store-like install was refused without the pnpm remedy. Classification now runs as soon as the listed package matches, and every refusal of a classified owner carries the hint.
…ks directory A v<N>/links component only classified a store install when it appeared in a symlink target, so a package listed at its own path inside such a directory skipped the store proof that decision B requires. The package's final location now classifies by the same rule; an isolated install ending in node_modules/.pnpm stays unclassified.
… owner Preflight, the post-install store check and the rollback store recheck returned the raw reason for a store owner, so ocx update printed it without the cause and remedy discovery gives. They now keep the reason as the prefix and append the same hint.
… install Any node_modules/.pnpm segment suppressed the v<N>/links classification, including one above the links directory, so a package under node_modules/.pnpm/<x>/v1/links/... skipped the store proof. One helper now decides for both a symlink target and the final location, and a .pnpm virtual store counts only below the last v<N>/links component.
3 tasks done
added 8 commits
November 13, 2026 12:58
…back readback reasons A symlink target was classified before the rest of the path was appended, so an isolated .pnpm install reached through a link to its group required the store proof while the same location reached directly did not. The verifier now judges the joined spelling. The final rollback readback also kept no reason; its failure, a store-proof failure included, is now part of the error, and a store owner's post-install outcomes carry the remedy.
…s; keep isolated installs and hints consistent The marker check only looked at the innermost v<N> directory, so a package at store/v11/custom/v2/slot/node_modules skipped the store proof although store/v11 carries pnpm's files and index markers. Every versioned ancestor is now checked. The isolated .pnpm exception also covers the default store/v<N>/links spelling, and a store-like running package that no pnpm candidate lists is refused with the remedy.
…ore owner version mismatch Store markers were only checked on the package's final realpath, so a listed path below a marked store whose package link pointed elsewhere was accepted on the legacy verifier with no store query. Markers now classify on every effective spelling. A store owner's active-version mismatch at preflight also carries the remedy.
…onical spelling A readback that found the global group behind a link was not treated as a configuration failure, and the pre-rollback recheck validated only the store, so a second pnpm add ran through the changed group. Global group refusals now stop without a rollback, and the recheck validates the group too. The final rollback readback reason now leads its error, and an unpinned store owner is refused with the remedy.
…nd group identity for the transaction The listed package spelling was checked only with the default-store patterns, so v7/links/group/node_modules/<pkg> linking elsewhere was accepted with no store query. Every effective spelling with a v<N>/links component now classifies unless the package finally lands in an isolated .pnpm install inside that same links directory. A store owner's store and global group are also pinned by device and inode for the update, and a replaced directory stops the transaction before pnpm add or rollback.
The update mutation scanner, which runs where TypeScript's sync parser can start (Windows), rejected this branch: a stale pnpm-store-layout import ledger, node:path imports in index.ts and orchestrated-pnpm.mjs, the node:module globalPaths import and process.execArgv. Node's default global lookup paths are now computed from HOME/USERPROFILE and process.execPath the way Node builds Module.globalPaths, the ledgers match the imports, and the read-only process.execArgv site has an exact allowlist entry and control-site contracts. A Node-run probe of both lint cases reports no violations.
Owner
Author
Maintainer judgment (head
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 13, 2026
This was referenced Nov 13, 2026
3 of 7 tasks
3 tasks done
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
ocx updaterefused working pnpm 11/12 global installs whose package lives in pnpm's global virtual store (<pnpm home>/store/v11/links/...). Bun and Zod are linked beside the package there, and the verifier did not recognise that group (#8183). This carries #8298 and accepts such an install only when pnpm itself names the store.v<N>/linkscomponent, or pnpm's store markers (filesplus an index) on any versioned ancestor, requires the store proof. The one exception is an isolated install: a package that lands in anode_modules/.pnpmstore inside that same links directory. Paths, markers and.modules.yamlnever accept a package.PNPM_HOME,XDG_DATA_HOME/pnpm, then the platform default);pnpm store path --dir=<pnpm home>without--store-dir, through the same runner, environment and read cwd aspnpm list -g --depth=0 --json; exactly one absolute path ending inv<N>; the listed package's realpath inside that store. The home, printed store and listed group must be canonical (no./.., no link or junction component). On Windows a cmd.exe metacharacter ("%!^&|<>) in those paths is refused before any pinned pnpm command...detour. Dependency links, entry points and in-store lookup roots stay in the store; lookup roots outside it are ignored unless they would supply a declared dependency missing from the store.--store-dirtoaddand rollback. During an update the store and global group are also pinned by device and inode. A changed store, a group that gains a link component or a replaced directory stops the update beforepnpm addor a rollback. Orchestrated post-update verification re-proves a store-pinned owner (requireStoreProof).pnpm add -g @bitkyc08/opencodex@latest. This applies at discovery, preflight, post-install, rollback recheck and rollback readback.docs-sitetroubleshooting/update-failed has the matching section.Before: a default pnpm 12.16.1 global install fails with
sentinel dependency missing: bun. After: owner discovery accepts it after onestore path --dir=<pnpm home>query and updates with the store pinned.Closes #8183
Co-authored-by: Ingwannu [email protected]
Verification
Commands ran with temporary
HOME,OPENCODEX_HOME,CODEX_HOME,CLAUDE_CONFIG_DIRandTMPDIR.tests/update/update-pnpm-global-store.test.tsfails on dev for the default-store case with [Bug]: pnpm global-store links fail updater package verification #8183's symptom. Each review fix added a regression that fails on the previous head and passes now.8b04177192: seven update files (update-pnpm-global-store,update-tree-ownership,update-pnpm,update-orchestrated-pnpm-entry,update-orchestrated-pnpm-global-store-entry,update-orchestrated-session,update-orchestrated-apply): 195 pass, 0 fail.pnpm-command-isolation, capability/mutation guard and scanner,status-install-method,update-mise, file-size ratchet: 47 pass, 304 skip, 0 fail.update-mutation-guardlint cases reports 0 violations across 79 files and all 168 helper sites contracted. On this branch merged with current dev, the only violations are dev's 3 pre-existing ones injob-windows-restart.ts.bun run typecheck,bun run structure:check,bun run privacy:scan,git diff --checkpass.globalStore: trueand a singlestore path --dir=<home>; a symlinkedPNPM_HOMEand an outside relay are refused. pnpm 10.12.3 and 11.20.0 without the global virtual store resolve as legacy owners with no store or version query.8b04177192(gpt-6.1-terra, high): final review PASS, security review PASS, plan audit PASS.bun run test:changed; real Windows; pnpm 12 on Linux arm64; the lint suites inupdate-capability-policy.test.tsandupdate-mutation-scanner.test.ts(skipped locally).Checklist