Repository navigation
fix(ci): provenance passes only when built by this repo's publish.yml on main - #16
Merged
Merged
Conversation
… on main The check accepted any SLSA attestation, so provenance minted by another repo, workflow or branch would have passed. It now also requires the statement's subject to be the package and version, and its workflow to be PracticalWorks/crm .github/workflows/publish.yml on refs/heads/main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
practical-bot
approved these changes
Nov 17, 2026
practical-bot
left a comment
Contributor
There was a problem hiding this comment.
The implementation correctly makes the expected source explicit, validates the npm subject and the workflow repository/path/ref, and treats source mismatches as final rather than retryable registry delays. The workflow passes PracticalWorks/crm; the focused tests cover wrong repository, workflow, branch, subject, missing source, and no-retry behavior.
Claim ledger:
- “
pnpm guardpasses, including the new tests.” PASS — CI run 44013200521 ranpnpm guard; output reported 20 tests, 0 failures andguard: 76 files clean. - “Against the live registry:
node scripts/verify-npm-provenance.mjs @practicalworks/crm 0.13.2 PracticalWorks/crm” PASS — independently queried npm attestations for@practicalworks/crm@0.13.2; it returned SLSA provenance with subjectpkg:npm/%40practicalworks/crm@0.13.2, repositoryhttps://github.com/PracticalWorks/crm, path.github/workflows/publish.yml, and refrefs/heads/main. - “Sabotage, run on guardrails#1 with the identical code … fails four tests.” UNVERIFIED — the guardrails checkout/commit is not available in this review workspace; the current CRM CI run does prove the restored CRM test suite passes.
- “The same check rejects a real attestation when the expected repo is wrong …” UNVERIFIED — the referenced rc-bridge release is outside this checkout and was not queried; no defect is inferred from this unavailable auxiliary proof.
CI run 44013200521 is green on this exact head and ran guard, build, typecheck, and test; the log reports client 120 tests and twenty-app 28 tests passing.
REVIEWED DIFF: base=main files=4 lines=134
REVIEW VERDICT: approve
NEEDS VERIFICATION: none; the live npm attestation check for @practicalworks/crm@0.13.2 was independently confirmed above.
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.
Why
Talos found this on PracticalWorks/guardrails#1, and this repo has the same script.
scripts/verify-npm-provenance.mjsaccepted any SLSA attestation. Provenance minted by another repository, workflow or branch would have passed as this release's provenance, which defeats the point of checking it.What changed
scripts/verify-npm-provenance.mjsnow also checks two things, and passes only if both hold:pkg:npm/<package>@<version>;https://github.com/PracticalWorks/crm.github/workflows/publish.ymlonrefs/heads/main.publish.ymland theverify:npm-provenancescript passPracticalWorks/crmas a literal.This is the same change as PracticalWorks/guardrails#1, applied from one patch.
What deliberately did NOT change
The retry window (15 minutes) and the publish steps.
Proof
pnpm guardpasses, including the new tests.node scripts/verify-npm-provenance.mjs @practicalworks/crm 0.13.2 PracticalWorks/crm→Verified npm provenance for @practicalworks/crm@0.13.2 (https://slsa.dev/provenance/v1) from PracticalWorks/crm .github/workflows/publish.yml on refs/heads/main.if (false)fails four tests (rejects provenance built by another repository,…from another workflow…,…from a branch other than main,a source mismatch is final…). Restored, all pass.PracticalWorks/guardrailsexits 1 withprovenance was built by https://github.com/PracticalWorks/rc-bridge … expected https://github.com/PracticalWorks/guardrails ….Refs: FACT-1986
🤖 Generated with Claude Code