Repository navigation
fix(plugin-sdk): block removal of shipped stable SDK surface without a dated compat record - #167036
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 8, 2026, 1:56 PM ET / 17:56 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR makes the SDK surface check reject removal of shipped stable subpaths or named exports unless a dated compatibility record authorizes it. Example: A contributor removes openclaw/plugin-sdk/channel-message and lowers export budgets
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review This PR remains useful: current main lacks the shipped-surface guard, and the earlier wrapper-inventory blocker is resolved. No concrete patch defects remain; the redundant test suggestion is still applicable. Priority: P2 Before mergeNone. FindingsNone. Provenance
Tests
Agent review detailsHow this fits togetherThe Plugin SDK is the public interface that plugins import from OpenClaw. Repository checks inspect its exports before publication; this change compares them with stable-release declarations and compatibility records. flowchart TD
A[Stable release declarations] --> B[Committed release inventory]
C[Current typed exports] --> D[SDK surface check]
B --> D
E[Dated compatibility records] --> D
D --> F{Removal authorized?}
F -->|Yes| G[Check passes]
F -->|No| H[Report missing exports]
Technical reviewBest possible solution: Keep stable-surface enforcement in the existing SDK check and compatibility registry, while tracking affected-plugin recovery separately. Do we have a high-confidence way to reproduce the issue? Yes, current-main source shows that export ceilings cannot reject removals accompanied by lowered budgets, and the PR records historical command-level detection after the fix. No target code was executed during this review. Is this the best way to solve the issue? Yes, the existing surface check and compatibility registry are the appropriate owners, and the shared renderer avoids a competing generation path. The redundant evaluator test adds no command-wiring coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1c8be7fb6e9a. Provenance checked
TestingProof path: shipped entry point. Added test files: 3. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +157, Tests +174, Docs +48, Config +1, Other +5199. Total +5579 across 18 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
|
Budgets only capped export counts, so e649be3/0d530ea5 could remove v2026.9.8 subpaths while lowering budgets (#166404). Adds a generated per-stable inventory (scripts/lib/plugin-sdk-shipped-surface.json, v2026.9.8, 158 typed subpaths, 4,591 names) via `pnpm plugin-sdk:shipped-surface:gen`, and `plugin-sdk:surface:check` now fails when a shipped subpath/name disappears without a qualified compat record whose removeAfter has passed. Records the eight retired subpaths with dated tombstones and 14 later export removals retroactively (owner decision 2026-10-07).
a799d38 to
3977a90
Compare
|
Landing note: the only red check on head 3977a90 is |
…a dated compat record (openclaw#167036) Related: openclaw#166404 ## What Problem This Solves Fixes: shipped Plugin SDK subpaths and exports could be removed without the surface check noticing, which broke published third-party plugins such as `@tencent-weixin/openclaw-weixin` on 2026.10.1-beta.1. ## User Impact User impact: the stable Plugin SDK surface can no longer silently disappear. Removing a subpath or named export that shipped in the latest stable release now fails `pnpm plugin-sdk:surface:check` unless a compatibility record covers it with a final compatibility day that has passed. No runtime behavior changes; nothing is restored here (restoring the removed subpaths for openclaw#166404 is a separate product decision). ## Why This Change Was Made `plugin-sdk:surface:check` only enforced maximum export-count budgets, and the API baseline diff is report-only. The commits that retired `config-runtime`, `infra-runtime`, `channel-message`, `command-auth` and four other subpaths (912+ named exports that shipped in v2026.9.8) lowered those budgets in the same change, so the check passed. A ceiling cannot detect a removal. This adds a committed inventory of the latest stable release's typed public surface (`scripts/lib/plugin-sdk-shipped-surface.json`, pinned to the current npm `latest` v2026.9.9: 158 typed subpaths, 4,591 named exports, identical to v2026.9.8). It is generated from the release tag's package exports and declarations by `pnpm plugin-sdk:shipped-surface:gen -- --release <tag>`, reusing the existing tagged-revision renderer from `plugin-sdk:api:diff`, and is regenerated during stable closeout (documented in RELEASING.md). The surface check compares the current tree against it: - A missing shipped subpath, or a missing name in a surviving subpath, needs a compat record whose `surfaces` names `openclaw/plugin-sdk/<subpath>` (whole subpath) or the qualified `openclaw/plugin-sdk/<subpath>.<Name>`. Bare names do not count. - The record must be `deprecated`, `removal-pending`, or `removed` with a `removeAfter` strictly before the current UTC date (the date is the final compatibility day). A `removalGate` alone or a future date does not authorize; budgets play no role. - Packaged private runtime facades without a `types` condition are excluded: they are not a declared contract. To make current `main` pass without restoring anything, the already-landed removals are recorded honestly: - Dated tombstones for the five subpaths retired under the Sept 30 owner decision (`removeAfter` 2026-09-30) and new tombstones for `command-auth`, `discord`, `telegram-account`, whose records were deleted in bc7ecd0 (`removeAfter` 2026-10-01). - 14 later named-export removals from surviving subpaths (936fe5d openclaw#165431, ed04ab7 openclaw#165288, 0e5b206 openclaw#163587) recorded retroactively per owner decision; each release note states the export was removed without a compatibility window. - The Skill Workshop proposal-hook types removed by 1991553 (openclaw#161057) already had a tombstone; its surfaces are now qualified and dated. Release-note context: Plugin SDK authors get a migration-guide row for each of the 14 retroactively recorded exports in `docs/plugins/sdk-migration/removed-surfaces.md`. ## Evidence - Inventory generation from tag `v2026.9.8` (fc23bc8): 158 typed subpaths, 4,591 names; `config-runtime` 115, `infra-runtime` 583, `channel-message` 136, `command-auth` 78 names. - Historical transition, guard + inventory overlaid on throwaway worktrees with `OPENCLAW_PLUGIN_SDK_SURFACE_NOW=2026-10-01`: `3be7252f^` shows only pre-existing gaps; `3be7252f` additionally fails on exactly `channel-lifecycle` (23), `channel-message` (136), `channel-reply-pipeline` (12), `config-runtime` (115), `infra-runtime` (583) despite its lowered budgets. - Final tree: `pnpm plugin-sdk:surface:check` → `shipped Plugin SDK v2026.9.8: no unauthorized removals`. Reverting the tombstone dates re-reports all eight subpaths; pinning `OPENCLAW_PLUGIN_SDK_SURFACE_NOW=2026-10-07` re-reports the eight Skill Workshop types (strict date semantics). - The guard already caught a live regression during this PR: 1991553 landed on main mid-review and the rebased check failed on its eight unqualified types until the record was fixed. - Regenerated against v2026.9.9 (bcfc888) after it went stable mid-review: zero subpaths or names added or dropped versus v2026.9.8; check still clean. - PR wrapper inventory lists the new compat-record module (first CI run failed `eager-import-closure` / `pr-worktree-provision` on its absence). - Focused tests (`--maxWorkers=1`): `test/scripts/plugin-sdk-shipped-surface.test.ts` 20 passed (~2.2 s wall), `src/plugins/compat/registry.test.ts` 12 passed, `test/scripts/plugin-sdk-surface-report.test.ts` 11 passed / 1 Linux-only skip; all three ~11.7 s wall. Pure evaluator tests, no TS project boots, no timers. - `node scripts/check-changed.mjs`: every lane passed except two inherited from `main`: the dead-export scan (`observePlacementAuthority`, already fixed on main by 6dfbb46) and core lint on three over-length files this PR does not touch. Direct oxlint on all changed `.ts`/`.mts` files is clean. - Autoreview (Codex, P2 threshold): scoped-clean.
Related: #166404
What Problem This Solves
Fixes: shipped Plugin SDK subpaths and exports could be removed without the surface check noticing, which broke published third-party plugins such as
@tencent-weixin/openclaw-weixinon 2026.10.1-beta.1.User Impact
User impact: the stable Plugin SDK surface can no longer silently disappear. Removing a subpath or named export that shipped in the latest stable release now fails
pnpm plugin-sdk:surface:checkunless a compatibility record covers it with a final compatibility day that has passed. No runtime behavior changes; nothing is restored here (restoring the removed subpaths for #166404 is a separate product decision).Why This Change Was Made
plugin-sdk:surface:checkonly enforced maximum export-count budgets, and the API baseline diff is report-only. The commits that retiredconfig-runtime,infra-runtime,channel-message,command-authand four other subpaths (912+ named exports that shipped in v2026.9.8) lowered those budgets in the same change, so the check passed. A ceiling cannot detect a removal.This adds a committed inventory of the latest stable release's typed public surface (
scripts/lib/plugin-sdk-shipped-surface.json, pinned to the current npmlatestv2026.9.9: 158 typed subpaths, 4,591 named exports, identical to v2026.9.8). It is generated from the release tag's package exports and declarations bypnpm plugin-sdk:shipped-surface:gen -- --release <tag>, reusing the existing tagged-revision renderer fromplugin-sdk:api:diff, and is regenerated during stable closeout (documented in RELEASING.md). The surface check compares the current tree against it:surfacesnamesopenclaw/plugin-sdk/<subpath>(whole subpath) or the qualifiedopenclaw/plugin-sdk/<subpath>.<Name>. Bare names do not count.deprecated,removal-pending, orremovedwith aremoveAfterstrictly before the current UTC date (the date is the final compatibility day). AremovalGatealone or a future date does not authorize; budgets play no role.typescondition are excluded: they are not a declared contract.To make current
mainpass without restoring anything, the already-landed removals are recorded honestly:removeAfter2026-09-30) and new tombstones forcommand-auth,discord,telegram-account, whose records were deleted in 0d530ea (removeAfter2026-10-01).Release-note context: Plugin SDK authors get a migration-guide row for each of the 14 retroactively recorded exports in
docs/plugins/sdk-migration/removed-surfaces.md.Evidence
v2026.9.8(fc23bc8): 158 typed subpaths, 4,591 names;config-runtime115,infra-runtime583,channel-message136,command-auth78 names.OPENCLAW_PLUGIN_SDK_SURFACE_NOW=2026-10-01:e649be31^shows only pre-existing gaps;e649be31additionally fails on exactlychannel-lifecycle(23),channel-message(136),channel-reply-pipeline(12),config-runtime(115),infra-runtime(583) despite its lowered budgets.pnpm plugin-sdk:surface:check→shipped Plugin SDK v2026.9.8: no unauthorized removals. Reverting the tombstone dates re-reports all eight subpaths; pinningOPENCLAW_PLUGIN_SDK_SURFACE_NOW=2026-10-07re-reports the eight Skill Workshop types (strict date semantics).eager-import-closure/pr-worktree-provisionon its absence).--maxWorkers=1):test/scripts/plugin-sdk-shipped-surface.test.ts20 passed (~2.2 s wall),src/plugins/compat/registry.test.ts12 passed,test/scripts/plugin-sdk-surface-report.test.ts11 passed / 1 Linux-only skip; all three ~11.7 s wall. Pure evaluator tests, no TS project boots, no timers.node scripts/check-changed.mjs: every lane passed except two inherited frommain: the dead-export scan (observePlacementAuthority, already fixed on main by 0178423) and core lint on three over-length files this PR does not touch. Direct oxlint on all changed.ts/.mtsfiles is clean.