Skip to content

perf(build): prune dead dependencies and consolidate contract tests - #2220

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/build-graph-contract-test-consolidation
Aug 11, 2026
Merged

perf(build): prune dead dependencies and consolidate contract tests#2220
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/build-graph-contract-test-consolidation

Conversation

@limityan

Copy link
Copy Markdown
Collaborator

变更说明

本 PR 在不迁移运行时 owner、不扩大产品 feature 的前提下,继续收敛 Rust 编译图和 integration-test 链接拓扑:

  • 删除 CLI、Desktop、Core、MiniApp Market 与 Page Function Runtime 中经源码、测试、build.rs、feature 和反向依赖核实后未消费的直接依赖。
  • CLI 删除未调用的 syntect-tui 时显式保留原 feature union 实际生效的 Oniguruma 后端,避免高亮引擎或性能语义被静默切换。
  • 将五个 contract/adapter/assembly crate 中同 owner、同 feature、同平台、同失败域的 integration tests 合并为显式 wrapper target。
  • Product Domains 的默认、External Source、Plugin Source、Function Agent、MiniApp 仍是五个独立 feature target;AI 纯协议与真实 loopback SSE 仍独立。
  • 扩展现有 check:core-boundaries 拓扑合同,锁定 exact target、leaf 和 required-features;没有新增 checker、package script 或 CI job。

收益

指标 变更前 变更后
Cargo.lock package 1176 1169
workspace integration target 91 73
本轮五个 crate integration target 28 10
对应 test executable(含 5 个 lib harness) 33 15
integration tests 270 270

Cargo.lock 仅删除 7 个 package,没有新增、升级或降级。三平台 normal/build 闭包复算结果:

范围 Windows macOS Linux
CLI 649 → 643 649 → 642 672 → 665
Desktop 792 → 790 807 → 805 892 → 887
Core minimal 104 → 102 93 → 91 92 → 90
Core product-full 570 → 570 557 → 557 601 → 601
MiniApp Market 205 → 204 208 → 207 206 → 205
Page Function test closure 38 → 35 38 → 35 38 → 35

这里只报告确定的依赖/链接拓扑收益,不在缺少同机多轮 A/B 时宣称 wall-clock 提速。

架构与行为边界

  • 未拆 crate、未修改 Runtime API,也未触碰 App Server、Server、Relay 或运行时 ownership。
  • Desktop global-shortcut 插件从未注册且无 Rust/JS 调用方;仅同步删除无 handler 的 ACL,不影响现有菜单、窗口或 computer-use 快捷键。
  • Core minimal 删除错误直接边后,product-full 闭包保持不变,真实 adapter/service owner 仍持有相关能力。
  • 单 leaf 仍可通过 --test <target> <module>::<filter> 聚焦执行;合并不会跨外部系统或 process failure domain。
  • .github 流水线零变更,不把 CI 扩张为全量校验入口。

验证

  • node --test scripts/check-core-boundaries.test.mjs:80/80
  • node scripts/check-core-boundaries.mjs
  • 五个治理 crate 的聚合测试全通过;Product Domains 五个精确 target/feature 分别 41/65/16/18/39
  • AI stream 23 个 loopback 测试通过;对抗复审中默认并发连续 5 轮共 115 次通过
  • cargo check --locked -p bitfun-cli --bins
  • cargo check --locked -p bitfun-desktop
  • cargo test --locked -p bitfun-page-function-runtime:5/5
  • cargo test --locked -p bitfun-miniapp-market-service:24/24
  • cargo metadata --offline --locked --format-version 1 --no-deps
  • git diff --check

提交前按架构/依赖/测试拓扑三个维度完成两轮独立对抗复审,并在变基到最新 main 后再次核对,P0–P3 均无 finding。

@limityan
limityan merged commit 7345619 into GCWing:main Aug 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant