Skip to content

ref(core): 分离独立 Python SDK 与应用装配 - #175

Merged
xiaoland merged 4 commits into
mainfrom
feat/core-app-separation
Nov 5, 2026
Merged

xiaoland merged 4 commits into
mainfrom
feat/core-app-separation

Conversation

@xiaoland

@xiaoland xiaoland commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

外部 Python 程序需要直接复用领域能力。本 PR 提供可独立安装的 inkcre_core,由调用方显式创建、绑定和关闭 Core。FastAPI 服务、环境读取、调度唤醒及安装/重启政策由 App 装配。

范围

  • 领域、协议、模型、持久化和通用执行进入独立 wheel,服务依赖进入 app extra。
  • Core 实例拥有 Source、Peer、Job 状态和数据库资源,每个 UoW 使用短生命周期 session。App 请求、lifespan、定时回调和容器预启动显式绑定实例。
  • 旧模型和领域导入通过兼容层转发到同一对象,第一方扩展继续通过已发布 Host SDK 入口接入。
  • 增加真实 wheel 的仓库外消费检查,并更新打包、服务装配文档和数据库测试 fixture 的生命周期。

发布项目为 inkcre-core,包含服务镜像,Towncrier fragment 已记录。

合并基线与验证

当前候选 0b0ab05 基于 main f87694d,已核对 #180 的 ChatGPT launcher、同容器集成和部署 workflow 内容。共享引用独立提交到已合入 Hub main 的 17fc19e7230187a7a989815e7b8303bbb380f478。

本轮重排后的 foundation、锁和 migration integrity、发布意图、共享引用及 git diff --check 检查通过。当前 head 的云端 required checks 是最终合并依据,包含仓库合同、真实 PostgreSQL 场景和容器 E2E。

此前 main 9031f7e 基线的本地集合为 104 passed、9 skipped、1 deselected,Core 生命周期等局部集合为 21 passed,两组有重叠。随后修复的数据库 fixture 已在 a749300 的云端仓库检查和 E2E 通过。这些历史结果记录验证范围,本轮结果请查看当前 head 的 Checks。用户要求将本地验证限定为静态、构建和局部检查,端到端验证由云端执行。

风险与回滚

全局状态改为实例所有权后,遗漏绑定或关闭顺序会影响服务回调、Job 与扩展。已有局部验证覆盖嵌套与并发绑定、借用和自建 engine、任务收束及兼容类型身份。

回滚时整体撤销本 PR,使用此前服务产物。部署的服务依赖安装需包含 app extra。

交付与关联

用户已授权本组 PR 按顺序合并。当前执行者已复核基线、资源所有权、兼容入口和打包范围,将在 required checks 满足后通过普通 squash 合并。整组 PR 合并后,指定 Dogfood 聊天负责按 main 更新正式自部署。

本 PR 直接基于 main,后续为 #178,再后续为 #181。共享合同为 InKCre/docs#51、#53、#56、#57,跨仓跟踪为 InKCre/docs#50、#52、#55。

- Memos migration fixture 绑定独立 Core,不再替换已删除的全局 session factory
- Job 集成场景通过 start/shutdown 管理执行准入
- 本地仅静态检查与测试收集,数据库行为交给云端 CI
@xiaoland
xiaoland force-pushed the feat/core-app-separation branch from a749300 to 0b0ab05 Compare November 5, 2026 09:46
@xiaoland
xiaoland marked this pull request as ready for review November 5, 2026 09:48
@xiaoland
xiaoland merged commit 4fa74bb into main Nov 5, 2026
7 of 8 checks passed
@github-project-automation github-project-automation Bot moved this from Review / acceptance to Done in InKCre Current Work Nov 5, 2026

This branch was previously deployed

1 inactive deployment
preview — 0b0ab053 Deployed Nov 5, 2026 by xiaoland via impl-py preview cleanup #555
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant