Skip to content

fix(release): publish ClawHub bootstrap artifacts immutably - #103809

Merged
vincentkoc merged 12 commits into
mainfrom
fix/clawhub-immutable-bootstrap
Jul 10, 2026
Merged

vincentkoc merged 12 commits into
mainfrom
fix/clawhub-immutable-bootstrap

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

Closes #103800

What Problem This Solves

Fixes an issue where first-publish ClawHub bootstrap jobs could execute target-controlled setup and packaging code while holding the ClawHub token, then treat an artifact URL response as sufficient proof without verifying the exact bytes stored by the registry.

Why This Change Was Made

The bootstrap path now packs plugins without credentials, uploads one immutable Actions artifact, and binds its producer run, attempt, artifact id/name/digest, target source, toolchain, package metadata, tarball SHA-256, and size. Trusted-main credential jobs publish that exact prebuilt tarball, while bounded verification downloads the registry artifact and requires exact bytes, metadata, tag, and GitHub Actions trusted-publisher identity before success.

The normal OIDC publication path uses the same bounded verifier and compares the published package to the exact package artifact produced earlier in the workflow. Validation-only and workflow-evidence changes remain on main; no release branch code is included here.

User Impact

Release operators can bootstrap a new official ClawHub package without exposing the publish token to target code, and successful verification proves ClawHub stored the exact reviewed package bytes. Existing packages continue through normal trusted-publisher OIDC publication.

Evidence

Exact reviewed head: 75fd05e171272aeab77c3591dc18774f939b3d9a

  • Blacksmith Testbox tbx_01kx6r16n4nytjz560em88wwyr: 60/60 focused artifact and registry-verifier tests passed.
  • Same Testbox: exact keeps beta release verification and ClawHub publish repair hooks wired workflow contract passed.
  • Pinned [email protected] materialization passed from lock SHA-256 f44f670d70f13a8cde566a174cae5be682ad98456ec7a85aafd497f7d8c71816.
  • [email protected] on every touched script/test, actionlint, Node syntax checks, and git diff --check passed.
  • Fresh structured autoreview reported no actionable findings; patch correct, confidence 0.84.
  • Crafted whitespace-bearing USTAR name and prefix attacks reproduce pinned ClawHub path normalization and are rejected before package selection.
  • Exact-head hosted pull_request gates and repo-native prepare are being rerun after this successor push.

Nothing was published: no npm package, GitHub release, tag, Docker image, or ClawHub package was created or promoted by this PR validation.

@vincentkoc vincentkoc self-assigned this Jul 10, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XL maintainer Maintainer-authored PR docs Improvements or additions to documentation labels Jul 10, 2026
@clawsweeper clawsweeper Bot added 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. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 10, 2026
@clawsweeper

clawsweeper Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 10, 2026, 4:32 PM ET / 20:32 UTC.

Summary
The PR makes ClawHub bootstrap and normal publication consume immutable prebuilt package artifacts and verify the registry’s exact bytes, metadata, tags, and trusted-publisher identity.

PR surface: Source +73, Tests +4810, Docs +92, Config +1190, Other +4864. Total +11029 across 42 files.

Reproducibility: yes. source-reproducible with high confidence. The old workflow executes target-local setup and publishing in the token job and then treats a successful artifact HEAD request as sufficient verification; this review did not perform a mutating live publication.

Review metrics: 2 noteworthy metrics.

  • Pinned release toolchain: 1 CLI dependency graph added. Bootstrap publication now depends on a separately locked ClawHub CLI whose complete graph and integrity are part of the release security boundary.
  • Publication paths hardened: 2 paths changed. Both first-publish token bootstrap and normal trusted-publisher OIDC publication now consume prebuilt artifacts and perform bounded registry readback.

Stored data model
Persistent data-model change detected: database schema: test/scripts/verify-clawhub-published-artifact.test.ts, migration/backfill/repair: .agents/skills/release-openclaw-maintainer/SKILL.md, persistent cache schema: .github/workflows/plugin-clawhub-release.yml, serialized state: scripts/lib/clawhub-bootstrap-artifact.mjs, serialized state: scripts/verify-clawhub-published-artifact.mjs, serialized state: test/scripts/clawhub-bootstrap-artifact.test.ts, and 5 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #103800
Summary: This PR is the candidate fix for the linked beta-blocker; the other related PR consumes one shared reader but addresses a distinct release-evidence problem.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🌊 off-meta tidepool
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] Regular beta and stable release publication now requires trusted workflow tooling from main; copied operator commands that still dispatch from a release branch will fail until they follow the updated runbook.
  • [P1] Merging changes the credential, OIDC, artifact, and trusted-publisher boundaries of official ClawHub publication, so green CI does not replace explicit release-security owner acceptance.
  • [P1] The separately pinned ClawHub CLI dependency graph becomes release-critical and will require the same direct lock, integrity, and upstream-contract audit whenever it is updated.

