refactor: accept the ecosystem stdlib Bundle (issue #11 Phase B) #17

Open
cflmy wants to merge 2 commits from migration/cli-stdlib-phase-b into master
pull from: migration/cli-stdlib-phase-b
Owner

范围(issue #11 Phase B,父仓 #9 的 MIG-CLI 完成项)

在 Phase A 显式 Bundle 输入之上完成源码所有权切换:CLI 不再拥有标准库源码,接受由生态根仓库组装的唯一 Bundle。

  • tools/stdlib/bundle-pin.json → source.kind = "ecosystem":cflmy/marqdo@48189243f7,marqdo-stdlib@0.2.0,tree digest sha256:db905508…,aliases digest sha256:5f513c0f…(17 模块,无组件自测)。
  • 新增 tools/ci/fetch_ecosystem_bundle.py:按 pin 抓取精确根提交与 6 个 stdlib gitlink,运行根唯一生产者并校验摘要;CI 用它物化 Bundle,不读浮动分支、不 vendor 源码。
  • 删除仓内 stdlib/(模块、自测、manifest)与任何 build profile 的编译期源码 fallback;运行时发现只剩 MARQDO_STDLIB_DIR 与二进制相邻 stdlib/。
  • bundle.py/测试 harness 对 ecosystem pin 要求显式已验证 Bundle;缺失即 fail-closed。
  • 产品测试改为验证 CLI 自身职责:外部 Bundle 必需公开面、std: 执行、官方 print/打印 alias 路由(tests/product-stdlib/)。
  • 归属迁移:Table/print 格式化组合断言移至根 Bundle 验收;HTTP/TCP 领域测试归 marqdo-ext-http(loopback 测试后续);CLI 保留通用 TCP round-trip(tcp_round_trip.rs)。
  • CI(Woodpecker/GitHub)、package/perf、README/ci/releasing/STATUS、ADR-0070 与 Phase B 证据同步。

验证(本地候选 72f57be,Bundle 由 fetch helper 物化)

  • cargo fmt --all -- --check、cargo clippy --workspace --all-targets -- -D warnings:PASS。
  • MARQDO_TEST_STDLIB_BUNDLE=<materialized> cargo test --workspace --locked:72 个测试二进制全部 PASS。
  • python3 -m unittest discover -s tools/ci -p "test_*.py":75 tests OK。
  • cargo test -p marqdo-cli --test stdlib_product:4 PASS(含缺 Bundle fail-closed)。
  • independent_build.py、release package + smoke:本地运行,结果见 PR 评论/CI。

未验证

  • CI 结果为门禁证据,记录在评论;完整生态冷安装与根晋升属 MIG-RELEASE(marqdo#9)。
  • HTTP loopback 领域测试迁移与多平台证据未完成,不在此 PR 声明。

Refs cflmy/marqdo#9, cflmy/marqdo-cli#11

## 范围(issue #11 Phase B,父仓 #9 的 MIG-CLI 完成项) 在 Phase A 显式 Bundle 输入之上完成源码所有权切换:**CLI 不再拥有标准库源码**,接受由生态根仓库组装的唯一 Bundle。 - `tools/stdlib/bundle-pin.json` → `source.kind = "ecosystem"`:`cflmy/marqdo@48189243f7`,`marqdo-stdlib@0.2.0`,tree digest `sha256:db905508…`,aliases digest `sha256:5f513c0f…`(17 模块,无组件自测)。 - 新增 `tools/ci/fetch_ecosystem_bundle.py`:按 pin 抓取精确根提交与 6 个 stdlib gitlink,运行根唯一生产者并校验摘要;CI 用它物化 Bundle,不读浮动分支、不 vendor 源码。 - 删除仓内 `stdlib/`(模块、自测、manifest)与任何 build profile 的编译期源码 fallback;运行时发现只剩 `MARQDO_STDLIB_DIR` 与二进制相邻 `stdlib/`。 - `bundle.py`/测试 harness 对 ecosystem pin 要求显式已验证 Bundle;缺失即 fail-closed。 - 产品测试改为验证 CLI 自身职责:外部 Bundle 必需公开面、`std:` 执行、官方 `print`/`打印` alias 路由(`tests/product-stdlib/`)。 - 归属迁移:Table/print 格式化组合断言移至根 Bundle 验收;HTTP/TCP 领域测试归 `marqdo-ext-http`(loopback 测试后续);CLI 保留通用 TCP round-trip(`tcp_round_trip.rs`)。 - CI(Woodpecker/GitHub)、package/perf、README/ci/releasing/STATUS、ADR-0070 与 Phase B 证据同步。 ## 验证(本地候选 `72f57be`,Bundle 由 fetch helper 物化) - `cargo fmt --all -- --check`、`cargo clippy --workspace --all-targets -- -D warnings`:PASS。 - `MARQDO_TEST_STDLIB_BUNDLE=<materialized> cargo test --workspace --locked`:72 个测试二进制全部 PASS。 - `python3 -m unittest discover -s tools/ci -p "test_*.py"`:75 tests OK。 - `cargo test -p marqdo-cli --test stdlib_product`:4 PASS(含缺 Bundle fail-closed)。 - `independent_build.py`、release package + smoke:本地运行,结果见 PR 评论/CI。 ## 未验证 - CI 结果为门禁证据,记录在评论;完整生态冷安装与根晋升属 MIG-RELEASE(marqdo#9)。 - HTTP loopback 领域测试迁移与多平台证据未完成,不在此 PR 声明。 Refs cflmy/marqdo#9, cflmy/marqdo-cli#11
cflmy added 1 commit 2026-11-27 01:05:30 +08:00
Phase B of ADR-0070 (issue #11): the CLI no longer owns standard-library
sources. The pin names the accepted ecosystem Bundle (marqdo-stdlib@0.2.0,
root commit + tree/alias digests); tools/ci/fetch_ecosystem_bundle.py
materializes it from the pinned root commit and stdlib gitlinks and verifies
the digests. bundle.py and the test harness require an explicit verified Bundle
for the accepted identity, and runtime discovery has no compile-time source
fallback in any profile.

Delete stdlib/ (modules, self-tests, aliases manifest). Module and domain tests
stay with their component owners; the CLI product lane now verifies the
external Bundle's public surface, std: resolution and official print/打印 alias
routing (tests/product-stdlib). Composition assertions whose owner is the
ecosystem (Table split, print-format equivalence) moved to the root Bundle
acceptance; the generic TCP round-trip stays a CLI test. Spawned-CLI tests name
the verified Bundle explicitly.

CI (Woodpecker + GitHub) materializes the pinned Bundle before product tests,
packaging and performance lanes; packaging and release take --stdlib-dir from
that artifact. Docs, STATUS, ADR-0070 and a Phase B evidence record updated.

Refs cflmy/marqdo#9, cflmy/marqdo-cli#11
cflmy added 1 commit 2026-11-27 01:21:47 +08:00
Woodpecker executes the job commands as one shell script; the inline contract
block plus its trailing commands exceeded the runner's command buffer and the
last command was truncated mid-argument (the raw log shows the shell received
'python3 tools/c'). Move the lane into tools/ci/contract_lane.sh and keep the
CI commands short, preserving every check.

CI jobs share one workspace, so a second job saw 'output already exists' from
the first fetch. The helper now reuses an output only after verifying it against
the pin, builds into a temporary sibling and moves it into place atomically.

Refs cflmy/marqdo-cli#11
All checks were successful
ci/woodpecker/push/main Pipeline was successful
ci/woodpecker/pr/main Pipeline was successful
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin migration/cli-stdlib-phase-b:migration/cli-stdlib-phase-b
git checkout migration/cli-stdlib-phase-b
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cflmy/marqdo-cli#17