Skip to content

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

Merged
steipete merged 3 commits into
mainfrom
codex/split-plugin-type-contracts
Jul 15, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/split-plugin-type-contracts

Conversation

@steipete

@steipete steipete commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

src/plugins/types.ts combined provider auth, provider runtime, capability providers, commands, registration, migrations, and the main plugin API in one 3,051-line contract file. The mixed ownership made focused changes harder to navigate and required a grandfathered max-lines suppression.

Why This Change Was Made

Keep src/plugins/types.ts as the stable public facade while moving definitions into thirteen focused domain modules. Provider contracts are separated into catalog, runtime, replay, transport, authentication, and final plugin composition surfaces. Plugin definitions get a leaf contract so the API and registration modules remain acyclic. Every resulting module stays below 700 physical lines. Preserve every named export and both runtime values, refresh generated SDK source-link hashes, and remove the stale max-lines baseline entry. No plugin API names or signatures change.

User Impact

No user-visible or runtime behavior change. Plugin authors keep importing the same public SDK contracts; maintainers gain narrower ownership and review surfaces.

Evidence

  • pnpm check:changed on Blacksmith Testbox: passed core production and test typechecks, all lint shards, architecture guards, max-lines ratchet, API baseline, and dependency checks.
  • Focused cycle-fix proof: core/test typechecks, architecture, SDK surface, and max-lines passed.
  • pnpm plugin-sdk:surface:check: passed with 345 entrypoints and 11,020 exports.
  • Public facade parity audit: 391 named exports before and after; no additions or removals.
  • Runtime and Madge import-cycle guards: 0 cycles.
  • Autoreview: clean, no accepted or actionable findings.

AI-assisted. I reviewed the ownership split, preserved facade contract, generated SDK metadata change, and validation results.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XL maintainer Maintainer-authored PR labels Jul 15, 2026
@steipete steipete self-assigned this Jul 15, 2026
@steipete
steipete force-pushed the codex/split-plugin-type-contracts branch from bef5d6f to 83b4f24 Compare July 15, 2026 18:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83b4f242d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/plugins/types.ts
// leaf contract surface instead of pulling the full plugin runtime barrel.
/* oxlint-disable max-lines -- TODO: split this grandfathered oversized file. */
export { WorkerProviderError } from "./capability-provider.types.js";
export type * from "./capability-provider.types.js";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Track split plugin types in DTS invalidation

This re-export moves the public SDK contracts into new leaf files, but the boundary declaration generator still treats only src/plugins/types.ts as the plugin-contract input (scripts/prepare-extension-package-boundary-artifacts.mjs's PLUGIN_SDK_TYPE_INPUTS), and the CI cache key has the same src/plugins/types.ts-only dependency. After this lands, a later change to src/plugins/provider-plugin.types.ts or another leaf that does not touch the facade can reuse a fresh .boundary-dts.stamp/cache and skip rebuilding the flat openclaw/plugin-sdk declarations, leaving shipped plugin SDK types stale. Please include the new leaf files or src/plugins/*.types.ts in those invalidation inputs.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the codex/split-plugin-type-contracts branch from 1ce1ff7 to c5cef83 Compare July 15, 2026 19:31
@steipete
steipete force-pushed the codex/split-plugin-type-contracts branch from c5cef83 to c175af3 Compare July 15, 2026 19:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c175af3d25

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/plugins/types.ts
export { WorkerProviderError } from "./capability-provider.types.js";
export type * from "./capability-provider.types.js";
export type * from "./migration-provider.types.js";
export type * from "./plugin-api.types.js";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep split plugin contracts in CodeQL checks

This split moves the public plugin API contract out of the only file that the CodeQL plugin-boundary workflow recognizes. I checked .github/workflows/codeql-critical-quality.yml and its PR shard detector only sets plugin=true for the explicit src/plugins/...|src/plugins/types.ts|... list, while .github/codeql/codeql-plugin-boundary-critical-quality.yml also lists only src/plugins/types.ts; a later PR that edits only src/plugins/plugin-api.types.ts or another non-provider leaf will skip/filter the plugin-boundary analysis. Please add the new leaf contracts, or a src/plugins/*.types.ts pattern, to those lists.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit d37e873 into main Jul 15, 2026
115 checks passed
@steipete
steipete deleted the codex/split-plugin-type-contracts branch July 15, 2026 19:51
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 16, 2026
* refactor(plugins): split plugin type contracts

* refactor(plugins): split provider type contracts

* refactor(plugins): extract plugin definition contract
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
* refactor(plugins): split plugin type contracts

* refactor(plugins): split provider type contracts

* refactor(plugins): extract plugin definition contract
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 size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant