Skip to content

fix: stop rejecting plugin-owned build dependencies in release checks - #138935

Merged
steipete merged 1 commit into
mainfrom
codex/frv-package-entry-snapshots
Sep 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/frv-package-entry-snapshots

Conversation

@steipete

@steipete steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The pre/postpublish root dependency check rejects a correctly packaged plugin builder because it treats every call named require as a core import. The Control UI builder anchors Node's createRequire to the caller plugin's package.json; its build tool belongs to that plugin. The existing checker limitation became visible when that builder was added in #134943.

Replace the name-only walk with lexical loader ownership using the existing TypeScript dependency, retaining strict Acorn syntax validation. Module-relative loaders and their known aliases count as root imports. Caller ownership is admitted only through a closed entry declaration prefix with plain parameters and supported Node normalization/factory calls; only immutable path and loader snapshots survive subsequent effects. Unsupported bindings, raw coercion, unknown calls and other unproved shapes retain the conservative literal-require check. This does not evaluate arbitrary paths or helper implementations.

The source change is release tooling only: +599 net tooling lines, +447 test lines, and no product runtime or dependency changes. The growth supplies the lexical owner boundary absent from the old walker, replacing its 66 lines; it handles aliases and unknown states without plugin-specific exemptions or an object mutation graph. Public collector tests cover both emitted builder orderings, root aliases, shadowing/reassignment/defaults, unknown loaders, and conservative effects. Existing manifest, syntax, comments/strings, bounds and package-exclusion coverage remains.

The full 146-test owner suite and complete changed-file gates passed on the main-derived candidate based on 805c6fb9cf2d4ec921603b95418ee5e21dbc9fde, using this Testbox run. Against identical extracted bytes from the failed release validation, the old checker rejects only esbuild and the new checker passes. Core artifact SHA-256: 57417cd2fced0ab19c6d4802184559a2ed47122bbd9859283f49c69850f607bb; source d3ebbd01d60ed316f2cefd7734f911039969ceb6, tooling 2329399cf6a9a2ca0c19d6c620b713a2768f9125.

The dependency comparison removes only esbuild from plugins-authoring-command-D5654nve.js and adds seven recognized root-loader importer edges: roots 46 → 47 and importer edges 370 → 376. Paired extracted-tree scans took 14.075 s / 2,029,188 KB peak RSS before and 29.656 s / 2,877,400 KB after; existing scan limits remain unchanged.

Separately, the previously completed installed compiled-plugin flow used the exact matching root + AI tarballs, with no root esbuild: init, build, validate, build --check, and pack all passed with plugin-owned build tools. Those runtime artifacts are unchanged by this scanner repair. Fresh managed review found no actionable P0–P2 findings.

@clawsweeper

clawsweeper Bot commented Sep 5, 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.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Sep 5, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 5, 2026, 3:24 AM ET / 07:24 UTC.

ClawSweeper review

What this changes

The PR makes release dependency checks distinguish root-package imports from plugin-owned build tools, while retaining strict JavaScript parsing and adding ownership regression coverage.

Merge readiness

⛔ Blocked before merge - 1 item remains

This repair remains useful: current main still rejects caller-owned build tools. No blocking patch defect was established, and the protected maintainer-owned PR should remain open.

Priority: P2
Reviewed head: 4bdeb8408f1c1947d230c2a3b1ee59a64b0c3312

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent owner-boundary repair with public-collector coverage and a relevant real-package comparison; no blocking defect was established.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The captured comparison exercises the changed release scanner against identical extracted package bytes and records esbuild rejection before, success after, and preserved root-import detection; linked logs were unavailable for additional inspection.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The captured comparison exercises the changed release scanner against identical extracted package bytes and records esbuild rejection before, success after, and preserved root-import detection; linked logs were unavailable for additional inspection.
Evidence reviewed 9 items Verified introduced scope: The pinned merge-base-to-head delta contains the scanner, its integration, and tests. The test merge records the pinned base followed by the exact PR head, and its delta contains the same three paths.
Current main and release still use name-only detection: Current main counts single-argument calls named require without examining their resolution anchor. The latest supplied release revision retains that condition too; neither contains this repair.
Concrete affected producer and documented contract: The Control UI builder canonicalizes the caller’s plugin directory, anchors createRequire to its package.json, and loads esbuild through that loader. The build command calls this owner; docs/plugins/feature-plugins.md:231 explicitly assigns esbuild to the plugin’s devDependencies.
Findings None None.
Security None None.

How this fits together

Prepublish and postpublish verification scan packaged JavaScript and compare its dependencies with package manifests. This scanner determines which imports belong to OpenClaw’s root package before reporting missing dependencies.

flowchart TD
  A[Packaged JavaScript] --> B[Strict syntax validation]
  B --> C[Loader ownership analysis]
  C --> D{Resolution owner}
  D -->|Root or unproven require| E[Root manifest check]
  D -->|Proven caller| F[Exclude caller-owned dependency]
  E --> G[Release verification result]
  F --> G
Loading

Before merge

  • Resolve merge risk (P1) - Reviewer coverage could not independently expand the linked Testbox logs or inspect the exact pinned TypeScript 6.0.3 implementation; direct compiler inspection used 5.9.2.
Agent review details

Security

None.

PR surface

Tests +447, Other +599. Total +1046 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 447 0 +447
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 665 66 +599
Total 3 1112 66 +1046

Review metrics

