Skip to content

perf(build): close Core feature dependency profiles - #1975

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/core-feature-closure-pr4
Aug 2, 2026
Merged

perf(build): close Core feature dependency profiles#1975
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/core-feature-closure-pr4

Conversation

@limityan

@limityan limityan commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

目标

收口 bitfun-core 的轻量 feature 依赖闭包,让局部检查/测试只加载真实能力 owner,同时保持默认 product-full 产品能力与运行时装配不变。

主要变更

  • 将 Core facade 拆为可独立编译的 announcement、file-watch、git、review-platform;service-integrations 仅保留为这四项的兼容聚合。
  • ssh-remote 只选择 services-integrations/remote-ssh-concrete;Dispatch controller、MCP、Remote Connect 和 agent runtime wiring 继续由 product-full 组装。
  • 将 agent runtime/stream、harness、runtime-services 等真实产品依赖改为可选并交给对应 owner feature;删除 Core 中无源码所有权的重复直接依赖。
  • 让 product-full 显式选择四个 facade feature,不通过兼容聚合间接获得能力。
  • 扩展既有 Core boundary checker:六个轻量 profile 校验直接引用及递归本地 feature 闭包,防止子 feature 间接接回 product-full。
  • 更新集成测试 required-features,使 Git 契约测试只启用 git,产品桥接测试仍要求 product-full。
  • 没有新增 workflow、CI job、crate 或第二套检查器。

依赖闭包

统计口径:cargo tree -p bitfun-core --no-default-features -e normal,build --prefix none 的唯一 name@version 数量;基线为上一治理提交 8717022

Core profile Before After 变化
no features 216 202 -14 (-6.5%)
service-integrations 438 243 -195 (-44.5%)
ssh-remote 327 320 -7 (-2.1%)
product-full 518 517 -1 (-0.2%)

product-full 的能力选择和运行时装配保持不变;减少的 1 个包来自无源码引用的重复直接边,不是裁剪产品功能。

验证

  • pnpm run check:core-boundaries:test — 33/33
  • pnpm run check:core-boundaries
  • cargo check -p bitfun-core --no-default-features --locked
  • cargo check -p bitfun-core --no-default-features --features service-integrations --locked
  • cargo check -p bitfun-core --no-default-features --features ssh-remote --locked
  • cargo check -p bitfun-core --no-default-features --features product-full --locked
  • cargo test -p bitfun-core --no-default-features --lib service::dispatch --locked — 15/15
  • cargo test -p bitfun-core --no-default-features --features git --test git_contracts --locked — 1/1
  • cargo test -p bitfun-core --lib product_runtime::runtime_services::local_runtime_tests --locked — 3/3
  • cargo test -p bitfun-core --lib external_hooks_tests --locked — 5/5
  • cargo test -p bitfun-core --test remote_connect_host_boundary --locked — 4/4
  • cargo test -p bitfun-core --test remote_mcp_streamable_http --locked — 1/1
  • cargo check --workspace --exclude bitfun-desktop --locked

完整 cargo check --workspace --locked 在本地 Tauri build script 处因干净 worktree 缺少未跟踪的 src/mobile-web/dist 构建产物而停止;没有通过修改构建脚本或伪造资源目录绕过,desktop 完整路径交由现有 CI 按既有资源生成流程验证。

风险与兼容性

  • 仓内所有产品入口已显式选择 product-full,默认产品路径不受轻量 feature 变化影响。
  • service-integrations 不再暴露此前无法独立编译的 MCP/Remote Connect 产品桥;这两个桥的真实前置条件仍由 product-full 表达。
  • Durable Dispatch store/DTO 在 no-feature 下继续可用并保持失败关闭;controller/device/preparation 等产品执行路径只在 product-full 编译。

Split lightweight service and SSH facade features from full product composition, remove redundant Core dependency ownership, and guard the recursive feature closure with boundary tests.
@limityan
limityan merged commit 578f51b into GCWing:main Aug 2, 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