Skip to content

fix(package): bound installed worker artifact parsing - #126491

Merged
steipete merged 2 commits into
mainfrom
steipete/worker-package-parse-bound-20260819
Aug 20, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/worker-package-parse-bound-20260819

Conversation

@steipete

@steipete steipete commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Related: #126448

What Problem This Solves

Fixes a release-verifier resource gap where a malformed canonical worker artifact could bypass the generic 6 MiB file limit and be synchronously read and parsed up to the root package's overall size ceiling. It also closes the earlier context-engine reader that ran before the dependency parser.

Why This Change Was Made

Every installed root-dist JavaScript read now goes through one shared pre-read policy: canonical self-contained worker artifacts use an 80 MiB limit, while all other root files retain the existing 6 MiB limit. The legacy context-engine marker scan now follows its root-runtime ownership boundary and skips plugin-owned extension assets; the public verifier deduplicates identical errors from its independent checks.

User Impact

Release and postpublish verification still accepts the current ~68.8 MB self-contained worker with 21.9% headroom, while rejecting unexpectedly bloated worker artifacts before either verifier pass can read or parse them.

Evidence

  • Public-flow sparse-worker regression proves an 80 MiB-plus-one worker returns the structured 83,886,080-byte error exactly once and does not expose the embedded legacy context-engine marker.
  • Generic direct and nested root files still reject above 6 MiB; canonical workers below 80 MiB remain accepted.
  • Extension-owned JavaScript assets are excluded from the root context-engine marker contract.
  • Focused verifier/release tests: 123 passed on the full-flow repair.
  • Changed-path checks and pnpm build passed.
  • Clean current-main root npm tarball: 211,485,321 bytes, 327,031 under the unchanged 211,812,352-byte budget.
  • Exact-head CI passed on d5acc875b27cf633dbe5f36742c29101b6e3b1f0.
  • Package Acceptance passed on the exact package candidate (source=ref, suite_profile=package).
  • Fresh Codex autoreview: no accepted/actionable findings after both repair rounds.
  • Whole PR delta: production +47/−47; tests +68/−4.

The earlier apparent package overage was traced to stale local dist/ output, not this change. That build-hygiene issue is tracked separately.

AI-assisted: yes. The full verifier read graph, resource boundary, sparse-file behavior, package inventory, and review findings were manually inspected.

Keep canonical self-contained worker bundles above the generic dist-file cap while enforcing an 80 MiB limit before installed-package verification reads or parses them.
@clawsweeper

clawsweeper Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Aug 20, 2026
@steipete
steipete marked this pull request as ready for review August 20, 2026 00:22
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 20, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. 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 Aug 20, 2026
@clawsweeper

clawsweeper Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 9:21 PM ET / August 20, 2026, 01:21 UTC.

ClawSweeper review

What this changes

This PR routes installed root distribution JavaScript reads through a shared size policy, allowing canonical worker bundles up to 80 MiB while retaining the 6 MiB limit for other files.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. The follow-up commit addresses the prior unbounded context-engine read, and no new actionable correctness finding was identified; exact-head release/package checks were still running in the supplied state.

Priority: P2
Reviewed head: d5acc875b27cf633dbe5f36742c29101b6e3b1f0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused owner-boundary repair with a credible public-flow regression test; exact-head package validation is still pending.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless reports an after-fix sparse-artifact verifier run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless reports an after-fix sparse-artifact verifier run.
Evidence reviewed 5 items Current-main gap: Current main's context-engine scan synchronously reads every distribution JavaScript file before the dependency scan's size guard, so a canonical worker above the generic limit can be read first.
Shared owner-boundary repair: The PR computes the canonical-worker or generic limit before readFileSync, and both the context-engine and dependency passes use that helper.
Public-flow regression coverage: The added sparse-worker test invokes the public package-error collector, asserts one size error, and asserts that the earlier marker scan did not read the artifact.
Findings None None.
Security None None.

Live Verification

Command: node --import tsx scripts/openclaw-npm-postpublish-verify.ts --help

Result: PASS (completed)

