Adopt org pnpm supply-chain policy (recipe A) - #342
Merged
Conversation
Third-party releases now wait 2 days before install: a compromised release is normally reported and yanked within hours, so the wait catches it without stalling legitimate upgrades. First-party packages (our own scopes/maintainer) skip the wait since we control what we publish. The exemption list in pnpm-workspace.yaml is generated from the pinned @constructive-io/pnpm-policy inventory package, not hand-maintained, so it can't silently drift out of sync with what we actually own. - pnpm-policy.yaml: 2d minimumReleaseAge, blockExoticSubdeps, intersect: true (only emits the ~7 first-party packages this lockfile resolves out of ~891 in the inventory). - allowBuilds: nx, unrs-resolver, @launchql/protobufjs — each already ran an install script pre-policy; documented with a real reason. - @constructive-io/pnpm-policy pinned exact (0.2.1) so an inventory bump shows as a visible diff instead of silently widening the exemption list. - Wired pnpm run policy:check into the existing Parser tests workflow, right after its pnpm install step. Part of constructive-io/constructive-planning#1464 (recipe A rollout). 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.
Rolls this repo onto the org pnpm supply-chain policy. Part of the queue in constructive-io/constructive-planning#1464 (recipe A).
What changes
pnpm-policy.yaml(new):minimumReleaseAge: 2d,blockExoticSubdeps: true(this workspace resolves zero git/tarball transitive deps, verified against the lockfile),intersect: true, maintainerpyramation, and 6 owned scopes (@constructive-io,@constructive-db,@launchql,@pgpm,@pgpmjs,@pgsql).pnpm-workspace.yaml— generated block: 6 scope globs + 7 first-party packages exempt from the wait (git-changed,libpg-query,makage,nested-obj,pnpm-policy,strfy-js,yamlize), 884 omitted since this workspace does not resolve them. Confirmedintersect: trueis doing real work: total inventory is 891 first-party names (7 + 884), and this parser monorepo only pulls in 7 of them — far fewer than the ~1100-package org inventory the task flagged as a risk.allowBuilds— three packages were already running install scripts pre-policy and now need an explicit reason:nx: native postinstall step (downloads/links its native project-graph daemon binary)unrs-resolver: ships a native (Rust/N-API) module resolver binary that must be built/linked on install@launchql/protobufjs: protobufjs's own postinstall (environment/feature detection for the protobuf.js runtime, no native compile)package.json—@constructive-io/pnpm-policypinned exactly at0.2.1(not^0.2.1), so an inventory bump shows as a visible diff instead of silently widening the exemption list.pnpm-policyCLI added as^0.2.2. Addedpolicy/policy:checkscripts..github/workflows/run-tests.yaml— added apnpm run policy:checkstep right after the existingpnpm installstep in the (only)parser-testsjob.pnpm-lock.yaml— resolves the two new devDependencies. Note: pnpm also reformatted the file's YAML quoting style (double → single quotes) as a side effect of running install with the local pnpm toolchain (11.11) vs whatever generated the file previously — pure formatting noise,pnpm install --frozen-lockfilestill passes.Verification (all run and read, not assumed)
pnpm run policy:check→pnpm-workspace.yaml matches the policy✓pnpm install --frozen-lockfile→ succeeds, no ignored-builds errors ✓pnpm run policyrun twice →pnpm-workspace.yamlbyte-identical both times (shasum matched) ✓Deviations / notes
.github/workflows/run-tests.yamlpinspnpm/action-setup@v4toversion: 9. pnpm's nativeminimumReleaseAge/blockExoticSubdeps/allowBuildsenforcement requires pnpm ≥ 10.16 (allowBuildsis the newer key name for that version; older pnpm usedonlyBuiltDependencies). The repo has nopackageManagerfield pinning a version anywhere, so I generated with the modern default key (allowBuilds), matching the toolchain actually used for local installs (pnpm 11.11) and bypolicy:check(a plain Node CLI that only diffs YAML, so it still catches manual drift in CI regardless of pnpm version). What it does not do under the current pnpm 9 pin: pnpm itself won't actively enforce the release-age wait or build-script gating during CI'spnpm installstep, since v9 predates those pnpm-native features entirely. Bumping CI's pnpm pin to ≥10.16 was out of scope for this recipe rollout (a separate, matrix-wide change to an already-passing test workflow) — flagging it here as a natural follow-up rather than making it silently.pnpm-policy generate(via the underlyingpnpm add/pnpm install) triggers pnpm's ownERR_PNPM_IGNORED_BUILDSauto-stub behavior, which writes a placeholderallowBuilds: {pkg: "set this to true or false"}block intopnpm-workspace.yamloutside pnpm-policy's managed section. That's pnpm 11 itself, not pnpm-policy. Removed the stray stub by hand each time it appeared; the committed file has none.Do not merge — for review only.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CEswUi4ANuB58rva48aHge