Skip to content

fix(release): harden published artifact verification (#81) - #90

Merged
steipete merged 1 commit into
mainfrom
fix/release-verification
Aug 2, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/release-verification

Conversation

@steipete

@steipete steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • create an idempotent draft GitHub Release before npm publication, then attach proof and promote it only after verification succeeds
  • share one pinned-origin npm verifier across publication and release-proof generation, with canonical tarball fallback for conflicting packument integrity
  • verify npm registry signatures and Sigstore provenance against the validated digest, package identity, repository, release workflow, tag ref, builder, and certificate identity
  • classify transient registry/provenance propagation separately from fatal identity, URL, signature, policy, and downloaded-byte failures
  • cover retry exhaustion, fallback success/failure, provenance, argument and manifest validation, publish failure paths, and release-proof generation

Live proof

  • verified the real @openclaw/[email protected] registry signature and Sigstore bundle
  • downloaded 5,609,950 bytes with SHA-1 f4dabf3ed706bf08ea7a282750baa4ebf1707b60 and integrity sha512-WcaG3NUMd4q+puq/I55zxwc0+OjNVhqxSprKzpS17c2cDd9bYc8c2DrYrs6Io3mmNXNa90re/UWSwVkX4I6PkA==
  • reproduced persistent divergent metadata: current main exhausted 13 attempts; this branch logged the conflict, verified the real tarball bytes, registry signature, and provenance, and passed
  • flipped one downloaded byte and observed immediate fatal tarball-integrity-mismatch without retry

Verification

  • pnpm check
  • pnpm test:security
  • pnpm pack:check
  • focused verifier/proof tests: 19 passed
  • actionlint .github/workflows/release.yml
  • git diff --check
  • Codex autoreview: clean, no accepted/actionable findings

No package, tag, or GitHub Release was published or created during verification.

Closes #81

@steipete
steipete requested a review from a team as a code owner August 2, 2026 21:08
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 5:18 PM ET / 21:18 UTC.

ClawSweeper review

What this changes

The PR changes the protected-tag release pipeline to create a draft release before npm publication, then verifies the published tarball, npm signature, and Sigstore provenance before attaching proof and promoting that draft.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for normal merge review. Current main still treats a conflicting registry integrity value as pending and eventually fails, while this branch adds a bounded canonical-tarball fallback plus signature and provenance verification; the reviewed workflow remains fail-closed for identity, URL, signature, policy, and byte mismatches.

Priority: P2
Reviewed head: c2f5004560e5cd2126ce58cd951056024ea3efeb

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-tested release hardening patch with concrete live verification evidence and no actionable correctness finding in review.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body supplies after-fix live-output evidence for the real v0.5.1 registry artifact, including measured bytes and integrity, a current-main retry-exhaustion scenario, successful branch verification, and a deliberate one-byte corruption failure.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body supplies after-fix live-output evidence for the real v0.5.1 registry artifact, including measured bytes and integrity, a current-main retry-exhaustion scenario, successful branch verification, and a deliberate one-byte corruption failure.
Evidence reviewed 6 items Current-main behavior: Current main returns a pending registry state whenever dist.integrity differs from the locally validated artifact, so a persistent metadata conflict exhausts retries rather than checking the canonical tarball bytes.
Bounded fallback and fail-closed verifier: The proposed verifier downloads canonical registry bytes only after a conflicting integrity value, requires exact size and SHA-512 equality, and treats registry URL, signature, provenance-policy, and byte failures as fatal.
Release ordering: The branch creates a draft release after artifact collection, gates publication on that job, and only promotes the draft after a second verification pass appends registry proof.
Findings None None.
Security None None.

How this fits together

The protected-tag release workflow builds a validated package artifact, publishes it to npm, and then creates the public GitHub Release. The changed verifier compares the trusted local artifact with npm registry metadata, canonical registry bytes when needed, registry signatures, and provenance before the release is made public.

flowchart LR
  A[Protected release tag] --> B[Build validated package artifact]
  B --> C[Create draft GitHub Release]
  C --> D[Publish or locate npm version]
  D --> E[Verify registry metadata and bytes]
  E --> F[Verify signature and provenance]
  F --> G[Attach proof and promote release]
Loading

Before merge

  • Resolve merge risk (P1) - A failed npm publication or post-publish verification now intentionally leaves an unpublished draft GitHub Release; this preserves the public-release boundary but requires rerunning the same tag or deliberately cleaning up the draft during recovery.
  • Complete next step (P2) - No discrete repair is indicated; this PR has a coherent implementation, focused tests, and sufficient real behavior proof, so the remaining action is ordinary maintainer merge review.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Release verification surface 11 files affected; 1,675 additions and 173 deletions The change spans the protected-tag workflow, the registry verifier, one pinned dependency, and focused validation coverage.
Focused verifier coverage 8 verifier cases and 6 publish-script cases The tests cover fallback, fatal identity failures, provenance retry behavior, and publication retry behavior.

Merge-risk options

Maintainer options:

  1. Accept the recoverable draft-release state (recommended)
    Merge with the documented operational tradeoff that a failed publish or verification leaves a non-public draft which a later same-tag run can reuse.
  2. Add an explicit recovery note
    Before merge, add maintainer-facing release-runbook wording that tells operators how to inspect or reuse a draft after a failed verification.

Technical review

Best possible solution:

Merge the shared verifier and draft-to-public workflow so releases remain unpublished until the exact package bytes, npm signature, and trusted GitHub Actions provenance all verify, while retaining draft releases as the explicit recovery state for failed release attempts.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: current main marks a mismatched dist.integrity pending and retries until exhaustion, while the new verifier downloads and hashes the canonical tarball for that exact condition. The PR body additionally supplies concrete v0.5.1 live-run measurements, though this read-only review did not rerun the registry scenario.

Is this the best way to solve the issue?

Yes. Sharing one verifier between publication and release-proof generation avoids two competing trust decisions, and the fallback is narrow: it only accepts canonical registry bytes that exactly match the prevalidated artifact while preserving fatal handling for identity and provenance failures.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2477f5681f68.

Labels

Label changes:

  • add P2: This is a bounded release-pipeline correctness and hardening change with meaningful but limited release-time impact.
  • add merge-risk: 🚨 compatibility: The workflow changes release sequencing and introduces a draft-release recovery state for existing protected-tag publication runs.
  • add merge-risk: 🚨 security-boundary: The PR adds cryptographic npm signature and Sigstore provenance checks to the trusted publication boundary.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies after-fix live-output evidence for the real v0.5.1 registry artifact, including measured bytes and integrity, a current-main retry-exhaustion scenario, successful branch verification, and a deliberate one-byte corruption failure.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body supplies after-fix live-output evidence for the real v0.5.1 registry artifact, including measured bytes and integrity, a current-main retry-exhaustion scenario, successful branch verification, and a deliberate one-byte corruption failure.

Label justifications:

  • P2: This is a bounded release-pipeline correctness and hardening change with meaningful but limited release-time impact.
  • merge-risk: 🚨 compatibility: The workflow changes release sequencing and introduces a draft-release recovery state for existing protected-tag publication runs.
  • merge-risk: 🚨 security-boundary: The PR adds cryptographic npm signature and Sigstore provenance checks to the trusted publication boundary.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body supplies after-fix live-output evidence for the real v0.5.1 registry artifact, including measured bytes and integrity, a current-main retry-exhaustion scenario, successful branch verification, and a deliberate one-byte corruption failure.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies after-fix live-output evidence for the real v0.5.1 registry artifact, including measured bytes and integrity, a current-main retry-exhaustion scenario, successful branch verification, and a deliberate one-byte corruption failure.

Evidence

What I checked:

  • Current-main behavior: Current main returns a pending registry state whenever dist.integrity differs from the locally validated artifact, so a persistent metadata conflict exhausts retries rather than checking the canonical tarball bytes. (scripts/publish-or-verify.mjs:66, 2477f5681f68)
  • Bounded fallback and fail-closed verifier: The proposed verifier downloads canonical registry bytes only after a conflicting integrity value, requires exact size and SHA-512 equality, and treats registry URL, signature, provenance-policy, and byte failures as fatal. (scripts/npm-registry-verification.mjs:435, c2f5004560e5)
  • Release ordering: The branch creates a draft release after artifact collection, gates publication on that job, and only promotes the draft after a second verification pass appends registry proof. (.github/workflows/release.yml:231, c2f5004560e5)
  • Focused coverage and stated live proof: The branch adds tests for canonical-tarball fallback, corrupt/same-size bytes, signature and provenance failures, retry exhaustion, publish behavior, and release-proof generation. The PR body also reports a real v0.5.1 registry verification, a persistent current-main conflict, branch success, and a one-byte corruption rejection. (test/npm-registry-verification.test.ts:14, c2f5004560e5)
  • Feature provenance: The existing protected-tag release pipeline and baseline retry behavior were introduced by the v0.5.1 release commit; the proposed hardening is a direct follow-up commit by the same area contributor. (.github/workflows/release.yml:230, 16e1bd489ae8)
  • Release provenance: The current release baseline is v0.5.1, which contains commit 16e1bd4; the proposed fix commit is not contained in current main or that release. (CHANGELOG.md:10, 16e1bd489ae8)

Likely related people:

  • steipete: Current-main release workflow and publish behavior trace to the v0.5.1 release commit by Peter Steinberger, and the proposed bounded verifier follow-up is also authored by steipete. (role: release-pipeline contributor; confidence: high; commits: 16e1bd489ae8, c2f5004560e5; files: .github/workflows/release.yml, scripts/publish-or-verify.mjs, scripts/npm-registry-verification.mjs)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Ensure release operators understand that an unpublished draft is the intentional recovery state after a verification failure.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete force-pushed the fix/release-verification branch 3 times, most recently from efed9e9 to 836229f Compare August 2, 2026 21:51
The v0.5.1 run published the workflow-validated tarball with provenance, but
npm view transiently reported a different dist.integrity for longer than the
retry budget, so the release job was skipped even though the published bytes
were later proven byte-identical.

The gate accepted only two packument facts: an integrity string match and a
truthy attestation URL that was never fetched. It now verifies the published
bytes directly when metadata conflicts, checks npm's ECDSA registry signature,
and validates the Sigstore bundle and DSSE subject digest under a policy pinning
this repository, the release workflow, the version tag and the builder identity.

append-release-proof.mjs repeated the same weak check without retries, so both
gates now share one verifier. Releases are created as drafts before publication
and promoted only after verification, so a propagation incident leaves a
recoverable draft rather than no release at all.
@steipete
steipete force-pushed the fix/release-verification branch from 836229f to 092baac Compare August 2, 2026 21:51
@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(release): harden published artifact verification (#81) This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

release: registry integrity propagation can outlive verification retries

1 participant