Skip to content

fix(package): keep npm release artifacts within size limits - #126448

Merged
steipete merged 1 commit into
mainfrom
steipete/hopeful-bell-fb1a2c
Aug 19, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/hopeful-bell-fb1a2c

Conversation

@steipete

@steipete steipete commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a release-blocking problem where the root npm artifact exceeded its 202 MiB unpacked-size budget after the self-contained worker runtime and Crabbox desktop assets grew. The same release check also rejected the intentionally large canonical worker bundles during installed-package dependency verification.

Why This Change Was Made

The package now omits maintainer-only documentation sources, ships a desktop-scaled indexed Crabbox wallpaper instead of the 753 KiB source asset, and exempts only the two canonical self-contained worker artifacts from the generic 6 MiB parser bound while retaining regular-file, parse, and undeclared-dependency checks. The package-size budget and all other release gates remain unchanged.

User Impact

Maintainers can build and validate the root npm package on current main without raising the release budget. Crabbox workers retain the same lobster wallpaper design, delivered as a validated 1024×576 PNG suited to the stretched XFCE desktop background.

Evidence

  • Pre-fix current-main root tarball: 212,430,628 bytes, 618,276 over budget.
  • Fixed root tarball: 211,743,236 bytes, 69,116 under the unchanged 211,812,352-byte budget.
  • Wallpaper: 753,513 → 171,060 bytes (−77.3%); PNG signature and strict dimensions remain validated.
  • Focused tests: 262 passed.
  • node scripts/check-changed.mjs -- <changed files> passed all selected lanes.
  • pnpm build passed.
  • Canonical package preparation, tar inventory, extraction, and dist import graph passed.
  • node --import tsx scripts/release-check.ts passed end to end, including installed-package verification.
  • Exact-head CI passed.
  • Package Acceptance passed with the exact PR package candidate (source=ref, suite_profile=package).
  • An earlier Package Acceptance run with mock Telegram passed package integrity, npm 12 install, and every selected Docker product lane; only its Telegram reusable call failed before exposing a child job. This PR does not touch Telegram.
  • Codex autoreview: no accepted/actionable findings. The binary asset was inspected separately; the complete textual contract passed review.

Real Crabbox desktop comparison

Sanitized crops from the same task-owned AWS Crabbox XFCE surface show no visible background-texture regression after the asset reduction.

Before After
Crabbox wallpaper before Crabbox wallpaper after

The live proof also exposed a separate current-main XFCE session-binding issue that can leave the wallpaper black when setup runs outside the renderer's desktop session. That lifecycle bug is tracked separately and is not caused by this image/package change.

AI-assisted: yes. The implementation, package ownership, generated binary, and runtime evidence were manually inspected and verified.

Exclude maintainer-only docs, shrink the Crabbox worker wallpaper, and keep installed dependency scans compatible with canonical self-contained worker bundles without changing release budgets.
@clawsweeper

clawsweeper Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 19, 2026 21:45
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 19, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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 19, 2026
@clawsweeper

clawsweeper Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed August 19, 2026, 7:03 PM ET / 23:03 UTC.

ClawSweeper review

What this changes

This PR trims files and a Crabbox wallpaper from the npm package while allowing two self-contained worker bundles through installed-package dependency verification.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open: the previous P2 remains unfixed on the unchanged head, where two worker artifacts bypass the only per-file parser bound before synchronous read and parse.

Priority: P2
Reviewed head: c957819695b24ae89fda7923939a896b7409a3cb

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The package-size repair has concrete evidence, but the unresolved parser-bound defect blocks merge readiness.
Proof confidence 🌊 off-meta tidepool Not applicable: This is maintainer-authored; the PR body additionally reports package acceptance and a Crabbox desktop comparison, so the external-contributor proof gate does not apply.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is maintainer-authored; the PR body additionally reports package acceptance and a Crabbox desktop comparison, so the external-contributor proof gate does not apply.
Evidence reviewed 5 items Worker exception removes the only per-file bound: The changed condition exempts two named worker files from the 6 MiB limit, after which each file is synchronously read and Acorn-parsed.
Installed verifier reaches the unbounded parser path: Installed-package validation calls the root dependency manifest scan; the source-build worker layout guard is not part of that call path.
Tests encode unlimited acceptance: Both canonical worker paths are asserted to accept a file over 6 MiB; there is no dedicated cap-plus-one rejection case.
Findings 1 actionable finding [P2] Retain a finite bound for worker-bundle parsing
Security None None.

Live Verification

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

Result: PASS (completed)

node --import tsx scripts/openclaw-npm-prepublish-verify.ts --help
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126448-glGZBg/target$ node --import tsx scripts/openclaw-npm-prepublish-verify.ts --help
Usage: node --import tsx scripts/openclaw-npm-prepublish-verify.ts ‹tarball.tgz› [expected-version] [dependency.tgz ...]
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126448-glGZBg/target$ node --import tsx scripts/openclaw-npm-prepublish-verify.ts --help
Usage: node --import tsx scripts/openclaw-npm-prepublish-verify.ts ‹tarball.tgz› [expected-version] [dependency.tgz ...]
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126448-glGZBg/target$













































