Skip to content

fix(plugins): exclude scaffold tests from published packages - #129393

Merged
steipete merged 2 commits into
mainfrom
codex/qa-plugin-scaffold-package-test-leak-20260825
Sep 17, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/qa-plugin-scaffold-package-test-leak-20260825

Conversation

@steipete

@steipete steipete commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Generated tool plugin builds compile their Vitest tests into dist, which includes those development-only files in the published package.

User Impact

Tool packages contain the production module graph and its declarations. Imported production helpers remain included, and feature scaffolds retain TypeScript checking for their separate browser entry.

Why This Change Was Made

Use the production entrypoint as the compiler root for tool and provider scaffolds. Preserve the feature scaffold's broader compiler roots: that scaffold was added after this PR and has a browser entry that the backend does not import.

Evidence

  • Original-main regression: real TypeScript emission produced unwanted index.test.js and index.test.d.ts alongside the tool's production files.
  • Stale-PR regression: applying the original unconditional entrypoint-only change skipped the feature scaffold's browser source; the sibling compiler-root check failed.
  • Corrected candidate passes all 57 scaffold, validation, and artifact tests, including real TypeScript emission and isolated npm pack --dry-run --json --ignore-scripts --offline inventories. Dependency-free consumer fixtures prove imported production helper output and tool declarations remain included while independent test files stay out of the package.
  • Scoped type-aware lint, formatting, docs MDX checks, line-cap ratchets, and selected boundary/dependency guards pass. Local full typechecking is blocked by the nested checkout's borrowed dependency isolation guard; hosted CI remains the full typecheck gate.
  • Fresh independent P0–P2 review is clean.
  • Exact-head hosted CI passed for b910862992b57217b6cf42031d75a142ea7b21a6: run 35167998221.

@clawsweeper

clawsweeper Bot commented Aug 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.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS maintainer Maintainer-authored PR labels Aug 25, 2026
@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 Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 8:54 PM ET / September 17, 2026, 00:54 UTC (Revision 5).

ClawSweeper review

What this changes

The PR excludes independent tests from generated tool-plugin builds while preserving imported production modules, declarations, and feature-plugin browser checks.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary on current main and v2026.9.4. The refreshed patch preserves feature compilation, adds meaningful package-boundary coverage, and has no blocking correctness findings.

Priority: P2
Reviewed head: b910862992b57217b6cf42031d75a142ea7b21a6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level fix with useful compiler and package coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Its reported TypeScript emission and npm inventories exercise the changed packaging boundary as supplemental validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Its reported TypeScript emission and npm inventories exercise the changed packaging boundary as supplemental validation.
Evidence reviewed 8 items Introduced change and actual merge result: The verified test merge has the pinned main and PR head as its parents. Its production change is the compiler-root conditional; provider and feature behavior remain unchanged.
Current-main defect: Main selects src/**/*.ts for tool scaffolds, generates src/index.test.ts, and packages dist. The CLI init registration calls this scaffold owner directly.
Latest release still affected: The v2026.9.4 source retains the provider-only entrypoint conditional, so tool scaffolds still compile the broader source glob. GitHub source inspection succeeded after the local release-blob read failed.
Findings None None.
Security None None.

How this fits together

OpenClaw’s plugin authoring CLI generates source files, build configuration, and package metadata. TypeScript compiler roots determine which files reach the distribution directory that npm packages.

flowchart LR
  A[Plugin init command] --> B[Scaffold type]
  B --> C[Tool or provider entrypoint]
  B --> D[Feature backend and browser sources]
  C --> E[TypeScript compilation]
  D --> E
  E --> F[Distribution files]
  F --> G[Published package]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +56, Docs +4. Total +60 across 3 files.

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

Review metrics

None.

Technical review

Best possible solution:

Keep compiler-root selection in the scaffold owner so new tool packages contain their production module graph while feature browser sources remain checked.

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

Yes, from source: generate a tool scaffold, compile its broad source glob, and inspect dist or the npm inventory for emitted test files. This review did not execute that flow.

Is this the best way to solve the issue?

Yes. Narrowing the generated tool compiler root fixes the producer directly, preserves imported helpers, and leaves provider and feature behavior intact.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4e44dbfb428a.

Labels

Label justifications:

  • P2: Generated tool packages include development-only files; this is a bounded packaging defect.
  • 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: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Its reported TypeScript emission and npm inventories exercise the changed packaging boundary as supplemental validation.

Evidence

What I checked:

  • Introduced change and actual merge result: The verified test merge has the pinned main and PR head as its parents. Its production change is the compiler-root conditional; provider and feature behavior remain unchanged. (src/cli/plugins-authoring-command.ts:491, 94bad81082fe)
  • Current-main defect: Main selects src/**/*.ts for tool scaffolds, generates src/index.test.ts, and packages dist. The CLI init registration calls this scaffold owner directly. (src/cli/plugins-authoring-command.ts:491, 4e44dbfb428a)
  • Latest release still affected: The v2026.9.4 source retains the provider-only entrypoint conditional, so tool scaffolds still compile the broader source glob. GitHub source inspection succeeded after the local release-blob read failed. (src/cli/plugins-authoring-command.ts, 3a9d69db306c)
  • Regression coverage and execution limits: The complete new tests invoke the scaffold owner, compile dependency-free consumer fixtures with TypeScript, inspect npm pack inventories, and preserve the feature browser compiler root. The captured PR body reports 57 passing tests and pre-fix failures; these were not rerun during this read-only review. (src/cli/plugins-scaffold-compilation.test.ts:11, b910862992b5)
  • Existing-project safety: The changed configuration is generated by init, which refuses an existing destination unless force is explicitly requested. Ordinary upgrades do not rewrite existing plugin projects, and the patch changes no plugin SDK API. (src/cli/plugins-authoring-command.ts:906, b910862992b5)
  • Compiler dependency contract: The generated build invokes TypeScript and the new test imports its compiler API, establishing the dependency signal. TypeScript 5.9.3, within the generated scaffold’s declared range, expands validated include specifications through getFileNamesFromConfigSpecs; its program owner separately resolves imported modules. Repository ownership and the release commit were verified through GitHub. (src/compiler/commandLineParser.ts:3937, c63de15a992d)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: 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 (4 earlier review cycles)
  • reviewed 2026-08-25T15:07:05.524Z sha 374c943 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-25T15:50:08.683Z sha 374c943 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-29T03:34:41.990Z sha 374c943 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-04T14:39:20.791Z sha 374c943 :: blocked before merge. :: none

@steipete
steipete force-pushed the codex/qa-plugin-scaffold-package-test-leak-20260825 branch from 374c943 to b910862 Compare September 17, 2026 00:47
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S and removed size: XS labels Sep 17, 2026
@steipete
steipete merged commit f7fe156 into main Sep 17, 2026
116 of 117 checks passed
@steipete
steipete deleted the codex/qa-plugin-scaffold-package-test-leak-20260825 branch September 17, 2026 01:27
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
…w#129393)

* fix(plugins): exclude scaffold tests from published packages

* fix(plugins): preserve feature compilation and verify scaffold packages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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