Skip to content

chore(deps): move to pnpm 11 and put pnpm config where v11 reads it - #2411

Merged
kompiro merged 6 commits into
mainfrom
chore/pnpm-11
Aug 8, 2026
Merged

kompiro merged 6 commits into
mainfrom
chore/pnpm-11

Conversation

@kompiro

@kompiro kompiro commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Purpose

Closes #2401

Summary

Moves the workspace to pnpm 11.20.0 and relocates pnpm's configuration to pnpm-workspace.yaml, where v11 actually reads it. The lockfile comes out byte-identical and all 22 transitive security floors resolve to the same versions.

The migration's real hazard is that pnpm warns rather than errors when it finds the now-ignored pnpm field, so a careless version bump would have dropped every GHSA remediation since ADR-1474 while leaving CI green.

Changes

  • overrides and allowBuilds → pnpm-workspace.yaml. pnpm 11 stops reading package.json#pnpm (pnpm#10086); onlyBuiltDependencies is removed in favour of allowBuilds.
  • packageManager → [email protected], and pnpm/action-setup → v6.0.10 across all 19 usages.
  • allowBuilds denies @vscode/vsce-sign and keytar explicitly. strictDepBuilds now defaults to true, so an undeclared postinstall is an install error; both were already being skipped, so false preserves behaviour.
  • minimumReleaseAge stays at pnpm's 1-day default — see below.
  • .claude/rules/dependabot.md gains a "where the overrides live" section, and ADR-1474's operating rule gets a relocation note.
  • scripts/ci/pnpm-config-location.test.ts asserts no package.json carries a pnpm field again, no removed v11 setting is in use, and the pin is a pnpm 11.
  • ADR-2401, plus two ADR assumptions: repointed at the new file.

Corrections to the issue's plan

The 7-day minimumReleaseAge I proposed in #2401 breaks the build. Setting 10080 makes pnpm install fail today:

✗ Lockfile failed supply-chain policy check (1479 entries in 14.4s)
[ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION] 16 lockfile entries failed verification:
  [email protected] was published at 2026-08-03 ... within the minimumReleaseAge cutoff
  [email protected] ... (+ 13 @rolldown/binding-* entries)

Those are in main's committed lockfile already — not a fresh resolution. The issue framed the setting as "the same policy as the Dependabot cooldown, in a different file", and that was wrong. The cooldown delays PRs Dependabot raises for declared dependencies; minimumReleaseAge verifies all 1479 lockfile entries on every install, transitive ones nobody chose included. rolldown ships often and arrives under vite. Matching the number turns a supply-chain preference into a time-dependent build gate that would break CI for days at a stretch. One day still covers the attack this defends against.

The codemod was not used. codemod run pnpm-v10-to-v11 needs interactive TTY approval (Failed to get user input: The input device is not a TTY), and what it asks approval for is running code fetched at runtime from app.codemod.com via node -e. Letting remotely-fetched code rewrite 22 supply-chain pins, in a change whose whole purpose is preserving them, is the wrong trade when the surface is small enough to migrate by hand and read in full.

How the override move was verified

Two stages, to separate "the config moved" from "pnpm changed":

  1. Config moved, still on pnpm 10.33 (which reads both locations) → pnpm install --frozen-lockfile passes, pnpm-lock.yaml untouched.
  2. Then the version bump → same result.

End state: lockfile byte-identical, overrides: block identical at 22 entries, [email protected] and [email protected] still resolved. Full suite green (3308 + 1227 + 582 + 493 + 344 + 272 + 67 + …), pnpm run build, vscode build, and a CLI smoke test all pass.

One test failure surfaced and was not a pnpm 11 regression: karasu-vscode's webview tests fail in a fresh clone because @karasu-tools/i18n's export map points import at ./dist/index.js, which is gitignored and only exists after a build. Building i18n fixes it, and it would reproduce identically on pnpm 10. Root pnpm run test not being hermetic in a fresh clone is pre-existing; flagging it rather than fixing it here.

Preview URL

N/A — no app-facing change.

Scope filter (new-feature PRs only)

  • N/A — not a new-feature PR

Dependency & license impact

  • N/A — no production dependency added or bumped across a major version

Every resolved version is unchanged; only the package manager and the location of its config moved.

