Skip to content

fix(release): the provenance check waits for npm to serve a fresh version, and runs last [FACT-1884] - #11

Merged
practical-bot merged 1 commit into
mainfrom
fix/fact-1884-provenance-wait
Nov 16, 2026
Merged

practical-bot merged 1 commit into
mainfrom
fix/fact-1884-provenance-wait

Conversation

@jcotillo

Copy link
Copy Markdown
Contributor

What broke

publish went red on main at 05c89b1 (#10's merge). npm accepted 0.13.0: the log shows + @practicalworks/crm@0.13.0, and its provenance statement is in sigstore. But the registry kept serving 404:

  • for the version, for about 20 seconds;
  • for its attestation, for about 70 seconds.

I polled it live:

18:47:57 version=404 attest=404
18:48:17 version=404 attest=404
18:48:38 version=200 attest=404
18:48:58 version=200 attest=200

The verifier from #8 asked once, immediately, so it failed. It also ran before the GitHub Packages step, so 0.13.0 never reached GitHub Packages, which is where frontdesk installs from.

Fix

  • waitForNpmProvenance retries a 404 or 5xx every 15 seconds, up to 20 tries (5 minutes). Any other answer (no provenance, invalid JSON) still fails at once.
  • The verify step now runs last, after the GitHub Packages publish.

Proof

  • node --test scripts/verify-npm-provenance.test.mjs: 7 pass. Three are new: it waits through 404s, it gives up after its attempts, and "no provenance" is never waited on.
  • Sabotage: a wait that never retries turns two of the new tests red. Restored.
  • Live: node scripts/verify-npm-provenance.mjs @practicalworks/crm 0.13.0 prints "Verified npm provenance … (https://slsa.dev/provenance/v1)".
  • pnpm guard: 76 files clean.
  • Post-merge proof: this touches publish.yml, so the merge re-runs publish. npm SKIPs 0.13.0, GitHub Packages publishes 0.13.0 (the copy the red run skipped), and the verify step passes.

Refs: FACT-1884

🤖 Generated with Claude Code

…sion, and runs last [FACT-1884]

publish went red at 05c89b1: npm accepted 0.13.0 (and logged its provenance to
sigstore), but the registry served 404 for the version for ~20s and for its
attestation for ~70s. The verifier asked once, immediately. Because it ran
before the GitHub Packages step, that copy was skipped too.

- waitForNpmProvenance retries a 404 or 5xx every 15s, up to 20 times; any
  other answer (no provenance, bad JSON) still fails at once.
- The verify step moves after the GitHub Packages publish.

Refs: FACT-1884

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jcotillo jcotillo added the merge:queued Queued for the merge drain once Talos approves and CI is green label Nov 16, 2026

@practical-bot practical-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the current PR body and the 3-file diff against main.

Evidence ledger:

  • “waitForNpmProvenance retries a 404 or 5xx every 15 seconds, up to 20 tries (5 minutes).” PASS: node --test scripts/verify-npm-provenance.test.mjs — 7 passed, including 404 retry and attempt-limit cases. The implementation retries only HTTP 404/5xx and fails immediately for valid JSON with no provenance; the corresponding test passed.
  • “The verify step now runs last, after the GitHub Packages publish.” PASS: the workflow source order is npm publish at offset 1800, GitHub Packages publish at 2121, and verification at 3082 (1800 < 2121 < 3082).
  • “Sabotage: a wait that never retries turns two of the new tests red.” PASS: a scratch implementation with no retry produced the expected failures for both retry-dependent cases (HTTP 404), then the committed implementation passed all 7 tests.
  • “Live: node scripts/verify-npm-provenance.mjs @practicalworks/crm 0.13.0 prints ...” PASS: it printed Verified npm provenance for @practicalworks/crm@0.13.0 (https://slsa.dev/provenance/v1).
  • “pnpm guard: 76 files clean.” PASS: pnpm guard passed 14 tests and printed guard: 76 files clean.
  • CI: gh pr checks 11 reports check / test success on this head via run 43932921896; its job executed checkout, setup, lint, test, and run. The run is green.

The implementation correctly keeps non-transient failures terminal, bounds registry waiting at 20 attempts, and moves verification after the GitHub Packages publish so a delayed npm attestation cannot suppress the second registry copy.

REVIEW VERDICT: approve
REVIEWED DIFF: base=main files=3 lines=75
NEEDS VERIFICATION: After merge, the main publish workflow must complete successfully for the merged commit, including the final npm provenance check, and the resulting CI-published package version must have the expected SLSA attestation from PracticalWorks/crm/.github/workflows/publish.yml on refs/heads/main.

@practical-bot
practical-bot merged commit 8fbdcf1 into main Nov 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge:queued Queued for the merge drain once Talos approves and CI is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants