Repository navigation
fix: classify X runtime API in plugin guardrails - #165251
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 4, 2026, 9:47 PM ET / October 5, 2026, 01:47 UTC. ClawSweeper reviewWhat this changesAdds X’s single runtime setter to the plugin contract test’s guarded export table. Merge readiness✅ Ready for maintainer review This repair remains necessary: current main still omits X from the runtime API classification table. The patch preserves the existing assertions, matches the supported export exactly, and introduces no actionable defect. Priority: P2 Review scores
Verification
How this fits togetherPlugin contract tests discover bundled runtime API files and compare their exports with explicitly classified surfaces. These checks feed CI and release validation without executing channel behavior. flowchart TD
A[Bundled plugin manifests] --> B[Discover runtime API files]
B --> C[Check classification completeness]
D[Guarded export table] --> C
C --> E[Compare declared exports]
D --> E
E --> F[Contract validation result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +3. Total +3 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep X classified in the existing guardrail owner, with its single setter pinned and all completeness checks retained. Do we have a high-confidence way to reproduce the issue? Yes, from source: bundled discovery includes X’s runtime barrel while current main’s classification table omits it, causing the completeness assertion to fail. This reviewer did not execute tests. Is this the best way to solve the issue? Yes. Extending the existing guarded table is the narrowest repair and also detects future export expansion without weakening validation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eded1a387b79. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Fixed: plugin contract validation now recognizes and guards the X runtime API. |
Pin the X runtime API to its existing runtime setter so plugin contract validation recognizes the bundled channel and catches export growth. Refs openclaw#165138.
What Problem This Solves
The plugin contract CI lane fails after #165138 because the new X plugin supplies a
runtime-api.tsbarrel that is absent from the runtime API classification table. The discovery check finds 39 barrels while the table accounts for 38, so scheduled and release validation stop at the completeness assertion.User Impact
This repairs the X-related contract failure without changing channel behavior or plugin APIs. The existing X runtime entry remains limited to
setXRuntime; developers will also get a contract failure if that entry later adds or removes exports unexpectedly.Why This Change Was Made
Add X to the existing guarded-export table with its single runtime setter. The channel entry already loads that exact export, and the same table pins narrow setters for IRC, Signal, and Google Chat. The completeness assertion, export comparison, and other runtime API restrictions remain intact.
Evidence
The scheduled failure reports only
extensions/x/runtime-api.tsas the unexpected runtime API. The affected source and contract are unchanged between that run and this PR's base.Remote validation on the candidate passed formatting, lint, and all seven tests in
pnpm test src/plugins/contracts/plugin-sdk-runtime-api-guardrails.test.ts --maxWorkers=1. The command took 17.82 seconds including 13.81 seconds of native worker preparation; the seven assertions took about 34 ms combined.A temporary negative control added
getXRuntimeto X’s barrel. The pinned-export assertion failed with the added export while the other six tests passed. The original barrel was restored and the candidate tree verified unchanged. No extra test or production seam was added.Hosted CI passed the selected test, type, lint, source-contract, and boundary jobs. Its guardrail test invocation passed all seven cases in 4.30 seconds (3.25 seconds inside Vitest). Independent engineering review and autoreview found no actionable issues; ClawSweeper reviewed the exact commit at Platinum.