Maintainer options:

  1. Approve after exact-head gates (recommended)
    Merge once required checks finish and the release-security owner confirms the main-only dispatch transition and pinned dependency changes are intentional.
  2. Prove the dry-run handoff
    Hold the PR for a non-mutating pre-tag run if maintainers require live evidence of artifact production, download, rehashing, validation, and configure-only verification.
  3. Retain the prior release flow
    Pause or close if maintainers are unwilling to make trusted main the workflow source for regular beta and stable publication.

Next step before merge

  • [P2] A release-security owner should approve the new credential and operator boundary, then land the exact reviewed head when required checks and branch policy permit.

Maintainer decision needed

  • Question: Does this immutable-artifact handoff and pinned ClawHub workflow satisfy the intended release security boundary for first-publish bootstrap and normal OIDC publication?
  • Rationale: The implementation review found no concrete defect, but accepting a new credential and trusted-publisher boundary for official release automation requires explicit repository-owner intent.
  • Likely owner: vincentkoc — The history and PR context identify this person as the feature and release-security owner for the affected publication path.
  • Options:
    • Approve the boundary (recommended): Land after required exact-head checks complete, retaining the pinned CLI, main-only trusted tooling, and immutable reusable-workflow identities.
    • Require live dry-run proof: Pause until a non-mutating pre-tag bootstrap run demonstrates the complete artifact handoff and verification on the exact reviewed head.

Security
Cleared: No concrete security or supply-chain regression was found; the patch materially strengthens credential isolation, dependency pinning, and publication artifact integrity.

Review details

Best possible solution:

Approve and land the single immutable-artifact design after the release-security owner confirms the main-only workflow-source transition, pinned dependency graph, and exact-head checks; retain exact artifact and publisher identity verification for both token bootstrap and OIDC publication.

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

Yes, source-reproducible with high confidence. The old workflow executes target-local setup and publishing in the token job and then treats a successful artifact HEAD request as sufficient verification; this review did not perform a mutating live publication.

Is this the best way to solve the issue?

Yes. Secretless packing, immutable artifact binding, trusted credential use, and bounded exact-byte and publisher-identity readback form the narrowest maintainable fix and avoid a competing publication source of truth.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 99e1a6081bca.

Label changes

Label changes:

  • add merge-risk: 🚨 compatibility: Regular beta and stable release dispatch changes from release-branch workflow tooling to trusted main, so existing operator commands can stop working.
  • add merge-risk: 🚨 security-boundary: Merging changes the credential, OIDC, immutable-artifact, and trusted-publisher boundaries for official ClawHub publication.
  • add merge-risk: 🚨 automation: Merging rewires release dispatch, artifact production and download, approval evidence, publication verification, and final release evidence consumption.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; focused Testbox evidence and exact-head hosted checks still materially support readiness.

Label justifications:

  • P0: The PR addresses release-token exposure to target-controlled code and inadequate byte verification in a beta-blocking official publication path.
  • merge-risk: 🚨 compatibility: Regular beta and stable release dispatch changes from release-branch workflow tooling to trusted main, so existing operator commands can stop working.
  • merge-risk: 🚨 security-boundary: Merging changes the credential, OIDC, immutable-artifact, and trusted-publisher boundaries for official ClawHub publication.
  • merge-risk: 🚨 automation: Merging rewires release dispatch, artifact production and download, approval evidence, publication verification, and final release evidence consumption.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; focused Testbox evidence and exact-head hosted checks still materially support readiness.
Evidence reviewed

PR surface:

Source +73, Tests +4810, Docs +92, Config +1190, Other +4864. Total +11029 across 42 files.

View PR surface stats
Area Files Added Removed Net
Source 6 120 47 +73
Tests 14 4892 82 +4810
Docs 4 113 21 +92
Config 5 1486 296 +1190
Generated 0 0 0 0
Other 13 4965 101 +4864
Total 42 11576 547 +11029

What I checked:

  • Existing vulnerability is source-reproducible: The previous bootstrap job checked out the release target, installed its dependencies, and ran its local publish script while holding the ClawHub token; its post-publish verification only sent a HEAD request to the artifact URL. (.github/workflows/plugin-clawhub-new.yml:287, 615a5bdb7e35)
  • Credential boundary is isolated: The replacement token job checks out only trusted-main tooling, downloads and rehashes the bound artifact, validates package identity and registry state, reconfirms the release tag, and loads the token only immediately before packed publication. (.github/workflows/plugin-clawhub-new.yml:754, d7c7e8885747)
  • Registry readback verifies exact identity: The verifier performs bounded downloads and requires exact SHA-256, size, npm integrity, npm shasum, registry metadata, release tag, and GitHub Actions trusted-publisher repository and workflow identity. (scripts/verify-clawhub-published-artifact.mjs:232, d7c7e8885747)
  • Pinned ClawHub CLI contract matches the hardening: Direct inspection of [email protected] confirmed that its ClawPack parser trims USTAR name and prefix fields, normalizes separators, rejects unsafe dot segments, and permits only package-rooted regular files and directories. (scripts/plugin-publication-artifact.mjs:1, d7c7e8885747)
  • Pinned supply-chain identity is coherent: The committed lock and npm registry metadata agree on [email protected] and its integrity; materialization verifies the complete lock SHA and CLI integrity before installing with lifecycle scripts disabled. (scripts/materialize-clawhub-cli.sh:11, d7c7e8885747)
  • Normal OIDC publication uses the prebuilt artifact: The normal path calls the openclaw/clawhub reusable workflow at an immutable commit; that workflow derives its trusted source through OIDC claims, downloads the named prebuilt artifact, and publishes that artifact rather than repacking the target. (.github/workflows/plugin-clawhub-release.yml:390, d8096dfc039e)

