feat(runtime-host): integrate M3 domain ownership - #1190
Conversation
627bfb2 to
2524bc9
Compare
6642420 to
879266f
Compare
39901fd to
e7fa5b4
Compare
e7fa5b4 to
daf7fd7
Compare
|
I went through the seam surface of this branch (protocol specs, dispatcher, composition root, storage authority substrate) and ran the gate-related suites on it: protocol, host-kernel, execution-host, runtime-resource-execution-host, session-management-uds, and storage root-authority, all green. The registry pattern and the storage substrate are consistent enough to build slices on, and the tiered extraction plan in #1167 mostly holds. Three things need settling before extraction starts, plus one correction to the slice map. 1. Normal shutdown is not actually bounded (hard gate 3).
A timeout alone does not fix this. Releasing the lock after a deadline while hung writes can still resume recreates the dual-write that gate 1 forbids. The missing piece is a written fail-stop contract: process exit as the death guarantee, with the OS reclaiming the flock, or isolating hangable I/O in killable workers. The RFC already treats the OS lock as the sole ownership authority, so formalizing "exit on deadline" stays closer to the design than waiting longer. This belongs in the foundations, since every domain coordinator copies its close/drain semantics from there. 2. v0 cannot detect a stale same-version Host. The handshake compares only the integer 0 ( 3. Slice map correction: the session core is a dependency chain, not flat verticals. Walking the composition wiring: root-admission-owner -> message -> canonical projection -> continuity -> interaction -> root-turn -> {automation, goal}; oauth depends on native-provider; model composition needs native-provider for the browser and computer-use tools. The flat tier is therefore smaller than "13 domains". After foundations (storage authority, protocol/dispatcher skeleton, SessionAdmissionGate, root-admission-owner), the session-core cluster lands as one PR or a short stack. Then roughly nine verticals are genuinely flat: runtime-policy, memory, artifact, task-ledger, skill-catalog, usage-pricing, oauth, automation, goal. Session control plane stays last, which the fencing semantics force anyway. Same shape as the current plan, fewer flat lanes. Smaller items that can ride with their slices:
None of this challenges the architecture itself. Items 1 and 2 block extraction; the rest can ship with their slices. 简体中文我过了一遍这个分支的接缝层(protocol spec、dispatcher、composition root、storage authority 基板),并在分支上跑了 gate 相关测试套件:protocol、host-kernel、execution-host、runtime-resource-execution-host、session-management-uds 与 storage root-authority,全部通过。注册表模式和 storage 基板足够一致,可以承载 slice 拆分;#1167 里的分层提取方案大体成立。有三件事需要在开始拆分前定下来,外加一处对切片地图的修正。 1. 正常 shutdown 实际上不是有界的(hard gate 3)。
光加 timeout 修不好。到期放锁、而挂起的写之后恢复,恰好重新制造 gate 1 禁止的双写。缺的是一份书面的 fail-stop 契约:以进程退出作为死亡保证、由 OS 回收 flock,或者把可能悬挂的 I/O 隔离进可强杀的 worker。RFC 已经把 OS 锁当作唯一 ownership 权威,所以把"到期退出"正式化比"继续等"更贴合原设计。这属于 foundations,因为每个领域 coordinator 的 close/drain 语义都从这里复制。 2. v0 无法识别同版本的过期 Host。 握手只比较整数 0( 3. 切片地图修正:session core 是依赖链,不是 flat vertical。 沿 composition 接线走一遍:root-admission-owner -> message -> canonical projection -> continuity -> interaction -> root-turn -> {automation, goal};oauth 依赖 native-provider;model composition 需要 native-provider 提供 browser 和 computer-use 工具。因此真正 flat 的一层比"13 个领域"小。foundations(storage authority、protocol/dispatcher 骨架、SessionAdmissionGate、root-admission-owner)落地后,session-core 簇作为一个 PR 或一串短 stack 落地;之后大约九个 vertical 真正 flat:runtime-policy、memory、artifact、task-ledger、skill-catalog、usage-pricing、oauth、automation、goal。session control plane 仍在最后,fencing 语义本来就强制这一点。整体形状和现有方案一致,只是 flat 车道更少。 可以随各自 slice 携带的小项:
这些都不动摇架构本身。第 1、2 项阻塞拆分,其余随各自 slice 携带即可。 |
EnglishThanks for walking the branch at the seam level. I agree with most of the findings, with one adjustment to when item 2 becomes blocking. 1. Bounded shutdownAgreed. Destroying transports does not bound server-side operations, and releasing the owner lock while a suspended write may resume would violate the single-writer invariant. I think the foundation contract should be:
We should settle this before extracting Host-owned domains that inherit the same close/drain lifecycle. 2. Stale same-version HostThe failure mode is real, but I would classify it as an M4 activation gate rather than a blocker for the current non-serving M3 extraction. Before M4, no production Desktop/TUI/CLI surface launches or depends on a long-lived Runtime Host. Real-process tests use isolated roots and own their process cleanup. A stale Before the first production Client is enabled, the handshake must distinguish incompatible schema epochs, either through an explicit protocol epoch bump or a schema/build fingerprint. We should decide that before M4 rather than build a broader compatibility system during independent M3 slice extraction. 3. Slice topologyAgreed that the Session core is a dependency chain rather than a flat set of verticals. We will update the extraction map to represent it as one cohesive PR or a short stack: A genuinely dependent PR can remain Draft until its prerequisite lands; independent authority slices can still be reviewed and merged directly. Smaller items
I will reflect this dependency topology and gate placement in #1167. The current integration PR remains frozen as evidence; these corrections should be made in the extracted foundations and slices rather than by expanding #1190. 简体中文感谢你从接缝层完整检查这条分支。大部分 finding 我都认同,但第 2 项成为阻塞项的时间点,我认为需要稍作调整。 1. 有界 shutdown认同。销毁 transport 无法约束服务端 operation;如果挂起写入仍可能恢复,超时后主动释放 owner lock 也会破坏 single-writer 不变量。 我认为 foundation 契约应当是:
所有继承这套 close/drain lifecycle 的 Host-owned domain 在提取前都应先解决这一点。 2. 同版本 stale Host这个 failure mode 确实存在,但我倾向于把它归类为 M4 activation gate,而不是当前 non-serving M3 slice 提取的 blocker。 M4 前没有 production Desktop/TUI/CLI surface 启动或依赖长期运行的 Runtime Host;真实进程测试使用隔离 root,并自行管理进程清理。目前 stale 在启用第一个 production Client 前,握手必须能够区分不兼容的 schema epoch,可以直接 bump protocol epoch,也可以加入 schema/build fingerprint。我们应在 M4 前决定,而不必在独立 M3 slice 提取阶段提前建立更大的兼容系统。 3. Slice 拓扑认同 Session core 是依赖链,而不是一组完全平铺的 vertical。我们会把提取图调整为一个完整 PR 或短 stack: 具有真实依赖的后续 PR 可以在前置合并前保持 Draft;独立 authority slice 仍可直接审查和合并。 其余小项
我会把依赖拓扑和 gate 所属阶段反映到 #1167。当前集成 PR 继续冻结为集成证据,这些修正应落在提取出的 foundation 和各个 slice 中,而不是继续扩张 #1190。 |
English
Context
This is the non-production integration branch for the Runtime Host M3 work tracked by #1167 and designed under #853.
Its purpose is to validate cross-domain ownership, lifecycle, recovery, and multi-Client behavior before the implementation is extracted into independently reviewable upstream slices. This Draft is a reference and integration-evidence branch; it is not expected to merge as one change.
Integration evidence
The branch currently integrates and validates:
This branch is now frozen for feature growth. Further changes should be limited to upstream synchronization or repairs needed to preserve its value as integration evidence. The bounded-shutdown foundation has landed independently in #1355; it is not inferred from this integration branch.
Slice extraction
Extraction starts from the latest
main, not from this branch as a merge unit:This is an initial dependency map, not a fixed PR count. Domain completeness matters more than minimizing each diff. Mixed integration commits are re-sliced by ownership rather than cherry-picked wholesale. Independent slices open Ready; a slice remains Draft only while it genuinely depends on an unmerged prerequisite.
The stale same-version
v0Host check is an M4 production-activation gate. Closing every embedded raw-writer path remains an M5 prerequisite. Neither gate is silently claimed by this integration branch.Hosted graph execution is also a pre-M4 serving gate. Until graph claims have exact root admission, execution-descriptor, ownership, and stop routing, the non-serving Host fails closed before claim lookup or durable mutation.
Plan, Deep Research, Expert Team, and Daily Review are separate product/ownership decisions. They do not block extraction of the already validated foundations and domains.
Review principles
Each slice should:
v0protocol.Related to #853. Tracks #1167.
简体中文
背景
这是 Runtime Host M3 的非生产集成分支,整体进度由 #1167 跟踪,架构方向来自 #853。
它用于先验证跨领域 ownership、lifecycle、recovery 与多 Client 行为,再把实现提取成能够独立审查的上游 slice。这个 Draft 是参考与集成证据分支,预计不会作为一个整体合并。
集成证据
当前分支已经集成并验证:
该分支现在停止扩张 feature。后续变更只应是上游同步,或维持其集成证据价值所必需的修复。有界 shutdown foundation 已通过 #1355 独立合并,不能从本集成分支本身推断。
Slice 提取
每个 slice 都从当时最新的
main提取,而不是把本分支当成一个合并单元:这是初始依赖图,不预先固定 PR 数量。领域完整度比单纯压小 diff 更重要。混合型集成提交会按 ownership 重新切分,而不是整颗 cherry-pick。独立 slice 直接以 Ready 发布;只有确实依赖未合并前置 PR 的 slice 才保持 Draft。
同版本 stale
v0Host 的识别属于 M4 production activation gate。关闭全部 embedded raw-writer 路径仍是 M5 前置条件。这个集成分支不会暗示自己已经关闭了这两个 gate。Hosted graph execution 同样是 M4 serving 前置。在 graph claim 具备精确 root admission、execution descriptor、ownership 与 stop routing 前,non-serving Host 会在读取 claim 或持久化 mutation 前 fail closed。
Plan、Deep Research、Expert Team 与 Daily Review 是独立的产品/ownership 决策,不阻塞已经验证的基础与领域实现开始提取。
审查原则
每个 slice 应当:
v0协议增加兼容层。关联 #853;跟踪 #1167。