Manual Verification Checklist

  • Rebuild the devcontainer and confirm a clean pnpm install (first install after this lands purges node_modules — the store moves to v11/SQLite; non-interactive shells need CI=true)
  • At the next release, confirm OIDC publish still works: pnpm 11 makes pnpm publish native, so pnpm's version now governs the Trusted Publishing floor instead of the npm CLI's (ADR-2397 / ADR-9020)

TPL impact

Disposition: Designed against TPL-2253. Its checklist item "除去を宣言する living doc を更新したか" is what surfaced the documentation hazard: searching for pnpm.overrides rather than working from the issue's file list found .claude/rules/dependabot.md, which the issue never mentioned and which is the entry point for the very task that maintains those floors. The "CI に grep ガードを 1 つ置く" item is discharged by scripts/ci/pnpm-config-location.test.ts. No new TPL — the perspective already exists and this is its second consumer in a row.

The guard was verified to fail before being trusted: reinstating a pnpm.overrides block in package.json breaks it.

Related Docs

  • docs/adr/2401-pnpm-11-migration.md (new)
  • .claude/rules/dependabot.md — new "override はどこにあるか" section
  • docs/adr/1474-*.md — relocation note on the operating rule
  • CONTRIBUTING.md — prerequisite now pnpm 11+

kompiro added 5 commits August 8, 2026 15:25
pnpm 11 stops reading the `pnpm` field of `package.json` (pnpm/pnpm#10086),
which is where all 22 transitive security floors lived. It does not error on
finding one -- it warns and continues with the setting absent -- so a silent
migration would have dropped every GHSA remediation from ADR-1474 onward while
leaving the build green. The Node 24 devcontainer already ships pnpm 11.17, so
that warning was printing on every command.

Moves `overrides` and `allowBuilds` into `pnpm-workspace.yaml`, verified in two
stages to isolate the variable: first the config move alone under pnpm 10.33
(which reads both locations) confirmed `--frozen-lockfile` passes with the
lockfile untouched, then the version bump. Both stages leave `pnpm-lock.yaml`
byte-identical, all 22 overrides intact, and resolution unchanged.

`allowBuilds` denies `@vscode/vsce-sign` and `keytar` explicitly rather than
leaving them undeclared: `strictDepBuilds` now defaults to true, so an
undeclared postinstall is an install error. Both were already skipped.

Leaves `minimumReleaseAge` at pnpm's 1-day default rather than raising it to
match the 7-day Dependabot cooldown, as #2401 proposed. The two have different
scopes -- the cooldown delays PRs for declared deps, this verifies all 1479
lockfile entries including transitive ones. At 7 days the current lockfile is
already non-compliant (`[email protected]` + 13 bindings and `[email protected]` come
in under vite and are five days old), so every install including CI would fail
until the window passed.

Refs #2401
The dangerous part of the v11 move is not the code, it is the documentation.
ADR-1474 and the ~10 security ADRs citing it spell the remediation procedure
out by filename -- "root `package.json` の `pnpm.overrides`" -- and
`.claude/rules/dependabot.md` repeats it. That rule loads automatically during
Dependabot triage, the exact task that maintains those 22 floors. Left alone,
the next triage raises a floor in a file pnpm no longer reads, sees a green
build, and ships the unpatched dependency.

Adds a "where the overrides live" section to the rule with a pointer that past
ADRs are historical, and a guard asserting no `package.json` carries a `pnpm`
field again -- pnpm only warns, so without one CI has nowhere to fail. The
guard also rejects the ten settings v11 removed and requires a pnpm 11 pin,
since below 11 the field is still honoured and the assertion would be
enforcing a shape the toolchain does not need.

Refs #2401
Also repoints two ADR `assumptions:` entries at `pnpm-workspace.yaml`. They
grepped `package.json` for an override and would otherwise assert a floor that
had moved -- the same vacuous-guard trap the ADR describes.

Refs #2401
…epBuilds

`cloudflare/wrangler-action` runs its own `pnpm add wrangler@4` at deploy time,
which pulls `workerd` and its postinstall. Under pnpm 10 that build was skipped
with a warning and the deploy worked; pnpm 11 defaults `strictDepBuilds` to
true, so the same skip is now `ERR_PNPM_IGNORED_BUILDS` and the step fails.

Declared `false` to match what was already happening rather than `true`, which
would newly execute a build no deploy has ever needed.

Local installs cannot surface this: `workerd` is not in our lockfile, it only
exists inside the action's transient install. Four workflows use the action
(preview / deploy / nest-deploy / spike-preview) and only preview runs on PRs,
so the other three would have broken after merge.

Refs #2401
# Conflicts:
#	docs/adr/effective.md
#	docs/adr/graph.md
@kompiro

kompiro commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

Merged main (#2407, adr-tools 0.0.11). Two conflicts, both in generated ADR artifacts (effective.md / graph.md) — resolved by regenerating with 0.0.11 rather than hand-merging, since #2407 changed that output format. package.json auto-merged cleanly.

The 1-day policy fired for real during the merge, which is worth recording since it is the first live test of the setting this PR chose:

[ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION] 1 lockfile entries failed verification:
  @kompiro/[email protected] was published at 2026-08-08T14:19:57.000Z,
  within the minimumReleaseAge cutoff

#2407 published adr-tools 0.0.11 and adopted it in karasu about an hour later — a completely normal first-party workflow that the age check has no way to distinguish from a suspicious one.

Resolved with minimumReleaseAgeExclude for @kompiro/adr-tools and @kompiro/tpl-tools, on the reasoning that what this policy actually buys is the window in which someone else spots a compromised release and gets it yanked. These are published from our own repos via OIDC with provenance and have essentially no other consumers, so there is no community to do that noticing — the delay costs the publish-then-adopt loop and buys nothing back. The exclusion is documented as valid only while these stay first-party; a third-party package must not be added to it.

Worth being explicit that this is a deliberate narrowing of a security control, not a workaround to get CI green. The alternative was holding the PR until tomorrow 14:20 UTC, which would only defer the same collision to the next adr-tools release.

All checks green after the merge, including the Cloudflare preview deploy that the workerd fix repaired.

@kompiro
kompiro merged commit bbf5445 into main Aug 8, 2026
15 checks passed
@kompiro
kompiro deleted the chore/pnpm-11 branch August 8, 2026 23:11
kompiro added a commit that referenced this pull request Aug 9, 2026
main moved the security floors out of the root package.json `pnpm.overrides`
and into pnpm-workspace.yaml's `overrides:` (#2411 / ADR-2401) — pnpm 11 does
not read the `pnpm` field at all. So the half of this branch's fix that lived
in package.json had lost its home: taking it forward verbatim would have left
a `pnpm` field pnpm 11 silently ignores.

Resolved by taking main's package.json wholesale and re-applying the floor
raise where the floors now live: pnpm-workspace.yaml `dompurify: ^3.4.12` ->
`^3.4.13`. The direct declaration in packages/app merged cleanly and is
unchanged.

Re-ran the install under pnpm 11.20.0. The lock still resolves every dompurify
to 3.4.13 with no 3.4.12 entry, and the diff against main is only the three
dompurify lines. build and test pass.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
kompiro added a commit that referenced this pull request Aug 9, 2026
Two independent collisions with main.

The generated ADR artifacts (effective.md, graph.md, graph/build.md)
conflicted because adr-tools 0.0.11 dropped the ADR counts from their headers
(#2407) while this branch had regenerated them with the counts still in. Took
main's files and re-ran `pnpm adr:regenerate` rather than hand-resolving
generated output.

The real one was silent: main relocated the security floors to
pnpm-workspace.yaml (#2411 / ADR-2401) and added a rules section saying so,
explicitly warning that older security ADRs point at the dead location. The
section this branch adds pointed at exactly that dead location, and git merged
the two without a conflict. Retargeted the reachable state and the grep to
pnpm-workspace.yaml, and added the lock check as step 4.

ADR-2404 gets the same treatment: assumptions now grep pnpm-workspace.yaml
(the old `grep: package.json :: "dompurify"` would fail now that the pnpm
field is gone), and a note records that the fix moved location mid-flight,
since leaving it in package.json would have made pnpm 11 ignore it silently.

adr:validate 315/0 errors; check-assumptions both ADR-2404 entries pass.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

This branch was successfully deployed

1 active deployment
preview — 9c0a6bd9 Deployed Aug 8, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: upgrade pnpm 10.33.0 to 11.x (breaking config migration: pnpm.overrides and onlyBuiltDependencies)

1 participant