Skip to content

feat(plugins): 插件契约统一基线 0,契约与开发资料只在 Rust Core - #1826

Merged
xiaoyumuxi merged 3 commits into
feature/1794-viva-workbench-shellfrom
feature/plugins-v2-baseline
Nov 11, 2026
Merged

xiaoyumuxi merged 3 commits into
feature/1794-viva-workbench-shellfrom
feature/plugins-v2-baseline

Conversation

@xiaoyumuxi

@xiaoyumuxi xiaoyumuxi commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

关联 Issue / Linked issue

PR 类型 / Type

  • feat:新功能或用户可见的改进
  • fix:缺陷修复
  • docs:文档、Agent Note、Skill 等规则文件
  • release:稳定版发布准备

改动说明 / What changes

背景 / Why

插件 API 过去每个能力各有 1–12 不等的版本,宿主、清单、SDK 和文档都要处理“某能力到第几版才有某字段”,而这些旧版本没有需要兼容的已发布插件。契约还同时存在三份:本仓库的 shared/contracts/plugins/、Core 的 shared/plugins/contract/、lithe-plugin-docs,容易漂移。

Core #17 把每个能力收敛到当前最完整的一版并从 0 重新编号(版本字段和协商保留,以后从 0 往上加),并把契约、开发指南、参考和三个 SDK 合并到 Core 的 shared/plugins/ 作为唯一来源。本 PR 让 Viva 桌面端按基线 0 适配,并删除本仓库的契约副本。

改动 / Changes

桌面端按基线 0 适配

  • desktop/internal/pluginhost/pluginhost.go:宿主能力表的每个能力都只声明版本 0,pluginAPIVersion 只接受 0。
  • desktop/internal/core/plugin_session.go、pluginservice/backendlaunch.go、pluginservice/backends.go、pluginbackend/pluginbackend.go:后端协议版本按 0 协商。
  • 工具版本错误:runtimeTooOld 并入 toolTooOld(Core 已不再区分),删除对应的 i18n 词条并重新生成 desktop/internal/i18n/shared.generated.go。
  • 新建项目:desktop/internal/core/project_generators.go、desktop/internal/workbench/new_project*.go、projectgen/run.go 删除按生成器能力版本分叉的旧路径。
  • 测试:core、marketplace、pluginservice、pluginweb、pluginhost、workbench 下的插件相关测试把清单里的 schemaVersion、pluginAPIVersion、requires 改为 0。

契约只在 Core

  • 删除 shared/contracts/plugins/(契约 README、schema、fixture 全部副本)。
  • 新增 desktop/internal/contractfixture:测试从正在链接的 Core 检出读取契约 fixture。
  • scripts/desktop/desktop-go.sh 导出 LITHE_PLUGIN_CONTRACT_DIR;scripts/desktop/build-desktop-core.sh 的 PINNED_CORE_REVISION 升到 Core feat(database): add integrated database workspace #17 的 7a71cd6。
  • shared/contracts/rust-core-api.md、shared/contracts/vcs-provider-v1.md、shared/fixtures/plugins/*、shared/fixtures/vcs/model-v1.json、shared/fixtures/keymap/provider-negotiation-v1.json:按基线 0 改写版本号;删除只服务旧版本的 language-support-v1.json 用例和 official-v1.json 条目。
  • 平台功能矩阵 shared/platform-feature-matrix/features/*.json:证据路径改指 Core 的契约。

规则与文档

  • AGENTS.md 新增“插件契约只在 Rust Core”一节:契约、SDK、插件开发文档只在 Core shared/plugins/,改契约在同一个 Core PR 登记协议更新记录,桌面端经 contractfixture 读取;README.md、README.zh-CN.md、docs/ci-builds.md、docs/development/macos-plugin-api-plan.md、docs/development/windows-plugin-parity-plan.md 同步。
  • .github/pull_request_template.md 的“插件契约”一组改为指向 Core PR、PINNED_CORE_REVISION 和 sdk-e2e.mjs。
  • develop-lithe、create-lithe-plugin Skill:lithe-plugin-docs 与契约副本的引用改指 Core shared/plugins/。
  • Agent Note:新增 2026-11-11-plugin-contract-single-source-in-core.md(决策与被否方案)和统一基线 0 的 Note;归档“按能力分版本”和“契约发布到 lithe-plugin-docs”两篇;其余引用旧路径的 Note 改指新位置。

不在本 PR 范围内 / Out of scope

  • 已发布插件(Java、Maven、Gradle、lldb、快捷键导入等)按基线 0 适配:在各插件仓库进行。
  • 归档 lithe-plugin-docs、Lithe Store CI 改用 Core 的 plugin-index.schema.json URL、按 sdk-*-v* 标签发布新版 SDK:由维护者执行。

类型专属:feat

多平台对齐

  • 两端都具备:Viva 桌面端是 macOS 与 Windows 共用的一份 Go 代码,适配同时作用于两端
  • 只实现了 macOS:已为 Windows 提交跟进 Issue:#
  • 只实现了 Windows:已为 macOS 提交跟进 Issue:#
  • 刻意只属于某个平台(功能矩阵中另一端记为 platform-specific),理由:

范围检查 / Scope checks

功能矩阵 / Feature matrix

  • 已更新 shared/platform-feature-matrix/features/<id>.json:只改证据路径(契约移到 Core),实现与验证状态不变
  • 已运行 ./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh(255 项通过)
  • 没有提交 .artifacts/ 下生成的矩阵视图
  • [N/A] 没有更新矩阵的理由:已更新

统一日志系统 / Structured logging

N/A:没有新增或改动生命周期里程碑、终态、降级或失败路径的日志。

界面文案 / i18n

  • 只删除了 runtimeTooOld 一条词条,运行 node scripts/i18n/generate-i18n.mjs 并提交生成结果
  • 已运行 node scripts/i18n/generate-i18n.mjs --check(中英 11474/11474 完整);verify-app-language-localization.mjs 的既有违规与本 PR 无关,见“未能执行的检查”

逻辑归属 / Logic placement

性能与内存 / Performance and memory

N/A:不新增后台功能、子进程、缓存或依赖。

设置 / Settings

N/A:没有新增或修改设置项。

插件契约 / Plugin contract

发行包与资源 / Bundle and resources

N/A:不新增运行时资源或下载、生成步骤。

无用代码与重构 / Dead code and refactoring


验证 / Verification

命令或操作 平台 结果
./scripts/desktop/desktop-go.sh test core、pluginservice、marketplace、pluginweb、pluginhost、pluginbackend、projectgen(Core 按固定版本拉取 7a71cd6;contractfixture 由这些包间接覆盖) macOS 7 个包全部通过
./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh macOS 通过(255 项)
node scripts/i18n/generate-i18n.mjs --check macOS 通过(中英 11474/11474)
./scripts/agent-notes/verify-agent-notes.sh macOS 通过(233 篇)
Core #17:cargo test --workspace、注释门禁、sdk-e2e.mjs、verify-docs.mjs macOS 全部通过,详见 Core PR

未能执行的检查和原因:

  • Windows 实机:本机为 macOS,没有在 Windows 上运行。
  • 以下失败在本 PR 的基点 commit 上同样出现,与本 PR 无关:settingswindow 测试超时、workbench 的 Agent 相关测试、internal/i18n 的 TestCatalogsAreComplete、node scripts/i18n/verify-app-language-localization.mjs 的 632 条既有违规。

提交前确认 / Final checks

- 桌面端插件宿主、市场、工具链、新建项目和测试按基线 0 适配:pluginAPIVersion、requires 和宿主能力表都只用 0,runtimeTooOld 并入 toolTooOld
- 删除 shared/contracts/plugins 副本;测试通过新增的 internal/contractfixture 读取正在链接的 Core 检出里的契约 fixture
- desktop-go.sh 导出 LITHE_PLUGIN_CONTRACT_DIR;PINNED_CORE_REVISION 指向 Core 的 feature/plugin-api-single-baseline
- AGENTS.md 改为“插件契约只在 Rust Core”,PR 模板、develop-lithe 与 create-lithe-plugin Skill 同步;lithe-plugin-docs 和契约副本引用改指 Core shared/plugins
- 新增 Note:插件契约从统一基线 0 开始、插件契约与开发资料只在 Rust Core;归档“按能力分版本”和“契约发布到 lithe-plugin-docs”两篇
- 平台功能矩阵的证据路径改到 Core 契约
…l' into feature/plugins-v2-baseline

# Conflicts:
#	scripts/desktop/build-desktop-core.sh
@xiaoyumuxi
xiaoyumuxi marked this pull request as ready for review November 11, 2026 12:37
@xiaoyumuxi
xiaoyumuxi merged commit 1f9eee8 into feature/1794-viva-workbench-shell Nov 11, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: high ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant