Skip to content

test: pin the e2e npm CLI install to an explicit major (#438) - #439

Merged
thekevinbot merged 4 commits into
mainfrom
claude/issue-438-pin-e2e-npm
Jul 9, 2026
Merged

thekevinbot merged 4 commits into
mainfrom
claude/issue-438-pin-e2e-npm

Conversation

@thekevinbot

Copy link
Copy Markdown
Collaborator

Red phase for #438, per the red/green TDD workflow (test-only commit pushed alone; the one-line fix follows after red CI is witnessed).

The bug

Every e2e fixture publish job is red on every PR since npm's latest dist-tag moved to 12.0.0 (between the last green e2e run on July 5 and today). e2e-fixture-job.yml's "Pin npm to a Trusted-Publishing-capable version" step runs npm install -g npm@latest, and npm 12.0.0's published bundle ships libnpmpublish — which declares and requires the unscoped sigstore package — with no unscoped sigstore on its resolution path (only @sigstore/* scoped packages and a nested copy under pacote/node_modules). Every provenance publish dies at module load:

npm error Cannot find module 'sigstore'
npm error - .../npm/node_modules/libnpmpublish/lib/provenance.js

Reproduced outside CI with a fresh npm install -g npm@latest and a failing require.resolve('sigstore', { paths: [<libnpmpublish>/lib] }). Full investigation in #438. The real consumer release path (release.yml / _matrix.yml) uses setup-node's bundled npm and is not exposed — this is CI-harness-only, but it blocks every PR, including #437.

The contract this test pins

The step installs an explicitly-majored, Trusted-Publishing-capable npm (npm install -g npm@<major>, major ≥ 11 — TP landed in 11.5.1) and never a floating npm@latest, so an upstream release can only change CI's npm via a reviewed version-bump commit. Same mutable-external failure class as #436's tag race: CI went red with no commit to blame.

Expected red

unit (*) should fail on exactly the two assertions of test/workflows/e2e-npm-pin.test.ts. Local run against this commit:

 Test Files  1 failed (1)
      Tests  2 failed (2)

(The e2e fixture jobs on this red commit will also fail — that's #438 itself, still unfixed at this commit.)

The follow-up green commit changes npm@latest → npm@11 in e2e-fixture-job.yml; the e2e suite going green on it is the end-to-end proof.

Closes #438.

🤖 Generated with Claude Code

https://claude.ai/code/session_016dGfhcExpMzjQLnRU5aYyx


Generated by Claude Code

Red phase. npm's latest dist-tag moved to 12.0.0 between the last green
e2e run (2026-07-05) and 2026-07-09, and npm 12.0.0's bundle ships
libnpmpublish (which requires the unscoped 'sigstore' package) with no
unscoped sigstore on its resolution path — so e2e-fixture-job.yml's
`npm install -g npm@latest` step now breaks every fixture publish on
every PR with MODULE_NOT_FOUND, no commit to blame.

The new workflow-contract test asserts the step installs an explicitly-
majored, Trusted-Publishing-capable npm (npm@<major>, major >= 11) and
never `npm@latest`. Expected red: both assertions fail against the
current step.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016dGfhcExpMzjQLnRU5aYyx
Green phase. npm 12.0.0 (the current `latest`) ships a bundle whose
libnpmpublish requires the unscoped 'sigstore' package with no such
package on its resolution path, so every provenance publish dies at
module load. Pinning the major keeps the Trusted-Publishing-capable
CLI (TP landed in 11.5.1) while making an upstream release unable to
change CI's npm without a reviewed version-bump commit here.

skip-changelog: CI-harness-internal pin in the e2e fixture job; no
consumer-observable surface.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016dGfhcExpMzjQLnRU5aYyx

Copy link
Copy Markdown
Collaborator Author

Red→green complete, fully green CI.

  • Red (test-only f61ec90): unit (*) failed on exactly the two new assertions in test/workflows/e2e-npm-pin.test.ts (run 29016118446); the e2e fixture suite was red with the npm 12 sigstore MODULE_NOT_FOUND this PR fixes.
  • Green (fix ef17659): CI Gate success — all checks pass, including all 13 e2e fixture publish jobs under npm@11, which is the end-to-end proof the sigstore breakage is gone.

This PR unblocks every other PR's e2e suite (currently #437), so it should merge first; #437's branch then updates and its e2e reruns green.


Generated by Claude Code

@thekevinbot
thekevinbot enabled auto-merge (squash) July 9, 2026 15:00
@thekevinbot
thekevinbot merged commit 18402c8 into main Jul 9, 2026
124 checks passed
@thekevinbot
thekevinbot deleted the claude/issue-438-pin-e2e-npm branch July 9, 2026 15:16
github-actions Bot added a commit that referenced this pull request Jul 9, 2026
test: pin the e2e npm CLI install to an explicit major (#438) (#439)

* test: pin the e2e npm CLI install to an explicit major (#438)

Red phase. npm's latest dist-tag moved to 12.0.0 between the last green
e2e run (2026-07-05) and 2026-07-09, and npm 12.0.0's bundle ships
libnpmpublish (which requires the unscoped 'sigstore' package) with no
unscoped sigstore on its resolution path — so e2e-fixture-job.yml's
`npm install -g npm@latest` step now breaks every fixture publish on
every PR with MODULE_NOT_FOUND, no commit to blame.

The new workflow-contract test asserts the step installs an explicitly-
majored, Trusted-Publishing-capable npm (npm@<major>, major >= 11) and
never `npm@latest`. Expected red: both assertions fail against the
current step.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016dGfhcExpMzjQLnRU5aYyx

* fix: pin the e2e npm CLI install to npm@11 (#438)

Green phase. npm 12.0.0 (the current `latest`) ships a bundle whose
libnpmpublish requires the unscoped 'sigstore' package with no such
package on its resolution path, so every provenance publish dies at
module load. Pinning the major keeps the Trusted-Publishing-capable
CLI (TP landed in 11.5.1) while making an upstream release unable to
change CI's npm without a reviewed version-bump commit here.

skip-changelog: CI-harness-internal pin in the e2e fixture job; no
consumer-observable surface.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016dGfhcExpMzjQLnRU5aYyx

* chore: drop the npm-pin contract test; cite npm/cli#9722 in the pin comment

A test asserting the literal text of a dependency pin restates the
reviewed diff and taxes every future bump without guarding anything a
review can't see. The pin itself stays; the upstream bug reference in
the workflow comment now documents when to lift it.

skip-changelog: CI-internal test removal, no consumer surface.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016dGfhcExpMzjQLnRU5aYyx

* chore: date the npm pin's revisit (#440, 2026-08-09)

skip-changelog: comment-only edit.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016dGfhcExpMzjQLnRU5aYyx

---------

Co-authored-by: Claude <[email protected]>
github-actions Bot added a commit that referenced this pull request Jul 9, 2026
test: pin the e2e npm CLI install to an explicit major (#438) (#439)

* test: pin the e2e npm CLI install to an explicit major (#438)

Red phase. npm's latest dist-tag moved to 12.0.0 between the last green
e2e run (2026-07-05) and 2026-07-09, and npm 12.0.0's bundle ships
libnpmpublish (which requires the unscoped 'sigstore' package) with no
unscoped sigstore on its resolution path — so e2e-fixture-job.yml's
`npm install -g npm@latest` step now breaks every fixture publish on
every PR with MODULE_NOT_FOUND, no commit to blame.

The new workflow-contract test asserts the step installs an explicitly-
majored, Trusted-Publishing-capable npm (npm@<major>, major >= 11) and
never `npm@latest`. Expected red: both assertions fail against the
current step.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016dGfhcExpMzjQLnRU5aYyx

* fix: pin the e2e npm CLI install to npm@11 (#438)

Green phase. npm 12.0.0 (the current `latest`) ships a bundle whose
libnpmpublish requires the unscoped 'sigstore' package with no such
package on its resolution path, so every provenance publish dies at
module load. Pinning the major keeps the Trusted-Publishing-capable
CLI (TP landed in 11.5.1) while making an upstream release unable to
change CI's npm without a reviewed version-bump commit here.

skip-changelog: CI-harness-internal pin in the e2e fixture job; no
consumer-observable surface.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016dGfhcExpMzjQLnRU5aYyx

* chore: drop the npm-pin contract test; cite npm/cli#9722 in the pin comment

A test asserting the literal text of a dependency pin restates the
reviewed diff and taxes every future bump without guarding anything a
review can't see. The pin itself stays; the upstream bug reference in
the workflow comment now documents when to lift it.

skip-changelog: CI-internal test removal, no consumer surface.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016dGfhcExpMzjQLnRU5aYyx

* chore: date the npm pin's revisit (#440, 2026-08-09)

skip-changelog: comment-only edit.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016dGfhcExpMzjQLnRU5aYyx

---------

Co-authored-by: Claude <[email protected]>
thekevinbot added a commit that referenced this pull request Jul 9, 2026
…ound-trip (#441)

From the #439 retrospective: a one-line npm CLI pin (routing around the
npm 12.0.0 sigstore bundle breakage, npm/cli#9722) arrived with a
workflow-contract test asserting the pin's literal text and a full
red/green two-push round-trip — ceremony disproportionate to a reviewed
one-line dependency bump, cut in review.

Two clarifications, keeping the core thrust intact:

- Workflow-contract tests are earned: test/workflows/ guards invariants
  whose regression is silent in review and behavior-affecting in
  production (install fallback, missing env, race-dependent ordering) —
  never the literal text of a version pin, runner label, or timeout,
  where the diff review is the gate and the test is a standing tax.
- The red/green skip clause names CI toolchain/dependency pins
  explicitly, including pins that fix an outage: the suite going green
  on the PR is the evidence.

skip-changelog: agent-workflow docs, no consumer surface.


Claude-Session: https://claude.ai/code/session_016dGfhcExpMzjQLnRU5aYyx

Co-authored-by: Claude <[email protected]>
github-actions Bot added a commit that referenced this pull request Jul 9, 2026
docs: workflow-contract tests are earned; CI pins skip the red-test round-trip (#441)

From the #439 retrospective: a one-line npm CLI pin (routing around the
npm 12.0.0 sigstore bundle breakage, npm/cli#9722) arrived with a
workflow-contract test asserting the pin's literal text and a full
red/green two-push round-trip — ceremony disproportionate to a reviewed
one-line dependency bump, cut in review.

Two clarifications, keeping the core thrust intact:

- Workflow-contract tests are earned: test/workflows/ guards invariants
  whose regression is silent in review and behavior-affecting in
  production (install fallback, missing env, race-dependent ordering) —
  never the literal text of a version pin, runner label, or timeout,
  where the diff review is the gate and the test is a standing tax.
- The red/green skip clause names CI toolchain/dependency pins
  explicitly, including pins that fix an outage: the suite going green
  on the PR is the evidence.

skip-changelog: agent-workflow docs, no consumer surface.

Claude-Session: https://claude.ai/code/session_016dGfhcExpMzjQLnRU5aYyx

Co-authored-by: Claude <[email protected]>
thekevinbot added a commit that referenced this pull request Jul 16, 2026
npm 12.0.0's published bundle omitted libnpmpublish's unscoped
`sigstore` dependency, so every `npm publish --provenance` in the e2e
fixture job died at module load (npm/cli#9722). #438/#439 pinned
`npm install -g npm@11` as a workaround, with #440 tracking the unpin.

npm/cli#9740 fixed the packing bug and shipped in npm 12.0.1
(2026-07-10); the packed tarball again contains
`node_modules/sigstore`. `latest` now resolves to 12.0.1. Verified
locally with a fresh `npm install -g npm@latest` (→ 12.0.1) that
`require.resolve('sigstore', { paths: [libnpmpublish/lib] })` resolves
— the exact check that failed on 12.0.0.

Kept as an explicit major (npm@12), never floating `npm@latest`, per
the #438/#439 contract. The e2e fixture suite going green on this PR
is the end-to-end verification.

skip-changelog: CI-internal harness pin; no consumer surface


Claude-Session: https://claude.ai/code/session_0131HkmhYCFEQCJ4wZcGWABJ

Co-authored-by: Claude <[email protected]>
github-actions Bot added a commit that referenced this pull request Jul 16, 2026
ci: unpin e2e npm CLI from npm@11 to npm@12 (closes #440) (#535)

npm 12.0.0's published bundle omitted libnpmpublish's unscoped
`sigstore` dependency, so every `npm publish --provenance` in the e2e
fixture job died at module load (npm/cli#9722). #438/#439 pinned
`npm install -g npm@11` as a workaround, with #440 tracking the unpin.

npm/cli#9740 fixed the packing bug and shipped in npm 12.0.1
(2026-07-10); the packed tarball again contains
`node_modules/sigstore`. `latest` now resolves to 12.0.1. Verified
locally with a fresh `npm install -g npm@latest` (→ 12.0.1) that
`require.resolve('sigstore', { paths: [libnpmpublish/lib] })` resolves
— the exact check that failed on 12.0.0.

Kept as an explicit major (npm@12), never floating `npm@latest`, per
the #438/#439 contract. The e2e fixture suite going green on this PR
is the end-to-end verification.

skip-changelog: CI-internal harness pin; no consumer surface

Claude-Session: https://claude.ai/code/session_0131HkmhYCFEQCJ4wZcGWABJ

Co-authored-by: Claude <[email protected]>

This branch was previously deployed

1 inactive deployment
e2e — 6206c66a Deployed Jul 9, 2026 by thekevinbot via TestPyPI publish + verify #381
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

e2e fixture publishes broken by npm 12.0.0: npm install -g npm@latest pulls a bundle missing sigstore, failing every provenance publish

2 participants