Add pnpm supply-chain policy (recipe A) - #163
Merged
Merged
Conversation
Adds pnpm-policy.yaml enforcing a 2-day minimum release age on third-party npm releases: a compromised release is normally reported and yanked within hours, so the short wait catches it without stalling upgrades. First-party packages (accounts we maintain, plus our owned scopes) skip the wait since we publish them ourselves. The exemption list is derived from what we actually publish and resolve in this lockfile (via `intersect: true`), not hand-maintained, so it can't silently drift out of date. This repo pins pnpm@8.15.0 (< 10.16), which predates the allowBuilds key, so policy is generated with --builds-key onlyBuiltDependencies. No packages currently require install-script approval on this pnpm version. pnpm-workspace.yaml had no prior onlyBuiltDependencies entry to carry over. No git/URL-sourced transitive dependencies were found in pnpm-lock.yaml, so blockExoticSubdeps stays true (default). Wires `pnpm run policy:check` into the existing build-parser job in .github/workflows/ci.yml, right after the root `pnpm install` step. Part of the org-wide rollout tracked in constructive-io/constructive-planning#1464. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CEswUi4ANuB58rva48aHge
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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
Rolls out the org-wide pnpm supply-chain policy to this repo, part of constructive-io/constructive-planning#1464.
pnpm-policy.yamlat the workspace root:minimumReleaseAge: 2d— third-party releases wait two days before they can be installed. Most malicious releases are found and yanked well inside that window, so this catches supply-chain compromises without stalling normal upgrades.blockExoticSubdeps: true(default kept) — no git/URL-sourced transitive dependencies were found inpnpm-lock.yaml, so nothing needed loosening here.maintainers: [pyramation]and our ownedscopes(@constructive-io,@constructive-db,@launchql,@pgpm,@pgpmjs,@pgsql) are exempt from the wait — we publish those ourselves, so waiting protects nothing.intersect: true— the exemption list inpnpm-workspace.yamlonly lists the first-party packages this lockfile actually resolves (6 scope globs + 5 named packages), not the full ~1100 we publish org-wide. Derived automatically, not hand-maintained.allowBuilds: {}— no install-script approvals were needed (see deviation note below).exceptions: []— none needed.pnpm-policyand@constructive-io/pnpm-policy(pinned exact at0.2.1, persave-exact=truein.npmrc) as root devDependencies.policy/policy:checkscripts to the rootpackage.json.pnpm run policypatches the managed block intopnpm-workspace.yaml(packages/comments untouched).pnpm run policy:checkinto.github/workflows/ci.yml, in thebuild-parserjob, immediately after the rootpnpm installstep.Deviations from the standard recipe
packageManager: pnpm@8.15.0, which predates theallowBuildskey (needs pnpm >= 10.16). Bothpolicyandpolicy:checkscripts pass--builds-key onlyBuiltDependenciesso the tool emits/checks the older key name.pnpm-workspace.yamlhad no prioronlyBuiltDependenciesentry, so there was nothing to carry over/delete.pnpm installran all install scripts (@launchql/protobufjspostinstall,parserprepare) without anyERR_PNPM_IGNORED_BUILDSgate — that enforcement is a pnpm 9/10+ feature. So no packages needed an explicit approval entry. This repo builds via WASM (seeLOADING_WASM.md), not node-gyp/native compilation, so there's no native-binding install step to approve either.build-parserjob (not matrixed, runs once per trigger) over the matrixedbuild-wasm/testjobs, to avoid running the check redundantly 6x per workflow run.Verification
All three passed locally before opening this PR:
🤖 Generated with Claude Code
https://claude.ai/code/session_01CEswUi4ANuB58rva48aHge