Metric Value Why it matters
Production versus test growth Product runtime 0; release tooling net +599; tests net +447 The stated growth supplies lexical ownership analysis while replacing the old walker, with no new product or dependency surface.
Reported artifact scan cost 14.075 → 29.656 seconds; peak RSS 2,029,188 → 2,877,400 KB The measured 2.1× duration and 42% memory increase make the release-tooling tradeoff visible.
Reported dependency classification 1 caller-owned edge removed; 7 root-loader edges added The artifact comparison shows the exemption is accompanied by broader recognition of real root imports.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep dependency ownership analysis in the shared release scanner; lexical classification requires additional tooling beyond the old name-only walk, without adding root dependencies or package-specific exemptions.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep dependency ownership analysis in the shared release scanner; lexical classification requires additional tooling beyond the old name-only walk, without adding root dependencies or package-specific exemptions.

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

Yes: current main classifies the plugin builder’s literal require("esbuild") as a root dependency despite its plugin-relative anchor. The supplied artifact comparison corroborates this; no reproduction was executed here.

Is this the best way to solve the issue?

Yes for the reported failure: the shared scanner owns this classification, and its existing relative-import helper cannot determine loader ownership. Adding esbuild to the root package would contradict the documented plugin build contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This fixes a concrete release-verification false positive with a limited tooling blast radius.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured comparison exercises the changed release scanner against identical extracted package bytes and records esbuild rejection before, success after, and preserved root-import detection; linked logs were unavailable for additional inspection.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The captured comparison exercises the changed release scanner against identical extracted package bytes and records esbuild rejection before, success after, and preserved root-import detection; linked logs were unavailable for additional inspection.

Label justifications:

  • P2: This fixes a concrete release-verification false positive with a limited tooling blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The captured comparison exercises the changed release scanner against identical extracted package bytes and records esbuild rejection before, success after, and preserved root-import detection; linked logs were unavailable for additional inspection.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured comparison exercises the changed release scanner against identical extracted package bytes and records esbuild rejection before, success after, and preserved root-import detection; linked logs were unavailable for additional inspection.

Evidence

What I checked:

  • Verified introduced scope: The pinned merge-base-to-head delta contains the scanner, its integration, and tests. The test merge records the pinned base followed by the exact PR head, and its delta contains the same three paths. (scripts/lib/package-root-imports.ts:102, 4bdeb8408f1c)
  • Current main and release still use name-only detection: Current main counts single-argument calls named require without examining their resolution anchor. The latest supplied release revision retains that condition too; neither contains this repair. (scripts/openclaw-npm-postpublish-verify.ts:722, 54af8f1b839f)
  • Concrete affected producer and documented contract: The Control UI builder canonicalizes the caller’s plugin directory, anchors createRequire to its package.json, and loads esbuild through that loader. The build command calls this owner; docs/plugins/feature-plugins.md:231 explicitly assigns esbuild to the plugin’s devDependencies. (src/cli/plugins-control-ui-build.ts:33, 4bdeb8408f1c)
  • Shared repair boundary and alternatives: Both publish verifiers call collectInstalledPackageErrors, which invokes the changed scanner. Strict Acorn parsing, manifest checks, package exclusions, and file bounds remain. The existing package-dist-imports helper checks relative-file closure rather than loader ownership, so it does not already solve this problem. These paths provide no affirmative Codex dependency signal. (scripts/openclaw-npm-postpublish-verify.ts:670, 4bdeb8408f1c)
  • Public collector regression coverage: The added matrix exercises package-manifest errors through the public collector, covering root aliases, caller loaders, reassignment, defaults, effects, immutable snapshots, and both emitted builder orderings. Existing comments, strings, size-bound and package-exclusion cases remain. Tests were inspected, not executed during this read-only review. (test/openclaw-npm-postpublish-verify.test.ts:1196, 4bdeb8408f1c)
  • Direct Node contract inspection: Inspected installed @types/node 24.13.3, whose package metadata identifies this repository. module.d.ts:23–28 requires a file URL or absolute filename for createRequire; path.d.ts documents string-only normalization, and fs/promises.d.ts:930 returns Promise<string> for default realpath. These contracts support the scanner’s normalized-path and awaited-result distinctions. (types/node/module.d.ts:23)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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.

@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up verification closes both reviewer-coverage gaps. The complete Testbox owner-suite, changed-gate, baseline/fixed scanner logs and minimal scanner runner were read directly and checked against the recorded source/artifact hashes. The full 146-test owner suite and package scan used the pinned dependencies; exact-head CI 33951976541 also passed.

The installed TypeScript 6.0.3 implementation (package gitHead 050880ce59e30b356b686bd3144efe24f875ebc8; lib/typescript.js SHA-256 569177652966bd528c319171c7dd22860dbf72bde116cbc4f644f1d02bb12e39) was inspected directly for createSourceFile, findAncestor, getCombinedNodeFlags, getSymbolAtLocation, and getShorthandAssignmentValueSymbol; these are the public APIs used by this change. The older compiler available to the automated reviewer therefore leaves no unresolved dependency-contract gap in this verification. ClawSweeper identified no patch/security findings or rank-up work. The existing scan-cost tradeoff remains explicit in the PR body.

@steipete
steipete merged commit c9ab58e into main Sep 5, 2026
136 checks passed
@steipete
steipete deleted the codex/frv-package-entry-snapshots branch September 5, 2026 07:43
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor 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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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