node --import tsx scripts/openclaw-npm-postpublish-verify.ts --help
runner@runnervmzvulz:/tmp/clawsweeper-live-proof-126491-s9mga9/target$ node --import tsx scripts/openclaw-npm-postpublish-verify.ts --help
Usage: node --import tsx scripts/openclaw-npm-postpublish-verify.ts ‹version›
runner@runnervmzvulz:/tmp/clawsweeper-live-proof-126491-s9mga9/target$ node --import tsx scripts/openclaw-npm-postpublish-verify.ts --help
Usage: node --import tsx scripts/openclaw-npm-postpublish-verify.ts ‹version›
runner@runnervmzvulz:/tmp/clawsweeper-live-proof-126491-s9mga9/target$













































Assertions:

  • PASS expect_output: Usage: node --import tsx scripts/openclaw-npm-postpublish-verify.ts ‹version›

How this fits together

The npm postpublish verifier installs an OpenClaw package and examines its built distribution before release acceptance proceeds. It now applies a file-size decision before the legacy-runtime scan and dependency parser consume each root runtime file.

flowchart LR
A[Installed npm package] --> B[Root distribution JavaScript files]
B --> C[Shared pre-read size policy]
C --> D[Canonical worker limit]
C --> E[Generic file limit]
D --> F[Legacy runtime scan]
E --> G[Dependency parser]
F --> H[Release verification result]
G --> H
Loading

Before merge

  • Resolve merge risk (P1) - The 80 MiB allowance is a release-availability boundary: exact-head CI and package acceptance should confirm the shipped worker stays within it before merge.
  • Complete next step (P2) - No mechanical repair remains after the addressed prior finding; the remaining merge gate is normal exact-head release validation.
Agent review details

Security

None.

PR surface

Tests +64, Other 0. Total +64 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 68 4 +64
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 47 47 0
Total 2 115 51 +64

Review metrics

Metric Value Why it matters
Production versus test LOC production +47/-47 (net 0); tests +68/-4 The repair centralizes existing read policy without net production growth while adding boundary and full-verifier regression coverage.

Merge-risk options

Maintainer options:

  1. Complete exact-head package verification (recommended)
    Allow the running exact-head CI and package-acceptance checks to confirm that the shipped worker remains accepted and oversized artifacts fail before parsing.

Technical review

Best possible solution:

Keep one canonical pre-read policy for every root-runtime verifier pass, with the two manifest-defined worker paths as the only 80 MiB exception.

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

Yes in source: an 80 MiB-plus canonical worker reaches current main's context-engine scan and is synchronously read before the later dependency-parser guard; the added public-flow test targets that order.

Is this the best way to solve the issue?

Yes. Applying the size decision in the shared pre-read helper covers both independent verifier passes and avoids a downstream-only guard.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3bfc9bc80451.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless reports an after-fix sparse-artifact verifier run.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded release-verifier reliability repair with limited operator blast radius.
  • merge-risk: 🚨 availability: An incorrect size threshold could reject the shipped worker or allow expensive parsing during release verification.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless reports an after-fix sparse-artifact verifier run.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the current repair and the immediately preceding merged package-artifact work in the same verifier. (role: recent area contributor; confidence: high; commits: d5acc875b27c, 88345d984bf8; files: scripts/openclaw-npm-postpublish-verify.ts, test/openclaw-npm-postpublish-verify.test.ts)
  • Vincent Koc: History identifies the earlier bounded postpublish scan commit and substantial prior work on this verifier. (role: scan-bound introducer and adjacent contributor; confidence: medium; commits: 5296dc378f85; files: scripts/openclaw-npm-postpublish-verify.ts)

Rank-up moves

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

  • Let exact-head CI and Package Acceptance complete before merging.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-20T00:28:49.490Z sha c487731 :: found issues before merge. :: [P2] Bound the earlier context-engine scan

Route the context-engine and dependency scans through one root-dist pre-read policy, exclude plugin-owned extension assets from the root marker contract, and cover the public verifier flow.
@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 Aug 20, 2026
@steipete
steipete merged commit 53fb822 into main Aug 20, 2026
165 checks passed
@steipete
steipete deleted the steipete/worker-package-parse-bound-20260819 branch August 20, 2026 01:47
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 20, 2026
* fix(package): bound worker artifact parsing

Keep canonical self-contained worker bundles above the generic dist-file cap while enforcing an 80 MiB limit before installed-package verification reads or parses them.

* fix(package): bound every verifier read

Route the context-engine and dependency scans through one root-dist pre-read policy, exclude plugin-owned extension assets from the root marker contract, and cover the public verifier flow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S 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.

1 participant