refactor: add runtime services foundation#975
Merged
limityan merged 1 commit intoMay 30, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #970
背景
本 PR 实现 core runtime 架构迁移计划中的 PR1:Product Assembly / Runtime Services Foundation。目标是先建立可测试、可审查的 typed service assembly 基础,作为后续 remote / agent runtime / tool runtime 深迁移的前置门禁。
变更内容
bitfun-runtime-servicescrate,提供RuntimeServices、RuntimeServicesBuilder、RuntimeServicesRegistry、provider registration、capability availability 和 typed unsupported / mismatch error。bitfun-runtime-ports中补充 Runtime Services 所需的轻量 service port trait 与 Remote port trait,只表达 typed registration boundary,不暴露 SSH、relay、Tauri、process、filesystem manager 等 concrete handle。test_support::FakeRuntimeServicesProvider与 focused tests,覆盖 mandatory service、optional remote service、unsupported capability、capability availability 和 provider capability mismatch。scripts/check-core-boundaries.mjs,将bitfun-runtime-services纳入 no-core dependency、轻量依赖 profile 和 required-content 检查。core-decomposition-plan.md,把后续迁移收敛为 PR1-PR7,并细化 PR1 的实施步骤和验收门禁;同步更新架构设计文档和 AGENTS 模块索引。设计一致性与影响
bitfun-runtime-services当前仅依赖bitfun-runtime-ports、async-trait和thiserror;bitfun-core-types/bitfun-events仍是后续 service DTO 或 event contract 需要时才引入的允许依赖。这样可以避免 PR1 阶段引入未使用依赖,影响是依赖面更小,不改变功能边界。对抗性审查结果
bitfun-core,也不依赖 concrete service / product runtime / tool runtime 实现。runtime-ports测试 fixture 中会触发 repo hygiene 的本地绝对路径字面量。验证
cargo test -p bitfun-runtime-servicescargo test -p bitfun-runtime-portsnode scripts/check-core-boundaries.mjspnpm run check:repo-hygienegit diff --check gcwing/main..HEADcargo check -p bitfun-core --features product-fullcargo check --workspace