Repository navigation
ref(core): 分离独立 PeerCore 与应用资源装配 - #8
Merged
Merged
Conversation
This was referenced Nov 4, 2026
PeerCore 移除连接表单和进程默认数据库,App 拥有并关闭共享实例,扩展显式借用。增加独立 SwiftPM 消费检查,保留 macOS 平台能力。 按本任务要求不执行端到端验收;draft 阶段保留合并检查待执行。 [skip ci]
本地不执行端到端验收;云端按既有 PR 工作流正常验证。
Core/App 分离以 origin/main 为基线,测试消费者复用宿主拥有的数据库实例。
xiaoland
force-pushed
the
feat/core-app-separation
branch
from
November 4, 2026 13:06
930ad01 to
fb55f52
Compare
xiaoland
marked this pull request as ready for review
November 5, 2026 09:41
3 of 5 tasks
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.
PeerCore 的普通消费者此前会继承应用身份和进程默认数据库,扩展生命周期也要求窗口入口。本次将连接表单留在 PeerMacUI,App 显式创建并拥有数据库实例,Capture 和 Local Files 借用同一实例,停止扩展后由 App 统一关闭。
本 PR 直接基于
main(本次核对为880710b),只包含 Core/App 分离及对应消费者迁移,不依赖 maintainability PR。不引入统一平台适配层或 DI 容器;独立 PeerCore 仍支持 macOS 15+。意图与范围
PeerDatabase.shared;普通库实例不从 App Bundle 或机器名推导身份。App 显式提供版本、名称和 macOS 标签。NativeExtension仅要求启动/停止,不再要求showMain;ConnectionSettings.saveEdited移至 PeerMacUI。scripts/check-core.sh和 CI 入口。证据
以下检查均已针对修正到
main后的代码重新执行:swift build --disable-automatic-resolution --jobs 4通过。SWIFT_JOBS=4 bash scripts/check-core.sh通过;独立消费者只链接 PeerCore,不连接数据库、不启动 UI。swift test --disable-automatic-resolution --jobs 4 --filter 'ConnectionSettingsTests|ConnectionEditingTests|CaptureStoreTests|nativeExtensionLifecycleWorksWithoutAnyConnection':13 项局部测试通过。git diff origin/main...HEAD --check通过。main...HEAD仅包含本任务的 27 个文件;未带入其他分支的目录监视重构、数据库验收脚本、队列或连接收尾改动。按任务要求,本地未执行端到端验收、真实数据库主流程或系统权限/UI 完整旅程。云端 CI 按当前主线既有工作流正常运行,具体状态与结果以本 PR 的 Checks 为准。旧基线的 universal 应用打包与测试结果不作为当前 head 的验证证据;本次没有重新生成或验收
.app/DMG。风险与回滚
调用方需改用显式数据库实例,表单消费者需导入 PeerMacUI;仓内消费者已同步迁移。主要风险是外部候选消费者仍依赖旧构造方式,以及真实连接/退出行为尚未在本轮本地端到端验证;云端覆盖与结果以 Checks 为准。
回滚时整体撤销本 PR,恢复主线的 API 与资源装配;没有数据库 schema、迁移或持久化格式变化,无需数据回滚。
交付影响与下一步
本 PR 不执行部署、发布、公证、预览或凭据变更。请维护者审阅库边界和资源关闭责任;合并前需确保最新主线必需检查通过并处理审阅意见。用户已授权整组合并。共享合同 InKCre/docs#51 已合入 main(
6a34372),本 PR 在当前 head 云端检查成功后通过普通 squash 合入 main(e7e8cd3)。关联
main。后续命名迁移:https://github.com/InKCre/impl-swift/pull/9(draft),将原生业务接口按 Writer / Repository 职责命名;先合并本 PR,再将子 PR 重排到最新 main。跨仓跟踪 https://github.com/InKCre/docs/issues/55。