refactor: add xai plugin-sdk boundary canary#61548
Conversation
Greptile SummaryThis PR introduces a real Confidence Score: 5/5Safe to merge — only a P2 ergonomics finding remains. All findings are P2 or lower. The boundary enforcement mechanism, workspace package structure, and test coverage are sound. The standalone tsconfig issue is a documentation gap with no gate or correctness impact. No files require special attention before merge. Prompt To Fix All With AIThis is a comment left during a code review.
Path: packages/plugin-sdk/tsconfig.json
Line: 10
Comment:
**Standalone tsconfig references untracked `dist/` artifacts**
The `types/**/*.d.ts` files included here re-export from `../../../dist/plugin-sdk/src/plugin-sdk/*.js` paths, but `dist/` is gitignored and absent on a fresh clone. Running `tsc -p packages/plugin-sdk/tsconfig.json` standalone will fail with module-resolution errors until `tsc -p tsconfig.plugin-sdk.dts.json` (or `pnpm build`) has run. No current CI workflow invokes this tsconfig directly, so this is not a gate failure — and `test/extension-package-tsc-boundary.test.ts` correctly generates the artifacts in its setup step — but the file is misleading on its own. Consider adding a comment in the tsconfig (or a `README.md` in `packages/plugin-sdk/`) noting the prerequisite build step, so contributors who run it in isolation get a clear failure message instead of opaque module-not-found errors.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "build: add xai plugin-sdk boundary canar..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa3b49b42a
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42f508b64a
ℹ️ 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".
aac683e to
2b55dda
Compare
2b55dda to
778b576
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 778b5761b1
ℹ️ 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".
| "baseUrl": "..", | ||
| "ignoreDeprecations": "6.0", | ||
| "paths": { | ||
| "@openclaw/plugin-sdk/*": ["packages/plugin-sdk/dist/packages/plugin-sdk/src/*.d.ts"] |
There was a problem hiding this comment.
Stop hard-requiring prebuilt SDK d.ts for xai boundary checks
Pointing @openclaw/plugin-sdk/* only to packages/plugin-sdk/dist/.../*.d.ts makes extensions/xai/tsconfig.json fail on a clean tree (or after cleaning packages/plugin-sdk/dist) with TS2307 for every SDK import until a separate manual tsc -p packages/plugin-sdk/tsconfig.json step runs first. That introduces an implicit build-order dependency for normal extension-local typechecking/editor use and undermines the canary’s “fails closed” goal; the boundary config should include a project reference or a source fallback so tsc -p extensions/xai/tsconfig.json --noEmit is self-contained.
Useful? React with 👍 / 👎.
* docs: plan real plugin-sdk workspace rollout * build: add xai plugin-sdk boundary canary * build: generate plugin-sdk package types * build: hide plugin-sdk core export * build: alias scoped plugin-sdk runtime imports * build: repair plugin-sdk boundary drift * fix(plugins): remove duplicated plugin-sdk entrypoints * test(plugins): make tsc boundary canary portable --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
* docs: plan real plugin-sdk workspace rollout * build: add xai plugin-sdk boundary canary * build: generate plugin-sdk package types * build: hide plugin-sdk core export * build: alias scoped plugin-sdk runtime imports * build: repair plugin-sdk boundary drift * fix(plugins): remove duplicated plugin-sdk entrypoints * test(plugins): make tsc boundary canary portable --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
* docs: plan real plugin-sdk workspace rollout * build: add xai plugin-sdk boundary canary * build: generate plugin-sdk package types * build: hide plugin-sdk core export * build: alias scoped plugin-sdk runtime imports * build: repair plugin-sdk boundary drift * fix(plugins): remove duplicated plugin-sdk entrypoints * test(plugins): make tsc boundary canary portable --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
* docs: plan real plugin-sdk workspace rollout * build: add xai plugin-sdk boundary canary * build: generate plugin-sdk package types * build: hide plugin-sdk core export * build: alias scoped plugin-sdk runtime imports * build: repair plugin-sdk boundary drift * fix(plugins): remove duplicated plugin-sdk entrypoints * test(plugins): make tsc boundary canary portable --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
* docs: plan real plugin-sdk workspace rollout * build: add xai plugin-sdk boundary canary * build: generate plugin-sdk package types * build: hide plugin-sdk core export * build: alias scoped plugin-sdk runtime imports * build: repair plugin-sdk boundary drift * fix(plugins): remove duplicated plugin-sdk entrypoints * test(plugins): make tsc boundary canary portable --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
* docs: plan real plugin-sdk workspace rollout * build: add xai plugin-sdk boundary canary * build: generate plugin-sdk package types * build: hide plugin-sdk core export * build: alias scoped plugin-sdk runtime imports * build: repair plugin-sdk boundary drift * fix(plugins): remove duplicated plugin-sdk entrypoints * test(plugins): make tsc boundary canary portable --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Summary
openclaw/plugin-sdk/*path alias, so TypeScript does not fail closed when an extension reaches outside its own package root.../../src/cli/acp-cli.tscan look valid in normal extension-local editing unless a separate boundary script catches it.@openclaw/plugin-sdkworkspace package, optedextensions/xaiinto a package-boundary tsconfig, and added focused contract tests that prove clean typechecking plusTS6059failure for a bad relative import.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
rootDiralone either did nothing or broke allowed imports along with forbidden ones.openclaw/plugin-sdk/*alias for legacy extensions, so the incremental rollout needs both legacy and opt-in modes in parallel.Regression Test Plan (if applicable)
src/plugins/contracts/extension-package-project-boundaries.test.tsandtest/extension-package-tsc-boundary.test.tsextensions/xaitypechecks through@openclaw/plugin-sdk/*, and a canary import of../../src/cli/acp-cli.tsfails withTS6059.tsconfig.jsonboundary instead of only checking custom lint or report scripts.check-extension-plugin-sdk-boundaryscript still covers the relative-outside-package rule.User-visible / Behavior Changes
None.
Diagram (if applicable)
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation:Repro + Verification
Environment
Steps
./node_modules/.bin/tsc -p tsconfig.plugin-sdk.dts.json../node_modules/.bin/tsc -p extensions/xai/tsconfig.json --noEmit.import * as foo from "../../src/cli/acp-cli.ts";canary underextensions/xaiand rerun the extension typecheck.Expected
extensions/xaitypechecks cleanly through@openclaw/plugin-sdk/*.TS6059.Actual
Evidence
Attach at least one:
Human Verification (required)
tsc -p tsconfig.plugin-sdk.dts.json,tsc -p extensions/xai/tsconfig.json --noEmit,pnpm test src/plugins/contracts/extension-package-project-boundaries.test.ts test/extension-package-tsc-boundary.test.ts,pnpm test extensions/xai/onboard.test.ts, and the deliberate boundary canary through bothtscandnode scripts/check-extension-plugin-sdk-boundary.mjs --mode=relative-outside-package.extensions/xaifails while the clean package import path still typechecks.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations
xaionly and I am following this with a deeper change to make the package own its source/types end to end.