You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3854491
Browse filesBrowse the repository at this point in the historyBrowse files
Never patch a pnpm, yarn or vlt dependency the user patched
A package the project patches itself is applied by the package manager
on top of whatever tarball the lock names, so a Socket pin of it either
fails the install or installs the user's diff stacked on the Socket
patch. The CLI's consent gate (patch::user_patches::UserPatchIndex, #1646)
already kept `scan` / `get` / `vendor` / `apply` from wiring such pnpm,
yarn berry and patch-package packages unless --allow-patch-conflicts, but
two consumers did not read that evidence:
- vex discovery attested a pnpm, yarn, vlt (or npm / Bun) pin of such a
package: a pin written before the patch was declared, or one an
--allow-patch-conflicts run wrote.
- the in-memory hosted engine (Node addon, hosted-bundle) has no gate in
front of it and rewired them.
One detector, three consumers. UserPatchIndex's pnpm / yarn /
patch-package parse rules are factored into pure helpers (pnpm_yaml,
yarn_manifest, yarn_lock, patch_package_dirs, patch_file), which the
consent gate keeps using, plus UserPatchIndex::npm_family_in, which reads
the same declarations through a ProjectView (disk, snapshot or memory):
package.json's pnpm.patchedDependencies, yarn patch: descriptors and
patch-package dirs, pnpm-workspace.yaml's patchedDependencies, the
patches of the given pnpm locks (top-level map, patch_hash suffixes) and
yarn.lock's user patch: locators. It leaves out npm's and Bun's own
top-level patchedDependencies, which no other package manager reads and
which #711 / #367 / #2010 already judge per resolution.
- Discovery: a new vex::discover::user_patched pass marks every npm
ref the index protects UnattestedKind::UserPatchedDependency (the ref
stays, so rollback / remove / list still find it). The bytes the
install runs are Socket's patch alone only when no user patch is
declared, so a declared one always withholds the statement, with or
without consent.
- Hosted: engine::withhold_user_patched drops such candidates from every
rewriter and records them skipped `user_patch_conflict` (the consent
gate's code), plus a warning in memory. The in-memory engine always
applies it; the CLI disk flow applies it unless --allow-patch-conflicts
(it adds the Rush lock the consent gate does not read).
- Vendored: unchanged. Every vendored entry point already runs the
consent gate, which refuses (`vendor`, vendored writers) or skips
(`scan`, `apply`) these packages.
Override: the existing --allow-patch-conflicts, invocation-only. It
already covered pnpm / yarn / patch-package at the consent gate and now
also lifts the engine gate; vex never attests while the patch is
declared. npm / Bun native patches stay refused even with consent, as
before.
vlt has no patch mechanism (vlt@1.6.2 has no patchedDependencies,
patch_hash or `patch` command; vlt.json modifiers rewrite specs), and
neither has yarn classic, so patch-package is what is read for both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments