[ADR-040] 扩展安装唯一形态是 Bundle:封死「第三方插件装进引擎 plugin[]」 - #819
Merged
Conversation
jinjunnn
force-pushed
the
docs/adr-040-extension-package-taxonomy
branch
from
August 3, 2026 09:14
d879d6b to
aff7825
Compare
jinjunnn
force-pushed
the
docs/adr-040-extension-package-taxonomy
branch
from
August 3, 2026 09:50
aff7825 to
09224cb
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
owner 裁决(2026-08-03)
Alpha 的扩展安装唯一形态是 Bundle。任何扩展安装都不得写入引擎的
plugin[]。alpha.jsonc的plugin[]不是产品面 —— 它是引擎的内部装载机制,Alpha 对它唯一合法的用途是注入自己的引擎侧接缝(
@alpha-code/ext)。三条规则
信封的
root是字符串(指向components[]里某个 id),components[]maxItems 16、每个组件各带自己的 profileId ⇒ 「单组件包」只是组件数为 1 的 Bundle,Bundle 不是一种 profile。
alpha-web#96/#98);宿主不认识任何 provider,只认 profile。禁止为 provider 新增 profile ——
判据:新增理由里出现 provider 名字,就一定是形状问题。
plugin[]:catalog / package / Bundle / seed / vendored / 未策展 npm 导入一律禁止写入,且必须 fail-closed。咽喉点钉在
ext-config.ts/ext-install-planner.ts,要求新增写入点默认被挡(穷举 + 未知即拒,不是黑名单),并附可执行判据与绕过配方。
被否决的方案 C:
opencode-pluginprofile —— 判回滚REQ-128 Phase 4 已实现它。它把「第三方 JS 以引擎同等权限执行」变成产品面,
代价是一整套只为它存在的机制:同权限执行的授权披露、ABI 预检、strict wrapper、双载闸、pre-switch probe。
owner 裁决:Alpha 的扩展是声明式的(skill / agent / mcp / Bundle),不接受任意第三方代码在引擎进程里跑。
⇒ 该 profile 与配套的
engine:config/engine:pluginhost capability 全部回滚,宿主 profile 回到四个。最大收益:整个「同权限执行第三方 JS」的安全面消失。
如实登记的负面
alpha-work#49的 AC2 / AC6 明文提及 managed OpenCode Plugin,必须改写;git revert——那些 commit 里混着与插件无关的真实修复必须保住:卸载目录删不掉不再谎报成功(
#809)、else → mcp兜底收口、alpha-web 的E_HOST_PARSER_DRIFT修复(主线曾连红一天多);本 ADR 不裁决如何收敛,但要求动
#96/#98前先回答这个问题;{plugin,plugins}/*.{ts,js}的自动发现不在我们控制内,如实登记为已知边界。判据(新讨论照这个走)
Refs jinjunnn/alpha-work#49