Skip to content

fix(package): account for bundled docs growth - #126970

Merged
RomneyDa merged 1 commit into
mainfrom
fix/npm-pack-budget-doc-growth
Aug 21, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/npm-pack-budget-doc-growth

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

This is temporary, I have kicked off a bundle size audit in parallel to address root cause

Summary

  • raise the root npm unpacked-size ceiling from 202 MiB to 204 MiB
  • keep the historical 213.6 MiB bloat case rejected
  • document that installed-agent user docs are intentional package surface

Root cause

Preflight at bafa32fd544b5ad8ac0cba75ebb76bef2250e1d7 produced a 203.4 MiB unpacked package. Compared with the last green preflight target fdc1c2e6c1b5f41d00edb2eb55244fa7c51f87dd, package-included docs grew from 6,836,915 bytes to 9,526,623 bytes while bundled skills stayed flat. Those docs are intentionally installed so agents can resolve the package-local docs path; no duplicated channel shim, extension tree, or new binary asset accounts for the overage.

Failed proof: https://github.com/openclaw/openclaw/actions/runs/32442022790/job/96654478072

Validation

  • git diff --check
  • remote PR CI and exact npm preflight pending

Production/tooling delta: +1/-1 effective constant/comment adjustment; test delta +1/-1.

@clawsweeper

clawsweeper Bot commented Aug 21, 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 scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Aug 21, 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: 🐚 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 Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 20, 2026, 11:35 PM ET / August 21, 2026, 03:35 UTC.

ClawSweeper review

What this changes

The PR raises the npm package unpacked-size ceiling from 202 MiB to 204 MiB and updates the release-check expectation.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. Current main still rejects packages above 202 MiB, while this branch raises the shared release/install guard to 204 MiB and continues to reject the documented 213.6 MiB bloat case; exact-head package preflight remains the final check.

Priority: P2
Reviewed head: bb40f6b908ba478a59a2561710100a379e8145ce

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused shared-guard change matches current package configuration and preserves the oversized-package rejection; exact-head preflight remains the material confirmation.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored release-tooling PR, so the external-contributor proof gate does not apply; exact-head package preflight is still pending validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored release-tooling PR, so the external-contributor proof gate does not apply; exact-head package preflight is still pending validation.
Evidence reviewed 5 items Current-main behavior: Current main still sets the default unpacked-size limit to 202 MiB, so the requested adjustment is not already implemented.
Intentional documentation package surface: The root package explicitly declares docs as its documentation directory and includes docs/ in published files, supporting the PR's premise that bundled user documentation is intentional package content.
Shared enforcement boundary: The release check invokes the helper before failing the preflight, and the Docker install smoke imports the same helper, so the one threshold consistently governs both paths.
Findings None None.
Security None None.

Live Verification

Command: pnpm release:check

Result: FAIL (partial) — step 2 expect_output release-check: npm pack contents and bundled channel entrypoints look OK.: expected terminal output was not visible within 30 seconds: "release-check: npm pack contents and bundled channel entrypoints look OK."

pnpm release:check
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126970-uhSySh/target$ pnpm release:check
$ pnpm build:package && pnpm release:generated:check && node --import tsx scripts/release-check.ts
$ pnpm clean:dist && pnpm build
pnpm release:check
$ node -e "require('fs').rmSync('dist', {recursive: true, force: true})"
$ node --import tsx scripts/build-all.mts
[build-all] plugins:assets:build
$ node --import tsx scripts/bundled-plugin-assets.mts --phase build
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 108.32 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[build-all] plugins:assets:build done in 1.82s
[build-all] tsdown-ai
[PLUGIN_TIMINGS] Your build spent significant time in plugins. Here is a breakdown:
  - tsdown:deps (47%)
  - rolldown-plugin-dts:fake-js (23%)
  - rolldown-plugin-dts:generate (19%)
See https://rolldown.rs/reference/InputOptions.checks#plugintimings for more details.

[tsdown-build] invocation 1/1 finished in 4.6s
[build-all] tsdown-ai done in 5.17s
[build-all] tsdown-packages
[tsdown-build] invocation 1/1 finished in 19.9s
[build-all] tsdown-packages done in 20.5s
[build-all] tsdown-unified




















Assertions:

  • FAIL expect_output: release-check: npm pack contents and bundled channel entrypoints look OK.

How this fits together

Release tooling reads npm-pack metadata before publication and rejects unexpectedly large install artifacts. The same shared size helper is used by the release check and Docker package-install smoke, affecting whether a package may proceed through release validation.

flowchart LR
  A[Packaged files and docs] --> B[npm pack metadata]
  B --> C[Shared size budget]
  C --> D{Within 204 MiB?}
  D -->|Yes| E[Release and install checks continue]
  D -->|No| F[Report package bloat]
Loading

Before merge

  • Resolve merge risk (P1) - This changes a shared release automation guard; exact-head npm preflight should confirm that the current artifact fits below 204 MiB while the historical 213.6 MiB bloat case remains rejected.
  • Complete next step (P2) - No repair lane is needed: the two-file branch has no discrete defect; wait for the normal exact-head package preflight.
Agent review details

Security

None.

PR surface

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

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 1 1 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 3 2 +1
Total 2 4 3 +1

Review metrics

Metric Value Why it matters
Production versus test LOC production/tooling +1 net, tests 0 net The production change is a single shared budget increase with an explanatory comment; the test updates its expected diagnostic only.

Merge-risk options

Maintainer options:

  1. Verify the revised package guard (recommended)
    Let the exact-head npm preflight confirm the current package succeeds below 204 MiB while the existing oversized fixture remains rejected.

Technical review

Best possible solution:

Retain the intentional bundled docs and land the 204 MiB limit once exact-head package validation confirms the intended artifact passes and the historical bloat guard still fails.

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

Yes, at source level: the current 202 MiB comparison rejects the PR body's reported 203.4 MiB package, and the helper is called by the release preflight. The PR body also links the observed failing preflight.

Is this the best way to solve the issue?

Yes, conditionally: changing the existing shared guard is the narrowest repair because package docs are already a declared published surface and both release paths consume this helper.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5e00a07db8b2.

Labels

Label changes:

  • add P2: The current release preflight rejects an intended package surface, but the effect is limited to packaging and release validation.
  • add merge-risk: 🚨 automation: Raising the shared npm-pack threshold changes the release and install-smoke failure boundary.
  • 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 is a maintainer-authored release-tooling PR, so the external-contributor proof gate does not apply; exact-head package preflight is still pending validation.

Label justifications:

  • P2: The current release preflight rejects an intended package surface, but the effect is limited to packaging and release validation.
  • merge-risk: 🚨 automation: Raising the shared npm-pack threshold changes the release and install-smoke failure boundary.
  • 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 is a maintainer-authored release-tooling PR, so the external-contributor proof gate does not apply; exact-head package preflight is still pending validation.

Evidence

What I checked:

  • Current-main behavior: Current main still sets the default unpacked-size limit to 202 MiB, so the requested adjustment is not already implemented. (scripts/lib/npm-pack-budget.mts:9, 5e00a07db8b2)
  • Intentional documentation package surface: The root package explicitly declares docs as its documentation directory and includes docs/ in published files, supporting the PR's premise that bundled user documentation is intentional package content. (package.json:361, 5e00a07db8b2)
  • Shared enforcement boundary: The release check invokes the helper before failing the preflight, and the Docker install smoke imports the same helper, so the one threshold consistently governs both paths. (scripts/release-check.ts:1398, c19bdb3a1d21)
  • Retained bloat rejection: The changed test still exercises the historical 213.6 MiB package as an error, now reporting the 204 MiB limit. (test/release-check.test.ts:914, bb40f6b908ba)
  • Feature provenance: Blame attributes the original 202 MiB guard and its release rationale to the commit that introduced the shared helper and callers. (scripts/lib/npm-pack-budget.mts:9, c19bdb3a1d21)

Likely related people:

  • Vincent Koc: Introduced the helper, release-check call, and Docker install-smoke use in the current packaging guard lineage. (role: introduced the shared package-size guard; confidence: high; commits: c19bdb3a1d21; files: scripts/lib/npm-pack-budget.mts, scripts/release-check.ts, scripts/test-install-sh-docker.sh)
  • Peter Steinberger: History shows sustained work on the release-check and npm-pack tooling, including the TypeScript migration and npm 12 pack compatibility. (role: historical release-tooling contributor; confidence: medium; commits: c70aee247e83, 7866ecae4b85; files: scripts/release-check.ts, test/release-check.test.ts)

Rank-up moves

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

  • Confirm the exact-head npm preflight reports a successful package check before merge.

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.

@RomneyDa
RomneyDa merged commit 579f9b8 into main Aug 21, 2026
166 checks passed
@RomneyDa
RomneyDa deleted the fix/npm-pack-budget-doc-growth branch August 21, 2026 03:43
@RomneyDa

Copy link
Copy Markdown
Member Author

Merged via squash.

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: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XS 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