Skip to content

fix(ci): include runtime resources in build artifact - #98326

Closed
qingminglong wants to merge 10 commits into
openclaw:mainfrom
qingminglong:codex/98276-runtime-artifact-assets
Closed

qingminglong wants to merge 10 commits into
openclaw:mainfrom
qingminglong:codex/98276-runtime-artifact-assets

Conversation

@qingminglong

@qingminglong qingminglong commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #98276

What Problem This Solves

Fixes an issue where users downloading the CI dist-runtime-build artifact for gateway or ACP runtime proof would need local repairs before the artifact could resolve workspace templates and plugin runtime modules.

Why This Change Was Made

The runtime artifact now preserves the package-root launcher, package metadata, docs workspace templates, runtime agent templates, and built dist/dist-runtime outputs in the same archive. This keeps the existing package-root resolvers for src/agents/templates, docs/reference/templates, and dist/plugins/runtime working from the extracted artifact instead of requiring local copies or symlink repairs.

User Impact

Developers and proof workflows can use the CI runtime artifact as a pinned runtime input with the packaged template and plugin runtime layout present. This does not claim the downstream evaOS visible-agent ACP behavior is fixed; it only fixes the artifact reproducibility gap tracked here.

Evidence

  • Current head: c84f2784df1a6009c32c34342336d24e3ef37fae.
  • Claim proved: the CI workflow packages the runtime artifact with the package-root runtime resources needed by workspace template and plugin runtime resolution, and the current head keeps the follow-up lint/close-error fixes without changing artifact roots, manifest checks, or smoke behavior.
  • Commands / artifacts:
    • git diff --check -- .github/workflows/ci.yml test/scripts/ci-workflow-guards.test.ts scripts/dist-runtime-build-artifact.mjs passed locally on the PR worktree.
    • node --check scripts/dist-runtime-build-artifact.mjs passed locally on the PR worktree.
    • Earlier current-head author proof on c84f2784df: node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.scripts.json scripts/dist-runtime-build-artifact.mjs passed.
    • Earlier current-head author proof on c84f2784df: node scripts/run-vitest.mjs test/scripts/ci-workflow-guards.test.ts passed, 33 tests.
    • Earlier current-head author proof on c84f2784df: node_modules\.bin\oxfmt.cmd --check --threads=1 scripts/dist-runtime-build-artifact.mjs test/scripts/ci-workflow-guards.test.ts passed.
    • Earlier current-head author proof on c84f2784df: python .agents\skills\autoreview\scripts\autoreview --mode commit --commit f002d0df1b was clean, with no accepted/actionable findings.
    • PR check Real behavior proof passed on July 2, 2026: https://github.com/openclaw/openclaw/actions/runs/28606714095/job/84828724242.
    • PR checks check-lint, build-artifacts, Blacksmith Testbox check, and Blacksmith ARM Testbox check-arm are passing on the PR.
    • Maintainer artifact proof from 0223caf09c: local pnpm build:ci-artifacts passed; local node scripts/dist-runtime-build-artifact.mjs pack-and-smoke --archive dist-runtime-build.tar.zst produced sha256=8252ae210644893218abbcbf254ac281ca32ba9847ab5faeb8c595ea2289cb24, entries=13234, ACP import passed, and Gateway /readyz passed with the bundled browser plugin loaded; Crabbox remote Azure run run_412298228807 produced sha256=72c9f1235f2a9623f014762fb5fda04207a5d225cb3617049fbd2a8386782ee9, entries=13234, ACP import passed, and Gateway /readyz passed with the bundled browser plugin loaded.
  • Observed result: the artifact script/guard path preserves openclaw.mjs, package.json, docs/reference/templates, src/agents/templates, dist, and dist-runtime, while rejecting broad source/package roots outside the runtime-owned template paths; current-head checks show no relevant failed or pending checks.

@clawsweeper

clawsweeper Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed July 11, 2026, 5:46 AM ET / 09:46 UTC.

Summary
The PR replaces direct CI tar packaging with a contract script that adds templates and runtime outputs, verifies the archive, and smoke-tests extracted Gateway and ACP startup.

PR surface: Tests +36, Config 0, Other +618. Total +654 across 3 files.

Reproducibility: yes. from source and recorded evidence. The linked issue documents the missing-resource startup failures, while current source shows the proposed smoke can mask a remaining dependency-closure failure by linking checkout dependencies.

Review metrics: 1 noteworthy metric.

  • Runtime artifact roots: 4 added, 1 removed. The contract adds launcher, metadata, and two template roots but removes the workspace-package distribution payload used by externalized imports.

Stored data model
Persistent data-model change detected: serialized state: test/scripts/ci-workflow-guards.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #98276
Summary: This PR is the direct candidate fix for the canonical runtime-artifact reproducibility issue, but the implementation remains incomplete.

Members:

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

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦞 diamond lobster
Patch quality: 🦪 silver shellfish
Result: blocked by patch quality or review findings.

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

Rank-up moves:

  • [P2] Restore required workspace package outputs and rerun the extracted-artifact smoke with OpenClaw workspace imports isolated from the source checkout.

Risk before merge

  • [P1] Merging can publish a CI artifact that passes its smoke only because it resolves omitted OpenClaw workspace package outputs from the original checkout, then fails Gateway or ACP execution in an independent consumer layout.

Maintainer options:

  1. Restore hermetic workspace outputs (recommended)
    Add the required workspace package distributions to the artifact and prevent the smoke from resolving those packages from the checkout.
  2. Keep the prior payload while adding resources
    Preserve the existing packages/*/dist payload and layer the new launcher, template, and bundled-runtime roots onto it with focused manifest checks.
  3. Define a checkout-dependent artifact
    Pause the PR unless maintainers intentionally want an artifact requiring a matching hydrated source checkout and document that narrower contract.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Restore required OpenClaw workspace package dist outputs in the runtime artifact and update the smoke and guards so workspace runtime imports resolve only from archive-owned files.

Next step before merge

  • [P2] The blocking P1 is a narrow mechanical repair to the artifact root contract, manifest checks, and smoke dependency isolation.

Security
Cleared: The diff adds no new dependency source, action, workflow permission, secret access, or remote download-and-execute path; the blocker is artifact integrity rather than security.

Review findings

  • [P1] Preserve workspace package outputs in the artifact — scripts/dist-runtime-build-artifact.mjs:28-35
Review details

Best possible solution:

Retain the contract script, include every externalized OpenClaw workspace distribution required at runtime, and make the extracted smoke resolve those outputs only from the archive while borrowing only third-party dependencies.

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

Yes from source and recorded evidence. The linked issue documents the missing-resource startup failures, while current source shows the proposed smoke can mask a remaining dependency-closure failure by linking checkout dependencies.

Is this the best way to solve the issue?

No as written. A contract-owning pack-and-smoke script is the right boundary, but the archive and smoke must be self-consistent for OpenClaw-owned workspace outputs.

Full review comments:

  • [P1] Preserve workspace package outputs in the artifact — scripts/dist-runtime-build-artifact.mjs:28-35
    The artifact still omits and forbids packages/*/dist, but the build externalizes OpenClaw workspace packages such as @openclaw/ai. Because the smoke symlinks the checkout's whole node_modules, it can load those workspace outputs from outside the extraction and pass while the uploaded artifact remains incomplete. Include the required workspace distributions and make the smoke resolve them from the extracted artifact.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0e1e077f4fd4.

Label changes

Label justifications:

  • P2: The defect affects the CI runtime artifact and proof consumers with limited blast radius outside that workflow.
  • merge-risk: 🚨 automation: The new artifact producer can report success while its smoke resolves omitted workspace outputs from the checkout.
  • merge-risk: 🚨 availability: An independently extracted artifact may fail Gateway or ACP startup when required workspace package builds are absent.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦞 diamond lobster and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR provides local and Crabbox extracted-artifact ACP import and Gateway readiness output, but that proof does not clear the correctness finding because the smoke borrows checkout workspace dependencies.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR provides local and Crabbox extracted-artifact ACP import and Gateway readiness output, but that proof does not clear the correctness finding because the smoke borrows checkout workspace dependencies.
Evidence reviewed

PR surface:

Tests +36, Config 0, Other +618. Total +654 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 39 3 +36
Docs 0 0 0 0
Config 1 1 1 0
Generated 0 0 0 0
Other 1 618 0 +618
Total 3 658 4 +654

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs test/scripts/ci-workflow-guards.test.ts.
  • [P1] node scripts/dist-runtime-build-artifact.mjs pack-and-smoke --archive dist-runtime-build.tar.zst.
  • [P1] node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.scripts.json scripts/dist-runtime-build-artifact.mjs.
  • [P1] git diff --check -- .github/workflows/ci.yml scripts/dist-runtime-build-artifact.mjs test/scripts/ci-workflow-guards.test.ts.

What I checked:

Likely related people:

  • steipete: Authored the substantial artifact contract and smoke implementation in commit 0223caf and remains the live PR assignee. (role: introduced artifact contract; confidence: high; commits: 0223caf09cbb; files: scripts/dist-runtime-build-artifact.mjs, .github/workflows/ci.yml, test/scripts/ci-workflow-guards.test.ts)
  • vincentkoc: Current-main blame and history connect this contributor to the CI artifact payload, workspace bootstrap smoke, AI package exports, and externalization configuration carried by commit 64c50da. (role: recent adjacent contributor; confidence: medium; commits: 64c50da1b26d; files: .github/workflows/ci.yml, scripts/lib/workspace-bootstrap-smoke.mjs, tsdown.config.ts)
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 (5 earlier review cycles)
  • reviewed 2026-07-04T05:54:41.109Z sha c84f278 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-06T18:38:16.303Z sha c84f278 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-07T10:36:17.551Z sha 62bf489 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-10T12:35:38.724Z sha 8f8f47c :: needs maintainer review before merge. :: none
  • reviewed 2026-07-11T09:39:15.836Z sha 28983a9 :: needs changes before merge. :: [P1] Preserve workspace package outputs in the artifact

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 backlog priority with limited blast radius. labels Jul 1, 2026
@steipete steipete self-assigned this Jul 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: L and removed size: XS labels Jul 1, 2026
@steipete

steipete commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Maintainer update pushed in 0223caf09c.

This keeps the contributor PR branch and credit intact, but replaces the brittle tar invocation with a contract-owning artifact script:

  • artifact roots: openclaw.mjs, package.json, docs/reference/templates, src/agents/templates, dist, dist-runtime
  • manifest guard: requires package-root workspace templates, dist/entry.js, ACP runtime entry, and bundled plugin runtime layout under dist-runtime/extensions
  • bloat guard: rejects package/source roots such as extensions, packages, apps, ui, test, qa, node_modules, and any src/**/docs/** outside the runtime-owned template paths
  • extracted artifact proof: clean extraction, package-root dependency borrowing only for the smoke, workspace template bootstrap, packaged ACP runtime import, and packaged Gateway /readyz with the bundled browser plugin observed in the loaded-plugin banner

Evidence:

  • node scripts/run-vitest.mjs test/scripts/ci-workflow-guards.test.ts -> 32 passed
  • git diff --check -- .github/workflows/ci.yml test/scripts/ci-workflow-guards.test.ts scripts/dist-runtime-build-artifact.mjs -> passed
  • pnpm exec oxfmt --check --threads=1 scripts/dist-runtime-build-artifact.mjs test/scripts/ci-workflow-guards.test.ts -> passed
  • local pnpm build:ci-artifacts -> passed
  • local node scripts/dist-runtime-build-artifact.mjs pack-and-smoke --archive dist-runtime-build.tar.zst -> sha256=8252ae210644893218abbcbf254ac281ca32ba9847ab5faeb8c595ea2289cb24, entries=13234, ACP import passed, Gateway /readyz passed with browser plugin loaded
  • Crabbox remote Azure run run_412298228807 on Standard_D32ds_v6 -> sha256=72c9f1235f2a9623f014762fb5fda04207a5d225cb3617049fbd2a8386782ee9, entries=13234, ACP import passed, Gateway /readyz passed with browser plugin loaded
  • fresh autoreview -> clean, no accepted/actionable findings

Notes:

  • Two explicit Blacksmith Testbox attempts failed before the command reached the repo: tbx_01kwed2yqcp44qwax1pte4qqny failed during setup and tbx_01kwed974vzpjzyna47b24b5te was shut down while queued. I treated those as provider setup failures, then used the Crabbox fallback provider for the remote proof above.
  • GitHub CI for 0223caf09c is queued/running now.
  • I have not run prepare-sync-head, prepare-run, or merge-run.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. and removed 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. labels Jul 1, 2026
@qingminglong

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

I pushed fixes on current head c84f2784df for the contributor-facing automation blocker from the prior review.

What changed:

  • Fixed the scripts/dist-runtime-build-artifact.mjs promise executor lint hits without changing artifact roots, manifest checks, or smoke behavior.
  • Replaced the direct .catch((error) => ...) entrypoint handler with top-level try/catch in the .mjs direct-run guard.
  • Wrapped the server.close(...) callback rejection so the script satisfies the repo's prefer-promise-reject-errors rule.
  • Merged current upstream/main into the PR branch using merge, not rebase, to clear stale unrelated type/test failures from the older head.

Local evidence on the PR worktree:

  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.scripts.json scripts/dist-runtime-build-artifact.mjs -> passed.
  • node scripts/run-vitest.mjs test/scripts/ci-workflow-guards.test.ts -> passed, 33 tests.
  • git diff --check -- .github/workflows/ci.yml test/scripts/ci-workflow-guards.test.ts scripts/dist-runtime-build-artifact.mjs -> passed.
  • node --check scripts/dist-runtime-build-artifact.mjs -> passed.
  • node_modules\.bin\oxfmt.cmd --check --threads=1 scripts/dist-runtime-build-artifact.mjs test/scripts/ci-workflow-guards.test.ts -> passed.
  • python .agents\skills\autoreview\scripts\autoreview --mode commit --commit f002d0df1b -> clean, no accepted/actionable findings.
  • python .agents\skills\autoreview\scripts\autoreview --mode commit --commit c84f2784df -> clean, no accepted/actionable findings.

GitHub checks already green on the current head include:

  • Real behavior proof -> passed.
  • build-artifacts -> passed.
  • check-lint -> passed.
  • check-test-types -> passed.
  • checks-node-compact-small-whole-3 -> passed.

Some broad CI shards are still finishing, but the specific check-lint blocker from the previous review is resolved on the current head.

@clawsweeper

clawsweeper Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 1, 2026
@qingminglong

Copy link
Copy Markdown
Contributor Author

Have a nice day, please help merge!

@clawsweeper clawsweeper Bot added status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 2, 2026
@qingminglong

Copy link
Copy Markdown
Contributor Author

Have a nice day, please help merge!

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. labels Jul 4, 2026
@qingminglong

Copy link
Copy Markdown
Contributor Author

@steipete gentle ping when you have a moment.

I noticed the remaining merge-risk: 🚨 automation label, which makes sense because this changes the build-artifacts producer. Current head c84f2784df has proof: sufficient / status: 👀 ready for maintainer look, build-artifacts is green on the exact head, and the script now verifies, extracts, and smokes the artifact contract instead of only packing it.

If that automation-risk tradeoff looks acceptable to you, could you please take a final look and merge?

@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(ci): include runtime resources in build artifact 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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Runtime artifact must include agent templates and plugin runtime assets

2 participants