Repository navigation
Done
Labels
Milestone
Description
BranchLifecycle:开场的注册面与生命周期数据不一致
开场(opening)是「branch/start 或 branch/resume 写入之后、线发布之前」这段。部件在这段登记收据(receipt),由 BranchLifecycle 在发布前执行;收据负责写开场事实(设置快照、客户端 presence),失败即开场失败。背景见 #2127、#2015。
问题
- 同一个注册操作有两套接口:面里的
registerOpening(跨语言,回调不带上下文),面外的admit_opening_with(带OpeningKind)和opening_budget(#[service(skip)])。 - 面外的两个方法是服务类型上的公开方法,被访问层检查拦下(插件与服务治理:所有者提供操作,逐个扫描所有者 #2015 §5);base-1(feat(runtime): route calls by id to a live Session or line #2174)按 §5 例外把它们补进允许名单(171 → 173),等这里修完删除。
- 跨语言部件能注册,但拿不到 kind 和预算;Rust 部件能拿到。两种语言能力不一致,外语部件只能自己读 Timeline 推断 kind。
- kind(Root/Child/Resume)和开场预算是生命周期状态/配置,却通过 Rust 闭包参数与 skip 方法交付;旧做法还去读 Timeline 推断。
- 契约(plugin-contract §4
branchLifecycle一行)把registerOpening写成面的一部分,但面里混了只有 Rust 能用的方法,且生成声明的回调没有上下文。
两种自洽的形状(选一个)
- 扩展面:
registerOpening(completion: (opening: { kind, budgetMs }) => void | Promise<void>);Rust 和 TS 同形;删除admit_opening_with、opening_budget。 - 声明 Rust-only:把注册整体移到 Rust-only 的装配内部名字(如
BranchOpening),面里只留activated/closing;从契约与npm/branch-services.d.ts删除registerOpening。
验收
- 按选定形状实现,
cargo run -p xtask -- check通过;允许名单删掉BranchLifecycle::opening_budget(service-skip)与BranchLifecycle::admit_opening_with(rust-only-method)两条,不新增其它条目。 - 跨语言:要么 TS 部件能拿到与 Rust 相同的打开上下文,要么契约明确开场注册是 Rust-only。
docs/design/plugin-contract.md§4 与生成的npm/branch-services.d.ts与实际一致。- 收据的顺序与失败语义不变:开场事件之后、发布之前执行;任一失败则开场失败。
相关
- 插件与服务治理:所有者提供操作,逐个扫描所有者 #2015(交付计划 §5 允许名单)、按 id 调用:由持有实例的一方选目标(base-1) #2127(按 id 路由)、docs(adr): let the holder of an instance choose it by id in ADR 027 #2200(ADR 027)
- 引入这两个方法的提交:
fbd65fa82、b802a3f7d - 代码:
crates/dim-agent-runtime/src/config.rs(BranchLifecycle)、crates/dim-agent-runtime/src/timeline_context.rs(finish_opening)、crates/dim-agent-capabilities/src/timeline_tree.rs(launch调用)、crates/dim-agent-capabilities/src/execution_settings/prompt.rs、crates/dim-agent-capabilities/src/environment_clients.rs(收据登记方)
Activity
docs(release): record the opening hook removal as a breaking change
eric8810 commentedon Nov 28, 2026
Closed by #2226 (merged 07:30Z). Branch opening now uses the branch-private BranchOpening key; the P0 set for the current release is complete.
refactor(runtime): move branch opening to the branch-private BranchOp…
docs(plugins): attribute opening receipts to BranchOpening
test(integration): lock the child opening refusal settlement