Likely related people:

  • vincentkoc: Introduced the existing bootstrap path and authored the complete immutable-publication hardening series; the PR context also identifies release-security ownership for this work. (role: feature owner; confidence: high; commits: 90322074ddb7, 9b9f5b18f5c1, 21422b23a8b0; files: .github/workflows/plugin-clawhub-new.yml, scripts/plugin-clawhub-publish.sh, scripts/plugin-publication-artifact.mjs)
  • steipete: CODEOWNERS routes .github changes to this owner, and prior history includes release and dependency tooling work adjacent to the affected workflows. (role: adjacent owner; confidence: medium; commits: 53fd262173bc; files: .github/workflows/plugin-clawhub-new.yml, .github/workflows/openclaw-release-publish.yml)
  • Onur: Introduced the earlier ClawHub plugin release workflow that remains part of the normal OIDC publication surface changed by this PR. (role: introduced adjacent behavior; confidence: medium; commits: fa9e1e3d8eb2; files: .github/workflows/plugin-clawhub-release.yml)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (3 earlier review cycles)
  • reviewed 2026-07-10T16:57:11.124Z sha 1d90974 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-10T19:25:41.671Z sha 310adc28d9f5f2949703fee5b15525fd0933052f :: needs maintainer review before merge. :: none
  • reviewed 2026-07-10T20:04:45.350Z sha f3aa54e6a1663fb931a0756604ba9c301dc76c48 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the fix/clawhub-immutable-bootstrap branch 2 times, most recently from 310adc2 to f3aa54e Compare July 10, 2026 19:48
@vincentkoc
vincentkoc marked this pull request as ready for review July 10, 2026 19:48
@vincentkoc
vincentkoc requested review from a team as code owners July 10, 2026 19:48
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • .github/release/clawhub-cli/package-lock.json
  • .github/release/clawhub-cli/package.json

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfile, shrinkwrap, or workspace dependency policy changes are present.
  • Treat package-lock.json and npm-shrinkwrap.json diffs as security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@github-actions

github-actions Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph changes noted

This PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of @openclaw/openclaw-secops.

  • Current SHA: d7c7e8885747f2b965d6073d9f631d25aa045e56
  • Trusted actor: @vincentkoc
  • Trusted role: pull request author; openclaw-secops

Security review is still recommended before merge when the dependency graph change is intentional.

@github-actions

github-actions Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Security-sensitive changes noted

This PR includes security-sensitive file changes. The guard is informational because the PR author is a repository admin or a member of @openclaw/openclaw-secops.

  • Current SHA: d7c7e8885747f2b965d6073d9f631d25aa045e56
  • Trusted actor: @vincentkoc
  • Trusted role: pull request author; openclaw-secops

Changed files:

  • .gitignore: Controls ignored secret and local files, including common .env files, before they can be accidentally committed.

Security review is still recommended before merge when the change is intentional.

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 10, 2026
@vincentkoc
vincentkoc force-pushed the fix/clawhub-immutable-bootstrap branch from f3aa54e to 75fd05e Compare July 10, 2026 20:10
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling labels Jul 10, 2026
@clawsweeper clawsweeper Bot removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 10, 2026
@vincentkoc
vincentkoc merged commit 54cc90b into main Jul 10, 2026
124 of 131 checks passed
@vincentkoc
vincentkoc deleted the fix/clawhub-immutable-bootstrap branch July 10, 2026 20:33
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 10, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 11, 2026
…#103809)

* fix(release): harden ClawHub bootstrap

* fix(release): centralize publication artifact verification

* fix(release): harden publication artifact verification

* fix(release): lock ClawHub bootstrap toolchain

* test(release): assert locked ClawHub binary

* fix(release): pack with trusted ClawHub harness

* fix(release): bound beta verifier artifact reads

* fix(release): bind target and tooling identities

* fix(release): stabilize signed package ordering

* fix(release): bind ClawHub pretag proof

* fix(release): bind ClawHub OIDC readback

* fix(release): bind ClawHub OIDC readback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts security-sensitive-changed size: XL 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.

Beta blocker: Meta provider - make ClawHub bootstrap publish an immutable artifact

1 participant