Skip to content

test(deps): fail fast when a pnpm override contradicts its catalog entry - #514

Merged
thinkclay merged 1 commit into
mainfrom
claude/override-catalog-alignment
Jul 30, 2026
Merged

thinkclay merged 1 commit into
mainfrom
claude/override-catalog-alignment

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Implements the check half of #508.

Why

A pnpm.overrides entry silently outranks the catalog entry of the same name. When they disagree, the catalog lies about what installs. Three shipped incidents: #453, #501 (every web export broken), #511 (dependabot re-introduced #453 verbatim).

What

scripts/check-override-catalog-alignment.mjs, wired into prepush, pnpm lint, and precommit (~100ms):

  • Skips selector-scoped overrides (pkg@<=1.2.3 CVE floors) — they intentionally target a subrange
  • Passes overrides that are a semver subset of the catalog (react-dom 19.2.3 inside ^19.2.3 narrows, doesn't lie)
  • Fails everything else, printing both values and which one actually installs

Verification

scenario result
current tree (9 comparable pairs incl. pin-in-range + CVE selectors) pass ✅
#511 drift reproduced (catalog ~2.110.9, override ~2.86.0) fail ✅
expo-modules-core drift reproduced (56.0.12 vs 56.0.22) fail ✅
restored tree pass ✅

Left open on #508: telling dependabot to stop bumping catalog entries that an override pins.

CI is billing-blocked; verification above is local.

🤖 Generated with Claude Code

A pnpm.overrides entry silently outranks the pnpm-workspace.yaml catalog
entry of the same name; when they disagree, the catalog line reads like the
version in use and is ignored. That drift has shipped real breakage three
times: #453 (supabase-js catalog ignored), #501 (autolinking override pinned
below what @expo/cli needs — every web export died), and #511 (dependabot
bumped the supabase-js catalog while the override stayed put, re-introducing
#453 verbatim).

scripts/check-override-catalog-alignment.mjs compares every override against
the catalog with semver set logic:
- selector-scoped overrides ("pkg@<=1.2.3", CVE floors) are skipped — they
  intentionally target a subrange
- an override that is a SUBSET of the catalog range passes (react-dom pinned
  19.2.3 inside ^19.2.3 narrows, it does not lie)
- anything else fails, naming both values and which one actually installs

Wired into prepush.sh, `pnpm lint`, and precommit. Verified against the two
historical drifts reproduced verbatim (supabase-js ~2.86 vs ~2.110.9, and
expo-modules-core 56.0.22 vs 56.0.12): both fail; current tree passes with 9
comparable pairs checked. Runs in ~100ms.

Closes #508's check half. The dependabot-ignore half (stop bumping catalog
entries an override pins) stays open on the issue.

Co-Authored-By: Claude Fable 5 <[email protected]>
@thinkclay
thinkclay merged commit 67e6c31 into main Jul 30, 2026
5 of 7 checks passed
@thinkclay
thinkclay deleted the claude/override-catalog-alignment branch July 30, 2026 20:24
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.

1 participant