refactor: extract shared relay service and enforce Cargo boundary - #1569
Merged
Merged
Conversation
limityan
force-pushed
the
yanzhn/relay-boundary-enforcement
branch
from
July 16, 2026 05:19
f4c241b to
97c313d
Compare
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.
Summary
services/relay-service,standalone relay app 与 embedded 入口同向消费共享实现。assembly/core -> apps/relay-server反向 Cargo 边,并用 Cargo metadata 门禁保护 crate 层级方向。bitfun_relay_server原有模块路径、根导出、AppState结构、公开 handler 签名与四参数 router builder;新代码可直接依赖bitfun-relay-service。Scope and behavior boundaries
/health和/api/info的版本由构造 router 的宿主注入,避免 app/service 版本分离后误报 service crate 版本。Compatibility and deployment
AppStateliteral、零参server_info()与四参数 builder。src/apps/relay-server的部署包还需同时包含src/crates/services/relay-service。Adversarial review
架构、产品与实现三位隔离 subagent 完成两轮审查。首轮及修复复核发现并关闭:
最终三方复审均未发现 P0-P3,也未发现功能、接口或产品边界过度膨胀。
Validation
通过:
node --test scripts/check-core-boundaries.test.mjs(12/12)node scripts/core-boundaries/self-test.mjsnode scripts/check-core-boundaries.mjscargo +nightly fmt -p bitfun-relay-service -p bitfun-relay-server -- --checkcargo +nightly test -p bitfun-relay-service(12/12 + doc tests)cargo +nightly test -p bitfun-relay-server --test library_compat(1/1)cargo +nightly check -p bitfun-core --features service-integrations --lockedcargo +nightly check --workspace --exclude bitfun-desktopcargo +nightly test --workspace --exclude bitfun-desktoppnpm run check:repo-hygienegit diff --check gcwing/main环境限制:本机没有 Docker CLI/daemon,未执行镜像构建;Dockerfile/Compose 已完成静态复核。Desktop 本地全 workspace check 需要预生成
src/mobile-web/dist,本轮由 GitHub CI 继续覆盖三平台 Rust build。