diff --git a/AGENTS.md b/AGENTS.md index 3f8fcc897a..81e810f800 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -118,7 +118,7 @@ Dim's architecture and the way Dim uses rutis are documented apart ([ADR 006](do A rule is stated once, at its layer. The Rust spelling of a rule is a binding, not the rule. See the [architecture overview](docs/architecture/README.md#design-documents) for the full document index. -Before designing or changing a plugin, capability or event, read [design rules §4](docs/architecture/rust-agent/principles.md) (extending behavior through the Timeline), [ADR 002](docs/adr/002-plugin-scope.md) (scope, no wiring modules, configuration, language-neutral contracts) the [plugin contract](docs/design/plugin-contract.md) (how Dim's architecture applies to plugins) and [How Dim uses rutis](docs/design/rutis-usage.md) (how parts are mounted, name services and cross languages). Every plugin design document contains a "Rule check" section that says which parts are Capabilities ([principles §1](docs/architecture/rust-agent/principles.md)) and answers each of these rules (§4 rules 1–9, §1 and ADR 002 D1–D5; or states why one does not apply), and a "Requirements raised to mechanism owners" section in the format of §4 rule 8. Pull requests answer the checklist in the pull request template. +Before designing or changing a plugin, capability or event, read [design rules §4](docs/architecture/rust-agent/principles.md) (extending behavior through the Timeline), [ADR 002](docs/adr/002-plugin-scope.md) (scope, no wiring modules, configuration, language-neutral contracts) the [plugin contract](docs/design/plugin-contract.md) (how Dim's architecture applies to plugins) and [How Dim uses rutis](docs/design/rutis-usage.md) (how parts are mounted, name services and cross languages). Every plugin design document contains a "Rule check" section that says which parts are Capabilities ([principles §1](docs/architecture/rust-agent/principles.md)) and answers each of these rules (§4 rules 1–9, §1, the §7.2 owner checks and ADR 002 D1–D5; or states why one does not apply), and a "Requirements raised to mechanism owners" section in the format of §4 rule 8. Pull requests answer the checklist in the pull request template. 1. A feature is split into parts by the owner of their state, and each part lives in that owner's scope: the process, a Session or a branch ([ADR 002 D1](docs/adr/002-plugin-scope.md)). A part declares every dependency, including those only needed for load order. How a part is mounted and names its dependencies is [How Dim uses rutis](docs/design/rutis-usage.md); the current Rust spelling is below. `apply` acquires resources and registers their cleanup immediately, then registers services and subscriptions. Once `apply` completes, services and subscriptions are available. Input consumption and background work start only after the Session or branch is published (`activated()`); if assembly fails, they never start. They end on `closing()` without waiting for unload, and a Session is closing from the moment its close starts. A process part whose background work depends on the initial process assembly waits for the host-wide `processActivity.activated()` in its own tasks; `apply` does not block on it, and a row reload does not reset it ([plugin contract §7.1](docs/design/plugin-contract.md#71-phases)). 2. Behavior that produces or consumes events with critical effects (affecting a part's execution, or context content and its processing or insertion) writes facts to the Timeline, and the Dispatcher delivers them. Parts coordinate through facts and the named services they declare; direct calls are limited to handles they own. diff --git a/docs/adr/027-cross-scope-access-by-id.md b/docs/adr/027-cross-scope-access-by-id.md new file mode 100644 index 0000000000..d10747350e --- /dev/null +++ b/docs/adr/027-cross-scope-access-by-id.md @@ -0,0 +1,93 @@ +# 027: 跨作用域访问按 id 直达所有者 + +Decision status: Proposed. + +## Context + +[ADR 002](002-plugin-scope.md) D2 规定,进程插件经 Agents 的 `sessions` 服务访问其他 Session。[Session 访问契约](../design/contracts/session-access.md)据此定义了 `sessions` 的方法。ADR 002 D3 又规定插件只依赖本作用域或外层作用域,所以进程插件不能注入 Session 组或分支组的服务。 + +`sessions` 的方法分两类: +- `launch`、`exists`、`delete` 是 Agents 自己的操作; +- 其余方法的数据和操作属于 Session 或分支内的所有者,例如输入的撤回与待处理属于 InputQueue,默认分支属于 TimelineTree,停止属于 Loop。 + +对第二类方法,Agents 要先取得 Session,再转述对方的结果、错误和新鲜度。每新增一种跨 Session 的需求,就要在 `sessions` 上加一个方法。Session 部件访问本 Session 内的分支所有者时,现在经 `Branch` 门面或交出的分支服务对象,同样绕开了所有者自己的操作。 + +[设计规则 §7](../architecture/rust-agent/principles.md#7-所有者与操作) 要求调用方直接请求数据的所有者,不代查,也不设只转发的门面。这需要一条从外层作用域到内层所有者的路径,而现在没有这样的路径: + +- 每个 Session 实例和分支实例下,都有本作用域数据面的派发入口; +- 但实例键只能在实例内部读取,rutis 拒绝实例外的实例键([Session 边界契约](../design/contracts/session-boundary.md)中的 `Session::instance()` 需求)。 + +## Decision + +### D1. 外层作用域的调用方按 id 直达内层所有者的数据面 + +- 进程作用域的调用方:用 `sessionId` 到达 Session 组的数据面,用 `(sessionId, branchId)` 到达分支组的数据面。 +- Session 作用域的调用方:用 `branchId` 到达本 Session 分支组的数据面。`branchId` 就是分支线的 id(line id)。 +- 调用方直接调用目标所有者自己的操作。中间的所有者不按操作名转发,不包装请求或回复,也不转述目标所有者的错误。 + +### D2. 路由由 dim 运行时按 id 完成,实例键不离开实例 + +- 这是一个新机制,所有者是 dim 运行时。 +- 运行时维护从 `sessionId`、`(sessionId, branchId)` 到当前存活实例的索引,把调用路由到目标实例内的派发入口。 +- 调用方只给 id 和服务名,拿不到实例键。所以「实例键只在实例内部可读」的约定不变。 +- 解析失败时,调用方要能分清三种情况:Session 不在、Session 正在关闭、分支不在。分支结束不等于 Session 关闭:Session 仍然存活时,分支不在对这个分支是最终结果,不影响同一 Session 的其他调用。错误的名字、每种错误下调用方的下一步和验收,由机制所有者在 [#2127](https://github.com/arcships/dim/issues/2127) 定义。 + +### D3. 可解析的只有目标作用域的数据面 + +- 可解析的是目标作用域在 catalog 中共享的数据面。 +- 不包括机制登记点(`sessionMethods`、`toolRegistry` 等)。登记属于登记方这一代部件,其他语言的部件属于 bridge 的调用方 row,只能在本作用域内进行。 +- 也不包括作用域的生命周期服务。 +- 各语言用同一条路径: + - Rust 插件在进程内调用; + - TypeScript、Python 等语言运行时和 UI leaf 经 rutis 会话调用,与其他数据面相同。它们是宿主运行的可信本地 rutis 节点,不靠 id 隔离([Dim 如何使用 rutis](../design/rutis-usage.md),AGENTS.md 规则 11)。 +- 哪些 link 能到达这条路径由部署决定([服务面](../design/service-faces.md) §2.1)。 +- RPC 客户端不经这条路径,仍经 Rpc 的方法表与 Session 授权访问。 + +### D4. 按 id 调用不是依赖 + +- ADR 002 D3 的依赖方向不变:调用方不把内层服务声明为依赖,也不参与内层的装配顺序。 +- 调用方在每次调用时给出 id 和服务名,由运行时解析。调用方不在装配时声明内层组的名字:外层装配解析不了内层组的名字。 +- 解析结果不跨调用保存,也不交给别的部件。 + +### D5. 让目标保持加载属于 Agents + +- Session 已加载时,单次调用不需要保持。 +- 进程调用方需要一个 Session 在多次调用之间保持加载,或者目标未加载,向 Agents 取一个保持;单次调用在调用后释放。 +- 保持属于调用方的 loader row,在调用方释放或该 row 卸载时结算。 +- 保持只决定 Session 是否加载,不提供对 Session 内部的访问。 + +### D6. Agents 只保留自己的操作 + +- Agents 拥有 Agent 与 Session 的实例:创建、关闭、删除,准入值,以及保持。 +- `sessions` 中不属于 Agents 的方法删除,调用方按 D1 直接调用目标所有者。 +- 每个方法的去向和被取代的条款由 Agents 契约([#2098](https://github.com/arcships/dim/pull/2098))给出,目标操作由各所有者的契约定义。 + +## Consequences + +- ADR 002 D2 表中「Reach other Sessions」一行由 D1 取代。 +- [Session 边界契约](../design/contracts/session-boundary.md)中以下两条不变: + - 附录 F「No service lookup by name is added to the Session facade」:D1 的路径由运行时路由,不在 Session facade 上加查找; + - 「实例键只在实例内部可读」:见 D2。 +- [Session 访问契约](../design/contracts/session-access.md)与 [sessions 服务设计](../design/appserver/sessions-service.md)中的 `sessions` 服务由 Agents 契约取代,两份文档中关于可达范围的条款改为 D3。 +- `sessions` 的使用方 Collaboration、Scheduler、Workflow、EventHub 改成 D1 的形状。Rpc 不使用 `sessions`,它的方法表派发仍走 Session facade。 + +### 向机制所有者提出的需求 + +| 项 | 内容 | +| --- | --- | +| 被挡住的 | 设计规则 §7「不代查」:进程部件与 Session 部件要直接调用内层所有者,但 ADR 002 D3 禁止注入内层服务,Session 边界契约又规定实例键只能在实例内部读取。 | +| 考虑过的现有机制 | 经 Agents 的 `sessions` 转发:违反 §7。Session facade 按名查找:附录 F 已经排除。把实例键交给调用方:违反 D2 中实例键不离开实例的约定。 | +| 需要的通用能力 | 按 `sessionId`、`(sessionId, branchId)` 把对目标作用域某个数据面的调用路由到存活实例;失败时区分 Session 不在、Session 正在关闭、分支不在(D2)。不带业务含义,也不把实例键交给调用方。 | +| 对序号、批次、中断、重载的影响 | 无:路由不写事件,调用的语义由目标所有者的操作决定。目标重载后,索引指向新的一代。 | +| 所有者与 issue | dim 运行时,两段都在 [#2127](https://github.com/arcships/dim/issues/2127) 跟踪。使用方:Session 到分支一段是 SessionScope 与 TimelineTree 契约中的 `line_owner`([#2025](https://github.com/arcships/dim/issues/2025)、[#2024](https://github.com/arcships/dim/issues/2024));进程到 Session 一段是 Agents 契约([#2020](https://github.com/arcships/dim/issues/2020))。 | + +## Non-goals + +- 不改变作用域划分(ADR 002 D1)和依赖方向(ADR 002 D3)。 +- 不改变机制登记点及其登记方式。 +- 不规定任何语言的写法,写法属于绑定。 +- 不改变客户端协议:RPC 客户端仍经 Rpc 的方法表访问 Session。 + +## Supersession + +取代 [ADR 002](002-plugin-scope.md) D2 表中「Reach other Sessions」一行。D2 的其余各行和 D1、D3–D5 不变。 diff --git a/docs/adr/README.md b/docs/adr/README.md index 2da733ce20..c67c5d07e8 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -34,6 +34,7 @@ original text. | [024 — Web 抓取层使用请求库,地址策略在请求之前执行](024-web-fetch-transport.md) | Proposed | Follows 006 D1; replaces the hand-written transport and narrows the address policy to a pre-request check | | [025 — The plugin runtime baseline is rutis 0.23](025-rutis-0-23.md) | Proposed | Follows 015; sets the rutis version baseline and the protocol-5 upgrade rule | | [026 — Verification tiers, test coverage and CI governance](026-verification-tiers-and-ci-governance.md) | Proposed | Extends 008; defines three operational test states, verification tiers (L0–L4), form-only doc checks and CI governance | +| [027 — 跨作用域访问按 id 直达所有者](027-cross-scope-access-by-id.md) | Proposed | Supersedes the "Reach other Sessions" row of 002 D2; follows design rules §7 | Source baseline: [initial foundation parent](https://github.com/arcships/dim/commit/aaaffa5768e031d781abb73e45b1915b05dc2aa0). This baseline includes lifecycle fixes not necessarily present on the default branch. diff --git a/docs/architecture/rust-agent/principles.md b/docs/architecture/rust-agent/principles.md index 55c3b15124..8b2964972e 100644 --- a/docs/architecture/rust-agent/principles.md +++ b/docs/architecture/rust-agent/principles.md @@ -104,3 +104,57 @@ Approval 与 Permission 只管 agent 决策引起的动作(工具调用); ## 6. 验证 需求变化时,旧断言按新需求修改或删除,测试跟随实现。日常行为验证用各 crate 的 `crates/*/tests` 与仓库根的 `tests/integration`(跨包扩展、公开流程)。事件格式样本位于 `crates/dim-agent-types/tests/fixtures/`,是冻结的兼容基线:保留原始公开 wire 样本及其来源,不随实现变更更新;契约测试(`crates/dim-agent-types/tests/*_contract.rs`)对这些样本做反序列化与序列化校验,`cargo run -p dim-agent-types --example compat -- --emit` 输出原生 Rust 样本的 v1 wire 形式供对照。对冻结事件结构的扩展须经设计决定,并在契约测试中登记。 + +## 7. 所有者与操作 + +本节是目标规则:现有插件中与它不符的形状是待改的差距,不是例外。**所有者**是持有某类资源或状态的部件;一个插件可以有多个所有者,以下规则以所有者为单位。 + +设计插件先回答"我负责什么、维护到哪里",再回答"别人需要什么"。插件与部件的形状由职责和维护边界决定;外部需求只决定对外提供哪些操作,不决定内部如何组织,也不决定交出什么。需求用来验证职责划分:每个真实需求都应落到某个所有者的某个操作上。落不下去说明划分有缺口;超出职责的需求交给真正的所有者,或新建一个所有者,不在现有插件上开口子。 + +**资源归所有者,别人只能请求它做事;业务状态通过事实或值共享。** + +| 对象 | 规则 | +| --- | --- | +| 资源(进程、PTY、文件与锁、连接、订阅等需要收尾的 I/O) | 创建、结算、取消、清理都在所有者内部完成;对外只给以 id 标识资源的操作;所有者仍要负责的句柄不离开所有者 | +| 业务状态 | 由事实推出:分支上的 Capability 写入并按序折叠事实(第 4 节);进程级所有者给出值(快照、配置),不进 Timeline(第 4 节规则 9) | + +判据:交出去之后,所有者还要不要为它负责?要,就只能给操作。副本与投影则问:新鲜度由谁负责?持有者接受过期时可以持有;正确性依赖最新值时,向所有者请求或订阅。 + +可以交出的是:值(快照、配置、身份;后续决定依赖修订时带版本)、只读视图(所有者发布、调用方只能观察的值及其订阅),以及按引用传递的回调(不在提交锁内同步调用,[服务面](../../design/service-faces.md)第 1 节规则 4)。 + +**交对象是最后手段。** id、值与回调都做不到时才交出对象。一旦交出对象,就要在更高一层统一设计相关插件的生命周期与边界:谁创建、谁持有、交接顺序、谁收尾、任何一方关闭或重载时如何处理,写进各方共同引用的设计中。资源句柄只能整体转移:接收方成为它的所有者并负责结算,交出方不再为它负责;交出后仍要交出方收尾的句柄,是待改的差距。"热路径"本身不是交出对象的理由。 + +**不代查别人的资源。** 一个所有者不替别的所有者返回它的资源或数据,也不替它接收写入;调用方直接请求数据的所有者。调用所有者的操作不是替它决定:所有者在操作内自己决定,结果事件由它按第 4 节规则 1 写。调用方在外层作用域时,按 id 经机制直达所有者([ADR 027](../../adr/027-cross-scope-access-by-id.md))。有性能需求时重新定义归属,而不是增加代查。从公开事件折叠出的投影是投影者自己的状态,发布它的部件就是它的所有者。 + +**一套公开面,控制概念数量。** 公开面就是所有者自身的操作:Rust 在进程内直接调用,其他语言经 rutis 的派发与声明调用同一组操作([Dim 如何使用 rutis](../../design/rutis-usage.md))。每多一个接口就多一个概念:新增接口要从所有者的职责与边界说明为什么需要,不因某个调用方的需求增加。同一组操作不以两套接口存在,不为调用方另造只转发的门面、命令、控制或宿主对象。机制提供的登记点(`sessionMethods`、`managementMethods`、`toolRegistry`,[ADR 002](../../adr/002-plugin-scope.md))不是转发门面;所有者向登记点登记的方法与工具,是它经该登记点提供的公开面。 + +**公开面以跨语言可用为准。** rutis 支持只在 Rust 内可用的方法与服务([Dim 如何使用 rutis](../../design/rutis-usage.md) §3.3);Dim 为了让跨语言插件的能力最大化、让插件的生命周期内聚,公开面不使用这一能力:参数、回复与错误是数据,资源以 id 表示([服务面](../../design/service-faces.md)第 1 节)。只能在 Rust 内使用的方法留在所有者内部。数据面不改变 Rust 进程内的直接调用,调用频率不是保留非数据面的理由。跨不了语言时按原因处理:参数不是数据就改形状;只服务同一功能内部的移出 catalog,作为私有名字;要求在提交锁内同步回调或交出对象的,改操作颗粒度。 + +**职责分界:业务面对更小的复杂度。** 设计接口前先分清所有者的内部职责与调用方的业务职责。接口用所有者自己的词汇表达,不出现调用方的业务概念;锁、版本、等待、重试、结算等所有者的内部机制不推给调用方,调用方只处理有业务含义的结果与异常。业务提出的需求,能用现有操作组合完成且不破坏所有者不变量的,留在业务侧;组合会破坏不变量的,才由所有者提供一个通用操作。每个参数都是复杂度,默认值由所有者决定,只有业务确实需要不同取值时才开放。 + +**一个所有者一次改完。** 改造一个所有者的公开面时,新的操作、全部调用方的迁移与旧公开面的删除在同一个改动中完成,不保留新旧并存的兼容期。一个插件的多个所有者可以分成多个改动,每个改动对它的所有者是完整的。[服务面](../../design/service-faces.md) §2.2 的 `internal(reason)` 记录的就是这类差距,随该所有者的改动一起消除。 + +### 7.1 设计三问 + +每个所有者在设计文档中回答下表(新所有者按[设计模板](../../templates/design.md),重设计已有所有者按 [owner-redesign 模板](../../templates/owner-redesign.md)): + +| 问题 | 要回答的内容 | +| --- | --- | +| 资源 | 拥有什么;哪些需要收尾,哪些只是值 | +| 生命周期 | 由谁触发、何时结束、由谁结算;发起方与所有者不在同一作用域时、所有者关闭或重载时、发起方异常退出时如何收尾 | +| 对外业务 | 调用方的意图推出哪些操作与值;每个操作的取消、超时与错误种类 | + +- **操作颗粒度**:一个操作是资源的一次状态迁移或一次一致的读取,所有者能独立完成并收尾。调用方漏调或调错顺序就会破坏所有者状态,说明太细;夹带调用方的决定,或调用方只需要其中一部分,说明太粗。步骤之间以 id 衔接,策略作为数据参数传入。 +- **错误**:错误是操作契约的一部分,由每个所有者按调用方下一步能做什么自行设计,不套用通用种类;所有者不会出现的情况不写对应错误,也不泄漏内部错误。取消与超时写明各自停止的是什么。指令没有生效时按第 4 节规则 1 不写结果事件;已经发生的操作,后续决定依赖其失败的,写成事实。 +- **所有者颗粒度**:在 [ADR 002 D1](../../adr/002-plugin-scope.md) 的作用域划分之内,生命周期不同的资源一般归不同的所有者;只是转发的所有者合并(ADR 002 D2)。上层只通过操作组合下层,不持有下层句柄,也不把下层资源再对外提供。 + +### 7.2 评审检查 + +- 每个跨插件调用都落到某个所有者的一个操作上。 +- 默认只交出值、只读视图或回调;交出对象的,有更高一层统一设计的生命周期与边界;资源句柄只整体转移。 +- 没有转手别人的资源,没有代查别人的资源或数据。 +- 同一组操作只有一套接口;每个新增接口都从所有者的职责说明了理由;没有只转发的门面、命令或控制对象。 +- 公开面上没有只能在 Rust 内使用的方法;参数、回复与错误是数据,资源以 id 表示。 +- 接口里没有调用方的业务概念,也没有推给调用方的所有者内部机制;每个操作和参数都说明了为什么不能由调用方组合完成。 +- 跨作用域的生命周期写明结算权与异常收尾。 +- 一个所有者的改造在一个改动中完成,旧公开面同时删除。 diff --git a/docs/templates/README.md b/docs/templates/README.md index 49ea5b565b..0c09cff73e 100644 --- a/docs/templates/README.md +++ b/docs/templates/README.md @@ -8,6 +8,7 @@ are in [AGENTS.md](../../AGENTS.md). | ADR | [adr.md](adr.md) | [ADR 008](../adr/008-documentation-ownership.md) | | Feature or plugin design | [design.md](design.md) | [Web](../design/plugins/Web.md) | | Contract | [contract.md](contract.md) | [Session access](../design/contracts/session-access.md) | +| Owner redesign | [owner-redesign.md](owner-redesign.md) | none yet | The [design guide](../design/capability-design-arguments.md) offers help with use, public promises and verification. The [detailed reference](../design/capability-design-reference.md) and [Wait example](../design/examples/wait-argument.md) diff --git a/docs/templates/design.md b/docs/templates/design.md index 2d92b71c4d..6836a29c95 100644 --- a/docs/templates/design.md +++ b/docs/templates/design.md @@ -17,6 +17,8 @@ Identify the parts that are Capabilities. Affected inputs, outputs, events, state, errors and public dependencies. Link the owners' contracts. For changed events, explain their meaning, correlation and compatibility. Describe affected recovery and lifecycle behavior under the existing contracts. Distinguish existing promises from proposed changes. +For each owner, answer the [design rules §7.1](../architecture/rust-agent/principles.md#71-设计三问) +questions: its resources, their lifecycle and the operations callers need. ## Verification @@ -26,7 +28,7 @@ Run results belong in the issue or PR. ## Rule check -Answer [design rules §4](../architecture/rust-agent/principles.md), §1 and +Answer [design rules §4](../architecture/rust-agent/principles.md), §1, the §7.2 owner checks and [ADR 002](../adr/002-plugin-scope.md) D1–D5 as required by AGENTS.md; explain inapplicable rules. ## Requirements raised to mechanism owners diff --git a/docs/templates/owner-redesign.md b/docs/templates/owner-redesign.md new file mode 100644 index 0000000000..b47ff1afa8 --- /dev/null +++ b/docs/templates/owner-redesign.md @@ -0,0 +1,85 @@ +# Owner redesign + +Use this shape when an existing owner's public surface is redesigned under +[design rules §7](../architecture/rust-agent/principles.md#7-所有者与操作). It has two parts. The design +part is durable and goes into the document that holds the owner's design. When the plugin's page +under `docs/architecture/rust-agent/plugins/` links a design under `docs/design/plugins/`, the +linked design is that document. Otherwise it is the plugin's architecture page, or its page under +`docs/design/plugins/` when it has no architecture page. An owner with neither gets +`docs/design/plugins/.md`, +created from the [design template](design.md). A plugin with several owners has one document per +owner; the plugin's row in the index of the tree holding its design links each of them. The delivery part is +temporary and goes into the owner's issue. A new owner uses the [design template](design.md) alone. + +Write conclusions first. Name things directly instead of referring back. Do not restate rules or +describe how the document was produced. Link evidence next to the claim it supports. + +## Design part + +### Use and scope: responsibility split + +- The owner's responsibilities, in the owner's own vocabulary. +- The responsibilities that stay with callers as business logic. +- One row per caller requirement: + +| Requirement | Can callers compose it from existing operations without breaking the owner's invariants? | Handling | +| --- | --- | --- | + +An operation or parameter exists only where the answer is no. + +### Caller example + +The caller code after the change for each main intent. It shows the owner operations it calls and +the errors it handles, and nothing of the owner's internal mechanisms. + +### Own contract + +Each operation: the intent it serves, request and reply data, cancellation, and error kinds named by +what the caller can do next. For each operation that holds a resource or waits, a flow covering the +normal path, the caller cancelling or unloading, and the owner closing or reloading, with the party +that settles each resource. + +Ids, values, read-only views and callbacks cross owners. Where an object still has to be handed out, +say why none of those works, and link the design shared by the plugins involved that fixes who +creates, holds, hands over and cleans up the object, and what happens when any side closes or reloads. +A resource handle crosses only as a whole transfer: the receiver becomes its owner and settles it. + +The client protocol and user-visible behavior stay as they are. List any change with its reason and +the affected clients. + +### Supersedes + +The clauses of other designs that define this owner's surface, each replaced by a link to this +contract or removed in the same change. Other owners' clauses stay. + +### Exceptions with reasons + +One line each, only for a deviation §7 allows, such as an object handed out with its shared +lifecycle design. A current shape that differs from §7 is a gap for the delivery part, not an +exception. + +### Rule check and requirements raised to mechanism owners + +As in the [design template](design.md). + +### Binding appendix + +The `#[rutis::service]` block on the owner type for the owner's own face; for what the owner +registers with a mechanism registration point, the registration call instead. Then the request, +reply and error types. Error types serialize to the codes in the error table, callbacks are +direct parameters, and an operation bound to the calling row takes the caller. + +## Delivery part + +Written in the owner's issue; it is history once the change lands. + +- **Deletion list**: public methods, types, wrappers and catalog entries that must not exist after the + change. +- **Caller migration**: one row per call site, `caller | current call | target operation`. +- **Implementation task**: rewrite the owner's public surface; do not add an interface beside it. + Read the responsibility split, write the callers' target code as flow tests, make the old public + methods `pub(crate)` and use the compile errors as the migration list, implement the operations, + then migrate every caller. The owner's new operations, every caller and the removal of the old + surface are one change, with no period where old and new coexist. +- **Acceptance**: the flow tests pass; no cross-crate reference to a deleted name remains; the + catalog has no `internal(reason)` entry for the owner; the diff removes the old surface.