Repository navigation
fix(release): the provenance check waits for npm to serve a fresh version, and runs last [FACT-1884] - #11
Merged
Conversation
…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>
practical-bot
approved these changes
Nov 16, 2026
practical-bot
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the current PR body and the 3-file diff against main.
Evidence ledger:
- “
waitForNpmProvenanceretries 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.0prints ...” PASS: it printedVerified npm provenance for @practicalworks/crm@0.13.0 (https://slsa.dev/provenance/v1). - “
pnpm guard: 76 files clean.” PASS:pnpm guardpassed 14 tests and printedguard: 76 files clean. - CI:
gh pr checks 11reportscheck / testsuccess on this head via run43932921896; 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.
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.
What broke
publishwent 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:I polled it live:
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
waitForNpmProvenanceretries a 404 or 5xx every 15 seconds, up to 20 tries (5 minutes). Any other answer (no provenance, invalid JSON) still fails at once.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.node scripts/verify-npm-provenance.mjs @practicalworks/crm 0.13.0prints "Verified npm provenance … (https://slsa.dev/provenance/v1)".pnpm guard: 76 files clean.publish.yml, so the merge re-runspublish. 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