Skip to content

fix: classify X runtime API in plugin guardrails - #165251

Merged
shakkernerd merged 1 commit into
mainfrom
fix/x-runtime-api-guard
Oct 5, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
fix/x-runtime-api-guard

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The plugin contract CI lane fails after #165138 because the new X plugin supplies a runtime-api.ts barrel 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.ts as 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 getXRuntime to 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.

@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 9:47 PM ET / October 5, 2026, 01:47 UTC.

ClawSweeper review

What this changes

Adds 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
Reviewed head: 3aaf7c5035156051617ff98784eb41261049338a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused contract repair with matching source, preserved assertions, and reported positive and negative validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The member-authored PR changes only the contract classification test, so contributor runtime proof is exempt. Reported passing tests and the export-expansion negative control address the changed contract; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The member-authored PR changes only the contract classification test, so contributor runtime proof is exempt. Reported passing tests and the export-expansion negative control address the changed contract; no stored-data contract changes.
Evidence reviewed 8 items Verified introduced change: The pinned introduction delta adds only the X classification and its setXRuntime export; no assertion, runtime file, dependency, or workflow changes.
Current main still needs the repair: Comparing the reviewed head with fetched main shows the same missing X table entry and no difference in X’s runtime barrel. Discovery still includes existing runtime-api.ts files, while the completeness assertion requires every discovered file to be classified.
Export matches the production entrypoint: X’s barrel exports only setXRuntime from its local runtime module, and its channel entry requests that exact export. The new expectation matches the parser’s normalized export representation; completeness and export comparisons remain intact.
Findings None None.
Security None None.

How this fits together

Plugin 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +3. Total +3 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 3 0 +3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 3 0 +3

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

  • add P2: This is a bounded repair to scheduled and release contract validation, with no demonstrated urgent user-facing runtime regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The member-authored PR changes only the contract classification test, so contributor runtime proof is exempt. Reported passing tests and the export-expansion negative control address the changed contract; no stored-data contract changes.

Label justifications:

  • P2: This is a bounded repair to scheduled and release contract validation, with no demonstrated urgent user-facing runtime regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The member-authored PR changes only the contract classification test, so contributor runtime proof is exempt. Reported passing tests and the export-expansion negative control address the changed contract; no stored-data contract changes.

Evidence

What I checked:

  • Verified introduced change: The pinned introduction delta adds only the X classification and its setXRuntime export; no assertion, runtime file, dependency, or workflow changes. (src/plugins/contracts/plugin-sdk-runtime-api-guardrails.test.ts:243, 3aaf7c503515)
  • Current main still needs the repair: Comparing the reviewed head with fetched main shows the same missing X table entry and no difference in X’s runtime barrel. Discovery still includes existing runtime-api.ts files, while the completeness assertion requires every discovered file to be classified. (src/plugins/contracts/plugin-sdk-runtime-api-guardrails.test.ts:243, 3aaf7c503515)
  • Export matches the production entrypoint: X’s barrel exports only setXRuntime from its local runtime module, and its channel entry requests that exact export. The new expectation matches the parser’s normalized export representation; completeness and export comparisons remain intact. (extensions/x/runtime-api.ts:1, 3aaf7c503515)
  • Merged feature context and source history: The provided GitHub context verifies feat(x): add the X (Twitter) mentions channel plugin #165138 as merged. Inspection of its commit against the raw recorded parent confirms the X barrel was added there. This is related feature history, not a replacement fixing PR. (extensions/x/runtime-api.ts:1, 9666c02c538f)
  • Validation evidence and review limits: The captured PR body reports seven passing contract tests in 17.82 seconds and a negative control where adding getXRuntime failed the pinned-export assertion. These are contributor-reported results, not executions by this reviewer. Read-only diff checking passed and the checkout remained clean. Older-history search and blame could not complete because an unavailable promisor blob could not be retrieved; recent commit history and the relevant feature patch were inspected successfully. (src/plugins/contracts/plugin-sdk-runtime-api-guardrails.test.ts:312, 3aaf7c503515)
  • Release context: The latest supplied release, v2026.9.8, has no extensions/x directory, and no available tag contains this repair head. There is no evidence that the requested classification repair has shipped. (3aaf7c503515)

Likely related people:

  • Peter Steinberger: Raw commit 9666c02 adds extensions/x/runtime-api.ts:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9666c02c538f; files: extensions/x/runtime-api.ts)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@shakkernerd shakkernerd self-assigned this Oct 5, 2026
@shakkernerd
shakkernerd merged commit 43856f7 into main Oct 5, 2026
111 checks passed
@shakkernerd
shakkernerd deleted the fix/x-runtime-api-guard branch October 5, 2026 01:57
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: plugin contract validation now recognizes and guards the X runtime API.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant