Skip to content

refactor(plugins): split plugin type contracts - #108237

Closed
steipete wants to merge 1 commit into
mainfrom
codex/refactor-plugin-types
Closed

steipete wants to merge 1 commit into
mainfrom
codex/refactor-plugin-types

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The plugin contract surface had grown into one 3,051-line module spanning provider, command, migration, registration, media, worker, and host API concerns. Unrelated contract changes shared one review boundary and required a max-lines exception.

Why This Change Was Made

Split the contracts into nine focused owner modules while keeping src/plugins/types.ts as the stable public barrel. Registry types now import their direct owners, the max-lines exception is removed, and the generated Plugin SDK API baseline records the new declaration locations.

This is AI-assisted work requested by a maintainer. No compatibility layer or runtime behavior change was added.

User Impact

No user-visible behavior change. Plugin authors retain the same exported names and signatures. Maintainers get smaller, focused modules and clearer ownership for future reviews.

Evidence

  • Exact origin/main Plugin SDK comparison: 10,612 exports before and after; zero name, kind, or signature differences after normalizing declaration-owner paths; 223 source-location moves only.
  • Focused tests: 71 passed across plugin commands, captured registration, worker-provider registry, and MCP plugin-tool serving.
  • Remote Linux changed gate and production build: run_041d802a111c, exit 0. Includes formatting, max-lines ratchet, Plugin SDK API baseline, core and core-test typechecks, full core lint fan-out, import-cycle guard, boundary guards, package build, declaration verification, and Control UI build.
  • Autoreview against origin/main: no accepted or actionable findings; overall confidence 0.96.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XL maintainer Maintainer-authored PR labels Jul 15, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 16, 2026
@clawsweeper

clawsweeper Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 2:53 AM ET / 06:53 UTC.

ClawSweeper review

What this changes

This PR replaces the monolithic plugin type-contract module with nine focused contract modules while preserving src/plugins/types.ts as the public Plugin SDK barrel.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 4 items remain

Current main already uses the same stable plugin-contract facade and focused leaf-module architecture, but this 17-day-old PR is merge-conflicted and carries the protected maintainer label. Keep it open for a maintainer to decide whether any unique remainder warrants a rebase; do not auto-close it.

Priority: P3
Reviewed head: b960f81e0a0fa1c72ee3147b7adfab46b7cedf9e
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation goal is sound and current main now covers it, but the branch is conflicted and has only test/build claims rather than inspectable real behavior proof.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports tests, API comparison, and a remote build gate, but provides no inspectable after-fix terminal output, runtime log, or artifact showing representative plugins loading through the reorganized public contracts. If the branch is retained, add redacted real runtime proof and update the PR body for a fresh review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports tests, API comparison, and a remote build gate, but provides no inspectable after-fix terminal output, runtime log, or artifact showing representative plugins loading through the reorganized public contracts. If the branch is retained, add redacted real runtime proof and update the PR body for a fresh review.
Evidence reviewed 6 items Current-main contract facade: Current main retains a stable native-plugin contract facade and re-exports focused leaf modules for capability providers, migrations, plugin API, commands, registration, and provider contracts.
Current-main provenance: Blame attributes the current facade’s leaf-module exports to the July 31 current-main commit by steipete, showing the central split architecture was introduced independently of this still-open branch.
Integration commit scope: Commit d8ba00f adds the current focused plugin API, command, registration, provider, registry, and facade modules, which covers the PR’s central purpose with a more granular current-main topology.
Findings None None.
Security None None.

How this fits together

OpenClaw plugins consume a public TypeScript contract surface through the Plugin SDK. The public barrel feeds plugin registration, provider capability, migration, and runtime declarations while internal registry code can import narrower owner modules.

flowchart LR
  A[Plugin authors] --> B[Public Plugin SDK]
  B --> C[Stable contract facade]
  C --> D[Focused owner type modules]
  D --> E[Plugin registry and runtime]
  C --> F[Bundled declaration artifacts]
Loading

Decision needed

Question Recommendation
Does this PR retain any unique, desired plugin-contract improvement beyond current main’s July 31 focused-module implementation, or should it be closed as redundant? Close as redundant: Confirm that no unique public-contract change remains, then close the conflicted branch because current main already owns the canonical split.

Why: Current main reaches the PR’s central outcome but with a different, more granular module topology. The protected maintainer label and dirty merge state require an explicit owner decision rather than automated cleanup.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports tests, API comparison, and a remote build gate, but provides no inspectable after-fix terminal output, runtime log, or artifact showing representative plugins loading through the reorganized public contracts. If the branch is retained, add redacted real runtime proof and update the PR body for a fresh review.
  • Resolve merge risk (P1) - GitHub reports the branch as merge-conflicted, and current main has since adopted a more granular public-contract layout; rebasing the older split without an export and declaration-bundle comparison could regress Plugin SDK compatibility.
  • Complete next step (P2) - The protected maintainer label and the current-main implementation require an owner to decide whether this dirty branch has any unique remainder; there is no mechanical patch defect for an automated repair lane.
Agent review details

Security

None.

PR surface

Source +116, Generated 0, Other -1. Total +115 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 11 3084 2968 +116
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 1 2 2 0
Other 1 0 1 -1
Total 13 3086 2971 +115

Review metrics

Metric Value Why it matters
Plugin contract organization 1 stable public barrel retained; 9 proposed leaf modules This restructures a public Plugin SDK declaration surface, so a rebase must preserve the facade rather than only compile the new files.

Stored data model

Persistent data-model change detected: durable storage schema: src/plugins/worker-provider.types.ts, migration/backfill/repair: src/plugins/registry-types.ts, unknown-data-model-change: src/plugins/worker-provider.types.ts, vector/embedding metadata: src/plugins/plugin-migration.types.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Confirm redundancy before closing (recommended)
    Compare any claimed unique export or declaration change against current main, then close the branch if no distinct SDK improvement remains.
  2. Rebase only a unique contract change
    If a distinct improvement remains, rebuild the branch on current main and prove that public Plugin SDK declarations and representative plugin loading remain compatible.

Technical review

Best possible solution:

Keep the current-main facade and leaf-module layout as the canonical design; a maintainer should close this branch if it has no unique contract improvement, or require a narrow rebase that preserves every public export and current declaration-bundle behavior.

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

Not applicable: this PR is a contract-organization refactor, not a report of broken runtime behavior. Current source directly establishes that main already has the requested facade-and-leaf-module architecture.

Is this the best way to solve the issue?

No: the branch’s broad approach is already reflected in current main, but current main uses a more granular canonical split. The best path is to retain that implementation and only rebase a demonstrably unique remaining contract change.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is maintenance refactoring with no reported user-visible regression, and current main already implements the central architecture.
  • merge-risk: 🚨 compatibility: The PR reorganizes the public Plugin SDK type surface and is currently conflicted against a newer canonical layout, so export and declaration compatibility need confirmation before any rebase or merge.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports tests, API comparison, and a remote build gate, but provides no inspectable after-fix terminal output, runtime log, or artifact showing representative plugins loading through the reorganized public contracts. If the branch is retained, add redacted real runtime proof and update the PR body for a fresh review.

Evidence

What I checked:

  • Current-main contract facade: Current main retains a stable native-plugin contract facade and re-exports focused leaf modules for capability providers, migrations, plugin API, commands, registration, and provider contracts. (src/plugins/types.ts:115, 78486e27511c)
  • Current-main provenance: Blame attributes the current facade’s leaf-module exports to the July 31 current-main commit by steipete, showing the central split architecture was introduced independently of this still-open branch. (src/plugins/types.ts:115, d8ba00f8a262)
  • Integration commit scope: Commit d8ba00f adds the current focused plugin API, command, registration, provider, registry, and facade modules, which covers the PR’s central purpose with a more granular current-main topology. (src/plugins/plugin-api.types.ts:1, d8ba00f8a262)
  • PR and main differ in canonical grouping: The PR barrel re-exports combined provider, media, worker, and migration modules, while current main exposes the same categories through narrower capability, migration, provider-authentication, provider-catalog, provider-replay, provider-runtime, and provider-transport modules. (src/plugins/types.ts:117, 78486e27511c)
  • SDK contract coverage exists on main: Current main has dedicated bundle-import and plugin-registration contract coverage for the public Plugin SDK, although this read-only review did not execute those tests. (src/plugins/contracts/plugin-sdk-index.bundle.test.ts:107, 78486e27511c)
  • Release and branch status: The current-main implementation commit is on main but is not contained in the latest available release tag v2026.7.1. GitHub context reports this PR as mergeableState dirty, so its old topology cannot be treated as a clean merge candidate. (d8ba00f8a262)

Likely related people:

  • steipete: The current-main commit that introduced the stable facade and focused contract modules is authored by Peter Steinberger, and the same person authored this PR branch. (role: introduced current implementation; confidence: high; commits: d8ba00f8a262, b960f81e0a0f; files: src/plugins/types.ts, src/plugins/plugin-api.types.ts, src/plugins/registry-types.ts)

Rank-up moves

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

  • Have a maintainer decide whether any unique contract change remains beyond current main.
  • If retained, rebase onto current main and add redacted terminal or runtime output showing a representative plugin loads through the public SDK facade.

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 (2 earlier review cycles)
  • reviewed 2026-07-16T03:02:07.706Z sha b960f81 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-29T20:27:40.689Z sha b960f81 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jul 29, 2026
@vincentkoc vincentkoc self-assigned this Aug 4, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Closing as fully superseded.

The stable Plugin SDK facade and focused contract-module split landed through #108416 and was refined by #108440. Current main now owns a more granular canonical module layout while preserving the public facade and declaration surface.

I compared the branch's exports and owner boundaries against current main. There is no unique contract improvement left to port, and rebasing this conflicted older topology would only risk regressing the current SDK surface.

@vincentkoc vincentkoc closed this Aug 4, 2026
@RomneyDa
RomneyDa deleted the codex/refactor-plugin-types branch October 22, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants