Skip to content

feat(plugins): M0 fixture 覆盖检测与 Windows 真实包验收准备 - #1474

Closed
Mucheen wants to merge 3 commits into
previewfrom
codex/windows-plugin-fixture-audit
Closed

Mucheen wants to merge 3 commits into
previewfrom
codex/windows-plugin-fixture-audit

Conversation

@Mucheen

@Mucheen Mucheen commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

改动点

对应 Windows 插件对齐计划 M0 的"fixture 覆盖清单 + 遗漏检测/门禁"与 M10 的"真实包验收准备"。第一轮提交(3fd6fef2)新增检测器、清单、单测与两份文档;第二轮提交(215542c5)校正验收事实、接通 CI 门禁并同步 preview(merge 0ffa757)。所有文件均为新增或本文档/脚本/CI 范围内修改,不触碰共享契约、宿主生产模块与测试、功能矩阵行、M1 拥有的 Note。

  1. scripts/check-plugin-fixture-coverage.mjs:fixtures 目录真实枚举 vs 显式分类清单的检测器。unknown-fixture / missing-fixture / duplicate-entry / unsorted-entry / invalid-entry / evidence-path / io 七类失败;gapStage 允许 M0–M10 与 followup(冻结路线图后落地、按计划 §6 单列后续阶段的新能力),M11 拒绝;signature-vectors 类别预置,且是该类别唯一允许 coreEvidence 为空的例外(签名向量由双端宿主签名测试消费,无 Core 校验面)。
  2. scripts/plugin-fixture-coverage.json:35 个 fixture 文件的显式分类(已含同步 preview 带来的 backend.plugin.json)。现状:3 wired、10 validated-only、10 indirect-core、12 unwired → 32 个 known gap(followup:1,backend 属冻结范围外新能力)。
  3. scripts/check-plugin-fixture-coverage.test.mjs:18 个单测。防伪造立场是"证据与诚实分类",不是永久 partial:全 wired 且证据真实存在的清单必须通过(knownGaps=0 有专门正例锁住);没有证据的 wired、缺阶段/说明的 gap、证据文件不存在一律拒绝。真实仓库守护测试只断言"清单与目录一致 + 非 wired 条目带合法阶段与说明",不再断言缺口数量。另有 CI 接线守卫测试:workflow 停止调用检测器或测试时先红。
  4. CI 门禁(第二轮接通):ci-macos.yml 的 changes job 在 ubuntu runner 上对每个 PR(含 Draft)运行,镜像既有 Sparkle lane 模式插入三步——检测器 CLI(真实清单 vs 目录比较)、node --test --test-timeout=15000(每测试 15s 本地期限)、junit→HTML 逐项计时报告(parse-junit-cases.mjs + writeTestReportArtifacts,随既有 upload 步骤上传 artifact)。新增 fixture 不登记会让真实 PR 失败,不是可选本地命令;不新增 workflow、不占 macOS/Windows runner、不改安全权限、不绕过既有检查。
  5. 验收事实纠正(第二轮):docs/development/windows-plugin-acceptance.md 按基线代码重写 macOS 可装性——PluginTypes.swift:492-504 的 PluginManifest.hostCapabilities 声明 backend:[1]、buildProviders:[1]、buildSystems:[1,2]、executableResolution:[1]、executionProviders:[1]、projectGenerators:[1]、ui:[1,2,3]、vcsProviders:[1],Core capabilities.rs SUPPORTED_CAPABILITIES 同表。maven-build/cargo-build(含 buildSystems:2)/svn-support 在 macOS 均可安装;矩阵维度为:build-provider-refresh-and-tool 与 cargo-build-plugin macOS implemented/验证 pending、vcs-subversion-and-plugin-providers macOS partial/验证 pending、build-system-plugins macOS partial——implemented/partial 不等于已验证,声明不推出全工作流完成,Windows 侧仍全部 apiUnsupported(M4/M5/M9 开放)。商店索引新增 database 0.1.0(requires backend:1)一并记录为冻结范围外事实。
  6. testing Note(第二轮新增):.agents/notes/implemented/testing/2026-10-25-plugin-fixture-coverage-gate.md 记录门禁入口、计时/期限策略、防伪造立场、gapStage 语义与 M1 交接;未改 M1 拥有的宿主 Note。
  7. preview 同步(第二轮):merge origin/preview(83017afa,含 8471b998 插件后端能力与 feat(database): 数据库模块改造为组织仓库中的独立插件 #1470 数据库插件线);backend.plugin.json 随同步登记(unwired/followup,证据 declarative_plugins.rs:32/615);invalid-manifests.json 更新为 163 用例/13 基底;function-protocol 证据更新为 v2 行号(8 组协议测试,新增 hostRequests)。

审计发现(只记录,归属各自 owner)

  • windows/tauri/src-tauri/src/plugin_host/tests.rs:149 门控注释过时:settings-v2 实际因 requires buildSystems/buildProviders 被门控,而 host_capabilities 已声明 settings:[1,2]、languageServers:[1,2](断言本身仍通过且有效)。
  • shared/contracts/plugins/v1/README.md 能力一节(preview 上仍保留)称 macOS 不声明 buildProviders/vcsProviders,与 PluginTypes.swift 及功能矩阵矛盾;能力事实以 Core 与矩阵为准。
  • Lithe-IDEA/lithe-plugin-docs 的 contract.lock.json(gh 核实 2026-10-24)固定旧修订,缺 native-*、project-generator*、project-plans.json——契约发布 owner 待办。
  • macOS BuildSystemToolWindowTests 使用共享 fixture 的本地副本,共享 fixture 变更不会反映到该测试。

M1(#1476)交接

fixtures/signature-vectors.json 已在检测器预置 signature-vectors 类别(唯一允许 coreEvidence: [] 的类别)。#1476 合入 preview 后按最小补丁登记:

{
  "path": "signature-vectors.json",
  "category": "signature-vectors",
  "outcome": "success",
  "coreEvidence": [],
  "windowsEvidence": ["windows/tauri/src-tauri/src/plugin_host/signature.rs:663 shared_fixture_verifies_end_to_end"],
  "windowsStatus": "wired",
  "gapStage": null,
  "gapDetail": null
}

(macOS 对照证据 macos/Tests/LitheTests/PluginSignatureVectorTests.swift 四组 @test 写进 #1476 的 PR 描述即可;行号以合并时为准;windowsStatus 按 #1476 实际证据定。)已验证:对 M1 worktree 的组合检测现在只报 signature-vectors.json 一个 unknown;隔离组合树(其 fixture + 上述条目 + 13 个证据文件)检测通过 fixtures=36 wired=4 exit=0。合并顺序优先 #1474 先合;若 #1476 先合,它必须自带登记条目,否则其 PR 门禁失败。

明确不做

不改共享契约及其 fixture、现有 host 测试、宿主生产模块、capability 声明、功能矩阵行、M1 拥有的宿主 Note;不新增下载物/私钥/无版本生成资源;不执行真实包验收、不启动应用;不宣告 M10 完成。真实 Windows 包/架构 pending 维持第一轮结论:7+1 个商店插件全部只有 darwin 工件(windowsDownloads=0,2026-10-25 复核),windows-arm64 无工件无实机记录。

验证

检查 结果
node scripts/check-plugin-fixture-coverage.mjs fixtures=35 onDisk=35 wired=3 knownGaps=32 gapStages(...followup:1) ✓
node --test --test-timeout=15000 scripts/check-plugin-fixture-coverage.test.mjs 18 pass / 0 fail;junit+HTML 逐项计时(最慢 26ms,阈值 1000ms),报告 .artifacts/test-stability/plugin-fixture-coverage.{junit.xml,html,json}
verify-test-stability.ps1 passed (windows)
verify-platform-feature-matrix-change.mjs origin/preview HEAD no platform implementation paths changed
node scripts/verify-agent-notes.mjs 153 notes ok
git diff --check clean
M1 worktree 组合检测 仅 signature-vectors.json unknown(backend 已登记);隔离组合树 36/36 exit=0

- scripts/check-plugin-fixture-coverage.mjs:fixtures 目录真实枚举与显式
  分类清单的覆盖检测器,新增未知/失效/重复/乱序/非法条目/证据路径失效
  均明确失败,只读本地运行
- scripts/plugin-fixture-coverage.json:34 个 fixture 全量分类,3 wired /
  10 validated-only / 10 indirect-core / 11 unwired,31 个 known gap 如实
  归属路线图里程碑
- scripts/check-plugin-fixture-coverage.test.mjs:14 个单测覆盖全部失败
  模式(临时目录正反例,有界清理),并强制真实仓库当前状态通过
- docs/development/windows-plugin-fixture-coverage.md:M0 审计快照与横切
  发现(过时门控注释、契约 lock 落后、macOS 本地副本)
- docs/development/windows-plugin-acceptance.md:M10 通用验收链、12 行
  真实包矩阵与两阶段出口;全部 windows 工件/arm64 显式 pending
@ghfind-review ghfind-review Bot added the review: medium ghfind author score; see https://ghfind.com label Oct 24, 2026
- 验收矩阵按基线代码纠正:macOS 宿主能力表(PluginTypes.swift:492-504)已
  声明 buildProviders:[1]、buildSystems:[1,2]、executableResolution:[1]、
  executionProviders:[1]、projectGenerators:[1]、ui:[1,2,3]、vcsProviders:[1]
  (preview 另加 backend:[1]),maven/cargo/svn 在 macOS 可装且矩阵记
  implemented|partial/验证 pending;删除'契约只到 buildSystems:1'等过时结论,
  补记商店新增 database 插件(backend 属冻结范围外新能力)
- 检测器:gapStage 允许 M0 与 followup(M11 仍拒绝);预置 signature-vectors
  类别并允许其 coreEvidence 为空(双端宿主测试消费,无 Core 校验面)
- 测试:移除真实仓 knownGaps>0 永久缺口断言,改为全 wired 正例 + 诚实分类
  负例;新增 M0/followup、签名向量豁免与 CI 接线守卫单测(共 18 项)
- CI:ci-macos.yml changes job(ubuntu,Draft 也运行)新增检测器 CLI、
  node --test --test-timeout=15000 与 junit→HTML 计时报告三步,复用既有
  artifact 上传;新增 testing Note 记录门禁与测试策略
- 同步 preview(83017afa):登记 backend.plugin.json(unwired/followup),
  invalid-manifests 更新为 163 用例/13 基底,function-protocol v2 证据行号
  更新;M1 #1476 合入后仅需按 Note 中最小条目登记 signature-vectors.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant