[code-infra] Fix react@^18 CI failing on nanoid trust-downgrade#22923
Merged
Conversation
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
LukasTy
force-pushed
the
claude/optimistic-shamir-653f59
branch
from
June 24, 2026 08:05
6153846 to
4301290
Compare
LukasTy
marked this pull request as ready for review
June 24, 2026 08:22
The react@^18 jobs install with `package-overrides`, which re-resolves the dependency graph instead of using the committed lockfile. That re-resolution pulls in [email protected] (a transitive dep of [email protected]), which was published without provenance after 3.3.13 used a staged/trusted publish. The repo's `trustPolicy: no-downgrade` then rejects it with ERR_PNPM_TRUST_DOWNGRADE, failing install before any test runs. `pnpm dedupe` hits the same wall whenever it re-resolves nanoid (pnpm/pnpm#10329). [email protected] restored SLSA provenance and passes the trust policy on its own merit, but is still inside the 3-day minimumReleaseAge soak window, so the resolver falls back to 3.3.14. Exempt only 3.3.15's soak time via minimumReleaseAgeExclude so re-resolution lands on the attested 3.3.15 instead of the unattested 3.3.14 (which a frozen install would re-verify and reject repo-wide). Self-expiring: once 3.3.15 ages past minimumReleaseAge it resolves naturally and the entry can be dropped. Co-Authored-By: Claude Opus 4.8 <[email protected]>
LukasTy
force-pushed
the
claude/optimistic-shamir-653f59
branch
from
June 24, 2026 10:51
4301290 to
5f7553d
Compare
LukasTy
enabled auto-merge (squash)
June 24, 2026 10:55
LukasTy
disabled auto-merge
June 24, 2026 11:06
1 task
mbrookes
pushed a commit
to mbrookes/mui-x
that referenced
this pull request
Jun 27, 2026
…22923) Co-authored-by: Claude Opus 4.8 <[email protected]>
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.
Problem
All
*_react_18CI jobs (test_unit_react_18,test_browser_react_18,test_e2e_react_18) started failing in the Install js dependencies step, before any test runs:Example: https://app.circleci.com/pipelines/github/mui/mui-x/134351/workflows/af018f65-9aac-4f38-86f8-06b220834647/jobs/868597
Root cause
This is the repo's own
trustPolicy: no-downgrade(pnpm supply-chain feature) firing on a false positive:[email protected]was published via a staged/trusted publish;[email protected](2026-06-20) dropped all trust evidence, sono-downgraderejects it as a downgrade. It is published by the legitimate maintainer (ai, also postcss's author), not a real takeover.3.3.14is the newest version old enough to passminimumReleaseAge: 4320(3 days).[email protected]restored SLSA provenance but is still inside the 3-day window, so the resolver can't pick it yet and falls back to the unattested3.3.14.package-overrides(react@^18 ...), which re-resolves the dependency graph and pulls in[email protected]. The other jobs install the committed lockfile frozen, pinned to the trusted[email protected], so they never re-resolve.pnpm dedupehits the same wall whenever it re-resolves nanoid (Dedupe fails with trustPolicyno-downgradepnpm/pnpm#10329).Solutions considered
Two one-line fixes unblock CI. Both are self-expiring: they go inert once
[email protected]ages past the 3-dayminimumReleaseAgewindow and resolves on its own.Option A (chosen) -- relax the soak gate for the attested version
Lets the resolver reach
[email protected], which has restored SLSA provenance and passesno-downgradeon its own merit. Only the time-soak gate is waived, for one explicitly-named, attested version; the trust check stays fully enforced.Option B (rejected) -- whitelist the unattested version in the trust policy
Excludes
[email protected]from the trust check, allowing the unattested build through. The soak gate stays, the provenance/trust gate is relaxed.Comparison
[email protected](SLSA provenance)[email protected](no attestation)no-downgrade; soak stays3.3.15, passes a frozen re-verify3.3.14, fails frozen re-verify unless the exclude is carried repo-wide3.3.15ages in the entry is ignored3.3.14;3.3.14never gains provenanceWhy Option A
Re-resolution (the react@^18 overrides install,
pnpm dedupe, Renovate, a lockfile regen) writes the chosen nanoid version into the committed lockfile, and frozen installs re-verify lockfile entries against the active policies (pnpm 11.1.3+). Committing the unattested3.3.14(Option B) is therefore a standing trust-policy exception that every frozen install repo-wide must carry, and3.3.14never gains provenance to clear it. Committing the attested3.3.15(Option A) passes cleanly, and the soak exemption self-expires within hours. Option A keeps the stronger guarantee (provenance) enforced and only waives the softer time-soak gate.Honest trade-off: Option A does shave soak time off
3.3.15, and soak time is the one gate that would catch malware shipped with valid provenance (e.g. a maintainer/CI compromise). Low-stakes here -- legitimate maintainer, the version has already soaked ~2.4 days, and the entry self-expires the same day -- but noted.Verification
Reproduced locally with the repo's trust settings +
[email protected]:Baseline (no fix): install and
pnpm dedupeboth fail withERR_PNPM_TRUST_DOWNGRADEon3.3.14.Option A: the re-resolving install and
pnpm dedupeboth succeed and resolve[email protected].Frozen re-verify: a committed
3.3.14failsno-downgradeonce the exclude is removed; a committed3.3.15only trips the (transient) soak gate and passes once aged in.I have followed (at least) the PR section of the contributing guide.
🤖 Generated with Claude Code