Skip to content

fix(scripts): avoid redundant npm version process in package checks - #157809

Merged
steipete merged 1 commit into
mainfrom
deslop/l40-npm-inventory-version
Sep 25, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/l40-npm-inventory-version

Conversation

@steipete

@steipete steipete commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Package verification can reject a valid tarball before inspecting its npm inventory because a separate diagnostic-only npm --version process fails. While qualifying #157765, Windows CI timed out this probe after 10 seconds even though tarball preflight and extraction succeeded. The reason for that Windows startup delay remains unproven.

User Impact

Standard Node toolchain installations now read npm's diagnostic version from the package manifest belonging to the exact CLI selected by the existing npm runner. Real npm pack --dry-run still owns inventory validation. Its timeout, sandbox, lifecycle suppression, output limits, error handling, and file comparisons are unchanged. Executable/shim/PATH npm installations without a known CLI manifest retain their existing version probe.

Why This Change Was Made

npm itself reports the version from its package manifest. Returning that manifest location from the canonical toolchain resolver removes the redundant process without a second npm locator or a longer timeout. The existing real-pnpm package test now rejects the separate version process while allowing actual npm packing and inventory comparison to run.

Evidence

Blacksmith Testbox tbx_01m3b2ajg4vgtdvy8hd314h5ax, run 36081500042, fresh-main base ef2dd3235123371860c9154da7b47b2c1e940788:

  • The strengthened real-checker test fails on the original production files with npm version subprocess unavailable, then passes with the repair. It allows actual npm packing and comparison to run; no added real timer or production test hook.
  • Focused owner/importer selection: 7 files, 152 tests passed. Includes inventory failures and cleanup, runner resolution, lock generation, release/candidate tooling, and plugin scaffold packaging.
  • Original 19-file Windows job selection replayed three times on Linux: 352 tests passed and nine existing platform skips each, 116s / 100s / 91s wall. This is Linux order/stability evidence; native Windows proof belongs to hosted CI.
  • Full check-openclaw-package-tarball.test.ts ran 21 consecutive times, with all 101 tests passing each time and no skips. Every existing rejection case remains enabled.
  • Single-worker measured wall (pnpm test <file> --maxWorkers=1): npm runner 1.29s; full tarball file 20.65s (101 cases). No test count was added; the existing positive tarball case is stronger. Hosted Windows tarball-file time is 59.087s / 101 tests, including the strengthened regression at 1.174s. The file retains real tar-header, extraction, lifecycle, and npm-inventory boundaries; cheaper helper-only proof would miss those contracts. All nine npm-runner cases also passed on native Windows; that reporter emits only per-case timings for this fast file, so no hosted file-level duration is available.
  • node scripts/check-changed.mjs -- <four changed paths> passed in 299s, including script/test-root types, formatting, lint, erasability, and dead-export checks.
  • pnpm build passed in 484s. A declaration compiler emitted context canceled, then both declaration batches completed, all 158 public SDK subpaths verified, and the complete build exited zero. No rerun was required.
  • Independent Codex autoreview through P2: scoped-clean, no actionable findings.

The first transfer stopped before test execution because the local index changed during source freezing. The retry used the same lease with a fixed index; it did not retry a failed product test. Final candidate hashes matched after all phases, the wrapper exited zero, and the lease was explicitly stopped. No timeout, retry policy, assertion, skip, or baseline was relaxed.

Hosted CI — READY-TO-LAND

Exact-head CI run 36084529216, head ab201d64c0a3b4b4165cc69665821abd3446b555, completed successfully: 132 jobs terminal, zero failures. Required statuses openclaw/ci-gate, openclaw/security-sensitive-review, and openclaw/dependency-review are all successful.

checks-windows-node-test-2 (job 107913764707) passed the real-pnpm regression, all 101 tarball cases, and all nine npm-runner cases on native Windows. Hosted Ubuntu assignment delayed the run; CI was not rerun and no routing or capacity settings changed. This PR is left open and unmerged at READY-TO-LAND.

Review disposition

ClawSweeper's technical reviews found no actionable code or security issue; its revision 2 also explicitly agrees that stored-data upgrade proof does not apply. Its automated data-model heuristic separately requested migration proof for scripts/lib/npm-pack-inventory.mts; that requirement does not apply to this patch. The added operation only reads the existing manifest belonging to the selected npm installation. No persisted OpenClaw state, schema, serialized format, retention, or upgrade contract changes. The pre-existing withoutPackageScripts operation still touches only a unique disposable extracted package and restores its original bytes and mode; that code is unchanged, and the retained inventory tests verify restoration on success and failure. No migration or approval exception is needed.

@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 25, 2026 02:01
@clawsweeper clawsweeper Bot added 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 Sep 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 24, 2026, 10:51 PM ET / September 25, 2026, 02:51 UTC (Revision 4).

ClawSweeper review

What this changes

The branch reads npm’s diagnostic version from the selected Node toolchain manifest when available, retains the command fallback, and strengthens package-check tests.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open. Current main and the latest release still run the diagnostic npm version process before package inventory validation. The earlier migration concern does not apply because this patch changes no stored OpenClaw data.

Priority: P2
Reviewed head: ab201d64c0a3b4b4165cc69665821abd3446b555

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused repair with a meaningful checker-boundary regression and successful exact-head Windows validation.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The PR reports a baseline failure and after-fix success through the production package checker on a pnpm-built tarball; the test blocks only the version subprocess while real npm pack runs, and the exact-head native Windows job succeeded. The job log archive was unavailable to this reviewer. The manifest read changes no stored-data contract.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR reports a baseline failure and after-fix success through the production package checker on a pnpm-built tarball; the test blocks only the version subprocess while real npm pack runs, and the exact-head native Windows job succeeded. The job log archive was unavailable to this reviewer. The manifest read changes no stored-data contract.
Evidence reviewed 9 items Current main still has the failure path: The checker invokes npm --version before running npm pack, so failure of the diagnostic command prevents inventory comparison.
Introduced production behavior: The proposed checker reads the selected npm manifest for the diagnostic version, retains the version command when no manifest path is available, and still executes npm pack for inventory.
Toolchain selection and fallback: Only the recognized toolchain npm CLI supplies a manifest path; executable and command fallbacks retain their existing invocation paths.
Findings None None.
Security None None.

How this fits together

OpenClaw’s release tooling checks a package tarball against the files npm would pack before accepting the artifact. The npm runner selects the toolchain command, and the checker uses its result to report diagnostics and validate inventory.

flowchart LR
A[Package tarball] --> B[Package checker]
C[Node toolchain] --> D[npm runner]
D --> E[Version diagnostic]
E --> B
B --> F[npm pack dry run]
F --> G[Inventory comparison]
G --> H[Accept or reject package]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Tests +25, Other +14. Total +39 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 27 2 +25
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 24 10 +14
Total 4 51 12 +39

Review metrics

Metric Value Why it matters
Production and test growth production +14 net lines; tests +25 net lines The production growth carries the selected manifest path and preserves fallback behavior; the test growth exercises the checker boundary.

Stored data model

Persistent data-model change detected: serialized state: scripts/lib/npm-pack-inventory.mts, unknown-data-model-change: scripts/lib/npm-pack-inventory.mts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Land the focused checker repair through ordinary review gates, keeping real npm pack inventory as the package-validation authority.

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

Yes. Current main runs npm --version before inventory comparison, and the PR’s production-checker test blocks that subprocess to expose the failure; this read-only review did not execute the test.

Is this the best way to solve the issue?

Yes. Using the manifest associated with the already-selected npm CLI removes the unnecessary diagnostic process while preserving the command fallback and actual npm inventory check.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A diagnostic subprocess can block package verification, but the affected surface is bounded release tooling.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR reports a baseline failure and after-fix success through the production package checker on a pnpm-built tarball; the test blocks only the version subprocess while real npm pack runs, and the exact-head native Windows job succeeded. The job log archive was unavailable to this reviewer. The manifest read changes no stored-data contract.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR reports a baseline failure and after-fix success through the production package checker on a pnpm-built tarball; the test blocks only the version subprocess while real npm pack runs, and the exact-head native Windows job succeeded. The job log archive was unavailable to this reviewer. The manifest read changes no stored-data contract.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (3 earlier review cycles)
  • reviewed 2026-09-25T02:08:47.026Z sha ab201d6 :: blocked before merge. :: none
  • reviewed 2026-09-25T02:18:08.940Z sha ab201d6 :: blocked before merge. :: none
  • reviewed 2026-09-25T02:34:23.990Z sha ab201d6 :: blocked before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S labels Sep 25, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Sep 25, 2026
@steipete
steipete merged commit c1051da into main Sep 25, 2026
248 of 253 checks passed
@steipete
steipete deleted the deslop/l40-npm-inventory-version branch September 25, 2026 06:06
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 25, 2026
…4-prep

* commit '8fe893da516ebdc817692fb2d272e27bc3c88376': (31 commits)
  fix(test): wait for reload admission before restart polling (#157964)
  refactor(mattermost): reuse DM retry option selection (#157800)
  chore(i18n): refresh native locales (#157850)
  perf(sessions): reuse current participants across transcript appends (#157622)
  refactor(signal): share pending transport migration results (#157777)
  fix(tui): open model pickers without waiting for the Gateway (#157839)
  fix(gateway): apply config despite delayed file notifications (#157906)
  fix(auth): clear deleted account selections and support account recovery (#157745)
  fix: plugin reloads lose tool results and strand subagent settlement (#157339)
  fix(gateway): avoid preview errors during worker metadata updates (#157943)
  refactor(diffs): reuse native promisify for compression (#157835)
  fix(models): keep current choices on the first picker page (#157869)
  fix(plugins): retain existing quarantine across unrelated reloads (#157907)
  fix(openai): prioritize ChatGPT sign-in and clarify auth choices (#157792)
  chore(ui): refresh control ui locales (#157955)
  fix(ui): refresh connected accounts after auth changes (#157950)
  fix(scripts): avoid redundant npm version process in package checks (#157809)
  refactor(usage): capture hosted pricing once per operation (#157838)
  refactor(ui): share slash-command failure results (#157649)
  fix(cron): announce runs miss the channel's formatting rules (#157877)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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