From e3a08e7f5b48f725c2def0082d5a7538e3de157b Mon Sep 17 00:00:00 2001 From: lodekeeper Date: Fri, 24 Jul 2026 10:35:52 +0000 Subject: [PATCH 1/2] fix: handle Rekor 409 conflict during npm provenance publish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit npm provenance uploads a signed entry to the Sigstore Rekor transparency log via @sigstore/sign (pulled in by lerna-lite -> libnpmpublish -> sigstore). When Rekor is slow the POST is retried; the retry hits the already-created entry and comes back 409, which the sigstore client turns into a fatal TLOG_CREATE_ENTRY_ERROR. This has broken every dev publish since 2026-07-23 (#9670, #9699, #9606, #9697), each with a different Rekor UUID (retry-after-success, not a version collision). @sigstore/sign already fetches the existing entry on 409, but only when fetchOnConflict is true. The sigstore wrapper hardcodes it to false in initWitnesses() at every reachable version (4.0.0, 4.1.1, main), so a dependency bump does not change the behavior. Patch sigstore to set fetchOnConflict: true so the 409 fetches the valid existing entry and the publish proceeds. Provenance is preserved and the attestation is unchanged. 🤖 Generated with AI assistance Co-Authored-By: Claude Opus 4.8 --- patches/sigstore@4.0.0.patch | 13 +++++++++++++ pnpm-lock.yaml | 9 ++++++--- pnpm-workspace.yaml | 3 +++ 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 patches/sigstore@4.0.0.patch diff --git a/patches/sigstore@4.0.0.patch b/patches/sigstore@4.0.0.patch new file mode 100644 index 000000000000..fd9396c6adec --- /dev/null +++ b/patches/sigstore@4.0.0.patch @@ -0,0 +1,13 @@ +diff --git a/dist/config.js b/dist/config.js +index e8b2392f97f2362a61ada39405e322f3881ae93d..e42054bc3b3c2f17a66cdc61fe435628a596f633 100644 +--- a/dist/config.js ++++ b/dist/config.js +@@ -96,7 +96,7 @@ function initWitnesses(options) { + witnesses.push(new sign_1.RekorWitness({ + rekorBaseURL: options.rekorURL, + entryType: options.legacyCompatibility ? 'intoto' : 'dsse', +- fetchOnConflict: false, ++ fetchOnConflict: true, + retry: options.retry ?? exports.DEFAULT_RETRY, + timeout: options.timeout ?? exports.DEFAULT_TIMEOUT, + })); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a8f58e134321..73ded14b8b16 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,6 +25,9 @@ overrides: loupe: ^2.3.6 nan: ^2.19.0 +patchedDependencies: + sigstore@4.0.0: 0d9fa39ff088202d74fca3bec0d7bc1c2822b4bddcab7cd31627235b21b52b32 + importers: .: @@ -10483,7 +10486,7 @@ snapshots: npm-registry-fetch: 19.1.1 proc-log: 6.1.0 semver: 7.7.3 - sigstore: 4.0.0 + sigstore: 4.0.0(patch_hash=0d9fa39ff088202d74fca3bec0d7bc1c2822b4bddcab7cd31627235b21b52b32) ssri: 13.0.0 transitivePeerDependencies: - supports-color @@ -11103,7 +11106,7 @@ snapshots: npm-registry-fetch: 19.1.1 proc-log: 6.1.0 promise-retry: 2.0.1 - sigstore: 4.0.0 + sigstore: 4.0.0(patch_hash=0d9fa39ff088202d74fca3bec0d7bc1c2822b4bddcab7cd31627235b21b52b32) ssri: 13.0.0 tar: 7.5.2 transitivePeerDependencies: @@ -11585,7 +11588,7 @@ snapshots: signal-exit@4.1.0: {} - sigstore@4.0.0: + sigstore@4.0.0(patch_hash=0d9fa39ff088202d74fca3bec0d7bc1c2822b4bddcab7cd31627235b21b52b32): dependencies: '@sigstore/bundle': 4.0.0 '@sigstore/core': 3.0.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index a51187128d23..2227edea9961 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -37,3 +37,6 @@ overrides: elliptic: ">=6.6.1" loupe: "^2.3.6" nan: "^2.19.0" + +patchedDependencies: + sigstore@4.0.0: patches/sigstore@4.0.0.patch From 52811dfade518800bccba1e4d0df80eb9b0d6c8f Mon Sep 17 00:00:00 2001 From: matthewkeil Date: Wed, 5 Aug 2026 22:32:21 +0700 Subject: [PATCH 2/2] chore: pin sigstore to 4.0.0 while patch is in place libnpmpublish declares sigstore ^4.0.0, so a lockfile refresh could float it to 4.1.x and orphan patches/sigstore@4.0.0.patch (pnpm then fails the install with an unused-patch error). Pin the resolution exactly so the patch and the version travel together. Remove the override alongside the patch once sigstore-js#1709 ships and is consumed downstream. --- pnpm-lock.yaml | 1 + pnpm-workspace.yaml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2745052e2dcd..aacaf9f4c3e3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,6 +24,7 @@ overrides: elliptic: '>=6.6.1' loupe: ^2.3.6 nan: ^2.19.0 + sigstore: 4.0.0 patchedDependencies: sigstore@4.0.0: 0d9fa39ff088202d74fca3bec0d7bc1c2822b4bddcab7cd31627235b21b52b32 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 2227edea9961..4da3aa595218 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -37,6 +37,10 @@ overrides: elliptic: ">=6.6.1" loupe: "^2.3.6" nan: "^2.19.0" + # Pin exactly while patches/sigstore@4.0.0.patch is in place (PR #9703). + # Remove together with the patch once sigstore-js#1709 ships and is consumed + # by libnpmpublish/lerna-lite. + sigstore: "4.0.0" patchedDependencies: sigstore@4.0.0: patches/sigstore@4.0.0.patch