Skip to content

refactor(plugins): trim test-only barrel exports - #124192

Merged
steipete merged 1 commit into
mainfrom
test/remove-plugin-test-barrel-exports
Aug 15, 2026
Merged

steipete merged 1 commit into
mainfrom
test/remove-plugin-test-barrel-exports

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Removes test-only helpers from broad plugin API barrels when their real owners already provide a narrower path.

  • Signal installer archive/asset helpers and fixture types remain local to install-signal-cli.ts, where production and owner tests use them directly.
  • Matrix and Telegram thread-binding reset hooks remain available through their dedicated session-binding contract APIs and owner modules, but no longer appear in the general plugin barrels.

The broader cache-reset candidates were deliberately left unchanged because removing those underlying exports requires a separate cache-state owner refactor.

Why This Change Was Made

Broad api.ts and runtime-api.ts barrels are production/plugin surfaces. Re-exporting test-only helpers makes them look supported and increases compatibility and dead-code pressure without adding runtime capability.

The retained owner tests still exercise Signal install selection/extraction and Matrix/Telegram binding reset behavior. Core session-binding tests continue to load the narrow contract sidecars rather than the broad barrels.

User Impact

No runtime behavior change. Plugin public surfaces are smaller and more accurately describe supported capabilities.

Evidence

  • Signal installer, Telegram thread bindings, Matrix thread bindings, channel session-binding contracts, and Plugin SDK runtime guardrails: 81 tests passed across 5 Vitest shards.
  • pnpm build passed, including bundled plugin assets, package builds, runtime postbuild, and import guards.
  • The core, coreTests, extensions, and extensionTests changed gate passed through the documented trusted-source local fallback because no Crabbox/Testbox provider was ready. Typechecks, formatting, lint, dead-export scans, plugin boundaries, import cycles, database/sidecar/security guards, and architecture checks passed.
  • git diff --check passed.
  • Fresh structured autoreview reported no accepted/actionable findings.

Production delta: +1/-11, net -10. Tests: +1/-1, net 0. Total: +2/-12, net -10. No docs, config, schema, protocol, dependency, or changelog change.

AI-assisted: yes.

@clawsweeper

clawsweeper Bot commented Aug 15, 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 channel: matrix Channel integration: matrix channel: signal Channel integration: signal channel: telegram Channel integration: telegram size: XS maintainer Maintainer-authored PR labels Aug 15, 2026
@steipete
steipete marked this pull request as ready for review August 15, 2026 15:16
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 11:22 AM ET / 15:22 UTC.

ClawSweeper review

What this changes

This PR removes test-only Signal installer and Matrix/Telegram thread-binding helpers from broad plugin API barrels while retaining their narrow owner contracts.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open for normal maintainer merge flow. The branch cleanly narrows never-released broad plugin barrels while preserving the owner-local and dedicated session-binding contracts used by tests; no blocking defect was found.

Priority: P3
Reviewed head: af5a7b2f8300fbbec2ce19614154218107d68e7d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative refactor with the relevant contract guard updated and no actionable correctness concern found.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, behavior-neutral API-surface refactor does not require external real-behavior proof; source confirms unchanged runtime and retained contract paths.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, behavior-neutral API-surface refactor does not require external real-behavior proof; source confirms unchanged runtime and retained contract paths.
Evidence reviewed 5 items Narrow contracts remain intact: Matrix and Telegram retain reset hooks in dedicated session-binding contract sidecars, and the core registry test imports those sidecars rather than the broad barrels.
Removed Signal helpers are test-only: The installer module marks the removed extraction and asset-selection helpers as internal testing exports; its colocated tests import them directly from the owner module.
Barrel contract guard updated: The runtime API guard parses export statements and compares them with the approved list; the branch updates the Telegram expectation to match the narrowed barrel.
Findings None None.
Security None None.

How this fits together

Channel plugins own their installer and conversation-binding logic. Core session-binding tests load dedicated contract sidecars, while broader API barrels describe the general plugin surface.

flowchart LR
A[Plugin consumers] --> B[Broad API barrels]
B --> C[Channel owner modules]
D[Core session-binding tests] --> E[Dedicated contract sidecars]
E --> C
C --> F[Signal installer]
C --> G[Matrix and Telegram bindings]
Loading

Before merge

  • Complete next step (P2) - This fresh maintainer-owned PR has no mechanical repair finding and should remain in ordinary merge review.
Agent review details

Security

None.

PR surface

Source -10, Tests 0. Total -10 across 4 files.

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

Review metrics

Metric Value Why it matters
Production versus test delta production +1/-11 (net -10); tests +1/-1 (net 0) The refactor reduces production API surface and changes only the matching export-contract expectation.

Technical review

Best possible solution:

Merge the narrow-barrel cleanup while keeping the dedicated session-binding sidecars and owner-local installer tests as the sole access paths for these test helpers.

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

Not applicable: this is a behavior-neutral barrel-surface cleanup, and source inspection establishes the retained owner and contract paths.

Is this the best way to solve the issue?

Yes. The helpers were added only on current main, their narrow test contracts remain, and the branch removes the misleading broad exports without changing runtime behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a small, behavior-neutral API-surface cleanup with no user-facing runtime change.
  • 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 maintainer-authored, behavior-neutral API-surface refactor does not require external real-behavior proof; source confirms unchanged runtime and retained contract paths.

Label justifications:

  • P3: This is a small, behavior-neutral API-surface cleanup with no user-facing runtime change.
  • 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 maintainer-authored, behavior-neutral API-surface refactor does not require external real-behavior proof; source confirms unchanged runtime and retained contract paths.

Evidence

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored the current-main commit that introduced all three affected broad barrels and the Matrix/Telegram dedicated session-binding sidecars. (role: introduced the current barrel and sidecar split; confidence: high; commits: 11bcc0eb4985, af5a7b2f8300; files: extensions/matrix/api.ts, extensions/matrix/session-binding-contract-api.ts, extensions/signal/api.ts)

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

Copy link
Copy Markdown
Contributor Author

Land-ready proof for af5a7b2f8300fbbec2ce19614154218107d68e7d:

Production delta: +1/-11, net -10. Tests: +1/-1, net 0. Total: +2/-12, net -10. No behavior, docs, config, schema, protocol, dependency, or changelog change.

@steipete
steipete merged commit 7ce902c into main Aug 15, 2026
287 checks passed
@steipete
steipete deleted the test/remove-plugin-test-barrel-exports branch August 15, 2026 15:25
@steipete

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

channel: matrix Channel integration: matrix channel: signal Channel integration: signal channel: telegram Channel integration: telegram maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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