Skip to content

fix(release): npm postpublish verification fails for releases published from repaired tooling - #169497

Merged
RomneyDa merged 1 commit into
mainfrom
fix/postpublish-verify-derive-tooling
Oct 12, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/postpublish-verify-derive-tooling

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: npm postpublish verification fails with SHA-pinned release-publish ref does not match the approved workflow ref and SHA when a release was published from a protected release-publish/* tooling tag, unless the operator hand-exports OPENCLAW_NPM_EXPECTED_WORKFLOW_REF and OPENCLAW_NPM_EXPECTED_WORKFLOW_SHA. That is every regular release published on repaired tooling, such as 2026.10.5-beta.1.

User Impact

Release operators can run node --import tsx scripts/openclaw-npm-postpublish-verify.ts <version> without looking up and exporting the publish tooling identity. The env vars remain explicit overrides; setting only one of them is still rejected. The publish workflow already passes both, so its behavior is unchanged. Manual derivation needs gh auth for two read-only GitHub API calls.

Why This Change Was Made

When neither override is set and the attestation names a release-publish/<sha12>-<n> tag, the verifier takes the attested commit for that tag as a claim only. It becomes the expected identity after the existing release-tooling identity owner (verifyReleaseToolingIdentity) confirms both:

  • GitHub still has that exact lightweight tag at that commit (not moved, not annotated);
  • the commit is reachable from current main.

Everything after that is unchanged. The existing policy binds the ref and commit to the attestation's resolved dependency, and Sigstore verifies the bundle against the certificate identity for that ref. Other callers of verifyNpmProvenanceAttestation (prepublish verify, release check, resume run) don't pass the new option and keep the strict behavior.

pnpm release:verify-beta still reads the same env vars to identify the npm child run, so the publication-recovery docs keep exporting them. Only the two postpublish-only snippets drop them.

Evidence

  • pnpm test test/openclaw-npm-postpublish-verify.test.ts --maxWorkers=1: 51 passed, about 25s wall for the file. The new cases are sub-second and use no timers or network.
    • Derived identity: the verifier is called once with the attested {ref, sha}, and the bundle is then verified for that ref.
    • A failing trusted-source check rejects before any Sigstore call.
    • An attested commit whose prefix doesn't match the tag is never derived.
    • A partial env override stays strict and skips derivation.
    • The trusted-source check accepts the live exact tag on main, rejects a tag bound to another commit, and rejects a commit that has diverged from main.
  • Read-only replay against the real published [email protected], with real registry attestations, real Sigstore and live GitHub, and no env vars:
    • with derivation: verified 2026.10.5-beta.1 [{"ref":"refs/tags/release-publish/d29e2d5be0f6-1791720622","sha":"d29e2d5be0f618c13417d74fa48216384ea3bb74"}];
    • without derivation (current main behavior): npm provenance SHA-pinned release-publish ref does not match the approved workflow ref and SHA.
  • pnpm tsgo:scripts, pnpm tsgo:test:root, oxlint and oxfmt pass. Autoreview (codex): no findings.

Real CLI authority-chain proof (combined provenance → install flow)

The unmodified CLI entrypoint ran against the published [email protected] with no OPENCLAW_NPM_EXPECTED_WORKFLOW_* env. It used the real npm registry metadata and attestations and real Sigstore verification. The release source was package.json, extensions/ and scripts/lib/ extracted from v2026.10.5-beta.1.

  • Accept (live GitHub, real gh): exit 0 in 74s. It printed registry signature and provenance attestation verified, then fresh-exact OK, then verified published npm install paths for 2026.10.5-beta.1.
  • Reject: for these runs a gh shim on PATH answered only the two read-only GitHub API calls the verifier makes; the calls are logged below. Each run exits 1, and the provenance error is its only output. No install scenario starts, so nothing is installed or executed.
Scenario GitHub calls Result
tag deleted (404) git/ref/tags/release-publish/d29e2d5be0f6-1791720622 protected release tooling tag is missing or unreadable.
tag moved to another commit same protected release tooling tag is missing, moved, annotated, or bound to the wrong SHA.
annotated tag same same as moved
tag intact, commit off main (diverged) tag ref, then compare/d29e2d5…...main main release tooling SHA is not reachable from current main.

These failures are not in the provenance read's retry set, so the verifier fails fast rather than retrying.

@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S labels Oct 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

The postpublish verifier derives missing publish-tooling pins from attestations after checking the live GitHub tag and main ancestry.

Example: Verify [email protected] without either expected-workflow environment variable.

  • Before: Provenance verification rejects release-publish/d29e2d5be0f6-1791720622 because no approved ref and SHA were supplied.
  • After: Provenance verification derives d29e2d5, validates its live tag and main ancestry, and verifies the Sigstore bundle.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, useful repair with meaningful live acceptance evidence and no discrete defect found; authority-boundary rejection evidence remains incomplete.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Release operators cannot verify packages published from protected repaired-tooling tags without manually discovering and exporting the tooling identity.
Reason: The repair removes a demonstrated manual verification failure while retaining explicit overrides and existing cryptographic checks.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep this useful maintainer-authored repair open: current main still requires manual tooling pins, and no definite introduced code defect was found.

Priority: P2
Reviewed head: a72574d6dc30ade29d377dc6f636da3d16e43fa2

Before merge

  • Add real behavior proof - Authority-chain proof required: the supplied real npm/Sigstore/GitHub replay demonstrates acceptance of valid 2026.10.5-beta.1 tooling, while invalid-tag and off-main rejection use separated mocks. Supply a trace through the combined production provenance-to-install flow showing rejection for a moved or deleted tag and an off-main tooling commit before package execution; redact credentials and non-public endpoints. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve security review attention item - This changes release provenance trust before package execution; no concrete exploitable bypass was identified.
  • Resolve merge risk - The new automatic trust route authorizes subsequent package execution, but rejection of unauthorized or revoked tooling has not been demonstrated through that combined boundary.

Findings

None.

Tests

  • Missing end-to-end proof: Missing a combined production-path trace showing invalid or revoked tooling rejected before installation or installed-CLI execution.
Agent review details

How this fits together

Release verification consumes npm metadata and attestations, authenticates package provenance, then installs and executes the published package in a temporary prefix.

flowchart TD
  A[Postpublish CLI] --> B[Npm metadata and attestations]
  B --> C[Provenance policy]
  C --> D[Live GitHub tooling identity]
  D --> E[Sigstore verification]
  E --> F[Package install and CLI checks]
Loading

Technical review

Best possible solution:

Keep derivation in the postpublish provenance owner, using canonical live tooling checks while preserving explicit pins and Sigstore verification.

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

Current-main source deterministically rejects protected publish-tag provenance without both expected pins, matching the supplied real-package failure replay; no target code was executed during this review.

Is this the best way to solve the issue?

The opt-in callback is a focused repair that reuses the existing trust owner and leaves strict callers unchanged; the maintainer-authored PR establishes direction.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ff59ae053bb2.

Merge-risk options

Maintainer options:

  1. Hold for authority-boundary evidence (recommended)
    Keep this PR open until a production-path trace demonstrates that invalid or revoked tooling is rejected before npm installation or installed-CLI execution.

Provenance checked

  • Protected-tag provenance pins changes intended behavior with a stated reason (dfa246e: Require the approved protected ref and SHA and bind them to the attestation's resolved dependency; the PR explains replacing absent manual pins with live trusted-source validation.)
  • Cryptographic provenance verification keeps the original intent (ci(release): harden release controls #93852: Verify the Sigstore signature and certificate identity rather than accepting a matching decoded payload.)
  • Manual release instructions changes intended behavior with a stated reason (948115a: Document explicit tooling exports needed for manual verification and recovery; this PR removes them only from postpublish-only snippets and retains recovery exports.)

Testing

Proof path: in-process harness.

Security

Needs attention: This changes release provenance trust before package execution; no concrete exploitable bypass was identified.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit dfa246e adds scripts/openclaw-npm-postpublish-verify.ts:298 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: dfa246e6fd16; files: scripts/openclaw-npm-postpublish-verify.ts)
  • Vincent Koc: Raw commit abb6f04 adds scripts/openclaw-npm-postpublish-verify.ts:241 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: abb6f04e0cac; files: scripts/openclaw-npm-postpublish-verify.ts)

PR surface

Tests +60, Docs +7, Other +54. Total +121 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 60 0 +60
Docs 2 13 6 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 1 57 3 +54
Total 4 130 9 +121

Labels

Label changes:

  • add P2: Manual release verification fails for protected tooling tags, with an existing explicit-pin workaround and unchanged workflow callers.
  • add merge-risk: 🚨 security-boundary: The change derives the identity trusted for package provenance before executable package installation; green CI does not establish final-effect rejection for unauthorized tooling.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: Manual release verification fails for protected tooling tags, with an existing explicit-pin workaround and unchanged workflow callers.
  • merge-risk: 🚨 security-boundary: The change derives the identity trusted for package provenance before executable package installation; green CI does not establish final-effect rejection for unauthorized tooling.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

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

  • Add final-effect proof that moved or deleted tags and off-main tooling commits cannot authorize package installation or execution.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 11, 2026, 9:42 PM ET / October 12, 2026, 01:42 UTC.

@RomneyDa
RomneyDa merged commit 1f8307f into main Oct 12, 2026
107 checks passed
@RomneyDa
RomneyDa deleted the fix/postpublish-verify-derive-tooling branch October 12, 2026 01:46
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review — the PR body now includes the combined real-CLI authority-chain proof (accept with live GitHub; deleted, moved, annotated and off-main tooling rejected before any install).

@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

ClawSweeper could not start a re-review for this item.
Reason: re-review requires an open issue or PR.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
RomneyDa added a commit that referenced this pull request Oct 20, 2026
…8170)

* fix: ClawHub release verification fails while publication is pending (#168153)

* fix(release): verify ClawHub only after public finalization

* fix: align ClawHub recovery with authoritative publication state

(cherry picked from commit 7985ac2)
Co-authored-by: RomneyDa <[email protected]>

* fix: Linux feed publication tolerates stale public downloads (#168179)

(cherry picked from commit 18f2006)
Co-authored-by: RomneyDa <[email protected]>

* feat(pr): scope worktree cleanup to one PR (#168152)

(cherry picked from commit 51c0f56)
Co-authored-by: RomneyDa <[email protected]>

* feat(release): reconcile exact owned validation cancellation trees (#168267)

* feat(release): reconcile exact owned FRV cancellation trees

* fix(release): parse cancellation provenance with fixed patterns

* fix(release): normalize rerun copies before cancellation discovery

(cherry picked from commit 02a2bd2)
Co-authored-by: RomneyDa <[email protected]>

* fix(release): recover failed receipts without rerunning workloads (#168266)

* fix: recover failed release receipts without rerunning workloads

* test(release): materialize publication harness preload closure

(cherry picked from commit 4485101)
Co-authored-by: RomneyDa <[email protected]>

* fix(qa): restore Telegram progress E2E delivery (#168675)

(cherry picked from commit 1fbfd4a)
Co-authored-by: RomneyDa <[email protected]>

* docs(release): generate release notes once after validation-recovery backports (#169495)

(cherry picked from commit 696fb2f)
Co-authored-by: RomneyDa <[email protected]>

* fix(release): explain why release:candidate --workflow-sha must be trusted main (#169496)

(cherry picked from commit 513d0e7)
Co-authored-by: RomneyDa <[email protected]>

* fix(release): full release validation helper fails when main advances before admission dispatch (#169500)

(cherry picked from commit 992410c)
Co-authored-by: RomneyDa <[email protected]>

* fix(release): derive attested publish tooling in npm postpublish verification (#169497)

(cherry picked from commit 1f8307f)
Co-authored-by: RomneyDa <[email protected]>

* fix(release): report candidate supersession and resume watchers (#168271)

* fix(release): report candidate supersession and resume watchers

* fix(release): keep invalid candidate metadata advisory to watchers

(cherry picked from commit cdb57ac)
Co-authored-by: RomneyDa <[email protected]>

* fix(pr): stop waiting for advisory ClawSweeper reviews (#169739)

(cherry picked from commit c2d1513)
Co-authored-by: RomneyDa <[email protected]>

* ci: let PR checks finish and classify inherited failures (#169647)

* ci: finish PR jobs and classify failures against main

* ci: distinguish signature and job-name failure attribution

* test(ci): avoid object spread in failure fixtures

* ci: classify differing validation scopes as unknown

(cherry picked from commit 7c4ff5a)
Co-authored-by: RomneyDa <[email protected]>

* fix(pr): scripts/pr keeps a lock after a failed command that fully drained (#169595)

* fix(pr): release drained failed-operation locks instead of requiring manual recovery

* test(pr): drop unused lock owner initializer

* docs(pr): drop obsolete blanket failure-retention claim

(cherry picked from commit a939a9d)
Co-authored-by: RomneyDa <[email protected]>

* fix(update): success headline hides post-swap steps that did not run (#170490)

(cherry picked from commit f26cdca)
Co-authored-by: RomneyDa <[email protected]>

* fix(release): require current website downloads at closeout (#170704)

* fix(release): require current website downloads at closeout

* fix(release): verify request-time downloads before closeout receipts

* style(release): use braces for dispatch validation

(cherry picked from commit 0c51cc6)
Co-authored-by: RomneyDa <[email protected]>

* fix(ci): prevent avoidable FRV retries and cold setup failures (#170964)

* fix(ci): preserve FRV work through transient GitHub reads

* fix(ci): retain cache reads for frozen workflow targets

* fix(ci): count contributing packed release timing samples

* fix(ci): avoid stalled iOS simulator diagnostics

* test(ci): correct FRV regression assertions and output capture

(cherry picked from commit 5cd688d)
Co-authored-by: RomneyDa <[email protected]>

* fix(update): stabilize stalled recovery cleanup validation (#171507)

* test(update): await recovery descendant before fixture expiry

Expire the generated helper recovery timeout callback after the isolated command has persisted a live descendant PID and emitted readiness. Keep process-group termination and close joins native, retain the durable failed sentinel and dead-descendant assertions, and bound missing readiness with a fixture watchdog.

Refs #170803 (stalled-recovery fixture race only).

* test(update): load recovery clock from fixture module

Replace the added hand-written preload source template with a test-owned ESM fixture and per-case JSON configuration. Preserve exact helper and recovery command scoping, native timeout callback and watchdog cleanup, persisted descendant readiness and existing deadline, close-order, sentinel and process-death assertions.

Production behavior and deadlines are unchanged. Refs #170803 (stalled-recovery fixture race only).

* test(update): join state workers before handoff cleanup

Await the maintained state-database test cleanup owner before removing managed-handoff fixture directories. Synchronous native-handle close only starts worker retirement and can race the final WAL cleanup, observed as ENOTEMPTY in the retained-notification triage case.

Reuse closeStateDatabaseForTest without retries, timing seams, triage behavior changes or production changes. Refs #170803 (managed-handoff test fixtures only).

(cherry picked from commit 4a25358)
Co-authored-by: RomneyDa <[email protected]>

* test(agents): retire session MCP managers left by earlier test files (#172515)

(cherry picked from commit d4be691)
Co-authored-by: RomneyDa <[email protected]>

* fix(release): show publication release and Windows source identities (#170274)

(cherry picked from commit 35fffec)
Co-authored-by: RomneyDa <[email protected]>

* fix: distinguish workflow approval and exception capabilities (#172661)

(cherry picked from commit aade2f8)
Co-authored-by: RomneyDa <[email protected]>

* fix(release): expose Linux builder admission and retain failed bundles (#170297)

* fix(release): expose Linux builder admission and retain failed bundles

* fix(release): preserve unconfirmed Linux dispatch status

* fix(ci): make Linux build event admission explicit

* fix(ci): separate Linux mirror dispatch from release builds

* fix(ci): budget cold Linux source package builds

(cherry picked from commit 614f559)
Co-authored-by: RomneyDa <[email protected]>

* fix(ui): let locale refresh workers bootstrap new locale memory (#172689)

(cherry picked from commit 17bea1c)
Co-authored-by: RomneyDa <[email protected]>

* test(gateway): prewarm history worker before composed SDK request budgets (#172745)

(cherry picked from commit 2051055)
Co-authored-by: RomneyDa <[email protected]>

* fix(release): packed package check refuses a root dist above 10,000 JavaScript files (#172954)

(cherry picked from commit 244cd79)
Co-authored-by: RomneyDa <[email protected]>

* test(agents): Bun agents-support shard fails after the question authority test leaks sharing reads (#172974)

(cherry picked from commit 54f0b41)
Co-authored-by: RomneyDa <[email protected]>

* test(plugins): IRC direct import smoke times out on loaded runners during its cold compile (#173105)

* test(plugins): IRC direct import smoke times out on loaded runners during its cold compile

* test(googlechat): keep the direct smoke test deadline above its child budget

(cherry picked from commit 8bc4915)
Co-authored-by: RomneyDa <[email protected]>

* fix(test): interrupted test wrappers miss their signal exit verifying a generation (#173068)

* fix(test): interrupted test runs miss their signal exit verifying a generation they will delete

* fix(test): keep borrower disposal verification; skip it only for interrupted wrappers

* fix(test): return the shim interruption result on every path

(cherry picked from commit b66e0fc)
Co-authored-by: RomneyDa <[email protected]>

* test(openshell): registration lifecycle test fails when registry retirement outlasts its 1s poll (#173205)

(cherry picked from commit 7cd0f47)
Co-authored-by: RomneyDa <[email protected]>

* fix(android): prepare focused proof before running Gradle (#172668)

* fix(android): prepare focused proof before running Gradle

* test(android): reach proof prerequisites on Linux ARM

* test: remove duplicated Android job structure assertion

* fix: seed stored inference account for Docker cron cleanup

(cherry picked from commit 404b708)
Co-authored-by: RomneyDa <[email protected]>

* fix: preserve bound Codex history after app-server restart (#172705)

(cherry picked from commit 9fe4372)
Co-authored-by: RomneyDa <[email protected]>

* fix(release): Linux channel promotion fails after a withdrawn Windows companion (#173615)

(cherry picked from commit c58afa2)
Co-authored-by: RomneyDa <[email protected]>

* ci(release): temporarily disable Windows companion publication (#173656)

(cherry picked from commit 99ce3ea)
Co-authored-by: RomneyDa <[email protected]>

* fix(qa): Telegram live lane fails scenarios when the stale-update drain hits a transient Bot API error (#173465)

* fix(qa): retry Telegram stale-update drain through transient Bot API failures

* fix(qa): cancel Telegram drain waits on proxy stop and cap attempts by budget

* test(qa): prove the Telegram drain abandons a stalled attempt at its deadline

* test(qa): drop timing-dependent upstream count from Telegram drain deadline test

(cherry picked from commit 387ebd6)
Co-authored-by: RomneyDa <[email protected]>

* test(scripts): give relocated worker facade and image tests the archive budget (#174556)

(cherry picked from commit 746a52a)
Co-authored-by: RomneyDa <[email protected]>

* test(ui): settle lazy preference reader before profile identity waits (#174614)

(cherry picked from commit d6ea634)
Co-authored-by: RomneyDa <[email protected]>

* test(plugins): collect Bun recovery retention from a timer phase (#174924)

Bun's JavaScriptCore scans native stacks conservatively. Under load, the
immediate dispatcher can keep a stale pointer to the completed recovery
fixture graph across every immediate-phase collection, so the retired
PluginInstance stayed reachable only through GC-internal roots. A
collection from a timer callback releases it. When the expected
references are still live after the existing immediate passes, run up to
four timer-phase collections; a strong retainer still fails.

(cherry picked from commit 8919729)
Co-authored-by: RomneyDa <[email protected]>

* test(scripts): adapt worker archive timeout backport

Keep the release branch test inventory while granting the two relocated archive cases the intended three-minute budget.

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

* fix(codex): adapt unloaded-thread recovery to release params

Use the release branch request parameter directly when deciding whether an ordinary bound thread may be resumed.

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

* test(codex): adapt recovery fixture to release helper

Use the release branch thread-result helper signature so the recovery regression validates the intended thread identity.

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

---------

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: roboclaw-bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant