You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: src/plugins/runtime/runtime-discord.ts and src/plugins/runtime/runtime-discord-ops.runtime.ts still imported extensions/discord/runtime-api.js directly.
Why it matters: that keeps Discord on the grandfathered side of the plugin import-boundary tripwire instead of using the public plugin-sdk surface that recent refactors are converging on.
What changed: rewired both Discord runtime entrypoints to import from src/plugin-sdk/discord.ts and refreshed the boundary inventory to remove the 3 Discord direct-import entries.
What did NOT change (scope boundary): this does not change Discord runtime behavior or the exported Discord runtime-api surface; it only changes which internal boundary src/plugins/runtime/* depends on.
Replace direct extensions/discord/runtime-api.js imports in src/plugins/runtime/* with src/plugin-sdk/discord.ts imports.
Refresh the plugin import-boundary inventory.
Run plugin boundary guardrails, Discord-focused tests, direct runtime smoke, and repo check/build.
Expected
Discord disappears from the src/plugins/** -> extensions/** inventory.
The published Discord runtime-api guardrails still pass.
Discord runtime surface shape stays intact.
Actual
After this patch, the import-boundary inventory drops from 8 entries to 5 remaining grandfathered entries.
Evidence
Attach at least one:
Failing test/log before + passing after
Trace/log snippets
Screenshot/recording
Perf numbers (if relevant)
Human Verification (required)
What you personally verified (not just CI), and how:
Verified scenarios:
pnpm lint:plugins:no-extension-imports
pnpm test -- test/plugin-extension-import-boundary.test.ts
pnpm test -- src/plugin-sdk/runtime-api-guardrails.test.ts
pnpm test -- src/plugins/runtime/runtime-discord-typing.test.ts extensions/discord/src/monitor/provider.lifecycle.test.ts
pnpm check
pnpm build
direct smoke: instantiated createRuntimeDiscord() and confirmed the expected runtime surface methods are present
Edge cases checked:
Discord dropped out of the boundary inventory completely
runtime-api allowlist/guardrails still match current exports
local build/check remained green after the refactor
What you did not verify:
full remote GitHub Actions matrix
live Discord bot traffic against a real account
Review Conversations
I replied to or resolved every bot review conversation I addressed in this PR.
I left unresolved only the conversations that still need reviewer or maintainer judgment.
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
Backward compatible? (Yes)
Config/env changes? (No)
Migration needed? (No)
If yes, exact upgrade steps:
Failure Recovery (if this breaks)
How to disable/revert this change quickly: revert commit fc11b66950ae204127a2eb239ad0bdc943c767c3
This PR is a clean, scope-limited refactor that reroutes the Discord runtime entrypoints (runtime-discord.ts and runtime-discord-ops.runtime.ts) off the grandfathered extensions/discord/runtime-api.js direct import path and onto the public src/plugin-sdk/discord.ts surface, then updates the plugin import-boundary inventory to reflect that Discord no longer appears in the grandfathered list.
All 17 named exports consumed by runtime-discord-ops.runtime.ts and all 9 consumed by runtime-discord.ts are confirmed present in src/plugin-sdk/discord.ts — no missing bindings.
The boundary inventory correctly drops from 8 to 5 entries (iMessage ×1, Slack-ops ×1, Telegram-ops ×2, Telegram ×1 remaining).
src/plugin-sdk/discord.ts itself still re-exports from extensions/discord/runtime-api.js, so the actual runtime symbols are unchanged — this is purely an import-path boundary change.
The only non-critical finding is that runtime-discord-ops.runtime.ts retains two separate import { … } from "../../plugin-sdk/discord.js" blocks (they were already two blocks before this PR); collapsing them into one would be a minor readability win but is entirely optional.
Confidence Score: 5/5
Safe to merge — purely a boundary refactor with no behavioral changes and all required symbols verified present in the target module.
Every imported symbol in both changed files was cross-checked against src/plugin-sdk/discord.ts and confirmed present. The boundary inventory update is correct and consistent with the code changes. No logic, types, or runtime behavior is altered. The only outstanding item is an optional style consolidation of two same-module import blocks.
No files require special attention.
Comments Outside Diff (1)
src/plugins/runtime/runtime-discord-ops.runtime.ts, line 1-21 (link)
Duplicate import blocks from the same module
Both import blocks (lines 1–9 and 10–21) now resolve to the same specifier ../../plugin-sdk/discord.js. Since this PR is already touching both blocks, it's a natural opportunity to collapse them into a single import { … } from "../../plugin-sdk/discord.js" statement, which is a minor readability improvement.
Feel free to leave as-is if you prefer to keep the two import groups for readability — totally understandable given they were originally two separate conceptual clusters.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/plugins/runtime/runtime-discord-ops.runtime.ts
Line: 1-21
Comment:
**Duplicate import blocks from the same module**
Both import blocks (lines 1–9 and 10–21) now resolve to the same specifier `../../plugin-sdk/discord.js`. Since this PR is already touching both blocks, it's a natural opportunity to collapse them into a single `import { … } from "../../plugin-sdk/discord.js"` statement, which is a minor readability improvement.
Feel free to leave as-is if you prefer to keep the two import groups for readability — totally understandable given they were originally two separate conceptual clusters.
How can I resolve this? If you propose a fix, please make it concise.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/plugins/runtime/runtime-discord-ops.runtime.ts
Line: 1-21
Comment:
**Duplicate import blocks from the same module**
Both import blocks (lines 1–9 and 10–21) now resolve to the same specifier `../../plugin-sdk/discord.js`. Since this PR is already touching both blocks, it's a natural opportunity to collapse them into a single `import { … } from "../../plugin-sdk/discord.js"` statement, which is a minor readability improvement.
```suggestionimport { auditDiscordChannelPermissions as auditDiscordChannelPermissionsImpl, createThreadDiscord as createThreadDiscordImpl, deleteMessageDiscord as deleteMessageDiscordImpl, editChannelDiscord as editChannelDiscordImpl, editMessageDiscord as editMessageDiscordImpl, listDiscordDirectoryGroupsLive as listDiscordDirectoryGroupsLiveImpl, listDiscordDirectoryPeersLive as listDiscordDirectoryPeersLiveImpl, monitorDiscordProvider as monitorDiscordProviderImpl, pinMessageDiscord as pinMessageDiscordImpl, probeDiscord as probeDiscordImpl, resolveDiscordChannelAllowlist as resolveDiscordChannelAllowlistImpl, resolveDiscordUserAllowlist as resolveDiscordUserAllowlistImpl, sendDiscordComponentMessage as sendDiscordComponentMessageImpl, sendMessageDiscord as sendMessageDiscordImpl, sendPollDiscord as sendPollDiscordImpl, sendTypingDiscord as sendTypingDiscordImpl, unpinMessageDiscord as unpinMessageDiscordImpl,} from "../../plugin-sdk/discord.js";```
Feel free to leave as-is if you prefer to keep the two import groups for readability — totally understandable given they were originally two separate conceptual clusters.
How can I resolve this? If you propose a fix, please make it concise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Describe the problem and fix in 2-5 bullets:
src/plugins/runtime/runtime-discord.tsandsrc/plugins/runtime/runtime-discord-ops.runtime.tsstill importedextensions/discord/runtime-api.jsdirectly.src/plugin-sdk/discord.tsand refreshed the boundary inventory to remove the 3 Discord direct-import entries.src/plugins/runtime/*depends on.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
None intended.
Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
extensions/discord/runtime-api.jsimports insrc/plugins/runtime/*withsrc/plugin-sdk/discord.tsimports.check/build.Expected
src/plugins/** -> extensions/**inventory.Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
pnpm lint:plugins:no-extension-importspnpm test -- test/plugin-extension-import-boundary.test.tspnpm test -- src/plugin-sdk/runtime-api-guardrails.test.tspnpm test -- src/plugins/runtime/runtime-discord-typing.test.ts extensions/discord/src/monitor/provider.lifecycle.test.tspnpm checkpnpm buildcreateRuntimeDiscord()and confirmed the expected runtime surface methods are presentReview 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)No)Failure Recovery (if this breaks)
src/plugins/runtime/runtime-discord.tssrc/plugins/runtime/runtime-discord-ops.runtime.tstest/fixtures/plugin-extension-import-boundary-inventory.jsonRisks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.src/plugin-sdk/discord.tscould diverge from the extension runtime surface expected bysrc/plugins/runtime/*.check/buildall passed.