Assertions:

  • PASS expect_output: Usage: node --import tsx scripts/openclaw-npm-prepublish-verify.ts

How this fits together

Release packaging builds the root npm artifact, then verifies installed distribution files and their declared runtime dependencies. Crabbox worker setup reads the bundled wallpaper when creating a worker desktop.

flowchart LR
A[Source tree] --> B[NPM package artifact]
B --> C[Installed package verifier]
C --> D[File size and import checks]
D --> E[Release gate]
F[Crabbox wallpaper] --> G[Worker desktop setup]
Loading

Before merge

  • Retain a finite bound for worker-bundle parsing (P2) - These two paths bypass the only per-file limit and are then synchronously read and Acorn-parsed. The worker layout guard only validates built source layout/imports, while the installed-package path calls this scan directly; add a dedicated finite worker cap and cap-plus-one rejection coverage.
  • Resolve merge risk (P1) - Merging this exception lets an arbitrarily large designated worker file consume memory and parsing time during installed-package release verification.
  • Resolve merge risk (P1) - Production code grows by 18 lines while weakening a resource guard; the exception should be absorbed into a finite worker-specific bound.
  • Complete next step (P2) - The unresolved P2 is a narrow, source-proven verifier repair with a clear regression-test boundary.

Findings

  • [P2] Retain a finite bound for worker-bundle parsing — scripts/openclaw-npm-postpublish-verify.ts:764-765
Agent review details

Security

None.

PR surface

Source 0, Tests +24, Config +5, Other +13. Total +42 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 2 2 2 0
Tests 2 40 16 +24
Docs 0 0 0 0
Config 1 5 0 +5
Generated 0 0 0 0
Other 1 16 3 +13
Total 6 63 21 +42

Review metrics

Metric Value Why it matters
Production versus test delta production +18, tests +24, binary asset −582,453 bytes The package fix reduces artifact size, but the production growth includes a release-verification exception that needs the finite-bound repair.

Merge-risk options

Maintainer options:

  1. Bound worker parsing before merge (recommended)
    Add a finite cap for each canonical worker artifact and prove both paths reject a cap-plus-one file before synchronous parsing.
  2. Accept unbounded release verification
    Land the exception as-is and explicitly accept that a malformed designated worker artifact can consume unbounded verifier resources.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Add a finite per-worker-bundle byte cap before read/parse, preserve the generic cap for every other dist file, and add cap-plus-one rejection coverage for both canonical worker paths.

Technical review

Best possible solution:

Keep the two canonical worker paths exempt from the generic 6 MiB limit, but impose and test a finite worker-bundle parser cap before reading either file.

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

Yes, source-reproducible: a worker-path file over 6 MiB bypasses the generic check and is then fully read and parsed; focused regression coverage can establish the failing cap behavior.

Is this the best way to solve the issue?

No. The two-path exception is appropriately narrow, but removing the only per-file resource limit is not the best repair; a dedicated finite cap preserves the release invariant.

Full review comments:

  • [P2] Retain a finite bound for worker-bundle parsing — scripts/openclaw-npm-postpublish-verify.ts:764-765
    These two paths bypass the only per-file limit and are then synchronously read and Acorn-parsed. The worker layout guard only validates built source layout/imports, while the installed-package path calls this scan directly; add a dedicated finite worker cap and cap-plus-one rejection coverage.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2fe6c0206d66.

Labels

Label justifications:

  • P2: The remaining defect affects release-package verification but has a narrow, mechanical repair.
  • merge-risk: 🚨 automation: The changed release verifier can synchronously parse an unbounded designated artifact during package validation.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This is maintainer-authored; the PR body additionally reports package acceptance and a Crabbox desktop comparison, so the external-contributor proof gate does not apply.

Evidence

Acceptance criteria:

  • [P1] pnpm test test/openclaw-npm-postpublish-verify.test.ts.
  • [P1] node scripts/check-changed.mjs -- scripts/openclaw-npm-postpublish-verify.ts test/openclaw-npm-postpublish-verify.test.ts.
  • [P1] node --import tsx scripts/release-check.ts.

What I checked:

Likely related people:

  • steipete: Authored this package repair and the recent Crabbox worker-desktop change that introduced the wallpaper surface. (role: recent package and Crabbox contributor; confidence: high; commits: c957819695b2, 84c2111b3090; files: scripts/openclaw-npm-postpublish-verify.ts, extensions/crabbox/src/crabbox-worker-wallpaper.ts)
  • Vincent Koc: Authored the history entry that added the postpublish dist-scan bound this change needs to preserve. (role: introduced bounded release-verification behavior; 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.

  • Add a finite per-worker cap and cap-plus-one rejection coverage for both canonical worker paths.

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-19T21:53:56.729Z sha c957819 :: found issues before merge. :: [P2] Retain a finite bound for worker-bundle parsing

@steipete
steipete merged commit 88345d9 into main Aug 19, 2026
310 of 311 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the steipete/hopeful-bell-fb1a2c branch August 19, 2026 23:07
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 20, 2026
Exclude maintainer-only docs, shrink the Crabbox worker wallpaper, and keep installed dependency scans compatible with canonical self-contained worker bundles without changing release budgets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: crabbox maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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: ⏳ 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.

1 participant