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
fix(build): parameterize the symlink policy so verify-pins survives no-install (24)
assertSafeSymlinks unconditionally realpathSync'd the workspace node_modules
root, so the advisory verify-binary-pins.yml job — which deliberately skips
`pnpm install` — threw ENOENT on a clean checkout and failed PR #19's
verify-pins check.
Replace the implicit global allowlist with an explicit policy every call site
must state: OWN_ROOT_ONLY (foreign tarball/cache trees and the digest
generator's scratch extraction — only the tree's own canonical root may be a
link target) vs ALLOW_WORKSPACE_NODE_MODULES (installed pnpm packages, where
the workspace node_modules root is additionally a legitimate target). A
missing node_modules under ALLOW_WORKSPACE_NODE_MODULES is now tolerated —
absence just means that allowance doesn't apply, not a crash.
Wire the correct policy into all four call sites (vendor-platform-packages.mjs
x2, prepare-package-deps.mjs, record-native-binary-digests.mjs) and add
scripts/safe-symlinks.test.mjs (node:test, 12 cases) covering both policies,
the missing-node_modules case, and genuine escape attempts under each policy
that must still be refused. Wired into `pnpm test` via a new `test:scripts`
script.
Also harden verify-binary-pins.yml: add `permissions: contents: read`, and
extend its path triggers to scripts/safe-symlinks.mjs,
scripts/vendor-platform-packages.mjs, and package.json so a future change to
the check itself re-runs the job. The advisory-not-gate framing in the
workflow's header comment is untouched.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments