[ADR] 发行证据依赖与 planned 组件设计输入分离(扩展库独立发行阻塞) #99

Open
opened 2026-12-02 22:27:28 +08:00 by cflmy · 0 comments
Owner

本工单由 #96 M0/M1 拆出:扩展库首次独立发行被现行依赖校验阻塞,需要一次 ADR 决策,不能靠伪造证据绕过。

现象(真实最小复现)

根 scripts/reconcile-releases.py 的 verify_release 要求发行证据覆盖组件 catalog 的全部 requires:

require(set(component["requires"]) <= seen, "release evidence is missing a declared dependency")

但根 components.toml 注释明确:“planned 的 requires 是设计输入,激活前须核对实际 imports 和发布依赖”。
以 http(extensions/http,catalog planned)为例:

  • catalog requires = ["cli", "std-net", "std-text", "std-encoding"](设计输入,后两者是 planned 空仓);
  • 实际 extensions/http/index.mq.md 只 import: utf8: "std:text/utf8",运行依赖是 cli + std-text;
  • 若把未使用且无实现的 std-net/std-encoding 写进 release-evidence.json,就是伪证据。

misext-http 的独立发行已在 Woodpecker CI 上有同 SHA 成功证据、确定性打包与真实测试,
但发布后根对账会因上述校验判 blocked。因此 #96 M1 的扩展试点保留真实阻塞,未发空包。

需要决定(ADR 候选)

发行证据中的 dependencies 语义应当是“实际测试/运行依赖”,与 catalog 的“设计输入”分开表达。可选:

  1. catalog 增加与 requires 区分的真实依赖字段(如 runtime_requires),只对 active 组件校验;
  2. 校验器只对 state = active 的组件强制 requires ⊆ dependencies,planned 的独立发行按实际依赖登记并记录差异;
  3. 扩展激活时把 requires 修正为实际依赖,再允许发行(会改变未来设计输入的表达位置)。

ADR 需同时给出:发行证据如何表达平台/契约兼容范围、独立发行与激活/根推荐的关系、以及历史已发布证据的兼容策略。

验收命令

python3 -m unittest tests.integration.test_reconcile_releases
python3 scripts/check-layout.py
python3 scripts/reconcile-releases.py --plan   # ext 发行应为 pending/tracked,而非 missing declared dependency

阻塞解除后计划发行 ext-http/ext-regex/ext-archive(均有真实实现与独立 CI),并复用 #96 推出的唯一发行事务。

本工单由 [#96](https://git.cflmy.cn/cflmy/marqdo/issues/96) M0/M1 拆出:扩展库首次独立发行被**现行依赖校验**阻塞,需要一次 ADR 决策,不能靠伪造证据绕过。 ## 现象(真实最小复现) 根 `scripts/reconcile-releases.py` 的 `verify_release` 要求发行证据覆盖组件 catalog 的全部 `requires`: ```python require(set(component["requires"]) <= seen, "release evidence is missing a declared dependency") ``` 但根 `components.toml` 注释明确:“planned 的 requires 是设计输入,激活前须核对实际 imports 和发布依赖”。 以 `http`(`extensions/http`,catalog `planned`)为例: - catalog `requires = ["cli", "std-net", "std-text", "std-encoding"]`(设计输入,后两者是 planned 空仓); - 实际 `extensions/http/index.mq.md` 只 `import: utf8: "std:text/utf8"`,运行依赖是 **cli + std-text**; - 若把未使用且无实现的 `std-net`/`std-encoding` 写进 `release-evidence.json`,就是伪证据。 `misext-http` 的独立发行已在 Woodpecker CI 上有同 SHA 成功证据、确定性打包与真实测试, 但发布后根对账会因上述校验判 `blocked`。因此 #96 M1 的扩展试点**保留真实阻塞**,未发空包。 ## 需要决定(ADR 候选) 发行证据中的 `dependencies` 语义应当是“**实际测试/运行依赖**”,与 catalog 的“设计输入”分开表达。可选: 1. catalog 增加与 `requires` 区分的真实依赖字段(如 `runtime_requires`),只对 active 组件校验; 2. 校验器只对 `state = active` 的组件强制 `requires ⊆ dependencies`,planned 的独立发行按实际依赖登记并记录差异; 3. 扩展激活时把 `requires` 修正为实际依赖,再允许发行(会改变未来设计输入的表达位置)。 ADR 需同时给出:发行证据如何表达平台/契约兼容范围、独立发行与激活/根推荐的关系、以及历史已发布证据的兼容策略。 ## 验收命令 ```sh python3 -m unittest tests.integration.test_reconcile_releases python3 scripts/check-layout.py python3 scripts/reconcile-releases.py --plan # ext 发行应为 pending/tracked,而非 missing declared dependency ``` 阻塞解除后计划发行 `ext-http`/`ext-regex`/`ext-archive`(均有真实实现与独立 CI),并复用 #96 推出的唯一发行事务。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cflmy/marqdo#99