You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
基线:origin/mainc347bc34463a178ad3d1e28024a6a1457f8d62ba。对照的 open PR:#2029 head ce840afdb6193442229f99b03136108d7981456e(§7 评审后修订);#1963、#1306 的改动文件不含本范围所有者。
Activity
eric8810 commentedon Nov 22, 2026
基线:
origin/mainc347bc34463a178ad3d1e28024a6a1457f8d62ba。对照的 open PR:#2029 headce840afdb6193442229f99b03136108d7981456e(§7 评审后修订);#1963、#1306 的改动文件不含本范围所有者。1. 摘要
连接、协议入口、UI 注册三类资源的所有者边界与代码边界不一致:一条连接由 Transport 创建并写帧、由 Connection 索引、由 UiHost 写通知;hello 在 Transport 的帧循环里,其余内建方法与模型/会话分派落在 Connection 类型上。
serverControl与processActivity是同一生命周期的两个名字,空闲关闭在 Connection 的准入锁内跨三个所有者取事实,并把 Agents 的暂停守卫存进 ServerControl。callChannel复制了方法表已经知道的声明名,原生Caller把连接的写口带出所有者;uiHost、uiExtensions、connectionHub、serverControl是 catalog 名却只能从 Rust 调用,uiHost的六个操作还收&Connection/&ConnectionHub,在场读取代查UiHost的注册表。2. 职责与维护边界
Connection(
sessionClientsHost,以及 catalog 里的connectionHub)持有活连接的索引、每条连接的附件与出站队列、入站处理代次、hello/attach 与空闲关闭的准入锁、连接任务的跟踪器、WebEntry,并向分支部件给出某 Session 的客户端在场。连接套接字由 Transport 的 accept 任务创建。Transport 持有监听端点、socket 文件与锁、accept 循环、开始/停止 accept 的时机,并把监听器退出变成进程故障。每条连接的帧读取、hello 握手与错误回写写在
transport.rs的run_connection里。Rpc 持有内建方法的分派、管理方法与会话方法的查表、调用准入与命令排空。第一次 hello 的握手写在
transport.rs的帧循环里;Call枚举里的Ping、Shutdown、Create、ModelPreview等分支写在Connection::dispatch,模型与会话调用写在RpcService。ServerControl 持有宿主发布门、关闭意图与强制标志、监听器故障、延迟的关闭应答、暂停中的 Session 守卫;
ProcessActivity持有进程级工作的准入计数,作为第二个名字由同一插件提供。ManagementMethods 持有进程的命名空间表与注册检查;
MethodTable的条目按注册部件的ctx登记,部件卸载即撤下。root 提供三个进程值:Session 命名空间的保留名检查、守护进程的 peer id、凭据类环境变量名。
CallChannel 持有进程唯一的调用者索引(按行实例的声明名、按(实例,连接)的写口与按
callId的未完成调用),并对其他语言提供notify、closed。UiHost 持有界面注册表(
uiId、generation、连接、leaf)、替换声明与令牌、挂在进程根下的UiLeaf会话。UiExtensions 持有 UI 内容目录、修订号与各代次快照。UiResources 持有一个 Session 已发布文件的引用与读取。Report 在进程表注册
report、在会话表注册session.report,持有按调用连接为键的草稿与一次性生成。EnvironmentClientsBranch 只写自己分支的输入,无公开面。3. 目标形态
连接、协议入口与监听
跨插件只给 id。唯一的对象交接是 Transport 把 accept 到的流交给 Connection:Transport 交出后不再读写流本身,Connection 从接管起拥有读写与关闭;关闭时 Connection 先关流,Transport 再释放端点(目标形态「客户端接入一条连接」)。
意图分类:
accept(stream, entry) → connectionIdsettle(connectionId, reason)request(connectionId, request) → replywrite(connectionId, frame)gone(已关闭或代次卸载)、too_large、慢消费者关闭连接attach(connectionId, sessionId)、detach(connectionId, sessionId)unknown_connection、closedattached(connectionId, sessionId) → boolpresences(sessionId)、counts(excludeConnectionId)close_for_idle(excludeConnectionId) → counts | busybusy(带三项计数)close_all()listenAddresses.read() → boundAddressesinvalid_path颗粒度:Connection 拥有连接、写口、附件、在场读与关闭顺序;Rpc 拥有协议语义;Transport 只拥有监听端点。Connection 按请求调用 Rpc 的
request/hello,Rpc 按 id 调用 Connection 的write/attached/counts,UiHost 按 id 调用 Connection 的write。Transport 的 accept 循环把流交给accept,不持有连接。关停与准入
activated() → boolclosing()解析即关闭开始hold() → holdId、release(holdId)shutdown(force) → completioncompletion在排空后解析;重复请求conflict;强制关闭不回滚已受理工作fault(error)颗粒度:ServerControl 与 ProcessActivity 是同一插件、同一生命周期的两个名字,合成一个所有者与一个面。空闲关闭的暂停是
shutdown的内部步骤;Session 的暂停守卫归 Agents,不寄存在 ServerControl。命名空间注册与分派
register(namespace, declarations, call)reserved、duplicate、名称非法call(namespace.method, params, caller) → replyReport/Drain;错误unknown_method、service_reloading、service_unavailable、interruptedlisted()reservedMethods.check(namespace, declarations)reservedlocalId.id()credentialVariablesHost.variables()颗粒度:命名空间表比 Rpc 活得久(Rpc 重载不重载表),两者分开。注册行撤下后按行状态决定
service_reloading/service_unavailable的映射属于表,不属于调用方。连接绑定通知
notify(connectionId, callId, method, params)undeclared、gone、too_largeclosed(connectionId, callId)颗粒度:声明名属于注册(方法表已经保存),写口与回复后排序属于 Connection。独立的 CallChannel 所有者把两件别人的事实复制了一份。
UI 注册与内容
open(request)、attach(connectionId, request)、replace(connectionId, request)not_attached、ui_token、ui_in_use、ui_generation、ui_unknown、ui_leaf_failedstatus()(值)、close(uiId, reason)、notice(uiId, reason)notify送;无返回值detach(connectionId, sessionId)、release(connectionId)register(plugin, manifest?)、withdraw(plugin)、plugins()、refusal(plugin)、directory()(值)invalid_params、resource_unavailabledirectory()read(generation, path, offset, limit)resource_unavailable;Web 的 HTTP 路由是同一读取的传输适配publish(path, mediaType)、withdraw(ref)、read(ref, offset, limit)resource_gone、invalid_params、resource_unavailable颗粒度:UiHost 与 Connection 分开(界面注册比连接活得久,leaf 跟会话同寿),按 id 组合。UiExtensions 是进程内容所有者,UiResources 是 Session 资源所有者,生命周期不同,分开。
报告
prepare、plan、generate、cancelreport_not_found、report_plan_stale、report_busy、report_model_unavailable、report_generation_failed、report_cancelled、invalid_params(仅字段不合法)4. 现状对照
结论里的「目标形态:X」指第 3 节的哪一项。
connectionHubpub字段internal(control)accept/settle/write/attach/attached/detach/counts/close_for_idle/close_allcontrol/ui字段把 ServerControl 与 UiHost 转手给注入者,按不转手删除;catalog 条目按 service-faces §2.6 移出(调用方都是 Rust 部件)(目标形态:连接、协议入口与监听)sessionClientsHost.presencesdatapresences(sessionId)ConnectionHub::rpc与with_rpc/register/take_rpcrequest/hello;表按一次call分派with_rpc取当前处理器(transport.rs:736、web_entry/resources.rs:37),上传路由用with_rpc克隆管理表再自己provider().accept()(web_entry/uploads.rs:289),装配关闭时用take_rpc取处理器排空(lib.rs:1573)、Rpc 装载时用register登记(connection.rs:2639);目标是把取处理器迁到 Rpc 的request/hello,把表的分派迁到表的一次call,连接索引不再寄存处理器对象Connection::dispatch的Call分派requestConnection.senderwrite(connectionId, frame)sender;写连接是 Connection 的操作,这些写入迁到write后字段收为私有ConnectionHub::connection(id) → Arc<Connection>write/attachedConnectionHub::admitaccept内部listenAddresses.readdataread() → boundAddressespub unix_path/pipe_name/websocket_addressPathBuf/SocketAddr)read的回复serve在lib.rs:1418-1433读字段并复制进RunningServer;同一个值read()已经给出,公开字段是第二套形态,这些读取迁到read()的回复后删除serverControl与processActivityprocessActivity是data;serverControl否activated/closing/hold/release/shutdown/faultserverControl条目按 service-faces §2.6 移出(没有跨语言调用方),面并入processActivity(目标形态:关停与准入)pause/keep_paused/pausedshutdown的内部步骤;Session 守卫归 Agentsdefer_shutdown_reply+shutdown_repliesshutdown(force) → completionProcessActivity::take_hold#[service(skip)]),返回守卫对象hold()/release(holdId)managementMethods.register与ForeignMethodsdataregister(namespace, declarations, call)MethodTable::owner+MethodProvider::acceptDeref交给 Rpc;查找与准入分两步call(namespace.method, params, caller)owner/accept外,同一表面上的holds(connection.rs:587、connection.rs:2650、methods.rs:263)与provider(web_entry/uploads.rs:186、289、470)也在生产路径上被直接调用;这些调用迁到表的一次分派(查询并入同一次查找,上传路由不再克隆表后自己provider().accept()),MethodTable不再作为对象交给调用方(目标形态:分派一次客户端调用)reservedMethods.check与check_typedatacheck(namespace, declarations)localId.getdataid()rutis_bridge::LocalId类型键;没有调用意图credentialVariablesHost.variablesdatavariables()${NAME}扩展时不把宿主凭据展开进第三方配置(目标形态:读凭据变量名)callChannel.notify/closeddataCallersCallerconnectionId/callId的绑定uiHost的 open/attach/replace/status/shutdown/close&Connection/&ConnectionHubinternal(control)connectionId/uiId的操作uiHost的调用方都是 Rust 部件,catalog 条目按 service-faces §2.6 移出,六个操作按 id 留在私有键上uiHost.detach/release与finishedinternal(control);随uiHost移出 catalog 后为私有键detach(connectionId, sessionId)/release(connectionId)uiExtensions.plugins/refusal/register/withdrawinternal(control)uiExtensions.directory与subscribewatch::Receiverdirectory()值;修订变化用事实ui.extensions.listdirectory()的协议绑定ui.extensions.readuiResources.publishFile/withdraw与 crate 内readpublishFile/withdraw是datapublish/withdraw/read/api/ui/sessions/{id}/resources/{id}读同一个引用(目标形态:发布与撤回 Session 资源)session.ui.resources.readread的 RPC 绑定report.*与session.report.*invalid_params报,错误种类不属于调用方能改输入的那一类(目标形态:报告)5. 调用点
「违反哪条」一列只在判为违规时填具体条目。
run_connectionConnection::new后自己跑帧循环,写connection.senderhub.admit()守卫内调hub.with_rpc与follow_ui_extensionshealthhub.control、hub.tasks、hub.closingrun_ws、hub.control、hub.tasksCall::Shutdownidle_decision、count_except、attached_sessions、index.running_sessions、activity.pause、index.pause_sessions、keep_pausedCall匹配Ping、Shutdown、Create、ModelPreview分支hub.register/take_rpc/with_rpctable.owner(method)两次、loader.get(row)、acceptui.*处理器hub.ui.open/attach/replace/status/shutdown/close,收&Connection/&ConnectionHubsession.detachhub.ui.release/finished/detach,按 idhub.connection(id)后写connection.senderclient_presencesself.ui.is_leaf_connection、self.ui.is_disposingtui通道与“正在销毁”的判断sessionClientsHost.presencesClientsChanged总线事实managementMethods.registerreservedMethods的check_typecredentialVariablesHost.variables${NAME}扩展时不把宿主凭据展开进第三方配置processActivity.hold/releasesessionsProcessActivity::take_holdCaller::closedcallChannel.notify/closedui.plugins/register/withdraw/plugin_refusalfollow_ui_extensionsctx.get::<UiExtensions>()与subscribe()rpc.ctx.get::<UiExtensions>()与readui.extensions.list与/api/ui/extensions/...uiResources.publishFile/withdrawUiResources::read6. 有原因的例外
sessionClientsHost、credentialVariablesHost、reservedMethods是闭包形状的宿主端口:消费方在dim-agent-capabilities,提供方在 App Server,依赖方向决定契约类型只能住在下游(SessionClientsHost)。Callers没有 catalog 名字:方法契约 A.2 写明Callers是 CallChannel 与 Rpc 之间的私有接线,私有键本身不是目录问题(索引内容的拆分见第 4 节)(A.2)。reservedMethods在进程根上只有一份:shared 名字的 isolate 覆盖 dispatcher key,process_value的隔离覆盖类型键,一份进程值对所有 Session 表等价且只留一个 dispatcher(service-faces §4.9)。Key<UiExtensions>会让内容 owner 重载时重载 Connection,按代次断开所有连接;ADR 002 D3 允许对可选提供方每次调用查找,但查找要经本部件自己的 ctx,不经 Rpc 保存的 ctx(第 5 节把后一条判为违规)(Owners)。uiResources.publish_file收&Ctx:引用归属与清理必须绑定调用行的生命周期,不能由参数指定;跨语言由 rutis 取调用行自己的 ctx,进程内调用方受信任(publish_file)。UiResources::read:浏览器要普通 HTTP 字节流与 Range,HTTP 是所有者读取的一次传输适配,读的是同一个Reads计数(session.ui.resources.read的移出见第 4 节)(session_resource)。7. 建议与影响面
每个板块的改造把旧公开面在同一改动里删除,不设新旧并存的兼容期。
transport.rs的run_connection/run_local/run_ws(约 200 行)移入 Connection,web_entry.rs的 upgrade 调用点,ui_host.rs的两处通知,Connection.sender收为私有;connectionHub按 service-faces §2.6 移出 catalog(调用方都是 Rust 部件)。没有相关 open PR。Call全枚举的分派移出Connection::dispatch,Connection 逐请求查 Rpc 的服务;去掉hub.rpc与with_rpc/register/take_rpc。理由:hello、内建方法、模型与会话路由是协议语义,与连接生命周期无关;寄存对象让 Connection 读 Rpc 的内部字段。影响面:connection.rs(dispatch与所有rpc.*字段读取)、transport.rs的帧循环、single-tree.md的「RPC 接线」一段。没有相关 open PR。idle_decision交给调用方持锁再走三个所有者,锁内调用别人的pause_sessions。影响面:connection.rs的Call::Shutdown、control.rs的paused/keep_paused、agents.rs的pause_sessions。没有相关 open PR。presences只由 Connection 自己的连接记录组成;UI leaf 的归属由 UiHost 以进程事实交给 Connection,Connection 折叠成自己的在场值;读取期间一次只持一个所有者的锁。理由:client_presences直接读UiHost的注册表(is_disposing、is_leaf_connection),既代查别人的数据,又把连接索引锁与 UI 注册表锁叠在一起。影响面:client_presences、ui_host.rs的两个查询、ClientsChanged事实的发送点。没有相关 open PR。activated/closing/hold/release/shutdown/fault一处提供,pause/keep_paused/defer_shutdown_reply移回内部;shutdown(force)返回完成,调用方在完成时写应答。理由:同一插件、同一生命周期,两个名字是同一状态的两次暴露;存回调与存 Agents 的暂停守卫都把别人的对象留在 ServerControl。影响面:control.rs、connection.rs的daemon.shutdown、lib.rs的coordinate、transport.rs的control.fail;serverControl按 service-faces §2.6 移出 catalog(调用方都是 Rust 部件)。没有相关 open PR。ProcessActivity的公开面只留 id 形式。 方向:删掉take_hold,Agents 与sessions用hold()/release(holdId);守卫对象不再出所有者。理由:公开面上不能有只在 Rust 内可用的方法,同一组操作也不留两套接口。影响面:take_hold、agents.rs的五处调用、connection.rs的一处、sessions.rs的一处、control.rs的ProcessHold。没有相关 open PR。MethodTable不再经Deref交给 Rpc。理由:撤下命名空间后service_reloading/service_unavailable由注册行状态决定,这是表的契约;Rpc 现在拿表对象、取两次并自己映射。影响面:crates/dim-app-server/src/methods.rs的management_provider/dispatch/session_provider,crates/dim-agent-capabilities/src/methods.rs的MethodTable。没有相关 open PR。Caller只带connectionId/callId。理由:Callers复制了表的声明名,并把连接的写口转手给提供方;两处都要靠别人通知才能保持一致。影响面:methods.rs的CallSite/Caller/Callers,connection.rs的CallChannelPlugin/ForeignCallChannel;callChannel的名字与 wire 形状不变。没有相关 open PR。open/attach/replace/status/close收connectionId与请求数据;附着校验读 Connection 的attached,关闭通知走 Connection 的notify;调用方都是 Rust 部件,uiHost按 service-faces §2.6 移出 catalog,九个操作按 id 留在私有键上。理由:&Connection让 UiHost 读连接内部并写别人的出站队列;catalog 名不能只有 Rust 可调的方法。影响面:ui_host.rs六个方法、connection.rs的ui.*处理器、ui_leaf.rs的 leaf 启动(不变)。没有相关 open PR。subscribe()的watch::Receiver不再跨所有者。理由:内容登记与skillsCatalog、hooksService、mcpService同类,插件内容面按跨语言写;调用方要的是「目录变了」,要求调用方维持接收器是把新鲜度责任转给调用方。影响面:ui_extensions/mod.rs、connection/ui_extensions.rs、web_entry的 list 读取、npm声明。没有相关 open PR。listenAddresses只留read。 方向:删掉公开字段,装配与 CLI 读read()的回复。理由:同一个值两套形态;非 UTF-8 路径在read()是invalid_path、在 CLI 的json!是序列化失败。影响面:transport.rs、lib.rs的serve取地址处、cli.rs的启动输出——输出字段不变,只改读取来源。没有相关 open PR。localId移出 catalog。 方向:删掉get面,保留 root 上的rutis_bridge::LocalId值供握手读类型键。理由:仓库内没有调用方,也没有调用意图;回复是无类型字面量,npm/branch-services.d.ts没有localId的声明(LocalIdDispatch)。影响面:service-faces.md§3.1 的条目同步删除;移出在同一改动里完成,TypeScript 声明里没有localId,已生成的绑定不变。没有相关 open PR。ui.extensions.read与session.ui.resources.read,媒体与内容文件走 WebEntry 的 HTTP 路由(UiResources::read与UiExtensions::read保留为所有者操作)。理由:仓库内没有调用方,两条路读同一份数据。影响面:两个方法随同一改动从协议里删除,客户端与文档在同一改动里迁移;Web 已走 HTTP(ui.extensions.read、session.ui.resources.read)。没有相关 open PR。invalid_params只留给字段不合法。理由:调用方无法通过改参数修复,错误要按调用方下一步能做什么来分。影响面:crates/dim-report/src/draft.rs一处。没有相关 open PR。eric8810 commentedon Nov 23, 2026
目标契约:交付部分。设计部分见 #2095(head
fa2eea2c7)。扫描报告是第一阶段材料,结论以 #2095 与这条评论为准。十一份契约按所有者写:
Connection、Transport、ServerControl、Rpc、ManagementMethods、ProcessRoot、CallChannel、UiHost、UiExtensions、UiResources、Report。跨插件的操作只收 id;唯一的对象交接是 Transport 把 accept 到的流交给 Connection,生命周期写在 Connection 契约里。删除清单
改造后不得存在:
connectionHub(internal(control))、serverControl(internal(control))两行;sessionClientsHost改名为connection,localId行删除。processActivity、managementMethods、reservedMethods、credentialVariablesHost、callChannel、uiHost、uiExtensions、uiResources、listenAddresses保留为 data 行。ConnectionHub的公开方法与字段:config、with_rpc、register、take_rpc、entry_count、connection、closing、counts/count、count_except、attached_sessions、admit、idle_decision、attached_clients、client_presences、notify_clients、close;pub control、pub tasks、pub shutdown_requests、pub web、pub ui。Connection的公开字段sender与公开方法dispatch、is_attached、admit、admit_entry、channel、label;Attachment的公开可见性收为 Connection 内部。RpcService的公开字段index、ctx、management、loader、stopping、control、config、callers、mcp、commands、unloading,以及RpcPlugin的注册路径;connection.rs中Call枚举在 Connection 上的分派。ServerControl的全部方法(keep_paused、defer_shutdown_reply、complete_shutdown、open、opened、is_ready、shutdown、force、forced、fail、take_fault)与ProcessActivity::take_hold、pause;ProcessPause、ProcessHold类型。MethodTable经Deref交给 Rpc 的对象面:owner、provider、holds、listed、accept;ManagementMethods的Deref实现。CallChannelPlugin/ForeignCallChannel的独立行与Callers、CallSite、Caller、CallerConnection、CallNotification;原生Caller类型。UiHost的open/attach/replace/status/shutdown/close原签名(收&Connection/&ConnectionHub),以及is_leaf_connection、is_disposing、finished。UiExtensions::subscribe与watch::Receiver的跨所有者传递;UiExtensions::register的Package参数(改为插件 id 与声明的数据)。ListenAddresses的pub unix_path/pipe_name/websocket_address字段与LocalIdDispatch。localId.get。不删除:协议方法
ui.extensions.read、session.ui.resources.read(客户端协议不变,二者是所有者read操作的客户端绑定)。Report用invalid_params报“没有调用连接”的路径。不删除:
ConnectionPlugin/TransportPlugin/ServerControlPlugin/RpcPlugin/ManagementMethodsPlugin/UiHostPlugin/UiExtensionsPlugin/UiResourcesPlugin的装配与初始值;ClientPresence、BoundAddresses等值类型;fsHost/pluginFiles等其他所有者的名字;testing feature 的装配钩子(挂在私有类型上);UiHost.open/replace的expected_generation(客户端观察并确认的界面版本,属业务版本,不由所有者内部决定)。调用方迁移
transport.rs的run_connection/run_local/run_wsConnection::new后自己跑帧循环、写connection.senderconnection.accept(交出流后不再读写);Rpc 的hello/request由 Connection 调用transport.rs的三个 accept 循环与healthhub.control、hub.tasks、hub.closingprocessActivity.activated/closing/fault;任务由 Connection 自己的跟踪器持有web_entry.rs的 upgrade 与web_entry/resources.rsrun_ws、hub.control、hub.tasks、rpc.ctx.get::<UiExtensions>()connection.accept;uiExtensions.read(经 WebEntry 自己的 ctx)connection.rs的Call::Shutdownidle_decision、count_except、attached_sessions、index.running_sessions、activity.pause、index.pause_sessions、keep_pausedprocessActivity.holds(有进程工作时由 Rpc 答daemon_busy带说明、不带计数);connection.close_for_idle(running取 Agentssessions里 running 的计数,拒绝映射为daemon_busy的connections/attachedSessions/running);processActivity.shutdown;提交后由 Agentsquiesce暂停各 Session,running不撤销已提交的拒绝connection.rs的Call匹配Ping、Shutdown、Create、ModelPreview在 Connection 上分派rpc.requestRpcPlugin::apply与lib.rs的coordinatehub.register/take_rpc、rpc.commands排空methods.rs的management_provider/dispatch/session_providertable.owner(method)两次、loader.get(row)、provider.acceptmanagementMethods.call(Session 表按 #2026 的同形操作)web_entry/uploads.rsconnection.rs的ui.*处理器hub.ui.open/attach/replace/status/shutdown/close(self, &hub, ...)uiHost.open/attach/replace/status/shutdown/close(收connectionId与数据)connection.rs的连接结束与session.detachhub.ui.release/finished/detachuiHost.release/uiHost.detach(finished删除)ui_host.rs的通知hub.connection(id)后写connection.senderconnection.writeconnection.rs的client_presencesUiHost::is_leaf_connection/is_disposinguiHost发 leaf 归属事实,Connection 折叠为connection.presences的自己的状态connection/ui_extensions.rsrpc.ctx.get::<UiExtensions>()与subscribe()uiExtensions,监听uiExtensions/changed事件plugin_manager.rs的 UI 内容ui.plugins/register/withdraw/plugin_refusaluiExtensions操作(数据面)lib.rs的serve与cli.rs的启动输出get::<ListenAddresses>()后读字段listenAddresses.readlib.rs的 rootLocalIdDispatch、ReservedMethods、CredentialVariablesHostlocalId删除;reservedMethods.check、credentialVariablesHost.variables不变dim-report的处理器Caller::closed、SessionLifecycle::take_hold、TreeCommands读callChannel.closed、SessionScope 的hold/release(#2025)、TimelineTree 的有界读(#2024)EnvironmentClientsBranchsessionClientsHost.presencesconnection.presencesruntime/plugins/workflowprocessActivity.hold/releasewithHold回调不适用;id 由 run 的业务对象持有,行卸载时由所有者释放(见 ServerControl 契约的 Exceptions)runtime/fixtures/session-part.tscallChannel.notify/closed;progresscallChannel.run(回调)后的notify/progress/closed:绑定活到连接关闭或行卸载,调用返回后仍可发通知;closed只按连接 id实现任务
按 #2015「第二阶段」的次序做;新操作、全部调用方迁移与旧公开面删除在同一个改动里完成,不留新旧并存:
pub(crate),编译错误就是迁移清单;ConnectionHub、RpcService、ServerControl的公开字段先收为私有。#[rutis::service(name = ...)],删除Caller/Callers/CallSite、ServerControl对象、MethodTable的Deref、UiHost的句柄参数;connection.accept留在 crate 内并写明流的生命周期。ProcessActivity只保留hold/release的 id 形式,不加withHold回调:被接纳的工作跨调用存活;UiHost.open/replace的expected_generation保留为业务版本。CallChannel只保留run(带回调的调用)/notify/progress/closed,不保留bind/finish:绑定活到连接关闭或行卸载,调用返回后仍可通知;Connection把reply(调用回复)与write_after(通知)分开。sessionClientsHost→connection与删除localId随同一次改动完成。EnvironmentClients.md、service-faces.md§4.9、process-owner-operations.md、session-boundary.mdA.2(callChannel的调用方改为 Rpc 的bind与 Connection 的write_after)、插件页面、catalog.md、npm/branch-services.d.ts。connection、processActivity、rpc、managementMethods、reservedMethods、credentialVariablesHost、callChannel、uiHost、uiExtensions、uiResources、listenAddresses在 catalog 里是 data。验收
hold在行卸载时由所有者释放、release幂等、shutdown(forced)不等未释放的 hold;uiHost的expected_generation不符返回ui_generation;close_for_idle的拒绝在准入锁内提交,提交后 Agentsquiesce答running也不撤销;attach用 Agents 的leaseId租约,审批每条路径释放;close_for_idle在准入锁内复核并提交、快照之外的计数变化不撤销拒绝;accept的流在 Connection 关闭时结算、Transport 重载只关监听器、Connection 重载让新 accept 得到closing;write_after的帧在调用回复之后写出、too_large不关连接、slow关连接;attach/detach的租约在每条路径释放;managementMethods.call在命名空间撤下后按注册行状态回答、被中断的report调用返回interrupted;callChannel.notify/progress在声明外返回undeclared、连接关闭或行卸载后gone,调用返回后仍可发通知;run的绑定随连接关闭或行卸载移除,closed只按连接 id 等待;回复走connection.reply、通知走write_after;uiHost的open二十秒未附着关闭、replace在 generation 不符时ui_generation;uiExtensions的失败注册撤下旧代次并报拒绝;uiResources.publish的引用随调用行卸载释放,分页走 design(fileStorage): target contract #2080 的无状态read {path, offset, length} → {data, eof, size}(页 64 KiB,total取size,无 reader id);report的caller_required与stale。daemon_busy的connections/attachedSessions/running、service_reloading/service_unavailable/operation_interrupted、report_*、resource_*、invalid_path;断开连接不取消已接受调用;调用返回后仍可发通知;progress 保留。唯一变化是空闲关闭的窄窗口:提交后 Agentsquiesce答 running 时优雅关闭而不是拒绝(见 Connection 的 Client-visible changes)。sessionClientsHost、ConnectionHub的方法、RpcService字段、ServerControl、ProcessHold/ProcessPause、Callers/Caller/CallSite、MethodTable的owner/accept、UiHost的&Connection签名、LocalIdDispatch。catalog.md没有connectionHub、serverControl、localId、sessionClientsHost行,本板块所有者没有internal(reason)条目;connection、rpc、uiHost、uiExtensions、uiResources、callChannel、managementMethods、processActivity、reservedMethods、credentialVariablesHost、listenAddresses的方法表就是契约里的操作。cargo run --locked -p xtask -- check、graph、types通过,npm/branch-services.d.ts与生成快照已更新。eric8810 commentedon Nov 23, 2026
扫描报告是第一阶段材料,结论以 #2095 与交付评论为准。
eric8810 commentedon Nov 23, 2026
来自 #2019 的契约(#2096):Report 登记的一次性无重试完成由 Provider 的
providerService.invoke以Mode::Once覆盖——一次请求、不重试、不替换模型;请求体与选定模型由调用方给出,取消与 owner 关闭的结算沿用 Provider 的invoke流。Report.md 的Requirements raised to mechanism owners可以据此把模型路径列为已覆盖。docs(design): settle holds, generation checks and the consumer's split
docs(design): align connection with the Agents operations
docs(design): name the Agents lease id as leaseId
docs(design): run a table call under one call binding
docs(design): restore the client contract and settle the bindings
docs(design): use FileStorage's offset read
docs(design): align the call binding with the methods contract
docs(zh): follow the report contract's heading
docs(design): page UI resources with FileStorage's stateless read
docs(design): compile the table binding and bound the pages
eric8810 commentedon Nov 24, 2026
SessionMethods 的组织者决定(
/tmp/owner-split/decisions.md,第 24 轮):call保留Option<CallSite>→CallReply { reply, registration, settled },不采用 所有者扫描:Session 登记点与工具 #2026 旧评论里的{connectionId, callId}→MethodReply。理由:A.2 要求Connection::answer在写完 reply 后 finish 调用索引并等待 settlement;MethodReply没有这个句柄。MethodError增加Reserved(仅 management 注册)和call的invalid;两个表共用一套 kind。请 ManagementMethods 契约的
call同样返回CallReply,并在其 §7/Exceptions 里写CallRegistration;sessionMethodsPR #(待开)会引用这条。eric8810 commentedon Nov 25, 2026
已定决定
UiResources
stat加上无状态的read分页。