Files
proxycast/internal/exec-plans/refactor-v2-implementation.md
2026-08-02 04:28:14 +08:00

673 KiB
Raw Permalink Blame History

Refactor v2 多进程实施计划

status: historical evidence / superseded for current rendering work owner: refactor-v2-coordinator coordination: required started: 2026-07-12 execution: post-skeleton-refinement source plan: internal/research/refactor/v2/12-plan/slices.md architecture: internal/research/refactor/v2/04-target/architecture.md

2026-07-29 current rendering correction:本计划记录旧广义 Refactor v2 多进程切片与 dated evidence,不再定义 ConversationProjection、ItemRenderer 或 agentSession/* 的 current owner。当前渲染实施顺序、写集和退出条件以 internal/refactor/v2/IMPLEMENTATION-PLAN.md 为准;与 internal/aiprompts/architecture.md 冲突的旧 owner 声明只作历史证据。

2026-07-22 current correction:v0 ManagedObjective、agentSession/objective/*、旧 Objective client/DTO/GUI/Automation projection 与 managed_objectives storage 已 dead / deleted / forbidden-to-restore。唯一 current Goal owner 是 thread-owned canonical ThreadGoal,并通过 App Server v2 thread/goal/*、RuntimeCore continuation、durable budget/usage accounting 和 Thread/Turn/Item projection 继续演进。旧 S5 Objective slice 只保留为 dated execution evidence,不得按其 owner 分类恢复实现。

1. 主目标

在没有外部用户和历史兼容负担的前提下,按 v2 copy -> adapt -> delete 顺序实施 Codex-first runtime 重构,并让多个本地进程能够并行施工而不夹写、不抢占、不恢复旧路径。

固定产品链:

Electron Desktop Host
  -> App Server JSON-RPC
  -> agent-runtime / RuntimeCore
  -> model-provider + tool-runtime
  -> Thread / Turn / Item materialization
  -> thread-store / ProjectionStore / read model
  -> React GUI projection

OpenCode 只参与 provider/model/multimodal 和 package ownership 参照;Codex TUI 不作为 GUI 实现目标。

2. 协调角色

角色 唯一职责 是否可以改中央计划
coordinator 分配 slice、处理冲突、更新状态、收集 evidence、批准跨区变更 可以,只有一个进程
worker 只实现已领取 slice 的窄写集,提交独立 handoff 不可以
reviewer 只读检查边界、测试和删除证明 不可以
gate-runner 执行共享验证,记录当前工作树 scope 不可以

中央计划是协调者单写文件。worker 不直接编辑本文件的状态表,避免多个进程争用同一 Markdown 文件。

3. 共享协调目录

每个进程使用唯一 <slice>-<owner> 名称,不使用 PID 或模糊名称。协调文件不放进代码目录:

.lime/refactor-v2/locks/<slice>/owner       # 本地原子锁,不提交
.lime/refactor-v2/claims/<slice>-<owner>.md # 本地认领快照,不提交
.lime/refactor-v2/handoffs/<timestamp>-<slice>-<owner>.md # 交接证据,不提交

.lime 下的文件可以被任意进程读取,但不能加入产品构建图。若需要把交接纳入仓库事实源,由协调者把不可变摘要复制到 internal/exec-plans/ 的 evidence 文件,不把本地锁文件提交。

<slice> 必须逐字使用本计划写集表中的 canonical ID。禁止用单复数、缩写、recovery/final 后缀或同义别名另建平级锁;恢复与复核仍锁定原 canonical ID,阶段信息只写入 owner/claim。否则两个进程可能分别取得 S5a-host-capability 与 S5a-host-capabilities 这类同义锁并夹写同一写集。

3.1 原子认领

先创建目录再写 owner 文件;mkdir 成功才算拿到锁。两个进程同时认领同一 slice 时,只有一个能成功。

SLICE="S1"
OWNER="protocol-a"
LOCK=".lime/refactor-v2/locks/${SLICE}"

if ! mkdir "${LOCK}" 2>/dev/null; then
  echo "slice already claimed: ${SLICE}"
  exit 2
fi

printf 'slice=%s owner=%s pid=%s host=%s started_at=%s\n' \
  "${SLICE}" "${OWNER}" "$$" "$(hostname)" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
  > "${LOCK}/owner"

释放锁必须由原 owner 完成,并在 handoff 中写明 released_at。不得删除别人的锁、覆盖 owner 文件或用 git clean 清理锁目录。

3.2 认领前检查

worker 获锁前必须执行并保存结果:

git status --short -- <declared-write-set>
git diff --name-only -- <declared-write-set>
rg -n "<slice>|<path>" "internal/exec-plans/refactor-v2-implementation.md" \
  ".lime/refactor-v2/claims" 2>/dev/null || true

发现写集已有非本人改动、已有 claim、或路径属于其他 slice,立即停止,不通过临时副本绕开冲突。

claim 必须记录精确文件/函数范围、依赖的 handoff、只读集、避让集、最小验证和进程 PID/host。PID 只是诊断信息,所有权仍以唯一 <slice>-<owner> 和原子锁为准。

3.3 异常退出与陈旧锁

  • 锁没有自动超时。长测试、模型调用或暂停不能被当成失联。
  • worker 异常退出后,只能由 coordinator 恢复;其他 worker 继续避让该写集。
  • coordinator 必须同时确认 owner 进程已不存在、目标写集没有继续变化、最近 claim/handoff 已读完,才可把原锁标记为 stale 并重新分配。
  • 恢复时先写一份 status: stale-recovered handoff,记录旧 owner、判断证据和新 owner;禁止静默删除锁后抢占。
  • 若无法证明旧 owner 已退出,保持阻塞并改派不相交 slice,不以并行速度为由强占热区。

4. 写集分区

每个 slice 只能有一个 active owner。目录级写集必须进一步列出实际文件;“整个 src/”“整个 runtime/”不是有效认领。

Slice 默认写集 依赖 默认 owner
S0 事实冻结 internal/research/refactor/v2/01-current-facts/**、快照脚本 无 coordinator
S1 protocol/runtime app-server-protocol、agent-protocol、agent-runtime、相关 fixtures S0 protocol-a
S1b request serialization app-server/src/processor/request_serialization.rs、processor/mod.rs、processor/dispatch.rs、定向 tests S1 canonical review protocol-scope-a
S1-contract-correct canonical correction agent-protocol/src/lib.rs、agent-protocol/src/thread.rs S1 coordinator review protocol-contract-a
S1c production protocol cutover app-server-protocol 的 thread/turn/item method 与 schema、App Server processor、generated TS client、Renderer typed gateway S1 contract、S2 read model contract protocol-cutover-a
S1d package canonical consumer packages/agent-runtime-client/src/{runtimeClient,eventPipeline,sessionGateway,eventVerifier}.ts 与定向 tests S1c canonical notification runtime-client-a
S1e package API/test cleanup packages/agent-runtime-client/src/index.ts、compat middleware/export、tests/client.test.mjs S1d handoff runtime-client-cleanup-a
S2 materialization/store app-server/src/runtime/thread_item_projection/**、read_model/**、thread-store S1 projection-a
S3 provider lowering runtime-core/src/llm_protocol/**、model-provider/**、provider fixtures S1 canonical types provider-a
S3c provider consumer cutover media-runtime/src/image_request/openai_images.rs、media-runtime/src/video_worker.rs、agent-runtime/src/provider_turn.rs、app-server/src/runtime_backend/tool_events.rs、对应 fixtures S3 lowering spike、S1 event contract provider-consumer-a
S3d provider stream cutover model-provider/src/current_client*.rs、runtime-core/src/llm_protocol/{canonical,events}.rs、agent-runtime/src/provider_turn.rs、App Server provider event consumers、对应 fixtures S3c handoff、S1 canonical event contract provider-client-a
S3e media event cutover media-runtime/src/llm_events.rs 与定向 tests S3d ready-for-review provider-media-a
S3f legacy request mapper exit media-runtime/src/image_request/responses.rs、runtime-core/src/{lib,llm_protocol}.rs 与旧 mapper positive tests S3e ready-for-review provider-request-a
S3g-runtime-core-dual-algebra-retirement runtime-core/src/lib.rs、llm_protocol.rs、llm_protocol/{types,events,tests}.rs S3f canonical media cutover;与 active S2o/S7ab 无交集 provider-runtime-core-cleanup
S3h-model-provider-generic-lowering-retirement model-provider/src/lowering/{mod,common,anthropic_messages,gemini,ollama_chat,openai_chat,openai_images,openai_responses,openai_responses_image_generation}.rs S3f canonical media cutover;保留 current client 与 canonical media body provider-lowering-cleanup
S3i-provider-dual-algebra-retired-guard scripts/check-app-server-client-contract.mjs::checkRetiredRuntimeCoreMapperSurface S3g/S3h landed;只加 physical path 与 symbol guard,不改 provider behavior coordinator
S4 tool/MCP/skills/agent graph tool-runtime、mcp、skills、graph/store、approval projection S1、S2 Item contract、S3c event contract runtime-tools-a
S5 GUI/Electron src/components/agent/chat/** 精确文件、src/lib/api/agentRuntime/**、必要 host tests S2 read model、S3 capability、S4 tool display contract gui-a
S6 删除/守卫 legacySurfaceCatalog、command policy、mock policy、旧 fixture、文档链接 S1、S2-S5 对应 handoff governance-a
S7 收口 evidence、architecture confirmation、中央计划 S0-S6 coordinator

4.1 永久热区

以下路径同一时间只允许一个 owner,其他进程只能只读:

lime-rs/crates/app-server-protocol/**
lime-rs/crates/app-server/src/processor/**
lime-rs/crates/app-server/src/runtime.rs
lime-rs/crates/app-server/src/runtime/**
packages/app-server-client/**
src/lib/api/appServer.ts
src/lib/api/channelsRuntime.ts
src/lib/dev-bridge/**
scripts/check-command-contracts.mjs
src/components/agent/chat/AgentChatWorkspace.tsx

热区 owner 需要在 claim 中列出函数/模块级范围。没有 coordinator 明确拆分,不允许两个 slice 同时夹写同一个热区。

4.2 共享只读资源

Codex/OpenCode 外部仓库、internal/aiprompts/**、v2 research 文档和生成的测试报告对 worker 默认只读。重大架构 slice 的 handoff 被接受时,由 coordinator 在同一变更集中同步 internal/aiprompts/architecture.md;S7 只做最终确认,不允许把必需的架构更新统一拖到最后。

4.3 S2 并行拆分

S2 不允许继续以一个模糊的 materialization/store 写集施工。下一轮只能按以下文件边界认领;前三项可并行,后两项必须按依赖串行:

子 slice 精确写集 依赖与禁止交集
S2a store contract thread-store/src/{lib,store,types}.rs 定义 async storage-neutral typed store/page/cursor contract;不碰 App Server
S2b typed materializer app-server/src/runtime/thread_item_projection/{change_set,materializer,typed_tests}.rs,以及 thread_item_projection.rs 仅 module/export 接线 依赖 S1 item family;不碰 schema、ProjectionStore、read model
S2c event-log repair app-server/src/runtime/event_log.rs、对应 tests、projection_repair.rs 与独立 repair tests 负责 malformed/unterminated tail、fingerprint、gap/divergence、audit;不碰 ProjectionStore/schema
S2d SQLite typed store projection_schema.rs、projection_store.rs、projection_item_events.rs、projection_store_tests.rs 依赖 S2a/S2b;单 owner 保留现有 collision hardening,并接入 changeset、ordinal、opaque cursor
S2e read-model cutover load_context.rs、read_model.rs、read_model/** 定向 tests 依赖 S2d;只消费 typed store,JSON-RPC/schema/client 接线归 S1c
S2j-projection-thread-identity projection_store.rs、projection_store_tests.rs 后续 guard:session 首 event 必须提供 threadId;后续缺失字段只可精确继承既有 session owner;session/turn owner 冲突与 repair replay 冲突必须在同一 SQLite 事务 fail closed。不得修改 Electron Host、schema、MCP runtime 或 protocol。
S2l-canonical-history-repair canonical_thread_store.rs、projection_repair.rs、history Item ordering projection 与定向 tests EventLog 全量 replay 必须识别并原子替换已存在但 Item 不完整的 canonical history,保留 Thread metadata;Renderer 的 live/history 路径必须统一按 canonical ordinal 排列 Item,再以 mutable sequence 做同 ordinal tie-break。只从正式 Item lifecycle 决定 terminal,禁止从 turn.completed 合成 Message completion;不得修改 Electron、protocol 或恢复 projected fallback。
S2s-canonical-agent-message-content-parts agent-protocol::ThreadItemPayload::AgentMessage typed content parts、App Server materializer/merge/read model、schema/generated client 与定向 tests 对齐 Codex message content 数组与 OpenCode typed message parts,让 text/media/reference 随 canonical ThreadItem 持久化并进入 thread/read、agentSession/read。禁止把 raw provider payload/inline data URI 写入 Item,禁止 metadata escape hatch、presentation fallback 或第二 read model。

旧 timeline/store 只有在 S2e 与 S1c production consumer 均通过后才能交给 S6 删除;不得提前删除仍有真实 consumer 的 agent_timeline、session_repository 或 runtime snapshot 路径。

4.4 S4 首个并行切片

S4 broader contract 先从不依赖 App Server 热区的 tool core 开始。canonical ID 为 S4a-tool-core,精确写集如下:

子 slice 精确写集 退出条件与禁止交集
S4a-tool-core tool-runtime/src/{tool_definition,tool_executor,tool_result_projection,tool_io,lib}.rs、新增 tool_call.rs、tool_lifecycle.rs 与同模块 tests 绑定 spec/executor/exposure;ToolCall 带 turn/call/environment;host emitter 输出 success/text/structured content/duration/truncation/sidecar。只建 contract 与 fake emitter,不碰 collab_agent/**、lime-agent、App Server、protocol、GUI;生产 cutover 另开依赖 S4b display DTO 的后续 slice。
S4b-display-items agent-protocol/src/thread.rs、app-server/src/runtime/thread_item_projection/{materializer,change_set,typed_tests}.rs、app-server/src/runtime/tests/approval_decision_contract.rs 冻结 Tool/Approval/MCP/Collab/SubAgent display DTO,metadata 只保留 extension;补 create/update/terminal/replay merge,并修复 resolved-without-decision 误判。不得碰 App Server protocol/schema/client、read model、GUI 或 S4a/S4c 写集。

S1f-thread-read-protocol、S2e-canonical-write-path 与 S2e 已在 20260712T123500Z-S2e-canonical-write-read-coordinator.md 发布并完成验证,S4b-display-items 现已解锁。approval resolved-without-decision 的误判已登记到 20260712T120403Z-S4-gap-audit.md,归 S4b 一并修复。

4.5 S6 首个 store 删除切片

S2e canonical write/read 已完成,thread-store 内部零外部生产 consumer 的旧模块可以单独删除。canonical ID 为 S6a-thread-store-dead:

子 slice 精确写集 退出条件与禁止交集
S6a-thread-store-dead thread-store/src/{conversation_transcript,history_search,legacy_conversation,runtime_store,runtime_status_item,session_insights,lib}.rs 与对应内部 tests 重新证明无 crate 外生产 consumer后物理删除 module/export/positive tests并补缺失守卫;不得触碰 session_repository.rs、runtime_snapshot.rs、session_record.rs、task_board.rs、S2 current store.rs/types.rs 或 App Server/agent consumer。

4.5a S6 默认 MCP seed 删除切片

Codex 的未配置 MCP 状态为 empty map;Lime 的 current MCP 管理入口只承接用户显式创建、导入或启用的 server。历史 migration_v3 自动注入 @modelcontextprotocol/server-playwright 的行为不属于 schema 升级,也不属于 GUI 产品预设,必须直接删除而不是保留 compat cleanup。

子 slice 精确写集 退出条件与禁止交集
S6b-dead-default-playwright-mcp-seed core/database/{mod,startup_migrations}.rs、migration_v3.rs(删除)、legacySurfaceCatalog.{json,test.ts}、S6b evidence fresh database 不生成默认 playwright 行;module/export/startup dispatch 不在编译图;旧包、marker 和调用受 dead guard 保护;不得删除或按名称重写显式用户 MCP,且不触碰 App Server runtime、Electron 或 Renderer。

4.5b S6 重复 agent session store 删除切片

App Server RuntimeCore、ThreadStore 与 ProjectionStore 已是 session CRUD、Thread/Turn/Item 持久化和 read model 的唯一 current 链。lime-agent/session_store family 仅在自身与 crate-root re-export 中循环,既无跨 crate 生产 consumer,也不承接 GUI/JSON-RPC 主链,必须整体删除,不能保留 compat public API。

子 slice 精确写集 退出条件与禁止交集
S6c-dead-agent-session-store agent/src/{lib,session_state_snapshot,session_store,session_store_*}.rs(删除)、agentMigrationBoundary.test.ts、legacySurfaceCatalog.{json,test.ts}、S6c evidence 删除 module/export、CRUD/read/subagent aggregation 及内嵌正向 tests;lime-agent 与 app-server/lime-scheduler/lime-server 反向依赖编译通过;路径、module/export 与旧符号由 dead guard 阻止回流。不得触碰 App Server runtime/event_store/runtime_backend、Electron、Renderer 或 current thread-store session repository/runtime snapshot/task board。

4.5c S6 无调用 Lime-Agent runtime sidecar 删除切片

App Server RuntimeCore、ThreadStore、ProjectionStore 与 agent-runtime 是唯一 current runtime 链。lime-agent 内没有 Rust caller 的 execution-strategy compat、local subagent sidecar、 aggregate execution runtime 和 direct session query 不是过渡 owner,直接删除并以 guard 禁止恢复。

子 slice 精确写集 退出条件与禁止交集
S6e-dead-rust-execution-strategy-compat agent/src/{lib,execution_strategy_compat}.rs(删除)、agent migration/catalog guards、S6e evidence Rust compat normalizer 与 module declaration 必须离开编译图;React typed request/lowering 与仍有 renderer caller 的 TypeScript executionStrategyCompat.ts 保持 current/compat 原状;不得触碰 App Server、Electron 或 Renderer。
S6f-dead-agent-subagent-sidecars agent/src/{lib,subagent_control,subagent_profiles}.rs(删除)、agent migration/catalog guards、S6f evidence local queue、旧 extension、profile/skill DTO 物理删除;agent-runtime/session_execution generic DTO 与 App Server canonical graph/mailbox/Thread projection 保持唯一 current chain;不得触碰 legacy Team GUI 或 App Server runtime。
S6g-dead-agent-runtime-aggregate agent/src/{lib,session_execution_runtime,session_execution_runtime/runtime_payload}.rs(aggregate-only 删除)、runtime/catalog guards、S6g evidence aggregate builder、metadata parser、permission fallback 与专属 DTO 必须离开编译图;保留 AgentEvent task/routing/limit/cost DTO 和 App Server read-model projection;不得修改 protocol、Electron、Renderer 或 wire。
S6h-dead-agent-runtime-session-query agent/src/{lib,session_execution_runtime,session_execution_runtime_query}.rs(query 删除)、agent migration/catalog guards、S6h evidence direct agent_sessions execution runtime query、module、alias/re-export 必须删除;App Server session_metadata read model 与 agent-runtime generic projection 保持 current,token usage projection 不受影响;不得触碰 App Server runtime、Electron、Renderer 或 protocol。

4.5d S6 Renderer fake Team 删除切片

RuntimeCore AgentControl 与 canonical Thread/Turn/Item 是 Multi-Agent 成员、活动和状态的唯一事实源。 Renderer 不得根据 selected Team、输入长度或正则在发送前宣布组队成功,也不得伪造成员、work-board 事件或 assistant preview。

子 slice 精确写集 退出条件与禁止交集
S6i-dead-team-formation-preview useRuntimeTeamFormation、teamFormationAgentUiProjection、send preview helper/state、shell preview flag 与对应正向 tests fake formation、虚拟成员、runtime-team-dispatch:* 消息和 preview layout 输入物理删除;发送直接进入 current Agent runtime,canonical child Thread/Item GUI 保持不变;负向 boundary guard 禁止回流。
S6j-dead-team-runtime-sidecar team-workspace-runtime/**、useTeamWorkspaceRuntime、session/control wrappers、teamWorkspaceRuntime 与对应 tests/i18n 删除 raw status/stream 订阅、本地 live/draft/tool/queue map、restored synthetic facts 和 unavailable control stubs;Workspace 只从真实 child facts 派生标题/可见性并直接委托主输出 stop;canonical reader/projection/timeline/navigation 不得删除。
S6k-canonical-child-roster App Server canonical thread/list、canonical child selector/hook、Harness/Workspace roster wiring 与 focused tests 成员和状态只读 canonical child Thread/lifecycle,保留 threadId/sessionId;不得恢复 raw Team sidecar、mock 或旧 roster owner。与 S6l 并行时拥有 AgentChatWorkspace roster wiring。
S6l-thread-first-subagent-navigation-guards current thread/read session identity helper、Workspace navigation hook、project-thread/dead/i18n/scenario guards 与 current docs canonical activity 的 child ThreadId 必须解析真实 sessionId 后导航,真实 roster sessionId 直接进入 session view;修复 S6j 漏跑 ENOENT guard,补 sidecar 回流 monitor,不触碰 raw status API/roster DTO 删除。
S6m-raw-subagent-channel-retirement raw status sync effect、runtime adapter alias、status/stream event API、DevBridge truth prefixes、stale fixture 与 dead-channel guard agent_subagent_status:* / agent_subagent_stream:* 无 producer/consumer,必须从生产订阅、API 与 mock policy 删除;generic agentSession/event transport、canonical read refresh 和 child roster 保持 current。
S6n1-raw-subagent-status-parser-retirement Renderer raw status parser、Agent UI dispatcher、正向 parser/projector tests 与负向 fail-closed guard subagent_status_changed 不再进入 Renderer typed event 或 Agent UI projection;canonical SubAgent Item、runtime status team projection 与 generic historical EventLog read 不变。本切片不冒充 raw type/package/fixture 已物理删除。
S6n-raw-subagent-type-package-fixture-retirement raw status TS type/local projector、projection package helper/barrel/runtime facts、summary/i18n/fixture 正向口径、docs 与回流守卫 raw status 类型、独立 local/package projector、fixture producer、summary/i18n 和正向文档全部物理删除;canonical run.status、SubAgent Item、thread/list child lifecycle 与 generic EventLog/hydration 保持 current。runtime Team snapshot 后续由 S6n2 直接删除,legacy roster DTO 不混删。
S6n2-synthetic-team-projection-retirement Renderer runtime lifecycle/team-control projection、projection summary 正向 label/fixture、package runtime-facts dead helper、README 与回流守卫 runtime_status -> team.changed 和 Team control synthetic Team snapshot 物理删除;runtime status 只输出 run.status/permission,Team control 只输出 task.changed/agent.handoff,canonical SubAgent Item、child Thread 与 queue facts 保持 current。
S6o-legacy-subagent-roster-dto-retirement team-memory shadow legacy child/sibling metadata、selected-team memory runtime wiring 与 focused guards 删除无 current consumer 的 team.subagents / team.parent_context shadow entries、legacy roster DTO 类型依赖与 Workspace memory-runtime 传参;保留 team.selection 和 canonical child Thread roster。不得删除 canonical roster/projection/navigation 或恢复 raw status/stream。
S6o-canonical-gui-fallback-retirement Harness delegation/status、AgentRuntimeStrip 与 Workspace Harness 的 canonical child roster 接线 GUI roster surfaces 只消费 CanonicalChildThreadSummary[],删除 legacy list、DTO prop、状态 helper 与 fallback;不改变 canonical child Thread、navigation、session state 或 protocol。
S6p-a-canonical-navigation-and-runtime-strip-fallback-retirement useWorkspaceSubagentNavigationRuntime legacy known-session 分支、AgentRuntimeStrip legacy roster 统计、对应 fixture、Workspace wiring 与 boundary guard SubAgent 导航只接受 canonical child ThreadId,命中 roster sessionId 直达,缺失时通过 current readThreadSessionId 解析;runtime strip 只消费 canonical child summaries。Harness delegation/status fallback、Task Rail stats、session state 与 legacy DTO 仍留给后续独立切片。
S6q-canonical-task-rail-subtask-stats Workspace scene -> Task Rail runtime -> Task Center Toolbar -> Task Rail ViewModel canonical child summaries 与定向 tests Task Rail 子任务统计只消费 canonical child 七态:pendingInit/running 为 active,completed/shutdown 为 completed,errored/notFound/interrupted 为需处理;删除 Task Rail 的 childSubagentSessions 输入。MessageList、Inputbar、Harness 与 session DTO 不混入。
S6r-canonical-inputbar-subtask-stats Workspace scene -> landing task card / MessageList / Inputbar runtime status canonical child summaries 与定向 tests landing、MessageList、Inputbar 子任务统计只消费 canonical child 七态;删除这些 surface 的 childSubagentSessions 输入和 projection deferral 搬运字段。session state、normalizer、API fixture、Rust metrics 留给后续 contract 切片。
S6s-legacy-subagent-session-contract-retirement React session state plumbing、Renderer session API/normalizer/fixture、canonical parent identity、Rust export active count 与三条窄 claim 物理删除 child/sibling/parent session roster DTO 与 state;API spread 不得穿透旧 roster;parent visibility 只读 canonical thread family;export activeSubagentCount 保持输出契约但只读 canonical AgentGraph/open child status。
S6u-post-s6-team-memory-shadow-and-selection-retirement completed follow-on;Renderer shadow/TeamDefinition owner、共享 request/projection 入口、Rust session/read-model/schema consumer 已按顺序删除;负向 guard 与证据已补齐 本地 Team memory shadow、无执行消费者的 recent_team_selection 和 selected-team metadata 已物理退出 current 构建图;ContextPacket/file-backed memory 的 typed team_memory_refs、AgentControl/canonical child Thread 继续作为唯一 owner。guard-only 旧字段仅用于阻止回流,不再作为 producer、read model 或正向 fixture。证据:2026-07-15-s6u-team-memory-selection-retirement.md。
S6v2-workspace-agent-team-settings-retirement completed follow-on;src/types/workspace.ts、Rust WorkspaceSettings 及其正向 serde/GUI fixture 无 current consumer 的 agentTeam / selectedTeam / customTeams workspace 设置 DTO 已物理删除;Workspace 只保留 MCP、provider、压缩和多媒体设置。harnessRequestMetadata、compaction 中同名旧字段仅作为 negative guard 保留,不得重新生产。证据:2026-07-15-s6v-workspace-agent-team-settings-retirement.md。

4.5e S7 post-skeleton gate correction

S7 skeleton closeout 后继续按 smart Vitest 失败点做窄写集修正。测试只能跟随 current 事实源, 不得为了恢复旧断言而把 retired 路径、重复规则文案或旧 package entrypoint 写回生产和文档。

子 slice 精确写集 退出条件与禁止交集
S7a-electron-ipc-contract-ordering electron/ipcChannels.test.ts 的 truth-bridge exact-set expectation 只把已排序的期望数组改为确定性字典序;生产 command catalog、preload、host、App Server、catalog/mock 均不变。focused 与 smart batch 9 必须通过。
S7b-current-electron-guard-alignment scripts/electron/current-entrypoints.test.mjs、scripts/electron/current-rules-guard.test.mjs renderer alias 断言跟随 current browser.ts;根规则只断言仓库级 owner,retired 细节只在 internal/roadmap guard 检查;质量断言绑定 Gate A/B、GUI smoke 与 no-mock 语义。不得修改生产 Vite、AGENTS、aiprompts 或 skill。
S7c-app-server-runtime-guard-currentization src/lib/governance/appServerRuntimeBoundary.testSupport.ts、src/lib/governance/appServerRuntimeBoundary.test.ts、internal/roadmap/appserver/app-server-agent-runtime-boundary-governance.md 修正 lime_agent::/CollabAgentState/registry wrapper 误报,排除 test-only;正向断言 current stream_current_provider_turn、session_configuration、workspace_patch_host、tool-runtime owner。不得放宽真实 boundary,不得触碰 active Rust 实现。
S7d-image-command-events-split lime-rs/crates/app-server/src/runtime_backend/image_command/mod.rs、新增 image_command/events.rs、模块 tests/exports 将 262-908 行 canonical image/tool/turn event projection 抽到 current events owner,mod.rs 保持 <=800 行 workflow facade;不改协议、provider、GUI 或 S2l 文件。
S7e-runtime-value-fields-split lime-rs/crates/app-server/src/runtime.rs、新增 runtime/value_fields.rs、module/tests/exports 将 runtime.rs 652-738 的 id/JSON/timestamp helpers 抽到 current value_fields owner,runtime facade 保持 <=720 行;不触碰 canonical history/store/projection 或 S2l 写集。
S7f-runtime-backend-execution-trait-split runtime_backend.rs、新增 runtime_backend/execution_backend.rs 与边界/contract guards ExecutionBackend trait 适配整体迁入 current 子模块,root facade <=480 行;不改变 turn/message lifecycle、协议或 provider 行为。
S7h-batch40-current-fixture-alignment agentProtocol.test.ts、agentRuntimeEvents.test.ts Approval 只接受 canonical request ID,Thread/Turn/Item lifecycle fixture 只走 canonical envelope;不得恢复 raw dual-ID、synthetic terminal/tool fan-out。
S7i-plugin-runtime-thread-fixture-alignment pluginRuntime.test.ts Plugin task start/get/cancel fixture 保留 canonical threadId;不得恢复 session-only task lookup。
S7j-plugin-capability-thread-fixture-alignment Plugin capability dispatcher test fixture Capability Host fixture 的 start/cancel 使用同一 canonical threadId;不改 production host。
S7k-client-factory-session-read-owner-alignment clientFactory.test.ts standard client 只注入 turn lifecycle,session read 仍由 App Server session owner 承接;不得路由到错误的 readThread mock。
S7l-plugin-host-bridge-thread-fixture-alignment Plugin Runtime Page Host Bridge fixture/test task refresh 改读 canonical thread/read(full);不得恢复 session-only refresh。
S7m-image-workbench-boundary-guard-alignment Image Workbench boundary guard 守卫对齐 Workspace -> SendSurface -> ImageRuntime current 组合链;不改 GUI 行为。
S7n-agent-chat-current-api-fixture-alignment index.testFixtures.tsx Skills fixture 走 execution current API,工具库存 mock 绑定 inventoryClient;不得扩展 compat root barrel。
S7o-live-reasoning-unsequenced-tool-order historical reasoning content sync 与 unit tests 历史切片曾让无 position Tool 的到达顺序参与 production reasoning 排序;S7x 冷审确认该输入不可能通过 current canonical reader,现已 superseded,不能作为 current 规则或正向 fixture。
S7p-stream-binding-canonical-lifecycle-fixture-alignment stream binding / tail recovery tests 正向 fixture 全部补 canonical Item/Turn envelope,production raw lifecycle 继续 fail closed。
S7q-runtime-sync-canonical-turn-fixture runtime sync effects terminal fixture completed Turn 通过 canonical turn/updated 触发 deferred reconcile;不清 mock、不改 production fallback。
S7r-canonical-tool-order-fixture-alignment runtime handler integration fixture WebSearch -> Reasoning -> WebFetch 顺序来自 canonical Tool/Reasoning Item sequence,不恢复 raw tool start/end。
S7s-streaming-renderer-checkpoint-mock-owner StreamingRenderer test mock checkpoint restore mock 绑定 current threadClient owner;不恢复 agentRuntime root compat mock。
S7t-vitest-smart-targeted-state-isolation smart runner 与 runner unit tests --only-batch / --list-batches 不写 resume state;该 runner slice 从冲突的旧 S7i 治理编号迁入 S7t,旧 claim 保留为 superseded evidence。
S7u-image-title-current-owner-fixture Image Workbench action shared test fixture 标题生成 mock 绑定 current agentClient;不改 production local fallback。
S7v-inputbar-objective-current-owner-fixture Inputbar/index.test.tsx objective persistence mock 绑定 current objectiveClient;plan/goal metadata 与 production send 保持不变。
S7x-canonical-reasoning-position-only agentStreamReasoningContentSync.ts 与 unit test 删除由无 position Tool arrival order 决定 production reasoning 顺序的特判和 sentinel 正向 fixture;只保留 canonical ordinal/sequence、稳定 Item identity 与 reasoning 位于正文前的 GUI 规则。不得回退 S2l ordinal-first、恢复 raw lifecycle 或修改 projector/reader。
S7y-approval-cold-read-typed-response runtime/read_model.rs、新增 runtime/read_model/approval.rs、read model tests、canonical Approval projector、timeline Approval view-model/tests cold/live terminal Approval response 输出 canonical { decision, decision_scope, reason_code },pending 不输出 response;wire 保持 approved/approvedForSession/denied/timedOut/abort,仅 GUI view-model lower 为现有显示值。不得新增 method、IPC、mock、legacy scalar parser 或触碰 conversation import/materializer。
S7ad-content-factory-action-identity-fixture completed / focused-and-Gate-B-validated / released / synthetic-probe-superseded-by-S7ae workflow/read 只发布匹配 canonical pending action 的 respond;Content Factory fixture 不再伪造 action.required 或调用无 continuation 的 workflow/respond。S7ad 曾用 typed metadata 修正后序 contract probe;该重复 synthetic probe 已由 S7ae 整组删除,不再是 current Gate B 组成。
S7ae-content-factory-synthetic-contract-probe-retirement Content Factory Article Workspace fixture、scenario assertions/constants/domain guard、no-synthetic-action regression guard 与 plugin worker focused Rust tests 删除产品闭环内额外制造的 contract-mismatch Turn、等待器、summary、专用常量和正向 assertion;plugin worker output contract 由 Rust fail-closed 测试承接,通用 worker failure read-model 测试承接投影,Content Factory Gate B 只验证真实成功 worker、真实失败 worker evidence、workspace、workflow control 与 GUI 恢复主链。不得修改生产 runtime、协议、Renderer 或恢复 mock/fallback。
S7af-code-artifact-recovery-turn-identity-fixture scripts/electron/code-artifact-workbench-fixture-smoke.mjs 与对应 guard test recovery Turn 的 tool/file/patch/command/test execution identity 必须按 Turn 唯一;初轮失败 operation ID 只作为 recovery source reference。失败路径同样写当前 backend ledger。不得放宽 canonical cross-Turn Item fail-closed、修改 Runtime/ThreadStore/read model 或新增 ID normalization fallback。

4.6 S1 canonical live producer 收口

S1c Renderer sequence gate 已只接受完整 canonical entity,但生产 App Server notification 仍直接包装 raw AgentEvent。canonical store 已写入不等于 live notification 已 canonical;不得让 GUI 恢复 ID normalization 或 lifecycle synthesis。

子 slice 精确写集 退出条件与禁止交集
S1g-canonical-live-producer app-server-protocol/src/protocol/v0/agent_session.rs、app-server/src/runtime/event_store.rs、app-server/src/processor/tests/event_notifications.rs、app-server/src/runtime/tests/turn_lifecycle.rs 依赖 S4b 释放 App Server protocol/generated schema 热区。EventStore 在持久化前用 canonical materializer 为 notification clone 生成完整 Turn/Item,materialization 失败必须在落盘前 fail-closed;durable internal event 不得因嵌入 canonical clone 改写 source payload。将 current turn.canceled 投影为 TurnStatus::Interrupted,删除协议层无生产来源的 turn.interrupted 接受分支。不得碰 S4b materializer/display DTO、Renderer 或生成 schema/client。

4.7 S4 production tool lifecycle 接线

S4a contract 已通过测试,但代码级审计证明 RuntimeTool::execute_call 与 ToolLifecycleEmitter 只有测试 caller。current provider 生产链仍在 agent-runtime/provider_turn.rs 直接调用 executor 并手工生成 start/end;先迁执行 owner,再迁出旧传输 DTO,避免与 S4b display contract 夹写。

子 slice 精确写集 退出条件与禁止交集
S4c-tool-production-wiring agent-runtime/src/provider_turn.rs、agent/src/current_provider_turn.rs 与两文件内嵌 tests 让 current provider 为每个 call 绑定 RuntimeToolDefinition + RuntimeToolExposure + RuntimeToolExecutorHandle,构造带 canonical turn/call/environment 的 ToolCall,由 host channel emitter 唯一发 started/completed;模型 transcript 使用 normalized output,保留 structured content、duration、truncation、sidecar 与 metadata。删除 CurrentProviderTurnEvent 手工 ToolStart/ToolEnd 生成,但本 slice 不改 App Server、S4b DTO 或旧 AgentEvent wire enum。
S4d-tool-wire-delete agent/src/{protocol,current_provider_turn,write_artifact_events,lib}.rs、agent/src/agent_tools/{mod,workspace_patch_host}.rs 并删除旧 workspace_patch_runtime_adapter、tool_lifecycle/**、tool_orchestrator/**;app-server/src/runtime/thread_item_projection/{materializer,typed_tests}.rs、app-server/src/runtime/{event_store,tool_lifecycle,tool_lifecycle_tests}.rs、app-server/src/agent_ui_sequence_verifier.rs(含内嵌 tests)、app-server/src/runtime_backend/{tool_events,tool_process_runtime_metadata,coding_events,workspace_patch_host_execution,workspace_patch_host_tools}.rs 与对应定向 tests;视零 consumer 结果删除 tool-runtime/src/tool_batch.rs 并清 lib.rs;同步 contract/governance guards 与架构确认 必须等待 S1g 释放 event_store.rs。host emitter 直接构造 S4b canonical Item,materializer 保真接收 nested Item,lifecycle/sequence guard 同步迁到 item.started/updated/completed,workspace patch 直连 RuntimeTool;最后物理删除 AgentEvent::ToolStart/ToolEnd 和旧 orchestrator/emitter。不得碰 GUI raw consumer;S5 后续只消费 canonical Item。

S4c 完成后必须执行 canonical S4d-tool-wire-delete。该 slice 将 host emitter 直接投影为 S4b canonical Tool Item,并迁移 workspace-patch 唯一旧 orchestrator consumer与 App Server lifecycle guard,最后物理删除 AgentEvent::ToolStart/ToolEnd、旧 agent_tools/tool_lifecycle emitter 与 App Server raw tool mapper。S4d 未完成前 S4 仍为 production cutover pending,不得把旧 wire DTO 改称 compat owner。

4.8 Canonical Tool durable consumer 收口

S4d live producer 切到 item.started/updated/completed 后,第二轮 provider transcript、大输出持久化和 thread_read.tool_calls 必须同步消费 typed ThreadItemPayload::Tool。S4e 已删除 read-model imported raw fallback;conversation import 必须在 commit 边界一次性 lowering 成 canonical Item,不得再用 raw bypass 或 duplicate live event 维持 consumer。

子 slice 精确写集 退出条件与禁止交集
S4e-canonical-tool-consumers app-server/src/runtime/provider_history.rs、output_refs.rs、tool_item_projection.rs、tool_item_projection/extract.rs 与同文件/紧邻定向 tests provider 第二轮历史保留 canonical ToolCall/ToolResult,nested ToolOutput 可落 sidecar 并 hydrate,thread_read.tool_calls 使用 callId/typed output;不碰 conversation import、evidence、GUI 或 active approval restart 写集。此前 import-only raw 退出条件已由 S4i-S4m 完成,不再保留 compat。
S4f-image-command-canonical-tool app-server/src/runtime_backend/image_command/{mod,tests}.rs、runtime_backend/tests/turn_flows.rs image command 只发 canonical Tool Item,保留 image-task/workflow/turn 领域事件、scope、arguments、text/structured output、error、metadata 与 duration;生产 raw tool lifecycle 清零。
S4g-current-tool-approval-identity tool-runtime/src/tool_executor.rs、agent/src/current_provider_turn.rs 与紧邻 tests execute_call 显式绑定 typed call/turn identity,current executor 持有 canonical thread identity;approval/request-user-input 禁止 metadata 反推和 session-as-thread fallback,真实 confirmation resume 回归通过。
S4h-delete-live-tool-args app-server/src/runtime_backend/tool_events.rs、runtime/{event_store,tool_lifecycle,tool_lifecycle_tests,projection_item_events}.rs 与 stale fixtures/contract guard 删除 canonical ItemStarted 后额外合成的 live tool.args;arguments 唯一来自 nested typed Item,EventStore 对 raw tool args fail-closed。
S4i-conversation-import-tool-items app-server/src/runtime/conversation_import/{commit,commit_events}.rs、conversation_import/tests/runtime_events.rs、runtime/{event_store,projection_item_events,tool_item_projection}.rs、external canonical tool tests 与 contract guard 已完成:Codex import 内部中间态在 commit 的真实 session/thread/turn identity 边界 lowering 为 item.started/item.completed;arguments/output/error/provenance/预算与 incomplete lifecycle 保真。已删除 is_imported_tool_wire_payload bypass、raw projection allowlist 与正向 compat test;outer AgentEvent identity/sequence/time 是 nested Item projection 的事实源。
S4i4-canonical-media-reference-fixture-lifecycle scripts/agent-runtime/claw-chat-current-fixture-backend-script.mjs media-reference 分支、既有 smoke guard、evidence/handoff test-only external backend 的媒体 AgentMessage 必须先发同 ID item.started 再发 item.completed;保持 contentParts/reference、GUI/read model 与 sidecar 断言不变。不得修改生产 Rust/GUI、恢复 raw Message lifecycle 或加入 mock fallback。
S4j-import-typed-draft app-server/src/runtime/conversation_import/{codex,commit_events}.rs 与其定向 tests 已完成:Codex ResponseItem/EventMsg/item_completed(TurnItem) Tool 先进入 typed draft;selector、normalizer、预算和 commit lowering 不再解析 raw Tool JSON。缺失 call ID 按 source sequence 唯一补齐,重复 lifecycle 幂等,terminal-only/incomplete 使用隔离的 synthetic draft;structured output 保真。commit_events.rs 从 922 行拆为 675 行入口、362 行 lowering 和独立 tests。StoredSession canonical wire、raw bypass 与 GUI/read fallback 均未恢复。
S4k-evidence-canonical-tool-consumers app-server/src/runtime/{provider_history,context_compaction,evidence_provider}.rs、evidence_provider/**、紧邻 evidence export tests 与 contract guard 已完成:provider transcript、compaction 与 coding/Skills/MCP/browser/artifact evidence 统一消费 nested canonical Tool Item;共享 typed view 保留 call ID、ItemStatus、arguments、metadata、structured output、output ref 与 MCP server identity。raw lifecycle 生产 consumer 和旧正向 fixture 已删除,非 lifecycle tool.output.delta side-channel 保持原语义;999 行 browser action index 已按 extraction/presentation 拆为 528/390/100 行。
S4l-mcp-step-snapshot tool-runtime/src/mcp_connection/**、tool_extension.rs;agent-runtime/src/provider_turn/**;agent/src/current_provider_turn/**、mcp_bridge.rs;mcp/src/{manager,bridge_client}.rs;tool execution fixture 每个 sampling step 同时冻结 definitions、allowlist、caller policy、route、connection handle 与其 tool timeout;unknown/hidden call fail closed,单 server error/timeout 不清空健康 surface,tool_search selection 只在本 Turn 下一 step 生效。禁止写成整 Turn snapshot,禁止全局 deferred selection、live registry redispatch 或恢复 raw tool.input.delta product event。
S4m-canonical-tool-residuals app-server/src/runtime/{event_store,output_refs,thread_item_projection}.rs 与职责子模块;output snapshot/external Tool tests、contract/governance guards 已完成:tool_end 在 normalization 前 fail-closed;Tool/MCP/Collab 大输出只从 nested ToolOutput 落 sidecar/hydrate,outer legacy output fallback 删除;图片 media projection 只消费 completed+succeeded canonical Tool metadata/structured output,pending/raw/无 sidecar fail closed。触碰的 953/859/1444/1174 行热区均拆到单文件低于 800 行。
S4n-dead-backend-event-stream-surface app-server/src/{backend_event,lib}.rs、core/src/agent/types.rs、contract guard 已完成:零消费者 backend event-name mapper/module/export 物理删除;零消费者 StreamEvent、ToolExecutionResult、StreamResult 整族删除,仍被数据库与 session 使用的 TokenUsage 保留。canonical ThreadItem 与 Item lifecycle 是唯一 current owner,旧路径/导出/DTO 均有回流守卫。
S4o-mcp-control-plane-step-snapshot-audit MCP resource/prompt/capability/elicitation consumer 与生命周期只读审计 已完成:Resource/Prompt/status 是 App Server management surface,不进入 S4l provider Tool snapshot;server capabilities 随 initialized connection replacement;server-originated elicitation 尚未实现,generic Tool approval 与 request_user_input 不是替代品。审计发现 resource 与 prompt 的 target identity 缺陷,分别交给 S4p/S4q。
S4o-mcp-control-plane-owner-split tool-runtime/src/mcp_connection{,/registry,/step_snapshot}.rs、mcp/src/{manager,bridge_client}.rs、agent/src/{mcp_bridge,current_provider_turn}.rs、contract guard 已完成:model bridge 只保留 sampling-step tool discovery、exact dispatch 与 notification handle;零消费者 caller-unaware live dispatch、resource/prompt/capability summary API 与 bridge facts 已删除。GUI Prompt/Resource/status 继续由 App Server -> lime-mcp::McpClientManager live management read 承接;server-originated elicitation 保持独立后续协议 slice。
S4p-mcp-resource-target-identity app-server-protocol MCP DTO/schema、Rust/TS client、lime-mcp manager、App Server local data source、native resource helper、Renderer API/Hook/资源浏览器与 MCP fixture/guard 已完成:read/subscribe/unsubscribe 统一使用精确 (server, uri),manager 删除跨连接 URI 扫描;协议/schema/client/gateway 对缺失或空 target fail closed;native Tool metadata 与 GUI preview/subscription key 保留 server identity。两个真实内存 MCP server 的同 URI 回归证明三种操作只命中指定 server;真实 Electron Host current smoke 走 app_server_handle_json_lines -> App Server JSON-RPC,legacy MCP 命令零命中。Prompt identity 已由 S4q 收口,server elicitation 保持独立后续 slice。
S4q-mcp-prompt-target-identity app-server-protocol MCP prompt DTO/schema、Rust/TS client、lime-mcp prompt manager、App Server local data source、Renderer API/Hook/提示词浏览器与 MCP guard 已完成:prompt get 统一使用精确 (server, name),manager 删除 prompt name 前缀解析与跨连接扫描;protocol/schema/client/gateway 对空 target fail closed;GUI active/result identity 同时绑定 server/name,并用 request generation 丢弃切换后的迟到结果。两个真实内存 MCP server 的同名 prompt 回归只命中指定 server;后置 processor/package client server-less fixture 已清零并通过 2/2、62/62。
S4s-mcp-sampling-capability-fail-closed mcp/src/client.rs、App Server contract guard 已完成:复制 Codex fail-closed initialize 口径,删除无 sampling/createMessage handler 的虚假 sampling 广告并补负向回归;stdio/HTTP 共享同一 client info producer。lime-mcp 116、focused 1 与 App Server check 通过,guard 禁止 enable_sampling() 回流。
S4t-agent-graph-edge-persistence thread-store/src/agent_graph.rs、ProjectionStore canonical SQLite graph 模块/schema/tests 已完成:复制并适配 Codex AgentGraphStore,持久化 child-unique parent 与 Open/Closed 状态,children/descendants 稳定排序,close 保留 audit 且 reopen 可读。只建立 edge storage owner,不读取 legacy session metadata;生产 AgentControl 接线归 S4v。
S4u-agent-mailbox-persistence thread-store/src/{agent_identity,agent_mailbox}.rs、App Server agent_{identity,mailbox}_store.rs 已完成 durable storage foundation:同一 Projection SQLite 持久化 root-tree agent identity 与 mailbox;path/task-name 双重唯一/派生、message-id idempotency/conflict fail-closed、QueueOnly/TriggerTurn、root+recipient 隔离 FIFO 与 delivered audit/reopen 均有定向回归。shared LocalAppDataSource fixture 同步后 App Server mailbox store 4/4 通过。未接入 AgentControl、Turn trigger、canonical Item append/ack 或 GUI;这些 production consumer 归后续 S4w,禁止 legacy metadata、临时 map 或第二套 queue。
S4v-agent-control-production-wiring app-server/src/runtime{,.rs/agent_control.rs} RuntimeCore first control boundary 已完成:loaded parent 创建 canonical child session/thread 后写 Open edge,edge failure 删除 child session/thread 并在补偿失败时 fail closed。Closed edge 与 descendants traversal 由 AgentGraphStore contract 保留;无 current consumer 的 RuntimeCore close/read 包装已在 S4x 收口时删除。未注册 gateway/tool/catalog/JSON-RPC/GUI,未消费 mailbox、未做 restart recovery 或删除 legacy Team;S4w 才能接 mailbox Item/ack 与 Turn trigger,六工具、GUI 与旧 Team 删除继续拆为后续窄 slice。禁止把内部 API 误报为 Multi-Agent 产品完成。原 S4v agent_control 6/6 已通过,S4x 当前 focused 11/11 覆盖 graph/gateway 生产边界。
S4w-agent-mailbox-production-consumer RuntimeCore 只消费 S4u durable mailbox/identity:以 message_id 派生 canonical Item,Item 可读后才 delivered ack;TriggerTurn 使用确定性 turn,QueueOnly 只在下一真实 turn 前注入。EventLog-first 后 canonical projection 失败保留 pending,并以 exact mailbox fields + contiguous durable tail fail-closed recovery;activity 查询只读 durable mailbox。 completed / focused-validated:6/6 App Server focused tests、独立 App Server library check、S4w write-set rustfmt/diff 通过。consumer production module 已拆至 423 行,focused test module 独立为 557 行;不得使用 RuntimeQueuedTurn、legacy session metadata、临时 map 或第二队列;未注册六个模型工具、JSON-RPC、GUI,也未执行旧 Team 删除或完整重启恢复。
S4x-agent-control-tool-gateway RuntimeCore durable graph/identity/mailbox control、tool-runtime V2 AgentControl gateway contract、current provider per-turn gateway injection 已完成 / focused-validated:RuntimeCore -> per-turn opaque gateway -> ExecutionRequest -> RuntimeBackend pass-through -> current provider 已接通;仅 gateway 存在时广告六工具,strict schema、canonical call/turn identity、root-tree target isolation、QueueOnly/TriggerTurn、interrupt 保持 Open edge 均 fail-closed。S4x 当时尚缺的 child terminal activity、prequeued steer 和 wait durable recovery 已由 S4aa 在同一 owner 内补齐;S4x 本身无 JSON-RPC/GUI,见 internal/research/refactor/v2/13-evidence/2026-07-14-s4x-agent-control-tool-gateway.md。
S4y-dead-team-tool-surface 删除 tool-runtime::collab_agent、旧 Team catalog/prompt/discovery/registry surface;迁移工具执行 smoke 与 dead guards 已完成 / focused-and-governance-validated:旧模块族及五个 Team 工具/alias 已离开编译图和 current 静态事实源,工具执行 smoke 改用六个 V2 AgentControl 工具;catalog/discovery/native allowlist 与物理路径均有负向守卫。canonical Collab/SubAgent 历史/展示协议保持独立 read/projection 边界;JSON-RPC/GUI 与完整 restart recovery 不属于本 slice。
S4ab-legacy-collab-projection-boundary 收紧共享 Multi-Agent taxonomy/schema/visual projection 的 V2 名称边界 已完成 / package-contract-and-governance-validated:六个 AgentControl V2 名称是唯一 current projection taxonomy;裸 send_input/resume_agent/wait/close_agent fail closed 且不计入 V2 coverage,V2 visual name 不再降回 V1。历史 Rust enum/schema/import/display 保持 deprecated read-only。package 298/298、typecheck、contracts 与 legacy report 0/0/0 通过。
S4am-spawn-agent-fork-turns tool-runtime::agent_control typed contract、App Server AgentControl canonical history fork、projection schema/tests 与 S4am evidence 已实现 / lifecycle-lineage-error-compensation-validated / hard-crash-recovery-pending:fork_turns 缺省/空白/all、none、正整数和非法值由 Rust strict parser 唯一解释,Renderer 按 64 位 usize 同边界验证。App Server 只从 canonical completed final-answer AgentMessage typed 重建 delta/completed,commentary/reasoning/tool/inter-agent 与 parent trace 不复制;child 使用稳定新 Turn/Item identity并保留 source mapping,非 none 同时持久化 parent/fork lineage。返回错误的补偿清 canonical projection、EventLog/workflow audit、sidecar、approval cache 与内存,稳定 ID 重试和 cold restart 有回归;进程在 history 与 graph/identity/mailbox 完成之间被硬杀仍缺 durable pending-spawn recovery owner,下一 slice 必须关闭后才能把 crash atomicity 标记完成。spawn 输出保持 canonical path + durable message_id。agent_type/model/reasoning_effort/service_tier 继续 fail closed。tool-runtime 6/6、App Server AgentControl 19/19、projection 294/294 通过。
S4an-dead-subagent-tool-exposure tool-runtime/src/turn_tool_surface.rs 与 S4an evidence 已完成 / dead-deleted:删除零生产 caller 的 subagent fixed whitelist API、两组常量、extension-prefix 特判与正向测试;current provider step snapshot、通用 registration/resource/direct/local/compact surface 和 per-turn AgentControl gateway 不变。focused Rust 7/7。递归 child AgentControl 已由 S4am 的 current per-turn gateway/history fork 回归确认,不恢复独立 whitelist。
S4ao-spawn-canonical-path-output App Server AgentControl spawn result、focused Rust assertion 与 projection result fixture 已完成 / Codex-output-aligned:task_name 从叶子名改为 canonical AgentIdentity.agent_path,恒空且无消费的 nickname 从 spawn result 删除,durable message_id 保留。App Server 1/1、projection 1/1。fork/role/route/service-tier 不混入。
S4z-agent-control-restart-on-demand 跨 RuntimeCore 重启后的 exact-target child hydrate 与 durable control 语义 已完成 / focused-and-App-Server-validated:root hydrate 不递归加载 descendants;send_message QueueOnly 不唤醒 child,followup/interrupt 只加载 exact target,Closed edge 不可寻址且不 reopen。App Server check 与 agent_control 12/12 通过;无 BFS registry、第二队列、legacy metadata、JSON-RPC 或 GUI。
S4aa-agent-terminal-mailbox-activity canonical child terminal -> direct-parent durable Result mailbox;EventLog crash recovery;steer-first wait 已完成 / focused-Rust-App-Server-and-GUI-smoke-validated / product-chain-closed-by-S4ad-S4ah:completed/failed 先 canonical 后写 direct-parent QueueOnly Result,interrupted/canceled 不写;Result 作为 assistant canonical Item 并保留 mailbox metadata,completed 长文本不静默截断。两类 EventLog-first crash window、repairable/empty-prefix tail、direct-parent isolation、pre-existing/new steer 优先、deadline final recovery、SQLite CAS 与 RuntimeCore/EventLog single-consume 已固定。原 JSON-RPC/Multi-Agent Gate B 缺口已由 targeted producer、canonical GUI 与 visible-DOM Gate B 关闭。
S4ac-wait-agent-canonical-item agent/src/protocol.rs 与独立 AgentControl projection tests 已完成 / focused-and-lime-agent-validated:wait_agent Started/Completed 直接产同一 canonical CollabAgentToolCall::Wait Item,terminal ToolOutput 保真;list/non-AgentControl 继续为 generic Tool。S4aa 已完成并释放 gateway,targeted SubAgent activity 可由 S4ad 用真实 ThreadId 接入。focused 1、protocol 19、current provider 13 与 lime-agent check 通过;无协议/schema/GUI 改动。
S4ad-targeted-subagent-producer App Server AgentControl gateway typed fact、tool-runtime internal transport、current provider canonical emitter、SubAgent activity protocol/schema 已完成 / focused-Rust-schema-and-S4ae-Gate-B-validated:spawn 成功追加真实 child ThreadId 的 Started;send/followup 成功追加 resolved target ThreadId 的 Interacted;interrupt 成功追加 Interrupted。四工具保留普通 Tool lifecycle,并在成功 terminal 后追加独立稳定 SubAgent Item;typed fact 不进入 model output、structured content 或 Tool metadata,失败/错配/wait/list 不伪造 activity。三新 activity为 current;S4ad 临时保留七个 historical wire 的决定已被 S4ae 按 Codex 三值与无兼容前提推翻,七旧值现为 dead / forbidden-to-restore。六工具真实 managed Gate B 已全绿。
S4ae-canonical-subagent-gui canonical cold/live SubAgent GUI、activity projection/i18n、synthetic sidecar 删除、三值协议收口 已完成 / focused-GUI-Rust-governance-and-AgentControl-managed-Gate-B-validated:spawn/followup 在 durable commit 与 turn.accepted admission 后返回,child 后台执行并继承 parent 显式 provider/runtime request;parent-only output contract 已清除。provider Text/Reasoning Item identity 提升为 Turn + sampling attempt scope,修掉 followup 跨 Turn raw ID 复用及其 EventLog sequence 次生错误,未放宽 canonical fail-closed。六个 AgentControl 工具全部 completed,15 项断言全真;旧 Team E2E 口径和 compat inventory evidence 字段已删除并补负向守卫。S4ag 已关闭 effective session-default/profile route 缺口,S4ah 已补完整可见 DOM Gate B。
S4af-codex-subagent-import-fidelity app-server/src/runtime/conversation_import/codex/events{,/tests}.rs 的 SubAgent activity kind lowering 已完成 / focused-and-App-Server-validated:Codex sub_agent_activity / subagent_activity source kind 显式写入 canonical activity,Started/Interacted/Interrupted 精确保真;statusLabel/status/role 只作来源展示,不替代 typed activity。focused 1+1 与 App Server check 通过,无 raw Codex product wire、协议或 GUI 改动。
S4r1-mcp-elicitation-router mcp/src/{elicitation,elicitation_tests,client,manager}.rs 与 lifecycle/Cargo feature 已完成:复制并强化 Codex connection-shared request router 与 RMCP form handler;opaque request ID、replacement 后旧 waiter 精确响应、bounded single-consumer、cancel/consumer-drop/cancel_all cleanup、typed action/content/schema 校验与 request _meta 已通过 focused 13、lime-mcp 128 和 App Server check。该 foundation 当时保持 capability absent;S4ak 已在 runtime owner 与 Gate B 完成后广告 form capability。
S4r2-app-server-reverse-jsonrpc app-server-protocol serverRequest catalog/schema、App Server broker、TS connection、Electron drain、Renderer event bus/dispatcher 已完成并经 S4r2b correctness closeout:outer ID 使用 boot UUID + counter,aborted wait remove-on-drop,ambiguous client fail closed,Renderer 对 connection-scoped in-flight/settled id at-most-once。App Server 7、protocol 45+1、package 63、Electron 22、Renderer 6、contracts 290、legacy 0/0/0 与 GUI smoke 证据成立。S4r3 adapter、GUI、五语言、thread-owned runtime connection 和专用 Gate B 仍是后续;MCP elicitation 不产生 canonical Item。
S4r3-mcp-elicitation-adapter app-server/src/{local_data_source,main,lib,mcp_elicitation}.rs 已完成 backend/transport foundation:启动期 clone 唯一 manager router,App Server transport lifecycle 并发 pump typed reverse request;R1 token 只留在 adapter task,R2 outer id 只留在 JSON-RPC,运行期不重锁 manager。真实 RMCP duplex 走 R1→R2→R1 已通过;当时的 GUI/product blocker 已由 S4r8-S4r9/S4ak 关闭。
S4r4-mcp-active-timeout mcp/src/{active_time,client,bridge_client,manager}.rs 与 lifecycle/tools、Agent bridge 已完成:复制 Codex 68a1d82a connection-local counted pause/RAII/active-time timeout;真实 handler 在整个用户等待期持 guard,overlap 计数,取消立即生效。删除 manager 第二套 wall-clock timeout 与 wrapper/snapshot/Agent bridge 假 handler。focused 4、lime-mcp 132 与三 crate check 通过。
S4r5-mcp-response-meta mcp/src/{elicitation,client_service,client,bridge_client,manager}.rs 与 lifecycle/tools、Agent bridge 已完成:Codex custom Service<RoleClient> 只拦截 elicitation 并用 raw CustomResult 保真 result _meta;其余 request/notification/info 委托现有 handler,stdio/HTTP 无 typed service 旁路。S4ak raw wire 与完整 lime-mcp 140/140 继续覆盖。
S4r6a-server-request-resolved app-server-protocol resolved notification/schema/generated client、app-server/src/{server_request,mcp_elicitation,lib}.rs 已完成:Codex serverRequest/resolved terminal notification 保持 request id/connection owner;正常、错误、RMCP cancellation 均向创建 outer request 的同一 client 有序发送 resolved,不新增第二 pending 表或 transport。S4r9/S4ak Gate B 已覆盖 resolved 后表单关闭。
S4r6b-mcp-elicitation-gui src/lib/api/{appServerEventBus,appServerServerRequest,mcpServerElicitation}.ts、全局 MCP elicitation modal、App.tsx、五语言 agent.json 与定向测试 已完成:Renderer dispatcher 使用 per-request AbortController 与 settled tombstone,支持 resolved 先于 request;主窗口根部一次性注册 typed handler,按 MCP primitive schema 渲染 GUI 表单并在远端撤销后静默关闭。重复 GUI claim 已合并到单一 owner,无 Approval、ask-user、生产 mock 或页面级挂载。S4ak 真实 Gate B 再次证明 visible/submitted/closed。
S4r7c-canonical-elicitation-producer 无 已 superseded:Codex 5c19155cbd93 定义 MCP server elicitation 为 thread-scoped、turn-correlated 的 in-memory reverse JSON-RPC waiter;不创建 durable Item、read-model projection 或 persistence producer。已删除本 slice 写入的 durable surface,禁止恢复。
S4r8-mcp-runtime-thread-owner tool-runtime/src/mcp_connection/**、mcp/src/{manager,bridge_client,client,elicitation}.rs、agent/src/mcp_bridge.rs、app-server/src/{local_data_source,local_data_source/mcp}.rs 与定向 tests owner/lifecycle 已完成:runtime MCP tool call 在 provider 边界构造完整 canonical scope,并只将 public threadId/nullable turnId lower 到 reverse request;management 无 scope nested elicitation fail closed。router 按 opaque id 精确结算,同 server 跨 thread 不串线;已转发 cancel/shutdown 保持 serverRequest/resolved -> RMCP terminal,未转发 waiter直接 Cancel。未新建 durable Item/read model,未公开 sessionId/parentToolCallId/raw token;S4r9 关闭 server fault isolation,S4ak 只对持有 immutable runtime owner 的 connection 广告 form capability。
S4r9-mcp-runtime-server-fault-isolation agent/runtime_state/{,mcp_runtime,mcp_runtime_tests}.rs、定向 Rust 与 Gate B evidence 已完成:Codex 式并发 per-server runtime startup 已收敛到 McpThreadRuntime current owner。optional failure 仅使该 server absent;required failure 关闭候选 connection、拒绝 replacement 并保留已发布 generation/pending elicitation;健康 server snapshot 原子发布,不复用 management RunningService、global registry 或 mock。故障默认 Playwright MCP + 健康 stdio elicitation MCP 的真实 Electron Gate B 已通过。
S4ak-mcp-elicitation-capability-advertisement mcp/src/{client,elicitation_tests}.rs、scripts/electron/mcp-elicitation-gate-b* 已完成:runtime-owned client 使用 MCP 2025-06-18 并广告精确 {"elicitation": {}};management/router-only client 保持 2025-03-26 且 capability absent。Gate B 按 stdio pid 绑定 initialize 与 accepted elicitation,缺 capability 时禁止发 request;lime-mcp 140/140、static 4/4 与真实 Electron Gate B 通过。
S1k-approval-session-cache-audit-only app-server/src/runtime/thread_item_projection/materializer/lowering.rs、thread_item_projection/typed_tests/canonical_lifecycle.rs、event_store/canonical_notifications.rs、canonical_thread_store_tests.rs 与 S1j blocker evidence approval.session_cache.hit 只保留 audit evidence,不创建或通知 canonical Approval Item;cache-backed action.resolved 是唯一 terminal Approval,保持 permission-<turnId> identity。materialize/replay/restart 后不得残留 pending Approval,严格 approval-request-resume Gate B 必须通过。禁止放宽 Renderer pending guard或修改 approval producer。

S4j 完成后按 current 风险拆 evidence/context-compaction consumer。Codex parser 的 rollout JSON 只能在输入边界存在,进入 selector/normalizer 前必须是 typed import draft;任何 source-local raw Tool event、StoredSession raw wire、ProjectionStore/read model/GUI fallback 均为 dead / forbidden-to-restore。

4.9 S2 empty Thread 创建修复

Gate B fixture 证明 start_session 只写内存 StoredSession,canonical Thread 要等首个 RuntimeEvent 才由 apply_canonical_events 延迟创建;GUI 在首个 Turn 前打开新会话时,agentSession/read 因 Thread 不存在 fail-closed,产品停在恢复态。

子 slice 精确写集 退出条件与禁止交集
S2f-empty-thread-create app-server/src/runtime/session_lifecycle.rs、app-server/src/runtime/canonical_thread_store.rs、app-server/src/runtime/canonical_thread_store/persistence.rs、app-server/src/runtime/projection_store.rs、app-server/src/runtime/conversation_import/commit.rs、app-server/src/runtime/tests/sessions.rs start_session 必须在返回成功前原子建立 empty canonical Thread,失败不得留下仅内存 session 或仅 SQLite thread;canonical session_id 必须跨 RuntimeCore 唯一;显式 delete 与 import replace 必须清除 canonical/projected SQLite 数据后再移除内存状态。补 create/read/list、duplicate/restart、store failure/retry、delete/recreate 与空 turns/items tests,并复跑 home-hotpath Gate B。不得通过 AgentSession fallback、mock 或 GUI 特判掩盖。

4.10 S5 canonical Thread queue control consumer

S5 terminal 与 Approval projection 收口后,首个 canonical production read consumer 只迁 queued-turn “立即执行”的 active/queued Turn 判定,不提前迁移 history、diagnostics、artifact 或 interrupted-input restore 等尚未由 canonical Item 完整表达的 rich detail consumer。

子 slice 精确写集 退出条件与禁止交集
S5c-canonical-read-consumer packages/app-server-client/src/agent-runtime.ts 与 tests/README、packages/agent-runtime-client/src/{index,runtimeClient,sessionGateway}.ts 与 tests/README;Renderer appServer{Constants,Types,ClientMethods,ClientMethodSpecs}.ts 与 tests;src/lib/api/agentRuntime/{threadClient,threadClient.test}.ts;新增 src/components/agent/chat/projection/chatRuntimeQueueControlProjection{,.unit.test}.ts;hooks/{agentRuntimeAdapter,agentRuntimeAdapter.test,useAgentStream,agentStreamFlowControl,agentStreamFlowControl.test}.ts;scripts/check-app-server-client-contract.mjs package readThread 必须直接调用 thread/read {threadId, turnsView:"full"},package root 只公开 canonical read params/response;queue control 只消费 narrow canonical projection,零 agentSession/read/getSessionReadModel Turn truth,identity 或 queue/status 非法时 fail closed。不得写回 rich AgentSessionDetail、不得迁 history/detail family、不得触碰 active S4h Rust 写集。Gate B 必须证明 thread/read -> promote -> cancel canonical activeTurnId -> resume。
S5d-plugin-canonical-thread-read src/lib/api/pluginRuntime.ts;src/features/plugin/runtime/agentRuntime{AppServerClient,AppServerClient.test,ClientApi,ClientApi.test,CapabilityHost,CapabilityHost.test,TaskState}.ts;src/features/plugin/sdk/CapabilityHost{,.d}.ts 的 PluginTaskLookup.threadId,仅限 canonical thread identity/read 迁移 从 startTurn 的 turn.threadId 建立唯一真实 identity,并贯穿 Plugin task result、snapshot/request、持久化 RuntimeTaskState、reload、typed lookup、get/cancel 与 session gateway;readThread 只调用 canonical thread/read {threadId, turnsView:"full"}。缺 threadId fail closed,禁止隐藏 cast、sessionId === threadId 假设、readSession fallback、进程内临时 map 或双读。不得触碰 S5c queue-control 文件。

4.11 S2 canonical queued Turn state correction

S5c read consumer review 证明 production 只发 queue.added,而 canonical materializer 只识别不存在的 turn.queued,导致 queued Turn 被错误物化为第二个 inProgress/notQueued Turn。该缺口必须在 canonical materializer owner 修复,GUI 不得读取 legacy queue shadow 兜底。

子 slice 精确写集 退出条件与禁止交集
S2h-canonical-queue-state app-server/src/runtime/thread_item_projection/{materializer,typed_tests}.rs、app-server/src/runtime/canonical_thread_store_tests.rs,必要时仅追加 app-server/src/runtime/tests/queue.rs 的 canonical read assertion queue.added 物化为 TurnStatus::InProgress + TurnQueueState::Queued;queue.removed 按真实 queuedTurnId 删除 canonical Turn;queue.promoted 在 resume 前保持 queued;后续 turn.started 将同一 Turn 推进为 Running。补 sequential apply/restart read、active+queued full read、remove、promote/start 状态转移;不改 emitter/protocol,不触碰 active S4h projection_item_events.rs。

4.12 S5 terminal queue history projection correction

首次 S5c Gate B 证明 canonical terminal Turn 会保留历史 queue.state=running;该状态不代表当前 active。 GUI queue projection 只能要求 queue.state=queued 的 Turn 仍为 inProgress,并继续只用 status=inProgress && queue.state!=queued 判定 active。

子 slice 精确写集 退出条件与禁止交集
S5e-terminal-queue-history src/components/agent/chat/projection/chatRuntimeQueueControlProjection.ts 与 unit test 接受 completed/failed/interrupted + historical Running/NotQueued,且 activeTurnId 必须为 null;terminal+Queued 仍 fail closed。不得放宽 identity/full hydration/multiple active/queued membership 约束,不改 flow-control、Rust 或 fixture。

4.13 S5 active stream queue intent correction

S5c Gate B 的完整 AgentDebug 证明 queuedPromotion.start 本身直到 120 秒 inactivity watchdog 才发生;并非 thread/read 早发晚回。两个真实 queued submit 均记录 expectingQueue:false, 因为 queue 判定把“同会话 activeStream + canonical read model 暂未 busy”误当成 stale binding。 真实 active stream 已有 turnId;无 turnId 的同会话残留 binding 才允许按 stale 处理。

子 slice 精确写集 退出条件与禁止交集
S5f-active-stream-queue-intent hooks/agentStreamUserInputSendPreparation{,.test}.ts、agentStreamPreparedSendEnv{,.test}.ts、agentStreamUserInputSubmission{,.test}.ts、agentStreamSubmitExecution{,.test}.ts、useAgentStream.ts prepared-env wiring queue intent 必须把同会话、带真实 turnId 的 active stream 视为 busy;保留无 turnId stale binding 的既有恢复语义。queued listener 不得覆盖 active binding,accepted 后必须释放 listener 并立即 refresh canonical read model,不创建第二个 active stream或 120 秒 watchdog;复跑同一 Gate B。不得恢复 legacy read truth或 local active turn fallback。

4.13a S5 Managed Objective current owner migration

Superseded on 2026-07-22:本节记录当时的 import/type owner 迁移,不再定义 current owner。相关 DTO、client、panel、Automation consumer 与 v0 RPC 已删除;后续只允许使用 canonical ThreadGoal 与 Thread/Turn/Item 主链。

Managed Objective 的 DTO 已归 agentRuntime/sessionTypes,行为已归 agentRuntime/objectiveClient; Agent Chat 叶子组件继续从 root @/lib/api/agentRuntime compat barrel 导入只会扩大旧入口。 本切片只迁 import/mock 并补负向守卫,不改变 Objective 行为、协议、文案或 App Server。

子 slice 精确写集 退出条件与禁止交集
S5g-managed-objective-current-owner-migration Inputbar Objective panel/send、ManagedObjective panel/view/model、agentStreamSubmitExecution 的 Objective imports/mocks 与新增 current-boundary guard ManagedObjective 类型只从 sessionTypes 导入,行为只从 objectiveClient 导入;测试 mock 同步指向 current owner,禁止本域恢复 root compat barrel。不得触碰 agentRuntimeAdapter、appServerSessionClient、S2l history/read model、S6o roster 或协议。
S5h-execution-runtime-type-only useAgentChat.ts、WorkspaceConversationScene.tsx 与 executionStrategyCurrentBoundary.test.ts AgentExecutionStrategy、AgentSessionExecutionRuntime 只从 agentExecutionRuntime current owner 导入;只改 type owner 与回流守卫,不改变 runtime、send、projection、协议或 GUI 行为。
S5-session-types-root-barrel-residual history、Task Rail、Harness 三个 session DTO consumer 与 sessionTypesCurrentBoundary.test.ts session DTO 只从 agentRuntime/sessionTypes 导入;只迁 import owner,不改变 history、roster 或 Harness 行为。
S5-session-types-status-surface-residual MessageList、task/status、projection deferral 五个 consumer 与 session/queued-turn guards ThreadReadModel 与 Todo 归 sessionTypes,QueuedTurn 归 queuedTurn;只迁 type owner。
S5-components-current-owner-clean-remainder Harness types、Task Center、General Workbench Task Rail 三个 component type consumer session、tool inventory、queued turn、execution runtime 各自直连 current owner;不改 component 行为。
S5-session-hooks-current-owner-migration agentRuntimeAdapter、agentSessionState、agentStreamSubmitExecution、useAgentSession import hunks client/request/session/queued/execution/protocol 类型分别直连 current owner;不改 hook 行为或 public type。
S5-workspace-current-owner-clean-remainder Workspace context/conversation/send/subagent navigation/task rail 五个 consumer session、execution、thread client 与 protocol search mode 分别直连 current owner;不改 Workspace 行为。
S5i-root-barrel-dynamic-type-residual agentSessionRefresh.ts、agentStreamUserInputSendPreparation.ts 与两个 current-owner guards 删除最后三处 dynamic root type query,并让 guard 同时禁止 static/dynamic exact root specifier;production root consumer 归零。
S5j-history-test-session-type-owner 三个 Agent history 测试的 AgentSessionDetail type import 直连 agentRuntime/sessionTypes;只迁 test type owner,不改变 fixture 或 assertion。
S5k-session-detail-test-owner 五个 session/history tests 的 AgentSessionDetail type import 直连 agentRuntime/sessionTypes;只迁 test type owner,避开并行 stream-runtime tests。
S5l-session-presentation-test-owner 三个 session presentation tests 的 AgentSessionInfo / AgentSessionDetail type import 直连 agentRuntime/sessionTypes;只迁 test type owner,不改变 presentation、topic 或 history merge fixture。
S5m-history-state-test-owner 五个 history/session-state tests 的 AgentSessionDetail type import 直连 agentRuntime/sessionTypes;只迁 test type owner,不改变 state fixture 或 assertion。
S5n-read-checkpoint-test-owner timeline fixture 与 workspace view-model test 的 Thread read/checkpoint summary type import 直连 agentRuntime/sessionTypes;只迁 test type owner,不改变 fixture 数据或运行时行为。
S5o-prepared-send-test-owner 四个 prepared-send tests 的 execution runtime / queued turn type import 分别直连 agentExecutionRuntime 与 queuedTurn;只迁 test type owner。
S5p-event-binding-test-owner 三个 resume/event-binding tests 的 Thread read、execution runtime 与 queued turn type import 分别直连 sessionTypes、agentExecutionRuntime 与 queuedTurn;root aggregate static test consumer 归零。
S5-client-factory-test-mock-owner agentRuntimeAdapter.test.ts、useAgentChat.testUtils.tsx 与 client owner boundary guard test mock 直连 agentRuntime/clientFactory;禁止 root aggregate mock 回流,不改 production adapter。
S5q-root-barrel-retirement agentRuntime.ts/.d.ts、agentRuntime/index.ts/.d.ts、Agent API aggregate test、剩余 component mocks/helpers 与 retired shell guard production/test/fixture static、dynamic 与 mock consumers 归零后物理删除四个 root aggregate 文件,不创建替代 barrel;direct clients 为唯一 current owner。
S5s-automation-managed-objective-type-owner 五个 Automation Managed Objective type consumers ManagedObjectiveStatus / objective request 直连 sessionTypes;只迁 type owner。
S5t-plugin-respond-request-type-owner Plugin runtime 与 capability host 的 respond request type import AgentRuntimeRespondActionRequest 直连 requestTypes;不改变 Plugin transport 或 thread identity。
S5u-experts-type-owner Experts skill binding/evidence 的四个 production 与两个 test consumers skill binding 直连 toolInventoryTypes,evidence pack 直连 evidenceTypes;不改变 Experts 行为。
S5v-evidence-normalizer-type-owner 六个 evidence projection/normalizer modules Evidence/Handoff/Replay/Analysis/ReviewDecision 类型直连 evidenceTypes;不改变 normalization 行为。
S5w-workspace-skill-binding-type-owner 三个 clean Workspace helper/test consumers workspace skill binding 直连 toolInventoryTypes;避让仍脏的 useWorkspaceSendActions.ts。
S5x-agent-client-type-owner agentClient.ts 与 executionStrategyCompat.ts 的 title/provider/strategy type imports session DTO 直连 sessionTypes,strategy 直连 agentExecutionRuntime;不改变 title generation 或 value normalization。
S5y-session-read-types-owner agentRuntime 内 session/read/objective/thread 的九个 clean TS/test consumers session/read DTO 直连 sessionTypes,request DTO 直连 requestTypes;不改 client、normalizer 或 projection 行为。
S5z-declaration-types-owner 九个手写 .d.ts consumers:Agent protocol 与 agentRuntime clients/factory declarations 每个 declaration 按符号直连 session/request/evidence/tool/execution current owner;不新增 declaration barrel,不修改运行时实现。
S5aa-protocol-media-types-owner agentProtocolEventTypes.ts、agentProtocolOps.ts、mediaTasks.ts execution policy 直连 agentExecutionRuntime,session/provider DTO 直连 sessionTypes,media DTO 直连 mediaTaskTypes;不改变 wire protocol 或 media behavior。
S5ab-workspace-article-request-types-owner 三个 clean Workspace article/helper modules 的 update-session request import AgentRuntimeUpdateSessionRequest 直连 requestTypes;不触碰 dirty useWorkspaceSendActions.ts 或 Workspace 行为。
S5ac-inventory-export-types-owner inventoryClient.ts 与 exportClient.ts inventory/workspace binding 直连 toolInventoryTypes,evidence/review DTO 直连 evidenceTypes;不改变 client behavior。
S5ad-workspace-skill-binding-type-residual useWorkspaceSendActions.ts 的单个 skill-binding type import hunk 在已释放 S5 Workspace direct-owner diff 上将最后一个 binding DTO 直连 toolInventoryTypes;不改 send behavior 或其余脏 diff。
S5ae-types-barrel-retirement agentRuntime/types.ts/types.d.ts、session roster boundary、ESLint import rule、retired shell contract guard 真实 consumer 归零后物理删除两个 compat/deprecated type barrel;移除手写镜像读取,反转 lint 推荐并把两路径纳入 forbidden-to-restore guard,不创建替代 barrel。
S5ag-workspace-command-wiring AgentChatWorkspace.tsx 公共入口、useAgentChatWorkspaceRuntime.tsx current 组合 owner、workspace/useAgentChatWorkspace{Entry,Setup,Command,Scene}Runtime* 与 command boundary guard Workspace owner 拆分已完成:公共入口 13 行,主 runtime 41 行,Entry 624、Setup 782、Command 653、Scene 684 行,均低于 <800;Hook 顺序固定为 Entry -> Setup -> Command -> Scene。不得搬移 Thread/Turn/Item、queue、stream、approval 或 provider 事实源,不得创建兼容层或可见行为变化。

2026-07-18 S5 复核:Workspace owner 拆分已完成,入口 13 行、主 runtime 41 行、四个 current owner 均低于 800 行;S5/S7 仍等待 fresh current-tree gates 与架构确认。

4.14 S2 canonical active Turn read timing hardening

Gate B 的首次复现曾在长流期间读到 queued Turn,却没有 active Turn;Rust canonical store 按 turn.accepted -> message.delta -> queue.added 顺序可稳定保留 active Turn,后续两次 --keep-temp Gate B 也在同一 SQLite/event log 中证明 active Turn 已 durable。该切片用于固定 服务端增量 apply/read 的时序回归,并把一次早读失败留作不可交付的 flaky evidence,禁止 GUI 用 local active stream 兜底掩盖。

子 slice 精确写集 退出条件与禁止交集
S2i-canonical-active-turn-read app-server/src/runtime/thread_item_projection/{materializer,typed_tests}.rs、app-server/src/runtime/canonical_thread_store_tests.rs、必要时 app-server/src/runtime/turn_execution.rs 的 active admission 相关测试 增量 apply/read 覆盖 active admission、provider/message progress、queue.added 并发时序;canonical thread/read 必须返回唯一 active Turn,queued promotion 必须能取出 active identity;只允许 current Thread/Turn/Item store,禁止 legacy read/local fallback。若没有可复现 Rust 丢写,Gate B 失败必须归类为 timing/environment evidence 并保留重跑证据。

4.14a S2 canonical Message / Plan lifecycle

聚合 fixture 的 Plan revision identity blocker 暴露出 canonical Message/Plan 终态不完整:user/agent Item 缺少一致 completed lifecycle,Plan delta/final 没有正式 typed Item 与可跨重启恢复的 revision identity,Plan-only 输出还可能创建空白 assistant message。该切片直接按 Codex Item lifecycle 收口, 不新增第二 read model、Tool alias 或 Renderer fallback。

子 slice 精确写集 退出条件与禁止交集
S2k-canonical-message-plan-lifecycle agent-protocol Plan payload/status、App Server runtime event mapper/parser、canonical materializer/store/read model/notification 与 tests、generated schema/client、Renderer canonical Item reader、Plan history Gate B fixture message.created 形成 completed UserMessage;AgentMessage 仅在真实正文出现后启动,并由同一 Item 在 message.completed 终结,取消映射 Interrupted;Plan 是正式 typed Item,delta/final 按 (turnId, revisionId) 共用 identity,completed final snapshot authoritative 且跨重启保真。Plan 前空白缓存,Plan-only 不创建空 AgentMessage;read model/GUI reload 保留 revision、steps/status,legacy update_plan Item 为 0。禁止新增 compat、第二状态机、mock fallback 或 Renderer lifecycle synthesis。

4.15 S4i Skills metadata and policy convergence

当前 Skills 已有 stable scope:name identity、局部 allowed_tools 和 session source/capability gate,但 catalog、selection 与 tool gate 尚未共享 typed authority/source/capability/dependency/ enabled/token-budget decision。该 slice 只收敛 Skills current owner,不触碰 S4d/S4e/S4h 热区, 也不把 MCP snapshot 偷接入本 slice。

子 slice 精确写集 退出条件与禁止交集
S4i-skills-metadata-policy skills/src/{agent_snapshot,agent_selection,agent_body}.rs、tool-runtime/src/{skill_gate,skill_search,skill_execute}.rs、App Server protocol v0/skills.rs、App Server skill catalog、Renderer skill-execution.ts 与对应 generated schema/types/tests catalog 与 selection 使用 stable skillId;metadata 显式区分 source/authority/scope/enabled/interface/dependencies/capabilities;selection 输出统一 allow/deny/omitted reason 与基于真实 SKILL.md + references 的 body token-budget decision;path 仅 locator。tool invocation gate 因不拥有 selected body,必须继续输出 not_evaluated,不得用 invocation args 代替。executable 与 management list response 必须拆分;skill/read name-only 请求的退出条件是上游 source ref 先持有 stable skillId。不得修改 MCP snapshot、S4d/S4e approval/tool consumer、S5 GUI/plugin 或生产 mock 路径。
S4i-stable-skill-read-id skills/src/agent_snapshot.rs 的 default root scope、App Server SkillReadParams/catalog、Rust/TS client、Renderer skill-execution、Workbench Skill detail reader、skills-current smoke 与对应 schema/tests default roots 必须从 project/user/app typed path API 保留 scope,禁止按扁平数组下标猜测;skill/read 只接受 catalog stable skillId 并从同一 snapshot winner locator 读取。GUI exact ID 优先,裸 name 只允许 catalog 唯一解析,重名/缺失/identity mismatch fail closed;禁止补 project:、path fallback 或 legacy wire alias。

5. Worker 生命周期

5.1 Start

  1. 读取本计划、v2 对应契约和 parallel-agent-collaboration.md。
  2. 宣布主线、slice、精确写集、只读集和避让集。
  3. 检查当前工作树和既有 claim。
  4. 成功创建原子锁后,写本地 claim 快照。
  5. 只在声明写集内修改;发现外部变化立即暂停。

5.2 During

  • 每次跨层改动都保持 protocol -> client -> bridge -> fixture 同步,不把半成品暴露给其他 slice。
  • 删除旧实现前,先确认新 current owner 已通过最小测试。
  • 不创建第二个 runtime、第二个 transcript store、第二个 projection 或临时 compat wrapper。
  • 复制上游实现时记录仓库、commit、源文件、许可证和 Lime 适配点;无法确认许可证或依赖边界时先阻塞,不凭相似重写掩盖来源。
  • 不执行 git reset、git checkout、git clean、git commit、git push。
  • 需要跨写集修改时,创建 blocker handoff,等待 coordinator 重新切分,不直接抢写。

5.3 Finish

worker 必须在释放锁前写一份独立 handoff,内容如下:

slice: S1
owner: protocol-a
status: ready-for-review|blocked|released
write_set:
  - lime-rs/crates/app-server-protocol/src/protocol/v0/thread.rs
read_only_set:
  - packages/app-server-client
avoided_set:
  - src/components/agent/chat/AgentChatWorkspace.tsx
changes:
  - copied: <Codex source>@<commit>
  - adapted: <Lime boundary>
  - deleted: <old surface>
tests:
  - command: npm run test:contracts
    result: pass|fail|not-run
evidence: <paths or command output summary>
governance: current|compat|deprecated|dead|test-only
next_owner: coordinator|<slice owner>
released_at: <UTC timestamp>

handoff 只写一次,不追加修改已发布记录;修正另开新时间戳文件并由 coordinator 汇总。

6. 冲突处理

情况 处理
同一 slice 已有锁 后到进程停止,转只读审阅或领取其他 slice
写集与其他 claim 相交 两边停止写入,coordinator 重新拆函数/文件边界
目标文件出现非本人变化 立即暂停;不覆盖、不 reset、不 cherry-pick 外部提交
必须改共享 protocol/client 由热区 owner 提交最小 patch,其他 slice 等待 handoff
测试失败但非本 slice 引入 记录 baseline failure,不修改他人写集;请求 gate-runner 复核
发现旧路径仍有真实 consumer 标记 deprecated,建立迁出子任务;不新增 compat
需要更新架构事实源 worker 在 handoff 标明变更,coordinator 在接受该 slice 时同步更新并确认架构图

出现冲突时的优先级是:保护当前工作树 > 保持唯一 owner > 维持并行速度。任何“先改了再说”的补丁都视为未授权写入。

7. Slice 依赖与并行窗口

S0 -> S1 -> S2 -> S4 --\
          \-> S3 -> S3c +-> S5 -> S6 -> S7
  • S0 只能由 coordinator 执行。
  • S1 取得 protocol/runtime contract 后,S2 与 S3 可并行,它们不能共享写文件。
  • S4 可先做只读盘点;涉及 Item/approval/agent edge 的写入必须等待 S2 contract handoff。
  • S5 必须等待 S2 read model、S3c production provider event、S4 tool display contract;各 worker 可提前只读审计 GUI,但不能提前接线。
  • S6 只能在相关 slice handoff 为 ready-for-review 后删除旧入口。
  • S7 只能由 coordinator 执行,负责合并 evidence、架构确认和最终门禁。

8. 验证归属

Slice worker 最小验证 coordinator 收口验证
S0 链接、快照、治理报告 facts 汇总和 source commit
S1 npm run test:contracts、Rust protocol/runtime related、runtime fixture schema/client/bridge 全链路
S2 projection、thread-store、resume/pagination/repair tests Agent runtime smoke + read model replay
S3 provider/lowering/capability tests contract + media GUI gate
S4 tool/MCP/skills/multi-agent tests runtime fixture + Gate B
S5 定向 Vitest/ESLint、GUI smoke Gate B Electron evidence
S6 governance report、negative guards、scripts governance 无旧入口回流
S7 不新增业务验证 npm run verify:local + architecture confirmation

共享测试由 gate-runner 执行时,必须注明验证的是当前工作树,不代表替代 worker 的归属测试。

9. 中央状态表

Slice 状态 owner claim handoff blocker
S0 completed coordinator research baseline refactor-v2-research.md -
S1 canonical-live-renderer-projection-Gate-B-validated / agentSession-current-presentation-boundary S1-coordinator -> root S1 claims + S2q boundary claim S1 handoffs + S2q evidence/handoff production Renderer 的 Thread/Turn/Item lifecycle 只消费 canonical entity;raw 仅保留 provider/runtime status/image/media side-channel,未知 raw/lifecycle fail-closed。旧“删除整个 AgentSession namespace”退出条件已 superseded:agentSession/read 是 ThreadStore-backed current 产品 presentation endpoint,thread/read/list/... 是同源 identity/control edge;禁止恢复的是 event/app-data/Renderer synthesis。
S1b completed / coordinator-validated / merged-into-S2e-canonical-handler s1b-request-serialization-fix -> S2e canonical handler .lime/refactor-v2/claims/S1b-recovery-final-s1b-request-serialization-fix.md S1b + S1f/S2e evidence Thread key 使用 RuntimeCore 只读 session→thread 解析;双 session FIFO、mismatch、SESSION_NOT_FOUND、fairness/admission 共 15 tests 在 canonical handler 合并后的当前树复测通过。
S1-contract-correct completed / consumer-cutover-closed-by-S1c-S1j protocol_s1_fix .lime/refactor-v2/claims/S1-contract-correct-protocol-contract-a.md S1 contract + S1c/S1j evidence Codex status、typed ThreadItem、ItemId prefix、Turn/Thread fields、pagination contract 与 provenance 已落地;package/Renderer consumer cutover 与 Gate B 已由 S1c/S1j 关闭。
S1c completed / renderer-gate-cutover-and-domain-side-channel-Gate-B-validated s1-canonical-cutover -> coordinator .lime/refactor-v2/claims/S1c-canonical-cutover-s1-canonical-cutover.md + .lime/refactor-v2/claims/S1c-renderer-sequence-gate-followup-coordinator.md S1c/S1j evidence package 与 Renderer sequence gate 只接受 canonical lifecycle;旧 ID normalization/tool terminal fanout 已删除;显式 allowlist 仅旁路 provider diagnostic、runtime.status 与 image_task domain notifications,未知 raw/lifecycle fail closed,focused/typecheck 与 Gate B 通过。
S1g-canonical-live-producer completed / coordinator-integrated-and-S1j-Gate-B-validated s1g-canonical-live-producer -> coordinator .lime/refactor-v2/claims/S1g-canonical-live-producer-s1g-canonical-live-producer.md + .lime/refactor-v2/claims/S1g-notification-json-assertions-coordinator.md S1g/S1j evidence durable append 前 materialize notification-only canonical Turn/Item clone,source payload 不改写,turn.canceled -> Interrupted,无 turn compaction 保留 raw;stdio JSON-RPC 与 S1j Gate B 明确验证 canonical Item。
S1j-canonical-live-renderer-projection completed / coordinator-validated / Gate-B-passed coordinator .lime/refactor-v2/claims/S1j-canonical-live-renderer-projection-coordinator.md 20260713T031243Z-S1j-canonical-live-renderer-projection-coordinator.md + internal/research/refactor/v2/13-evidence/2026-07-13-s1j-canonical-live-renderer-projection.md canonical Item 覆盖 Tool/MCP/Approval/Command/File/Media/SubAgent/Compaction/Extension,Approval terminal 可投影 resolved;冻结 raw fixture 仅走 test-only helper。104 项 canonical 投影、18 项 Workbench、21 项 scene、41 项 package projection、typecheck、contracts 290 checks 与真实 Electron Gate B 通过。此前并行 S4j draft 中间态造成的 sidecar 重编 blocker 已由 typed source contract、cargo check 与 conversation import 48/48 解除。
S1h-notification-test-correction completed / validated-and-consumed-by-S1j coordinator .lime/refactor-v2/claims/S1h-notification-test-correction-coordinator.md S1h/S1j evidence notification JSONL 回归先断言 canonical Item,再移除 notification-only 字段比较 durable source payload;定向 JSONL loop 与 downstream Gate B 通过。
S1f completed / handler-and-S2e-consumer-validated s1f-thread-read-protocol -> S2e canonical handler .lime/refactor-v2/claims/S1f-thread-read-protocol-s1f-thread-read-protocol.md + .lime/refactor-v2/claims/S2e-canonical-read-handler-coordinator.md S1f/S2e evidence 四个 canonical Thread read protocol/schema/Rust+TS client、direct ThreadStore handler、shared-read metadata 与 contracts 已在 current tree 通过。
S1d completed / package-cleanup-and-S1j-consumer-validated runtime-client-a -> runtime-client-cleanup-a .lime/refactor-v2/claims/S1d-runtime-client-a.md + .lime/refactor-v2/claims/S1e-runtime-client-cleanup-a.md S1d/S1e/S1j evidence production/package API/tests 只消费 canonical lifecycle;raw 仅保留 media non-thread channel;旧 raw mapper/export/tests 与 no-op schema middleware 已删除,package cleanup 与 Renderer Gate B 完成。
S2 completed / canonical-write-read-and-per-item-message-reasoning-plan-lifecycle-Gate-B-validated coordinator -> root S2a-S2q claims + S2o3 S2a-S2q/S2o3 handoffs/evidence event-driven typed write/read、empty canonical Thread、User/Agent/Reasoning/Plan Item lifecycle 已验证;provider Start/Delta/End 使用 canonical Turn + sampling attempt scoped identity,terminal Item 拒绝 late delta,per-item Plan parser 不串 buffer。agentSession/read 与 thread/read/list/... 共享 ThreadStore 事实源,缺失 canonical detail fail closed;imported Plan/User/Agent Message 保留 source identity、lifecycle 和 ordinal。
S2a completed s2a-store-contract .lime/refactor-v2/claims/S2a-store-contract-s2a-store-contract.md 20260712T095953Z-S2a-store-contract-s2a-store-contract.md async storage-neutral typed ThreadStore、cursor/page/metadata patch 已通过 check 与 45 tests;S2d 必须实现该 trait
S2b completed / workspace-and-S2d-S2e-consumer-validated s2b_typed_materializer .lime/refactor-v2/claims/S2b-materializer-s2b_typed_materializer.md S2b/S2d/S2e evidence typed materializer 已在真实 App Server workspace 通过 thread_item_projection 22 tests,并由 SQLite store/read consumer cutover 使用。
S2c completed / event-log-repair-and-downstream-recovery-validated s2c_event_log_repair -> coordinator .lime/refactor-v2/claims/S2c-event-log-repair-s2c-event-log-repair.md + .lime/refactor-v2/claims/S2c-validation-fix-coordinator.md S2c + S2l/S2v evidence canonical event log 16 tests 与 projection repair 7 tests 通过;invalid fixture 不绕过 production append guard,后续 history repair/fail-closed 已建立在该 owner 上。
S2d completed / canonical-ThreadStore-and-S2e-consumer-validated coordinator .lime/refactor-v2/claims/S2d-sqlite-thread-store-coordinator.md S2d/S2e evidence ProjectionStore 直接实现 canonical ThreadStore;canonical/projection/thread-store tests 通过,S2e consumer cutover 已完成。
S2e completed / canonical-read-owner-and-presentation-boundary-superseded coordinator -> root S2e claims + .lime/refactor-v2/claims/S2q-agent-session-canonical-presentation-boundary-root.md S2e handoff + S2q evidence/handoff block_on 与静默 store fallback 已移除;thread/read/list/... 负责 identity/control,agentSession/read 保留为同一 ThreadStore-backed current 产品 presentation endpoint。旧整段删除 AgentSession presentation namespace 的退出条件已 superseded;Renderer 缺 detail fail closed,production App Server 必须显式注入 runtime。
S2f-empty-thread-create completed / current-read-and-Electron-Gate-B-validated coordinator .lime/refactor-v2/claims/S2f-empty-thread-create-coordinator.md S2f evidence/handoffs empty canonical create、跨 RuntimeCore session identity、delete/import replace 清理与错误原子性已验证;真实 Electron Gate B 创建/列出/打开首个 Turn 前会话,不允许 GUI fallback。
S2g-sessions-canonical-fixtures completed / validated-and-consumed-by-current-read-model coordinator .lime/refactor-v2/claims/S2g-sessions-canonical-fixtures-coordinator.md S2g/S2k evidence 旧 gap、legacy process-item seed 与 delta batch fixture 已迁到 contiguous event/projection + canonical ThreadStore/Item;sessions/read fixtures 与 downstream lifecycle Gate B 已通过。
S2g-message-batch-materialization completed / validated-and-consumed-by-S2k coordinator .lime/refactor-v2/claims/S2g-message-batch-materialization-coordinator.md S2g/S2k evidence message.delta_batch 读取 deltas,Approval 使用 requestId,commentary/final 使用显式 itemId,Codex warning notification-only;projection 与 downstream canonical lifecycle 已验证。
S2h-canonical-queue-state completed / focused-and-unified-Gate-B-validated canonical-queue-state .lime/refactor-v2/claims/S2h-canonical-queue-state-canonical-queue-state.md 20260712T201546Z-S2h-canonical-queue-state.md + internal/research/refactor/v2/13-evidence/2026-07-13-s5-canonical-read-consumers.md queue.added -> InProgress + Queued、queue.removed 按 queuedTurnId 删除、queue.promoted 不生成 phantom Turn、turn.started -> Running;producer/materializer focused tests 与 S5 queued promotion 统一 Gate B 通过
S2i-canonical-active-turn-read completed / coordinator-validated / Gate-B-3-pass-1-flaky-evidence-closed coordinator .lime/refactor-v2/claims/S2i-canonical-active-turn-read-coordinator.md 20260713T055500Z-S2i-canonical-active-turn-read-coordinator.md + internal/research/refactor/v2/13-evidence/2026-07-13-s2i-canonical-active-turn-read.md 增量 turn.accepted -> message.delta -> queue.added canonical read 回归通过;三次 kept Electron Gate B 均在 promotion 前解析唯一 active Turn、收到 cancel,并由 SQLite/event log 证明 active durable;coordinator 复核 Rust 1/1、queue/read TS 32/32、typecheck 与 contracts 290 checks 通过;一次不保留目录的首跑早读失败仅保留为 timing/environment evidence,禁止 GUI fallback
S2j-projection-thread-identity completed / focused-validated coordinator .lime/refactor-v2/claims/S2j-projection-thread-identity-coordinator.md internal/research/refactor/v2/13-evidence/2026-07-13-s2j-projection-thread-identity.md ProjectionStore 已删除 threadId = sessionId fallback;首次缺 identity、后续 explicit conflict、turn 跨 owner reuse 与 repair clear/replay rollback 均 fail closed。projection_store_tests 23/23、rustfmt/diff 通过。Electron synthetic admission identity 修复是独立 Host write set;旧 turn first-notification fallback race 已登记给 Host owner。
S2k-canonical-message-plan-lifecycle completed / focused-contract-and-Gate-B-validated root .lime/refactor-v2/claims/S2-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s2-canonical-message-plan-lifecycle.md Codex 对齐的 user/agent completed lifecycle、typed Plan、turn-scoped revision identity、authoritative final snapshot、restart/read model/GUI hydrate 与 Plan-only whitespace suppression 已完成。Rust focused、protocol、canonical reader、typecheck、694 types 零漂移、290 client checks 与 Plan history Electron Gate B 通过;完整 test:contracts 仅被无关已跟踪 release plan 的 docs ignore 边界阻断。
S2l-canonical-history-repair completed / focused-and-Gate-B-validated / related-import-concern-closed-by-S2m root .lime/refactor-v2/claims/S2l-canonical-history-repair-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s2l-canonical-history-repair.md + S2l/S2m handoffs canonical Item 的 live/history 展示统一使用 ordinal;持久化 Reasoning 接管反序临时 thinking 时重新插入正文前。TS 12/12、Rust 8+21、typecheck/lint、history Electron fixture、GUI smoke 与真实 CDP thinking#6 -> text#314 通过。原 related 1093/1094 的 completed Plan 唯一失败已由 S2m 关闭,当前 related app-server 1097/1097。
S2m-conversation-import-plan-lifecycle completed / focused-and-related-rust-validated / file-size-residual-closed-by-S2r root .lime/refactor-v2/claims/S2m-conversation-import-plan-lifecycle-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s2m-conversation-import-plan-lifecycle.md + S2m/S2r evidence/handoffs Codex item_completed(Plan.id) 是 completed Plan 的 authoritative Item/revision identity;presentation/canonical read 同为 item-plan-1,不再按 turn/event 合成第二 identity。focused 2/2、related app-server 1097/1097、rustfmt/diff 通过。原 1002 行 events.rs 已由 S2r 拆出 Plan 子模块并降至 921 行。
S2n-conversation-import-message-lifecycle completed / focused-related-rust-and-history-Gate-B-validated / ordinal-owner-superseded-by-S2u root .lime/refactor-v2/claims/S2n-conversation-import-message-lifecycle-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s2n-conversation-import-message-lifecycle.md + S2n/S2u handoffs Codex imported User/Agent Message 使用 source call ID / source event sequence 派生稳定 identity,并写入完整 item.started / presentation / item.completed lifecycle;sourceEventSeq 仅保留 provenance,canonical ordinal 后续已由 S2u 统一为首次 Lime outer EventLog sequence。focused 2/2、shared related app-server 1097/1097、rustfmt/diff 与 history Electron fixture 通过。
S2o-runtime-message-reasoning-item-lifecycle completed / focused-related-history-and-reasoning-Gate-B-validated / identity-superseded-by-S2o3 / released root .lime/refactor-v2/claims/S2o-runtime-message-reasoning-item-lifecycle-root.md + S2o2/S2o3 follow-up S2o/S2o2/S2o3 evidence provider text/reasoning Start/Delta/End 的 raw ID 经 canonical Turn + sampling attempt scope 后贯穿 Agent/App Server;Message parser 与 Reasoning accumulator 按 Item ID 隔离,Plan 仅记录 sourceItemId。S2o2 的 attempt-only identity 已由 S2o3 判为 dead;current provider Turn 11/11、related Rust 全绿与六工具 Gate B 通过。
S2o3-provider-output-turn-identity completed / related-Rust-and-AgentControl-managed-Gate-B-validated / released root released internal/research/refactor/v2/13-evidence/2026-07-15-s2o3-provider-output-turn-identity.md provider:{turn_id}:{attempt}:{family}:{source_item_id} 成为唯一 current output identity;同 raw ID 跨 Turn/attempt 不复用,Start/Delta/End 同源。related Rust:agent-runtime 117、App Server 1119、lime-agent 263、scheduler 24、server 111 全绿;fresh Gate B 15/15 assertions、六工具 completed。
S2q-agent-session-canonical-presentation-boundary completed / focused-typecheck-history-Gate-B-and-GUI-smoke-validated root .lime/refactor-v2/claims/S2q-agent-session-canonical-presentation-boundary-root.md S2q evidence/handoff agentSession/read 保留为 ThreadStore-backed current presentation endpoint;无 detail Renderer fallback 已删除并反转测试,AppServer::new() 仅 test build。client 22/22、typecheck、history Electron fixture 与 GUI smoke 通过。
S2r-import-plan-module-split completed / focused-rust-and-line-guard-validated / released root .lime/refactor-v2/claims/S2r-import-plan-module-split-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s2r-import-plan-module-split.md + handoff conversation import root 只保留 item_completed Plan-vs-Tool 分派;Plan ResponseItem/completed Item lowering 与 markdown helpers 迁入 specialized module,root 1002 -> 921 行。Plan 24/24、App Server lib check、scoped rustfmt/diff 通过;协议、wire、GUI 与 shared S2o2 测试文件未改。
S2s-canonical-agent-message-content-parts completed / focused-and-media-Gate-B-validated / released root .lime/refactor-v2/claims/S2s-canonical-agent-message-content-parts-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s2s-canonical-agent-message-content-parts.md + S2s/S2s1 handoffs canonical AgentMessage typed Text/Media/reference parts 已贯穿 materializer、ThreadStore/read model、schema/generated client 与 live reader;agent-protocol 29、projection 39、read-model 47、canonical store 21、schema 1、client 63、reader 16、contracts 与 media Gate B 通过。后序 Content Factory action_not_found 已由 S7ad 关闭。
S2t-app-data-session-fallback-removal completed / focused-related-GUI-smoke-and-governance-validated / released root .lime/refactor-v2/claims/S2t-app-data-session-fallback-removal-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s2t-app-data-session-fallback-removal.md + handoff app-data AgentSessionReadResponse hydration、session/thread identity/read fallback 与 681 行 session_hydration.rs 已物理删除;RuntimeCore + EventLog + ProjectionStore/ThreadStore 是 session read/resume 唯一 current owner,objective/session-file app-data 能力保持 current。focused 100/100、App Server 1118/1118、GUI smoke、legacy 0/0/0 与 scoped rustfmt/diff 通过。
S2u-canonical-threadstore-ordinal-owner completed / focused-related-and-import-live-continuation-validated / released root .lime/refactor-v2/claims/S2u-canonical-threadstore-ordinal-owner-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s2u-canonical-threadstore-ordinal-owner.md + handoff App Server canonical materializer 以首次 Lime outer AgentEvent.sequence 作为 Item ordinal 唯一事实源;后续 lifecycle merge 保留首次 ordinal,Tool/Message/Reasoning/Plan/import producer ordinal 与 Codex sourceEventSeq 不再进入持久化 ordering,ThreadStore 不做 MAX+1 重编号。projection 40/40、store 10/10、import 13/13 与 import 后 live continuation 1/1 通过。
S2v-canonical-projection-fail-closed completed / focused-external-sequence-and-app-server-validated / released root .lime/refactor-v2/claims/S2v-canonical-projection-fail-closed-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s2v-canonical-projection-fail-closed.md + handoff EventLog-first 保持不变;普通 canonical ThreadStore apply 失败现在返回显式错误,不返回 notification、不推进内存 history,durable tail 留给 restart/repair 恢复。focused 1/1、external sequence 5/5、App Server 1118/1118 与 scoped rustfmt/diff 通过。
S3 production-canonical / provider-dual-algebra-deleted-forbidden-to-restore provider-a -> root S3f + S3g/S3h/S3i claims S3f + internal/research/refactor/v2/13-evidence/2026-07-15-s3-provider-dual-algebra-retirement.md + S3g/S3h/S3i handoffs provider stream、agent consumer 与 media request lowering 只走 canonical/current。runtime-core 旧 request/event algebra、event mapper/tests 与 model-provider generic old-request lowering 共净删 1561 行;8 个 pure-old 文件进入物理回流守卫,存活 lowering 禁止 LlmRequest/ProviderWireRequest。runtime-core 43、model-provider 126、media 51+9、client contract 288 通过。
S3c completed / environment-blocker-resolved-by-S3e-S3f provider-consumer-a -> coordinator .lime/refactor-v2/claims/S3c-provider-consumer-a.md S3c handoff + S3e/S3f evidence media consumer 已迁移;历史 ENOSPC 已由 S3e/S3f 的 media-runtime 50+51、route integration 9+9 与 model-provider 118 tests 关闭,不再是 current blocker。
S3d completed / stale-recovered-and-current-tree-validated coordinator-s3d-recovery -> root S3d provider client/cutover/recovery claims S3d recovery handoffs + active-claim audit handoff CurrentProviderEvent 投影已删除;既有 model-provider、App Server provider history/tool event 验证保持,fresh current-tree provider_turn 10/10 通过并覆盖 reasoning-only 无用户可见输出 fail closed。
S3g-runtime-core-dual-algebra-retirement completed / coordinator-recovered / runtime-core-validated / released provider-runtime-core-cleanup -> root .lime/refactor-v2/claims/S3g-runtime-core-dual-algebra-retirement-provider-runtime-core-cleanup.md internal/research/refactor/v2/13-evidence/2026-07-15-s3g-runtime-core-dual-algebra-retirement.md + recovery handoff runtime-core 旧 types/events/tests 与 crate exports 已物理删除;worker HTTP 400 后由 coordinator 基于完整 diff、停止变化与 43/43 shared tests 恢复收尾。
S3h-model-provider-generic-lowering-retirement completed / focused-and-shared-rust-validated / released provider-lowering-cleanup .lime/refactor-v2/claims/S3h-model-provider-generic-lowering-retirement-provider-lowering-cleanup.md internal/research/refactor/v2/13-evidence/2026-07-15-s3h-model-provider-generic-lowering-retirement.md + handoff 五个 generic old-request module 删除,四个存活 lowering 文件只保留 canonical media builder/options/error;model-provider 126、media 51+9 通过。
S3i-provider-dual-algebra-retired-guard completed / architecture-contract-validated / released root .lime/refactor-v2/claims/S3i-provider-dual-algebra-retired-guard-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s3-provider-dual-algebra-retirement.md + handoff architecture provider 单代数口径已更新;8 个 dead path 与四个 old symbol 纳入 contract guard,App Server client contract 288、exact format/diff 通过。
S4 completed / canonical-tools-skills-MCP-AgentControl-and-visible-DOM-Gate-B-validated coordinator -> root S4a-S4al claims S4a-S4al evidence,重点见 S4i2、S4l、S4aa、S4ad-S4al RuntimeTool、canonical Tool Item、approval/restart、Skills、MCP sampling-step snapshot/live management/form elicitation、AgentGraph、durable mailbox、restart recovery、terminal Result 和 canonical SubAgent GUI 已收敛。S4ag/S4aj 让 spawn 与 warm followup 消费 effective target route;S4ah 证明六工具 runtime/DOM completed 与三类 activity 可见;S4ai 删除 synthetic Team fixture;S4al 再证明关闭并重启 Electron/App Server 后 Tool/SubAgent/child Thread identity 完全恢复,且首页 bundle 资源不再产生 file:///home-covers 缺失。S4ak 让 runtime MCP initialize 如实广告 2025-06-18 + {"elicitation": {}},management 保持 absent,并以同 pid Gate B 关闭 capability 假绿。agentSession/read 是 ThreadStore-backed current presentation endpoint,不是 compat。
S4a-tool-core completed / production-consumer-closed-by-S4c tool-core-a -> runtime-tools-production-a .lime/refactor-v2/claims/S4a-tool-core-tool-core-a.md + .lime/refactor-v2/claims/S4c-tool-production-wiring-runtime-tools-production-a.md S4a/S4c evidence canonical spec/executor/emitter/output contract 97 tests 通过;S4c 已接入 current provider 生产 caller,旧 AgentEvent/App Server raw mapper 与残余 backend/core stream DTO 已由 S4d-S4n 删除。
S4b-display-items completed / review-and-governance-corrected coordinator .lime/refactor-v2/claims/S4b-display-items-coordinator.md S4b review/closeout evidence Tool/MCP/Collab/Approval typed display DTO、schema/client 与 25 materializer tests 通过;ask-user resolved-without-decision 为 terminal + decision null + Turn Resolved。MCP server elicitation 是独立瞬时 reverse request,不投影为 Item;legacy report 边界违规为 0。
S4c-tool-production-wiring completed / coordinator-unit-and-downstream-Gate-B-validated / product-chain-closed-by-S4f-S4l-S4ae runtime-tools-production-a -> coordinator .lime/refactor-v2/claims/S4c-tool-production-wiring-runtime-tools-production-a.md S4c + S4f/S4l/S4ae evidence current provider 已唯一走 RuntimeTool/ToolCall/Emitter/NormalizedOutput;缺 turn ID fail-closed,host-first 调度保证 canonical ItemStarted -> ActionRequired -> ItemCompleted。旧 wire DTO、backend mapper 与 core stream DTO 已由 S4d-S4n 删除,image/MCP/AgentControl 产品工具链 Gate B 已关闭原 tool-path pending。
S4d-tool-wire-delete completed / canonical-wire-and-deletion-validated coordinator .lime/refactor-v2/claims/S4d-tool-wire-delete-coordinator.md S4d/S4e closeout evidence host/backend/artifact/workspace patch 已切 canonical Item;nested materializer、lifecycle/sequence guard 已迁;旧 enum/orchestrator/emitter/batch 已物理删除并补回流守卫,workspace patch identity 8/8。
S4e-canonical-tool-consumers completed / canonical-only-read-projection-validated coordinator .lime/refactor-v2/claims/S4e-canonical-tool-consumers-coordinator.md S4d/S4e + S4i evidence provider history、nested output refs 与 thread/read-model tool projection 只消费 typed Tool Item;imported raw fallback、synthetic item、legacy merge/ID/conflict diagnostics 已删除并有 forbidden guard。projection 3/3、read model 27/27、contracts 通过,import producer 已由 S4i cutover。
S4f-image-command-canonical-tool completed / canonical-and-Gate-B-validated s4d-readonly-review -> coordinator .lime/refactor-v2/claims/S4f-image-command-canonical-tool-s4d-readonly-review.md 20260712T180729Z-S4f-image-command-canonical-tool-s4d-readonly-review.md + internal/research/refactor/v2/13-evidence/2026-07-12-s1c-image-domain-side-channel.md image command raw Tool lifecycle 清零;canonical Tool started/completed 同 identity 可投影,image task domain side-channel 进入既有 GUI 投影;图片命令、普通画图意图、terminal preview 与 reload restore Gate B 均通过
S4g-current-tool-approval-identity completed / coordinator-validated s4g-approval-identity-a -> coordinator .lime/refactor-v2/claims/S4g-current-tool-approval-identity-s4g-approval-identity-a.md 20260712T181403Z-S4g-current-tool-approval-identity-coordinator.md typed call/turn + canonical thread identity 已替代 metadata 反推;tool-runtime 7/7、current provider 8/8、真实 approval resume 1/1
S4h-delete-live-tool-args completed / coordinator-validated s4h-live-tool-args -> coordinator .lime/refactor-v2/claims/S4h-delete-live-tool-args-s4h-live-tool-args.md 20260713T050800Z-S4h-delete-live-tool-args-stale-recovered.md + internal/research/refactor/v2/13-evidence/2026-07-13-s4h-live-tool-args-closeout.md live tool.args synthesis 已删除并纳入 EventStore retired guard;canonical sequence fixture 与 approval terminal backend 已修正;lifecycle 13/13、tool events 13/13、external events 4/4、sequence 6/6、approval terminal 1/1
S4i-skills-metadata-policy completed / typed-catalog-body-and-S4i2-Gate-B-validated coordinator -> S4i2 .lime/refactor-v2/claims/S4i-skills-metadata-policy-coordinator.md + S4i2 claim S4i + S4i2 evidence/handoff typed stable skillId/source/authority/scope/enabled/interface/dependencies/capabilities 已贯穿 snapshot、search、selection、App Server catalog、schema/client 与 Renderer;真实 SKILL.md + references 累计预算只注入 allow body,omitted/deny 有稳定 reason/evidence。此前 GUI “Provider 鉴权”已重分类为 retired raw Tool fixture,不是外部凭证 blocker;S4i2 canonical fixture Gate B 与 stable skill/read 已关闭当前链路。
S4i2-skills-runtime-canonical-fixture-gate-b completed / skills-Gate-B-validated / released root .lime/refactor-v2/claims/S4i2-skills-runtime-canonical-fixture-gate-b-root.md + S4i3 guard claim internal/research/refactor/v2/13-evidence/2026-07-15-s4i2-skills-runtime-canonical-fixture-gate-b.md + S4i2 handoff Skills search/invocation fixture 已改发 canonical item.started/item.completed nested Tool Item;focused 57/57、专用 Skills Gate B、GUI smoke、scripts governance 与格式/diff 均通过。natural、显式 $skill、workspace manual-enable 三入口的 search/Skill Tool 均 completed;后续 media-reference Gate B 已由 S2s/S4i4 通过,不回退 S4i2。
S4i4-canonical-media-reference-fixture-lifecycle completed / focused-and-media-Gate-B-validated / released root .lime/refactor-v2/claims/S4i4-canonical-media-reference-fixture-lifecycle-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s4i4-canonical-media-reference-fixture-lifecycle.md + handoff external media AgentMessage 使用稳定同 ID item.started/item.completed lifecycle;focused guard 55/55、governance:scripts 与真实 Electron media Gate B 通过,read model/media card/preview/reference/no-inline-payload 均有证据。
S4i-stable-skill-read-id completed / stable-id-current-and-Gate-B-validated coordinator .lime/refactor-v2/claims/S4i-stable-skill-read-id-coordinator.md S4i stable-id evidence/handoff default provider roots 保留 project/user/app scope;skill/read wire 只接受 stable skillId,catalog/read 共享 first-provider winner locator,name/path/scope guess 已删除。skills 66、protocol/schema、Rust/TS client、Renderer、contracts、GUI smoke 与 Electron stable-id roundtrip 全通过。
S4i-conversation-import-tool-items completed / canonical-wire-and-Gate-B-validated coordinator .lime/refactor-v2/claims/S4i-conversation-import-tool-items-coordinator.md internal/research/refactor/v2/13-evidence/2026-07-13-s4i-conversation-import-tool-items.md Codex import 在 commit identity 边界 lower 为 canonical typed Tool lifecycle;raw import bypass、projection allowlist 和正向 compat fixture 已删除,read/write wire 均 fail-closed。conversation import 10/10、external canonical Tool 4/4、tool projection 4/4、read model 27/27、contracts 290 checks、typecheck 通过;home-hotpath Gate B 重跑通过。approval resume Gate B 在 action.required 前遭 fixture provider 鉴权失败,保留为环境 blocker。
S4j-import-typed-draft completed / coordinator-validated coordinator .lime/refactor-v2/claims/S4j-import-typed-draft-coordinator.md .lime/refactor-v2/handoffs/20260713T033127Z-S4j-import-typed-draft-coordinator.md + internal/research/refactor/v2/13-evidence/2026-07-13-s4j-import-typed-draft.md source-local raw Tool envelope 已删除;typed draft 覆盖 ResponseItem、specialized EventMsg 与 current paginated item_completed(TurnItem),unknown completed Item 显式记为 unsupported/provenance-only。conversation import 48/48、canonical external Tool 4/4、contracts 290 checks、legacy governance boundary 0 通过;本 slice 不改变 GUI,Gate B 继承 S4i canonical wire evidence。
S4j1-codex-import-tool-search-internal completed / parser-and-import-focused-validated / released root .lime/refactor-v2/claims/S4j1-codex-import-tool-search-internal-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s4j1-codex-import-tool-search-internal.md + handoff Codex tool_search_call/output 只保留在 provider/rollout history,不再 lower 为公开 canonical Tool Item,也不计入 imported Tool fidelity;function/custom/web/MCP import 保持不变。parser 1/1、conversation import 13/13 与 scoped rustfmt/diff 通过。
S4k-evidence-canonical-tool-consumers completed / coordinator-validated coordinator .lime/refactor-v2/claims/S4k-evidence-canonical-tool-consumers-coordinator.md S4k handoff + internal/research/refactor/v2/13-evidence/2026-07-13-s4k-evidence-canonical-tool-consumers.md provider history、context compaction、coding/Skills/MCP/browser evidence 与 snapshot artifact 只消费 canonical Tool Item;browser action index 已拆离 999 行热区。provider 6/6、compaction 3/3、evidence unit 8/8、export integration 5/5、browser split 1/1、App Server check、contracts 290 checks 与 legacy boundary 0 通过;本 slice 不改变 GUI wire,未重跑 Gate B。
S4l-mcp-step-snapshot completed / runtime-read-model-16-of-16 / visible-DOM-12-of-12-Gate-B-validated / released coordinator -> root S4l claims + .lime/refactor-v2/claims/S4l-visible-dom-gate-b-s4l-visible-dom-gate-b.md S4l handoffs + internal/research/refactor/v2/13-evidence/2026-07-15-s4l-visible-dom-gate-b.md per-sampling-step definitions/executor 与 caller-bound MCP route/handle 同 snapshot;unknown call fail closed,deferred selection Turn-local/next-step-only。独立 Electron run 已导航目标 session,证明 runtime/read model 16/16、visible DOM 12/12、new-Turn no-leak、agentSession/read electron-ipc、deferred Tool completed row、最终文本与零 invoke/console error。tool_search 按 Codex App Server 语义只保留在 provider/rollout history,不投影 public ThreadItem;focused 5/5、Prettier/diff/scripts governance 与截图检查通过。
S4m-canonical-tool-residuals completed / coordinator-validated coordinator .lime/refactor-v2/claims/S4m-canonical-tool-residuals-coordinator.md S4m handoff + internal/research/refactor/v2/13-evidence/2026-07-13-s4m-canonical-tool-residuals.md tool_end 与 raw Tool lifecycle 全部入口拒绝;Tool/MCP/Collab 大输出 sidecar、restart hydration 与 completed+succeeded image media projection 只读 canonical Item。output 6/6、snapshots 6/6、external 4/4、thread projection 34/34、media 5/5、App Server check、contracts 290、governance catalog 199 与 legacy boundary 0 通过;触碰的四个超线生产文件均拆到 800 行以下,GUI wire 未变化。
S4n-dead-backend-event-stream-surface completed / coordinator-validated coordinator .lime/refactor-v2/claims/S4n-dead-backend-event-stream-surface-coordinator.md S4n handoff + internal/research/refactor/v2/13-evidence/2026-07-13-s4n-dead-backend-event-stream-surface.md zero-consumer backend_event.rs、App Server export 与 core StreamEvent/ToolExecutionResult/StreamResult 已物理删除并补路径/symbol 守卫;TokenUsage current consumers 保留。Rust/contract/governance 定向验证见 evidence;GUI wire 未变化。
S4o-mcp-control-plane-step-snapshot-audit completed / read-only-audit coordinator .lime/refactor-v2/claims/S4o-mcp-control-plane-step-snapshot-audit-coordinator.md .lime/refactor-v2/handoffs/20260713T080102Z-S4o-mcp-control-plane-step-snapshot-audit.md + S4o evidence Resource/Prompt/status management owner、connection capability lifetime 与未实现的 server elicitation 已分类;resource/prompt identity 分拆为 S4p/S4q。
S4o-mcp-control-plane-owner-split completed / coordinator-validated coordinator .lime/refactor-v2/claims/S4o-mcp-control-plane-owner-split-coordinator.md .lime/refactor-v2/handoffs/20260713T094900Z-S4o-mcp-control-plane-owner-split-coordinator.md + internal/research/refactor/v2/13-evidence/2026-07-13-s4o-mcp-control-plane-owner-split.md tool-runtime bridge 已净减 caller-unaware dispatch 与 management APIs,只保留 same-step Tool snapshot/dispatch;tool-runtime 7、lime-mcp 114、lime-agent 10 与四 crate check 通过,contract/governance 见 evidence。
S4p-mcp-resource-target-identity completed / focused-contracts-current-smoke-and-GUI-validated coordinator .lime/refactor-v2/claims/S4p-mcp-resource-target-identity-coordinator.md .lime/refactor-v2/handoffs/20260713T090851Z-S4p-mcp-resource-target-identity.md + internal/research/refactor/v2/13-evidence/2026-07-13-s4p-mcp-resource-target-identity.md read/subscribe/unsubscribe 从 protocol 到 manager/native helper/GUI 全部使用 exact (server, uri);同 URI 双 server backend/GUI 回归通过。manager 13、Rust client 2、tool-runtime 2、schema drift 1、Renderer 38、contracts 290、legacy governance、五 crate check、MCP current smoke 与 GUI smoke 通过;live provider 未配置且非本 slice 门禁。
S4q-mcp-prompt-target-identity completed / focused-and-current-fixture-validated coordinator .lime/refactor-v2/claims/S4q-mcp-prompt-target-identity-coordinator.md + .lime/refactor-v2/claims/S4q-closeout-current-fixtures-coordinator.md .lime/refactor-v2/handoffs/20260713T095214Z-S4q-mcp-prompt-target-identity.md + .lime/refactor-v2/handoffs/20260713T101000Z-S4q-closeout-current-fixtures-coordinator.md + internal/research/refactor/v2/13-evidence/2026-07-13-s4q-mcp-prompt-target-identity.md Prompt get 从协议到 GUI 统一 exact (server, name),跨连接扫描/前缀解析与迟到结果串目标已删除;manager 10、typed Rust 3、schema 1、Renderer 43、App Server processor 2、package client 62、contracts 290 与 legacy 0/0/0 通过。deterministic fixture 不实现 prompt get,不冒充 Gate B。
S4s-mcp-sampling-capability-fail-closed completed / coordinator-validated s4s-sampling-cap-impl -> coordinator .lime/refactor-v2/claims/S4s-mcp-sampling-capability-fail-closed-s4s-sampling-cap-impl.md .lime/refactor-v2/handoffs/20260713T101000Z-S4s-mcp-sampling-capability-fail-closed.md + internal/research/refactor/v2/13-evidence/2026-07-13-s4s-mcp-sampling-capability-fail-closed.md 无 handler 的 sampling 正向广告已删除并补回流守卫;focused 1、lime-mcp 116、App Server check、contracts 290、legacy 0/0/0 与 rustfmt/diff 通过。GUI/protocol wire 未变。
S4t-agent-graph-edge-persistence completed / coordinator-validated / production-wiring-closed-by-S4v-S4ad s4t-edge-store-impl -> coordinator .lime/refactor-v2/claims/S4t-agent-graph-edge-persistence-s4t-edge-store-impl.md S4t + S4v/S4ad evidence Codex AgentGraphStore 已适配到 thread-store + ProjectionStore canonical SQLite;child unique parent、Open/Closed audit、stable BFS/reopen、transactional self/cycle rejection 已验证。AgentControl production caller 与 canonical SubAgent producer 已由 S4v/S4ad 接通。
S4u-agent-mailbox-persistence completed / durable-storage-and-production-consumer-closed-by-S4w-S4aa coordinator .lime/refactor-v2/claims/S4u-agent-mailbox-persistence-coordinator.md S4u + S4w/S4aa evidence thread-store contract 与 ProjectionStore 同 SQLite implementation 已建立;identity 双唯一、message-id idempotency/conflict、QueueOnly/TriggerTurn、FIFO、delivered audit/reopen 已验证。canonical Item append-before-ack、Turn trigger、wait/terminal activity 已由 S4w/S4aa 接通,无 legacy metadata/map/second queue。
S4v-agent-control-production-wiring completed / control-boundary-and-focused-test-validated coordinator .lime/refactor-v2/claims/S4v-agent-control-production-wiring-coordinator.md internal/research/refactor/v2/13-evidence/2026-07-14-s4v-agent-control-production-wiring.md + internal/research/refactor/v2/13-evidence/2026-07-14-s4r8-local-data-source-fixture-sync.md RuntimeCore 仅在 loaded parent 下通过 canonical start_session 创建 child,再写 Open edge;edge failure 会补偿删除 child session/Thread,close 仅接受 durable descendant 并保留 Closed audit,restart 无 legacy metadata fallback。rustfmt/diff、App Server library check 与 agent_control 6/6 通过。mailbox、gateway/tool、JSON-RPC、GUI、旧 Team 删除均不属于该 slice。
S4r8-local-data-source-fixture-sync completed / focused-validated coordinator .lime/refactor-v2/claims/S4r8-local-data-source-fixture-sync-coordinator.md internal/research/refactor/v2/13-evidence/2026-07-14-s4r8-local-data-source-fixture-sync.md LocalAppDataSource fixture 与 production router field 已同步;trait implementation 显式 clone owner router,真实 stdio MCP resource fixture 1/1、S4u mailbox store 4/4、S4v agent control 6/6 与 App Server check 通过。macOS test worker stack 以仓库既有 RUST_MIN_STACK=8388608 口径运行;不新增 MCP runtime/router owner 或 mock。
S4w-agent-mailbox-production-consumer completed / focused-validated / product-chain-closed-by-S4ad-S4ah coordinator .lime/refactor-v2/claims/S4w-agent-mailbox-production-consumer-coordinator.md S4w + S4ad/S4ah evidence RuntimeCore 已消费 durable mailbox:message ID 派生 canonical Item,TriggerTurn deterministic,QueueOnly 在下一真实 turn 前投影;Item-before-ack 与 EventLog recovery 已验证。六工具、GUI、restart 与旧 Team 退出已由后续 AgentControl/canonical GUI slices 关闭。
S4x-agent-control-tool-gateway completed / focused-and-product-chain-closed-by-S4aa-S4ah coordinator .lime/refactor-v2/claims/S4x-agent-control-tool-gateway-coordinator.md S4x + S4aa/S4ah evidence 六个 V2 AgentControl 工具仅在 RuntimeCore per-turn gateway 存在时进入 current provider;wait terminal/steer 由 S4aa 关闭,真实 Electron/GUI visible-DOM Gate B 由 S4ah 关闭。
S4y-dead-team-tool-surface completed / focused-governance-and-current-product-chain-validated root .lime/refactor-v2/claims/S4y-dead-team-tool-surface-root.md S4y + S4ae/S4ai evidence tool-runtime::collab_agent、旧 Team catalog/prompt/discovery/native allowlist 已物理删除;current 六工具与 canonical GUI 已接管,synthetic Team fixture 已由 S4ai 删除。
S4ab-legacy-collab-projection-boundary completed / package-contract-governance-and-S4ae-S4ah-product-chain-validated root .lime/refactor-v2/claims/S4ab-legacy-collab-projection-boundary-root.md S4ab + S4ae/S4ah evidence 六个 AgentControl V2 名称是唯一 current projection taxonomy;四个裸 V1 alias 为 dead,历史 Rust operation/activity 只读。canonical GUI 与 visible-DOM Gate B 已关闭原产品链缺口。
S4z-agent-control-restart-on-demand completed / focused-App-Server-and-product-chain-closed-by-S4aa-S4ah root .lime/refactor-v2/claims/S4z-agent-control-restart-on-demand-root.md S4z + S4aa/S4ah evidence 新 RuntimeCore 只 hydrate root;QueueOnly 不加载 child,followup/interrupt 精确 hydrate target,Closed edge 不可寻址且不 reopen。restart terminal activity 与真实 GUI Gate B 已由 S4aa/S4ah 关闭。
S4aa-agent-terminal-mailbox-activity completed / focused-Rust-App-Server-and-product-chain-closed-by-S4ad-S4ah root .lime/refactor-v2/claims/S4aa-agent-terminal-mailbox-activity-root.md S4aa + S4ad/S4ah evidence direct-parent completed/failed Result、assistant Item/mailbox metadata、EventLog recovery、steer priority、deadline recovery 与 CAS/dedupe 已完成;targeted producer、六工具与 visible-DOM Gate B 已关闭原 JSON-RPC/Multi-Agent pending。
S4ac-wait-agent-canonical-item completed / focused-and-lime-agent-validated / targeted-SubAgent-producer-ready root .lime/refactor-v2/claims/S4ac-wait-agent-canonical-item-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s4ac-wait-agent-canonical-item.md wait_agent canonical lifecycle 复用既有 CollabAgentToolCall::Wait,Started/Completed identity/ordinal 与 terminal output 保真;focused 1、protocol 19、current provider 13、lime-agent check、rustfmt/diff 通过。S4aa 已释放 gateway,S4ad 可用真实 target ThreadId 产 SubAgent;list 保持 generic Tool。
S4ad-targeted-subagent-producer completed / focused-Rust-schema-and-S4ae-Gate-B-validated root released internal/research/refactor/v2/13-evidence/2026-07-14-s4ad-targeted-subagent-producer.md + S4ae evidence gateway 成功结果携带真实 resolved ThreadId 的 typed internal fact;current provider 保留普通 Tool 并追加 distinct completed SubAgent Item。fact 不进入模型或 Tool metadata;失败、错配、wait/list 零 activity。S4ae 已将临时十值 contract 收口为 Codex 三值,并用六工具 managed Gate B 关闭 GUI/产品链验证。七旧值无兼容约束,禁止恢复。
S4ae-canonical-subagent-gui completed / focused-GUI-Rust-governance-and-AgentControl-managed-Gate-B-validated root released internal/research/refactor/v2/13-evidence/2026-07-14-s4ae-canonical-subagent-gui.md canonical SubAgent cold/live GUI、三值 activity、后台 child admission、显式 parent runtime request 继承与 Turn-scoped provider output identity 已收口;六工具 managed Gate B status=pass、15 assertions 全真、六项 completed。旧 Team current 文档、compat inventory evidence、synthetic sidecar 与七旧值均已删除/禁止回流;当时登记的 effective route、warm followup route 与 visible DOM 缺口已由 S4ag/S4aj/S4ah 关闭。
S4af-codex-subagent-import-fidelity completed / focused-and-App-Server-validated / registered-by-S7ah root .lime/refactor-v2/claims/S4af-codex-subagent-import-fidelity-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s4af-codex-subagent-import-fidelity.md + S4af handoff imported Codex SubAgent activity 保留 Started/Interacted/Interrupted exact kind,status labels 只作 presentation;focused 1+1、App Server check 与 scoped format/diff 通过。实现早于 S4ae 释放完成,本行补齐当时明确延期的中央计划登记。
S4ag-effective-child-route completed / focused-App-Server-validated / released root released internal/research/refactor/v2/13-evidence/2026-07-15-s4ag-effective-child-route.md RuntimeBackend 复用既有 selection/reasoning/turn-policy/workspace/search 解析,回写唯一 StoredSession.turn_runtime_options 后再构造 gateway;child 不复制 session metadata 或 parent-only output contract。focused 2/2、AgentControl 14/14。
S4ah-agent-control-visible-dom-gate-b completed / focused-Rust-Renderer-and-Electron-Gate-B-validated / released root released internal/research/refactor/v2/13-evidence/2026-07-15-s4ah-agent-control-visible-dom-gate-b.md 删除 smoke 从 SubAgent status 反推 Tool 的 compat 逻辑;wait_agent read presentation 修为普通 Tool。真实 Electron Gate B 28/28,六个 typed Tool row completed/visible,Started/Interacted/Interrupted activity 可见,agentSession/read=electron-ipc,console/invoke error 0。
S4ai-dead-synthetic-team-fixture completed / deleted-forbidden-to-restore / focused-governance-validated / released root released internal/research/refactor/v2/13-evidence/2026-07-15-s4ai-dead-synthetic-team-fixture.md multi-agent-team-fixture-scenario.mjs 与 15 个脚本 consumer 已物理删除/迁出;路线图和 Project/Thread 执行记录改用 canonical AgentControl evidence。净删 707 行,fixture 54/54、regression 16/16 与 scripts governance 通过。
S4aj-followup-target-route completed / focused-library-and-Electron-Gate-B-validated / released root released internal/research/refactor/v2/13-evidence/2026-07-15-s4aj-followup-target-route.md warm followup 优先 target 最近 effective Turn options;仅 cold/unloaded target 使用 caller effective snapshot。focused 1/1、AgentControl 15/15、App Server check、exact rustfmt/diff 与同代码状态 S4ah Electron Gate B 28/28 通过。
S4al-agent-control-cold-restart-visible-dom completed / focused-asset-unit-renderer-build-and-Electron-Gate-B-validated / released root released internal/research/refactor/v2/13-evidence/2026-07-15-s4al-agent-control-cold-restart-visible-dom.md managed Gate B 显式关闭 Electron/App Server 后重启,PID 8923 -> 9920;六 Tool、SubAgent activity、child Thread identity 前后稳定,agentSession/read/thread/list 为 electron-ipc,console/invoke 0。同步删除重复 JPG 与 /home-covers file-root 假设,保留 WebP bundle owner;9/9 unit、renderer build 和 diff/format 通过。
S4r1-mcp-elicitation-router completed / coordinator-validated / product-chain-closed-by-S4r9-S4ak s4r-router-impl -> coordinator .lime/refactor-v2/claims/S4r1-mcp-elicitation-router-s4r-router-impl.md S4r1 + S4r9/S4ak evidence manager-shared opaque exact router、bounded single consumer、closed token、cancel cleanup、typed form schema validation 与 RMCP duplex 已完成;runtime-only capability advertisement 和真实 Electron product chain 已由 S4ak 关闭。
S4r2-app-server-reverse-jsonrpc completed / correctness-and-product-chain-validated coordinator .lime/refactor-v2/claims/S4r2-app-server-reverse-jsonrpc-coordinator.md + .lime/refactor-v2/claims/S4r2b-reverse-jsonrpc-correctness-coordinator.md S4r2/S4r2b + S4r9/S4ak evidence boot-scope exact id、abort cleanup、ambiguous-client fail closed、settled replay suppression 与 typed reverse request/resolved 已完成;S4ak Gate B 证明真实 Electron/App Server/runtime/Renderer form 闭环。
S4r8-mcp-runtime-thread-owner completed / owner-lifecycle-and-S4r9-S4ak-Gate-B-validated coordinator .lime/refactor-v2/claims/S4r8-mcp-runtime-thread-owner-coordinator.md S4r8/S4r9/S4ak evidence AgentRuntimeState[sessionId] -> McpThreadRuntime 绑定 immutable thread 与独立 RMCP generation;management 只提供 typed specs 且 nested elicitation fail closed。S4r9 关闭 per-server fault isolation,S4ak 证明 runtime 2025-06-18 + elicitation {} 与 management absent 的同 pid Gate B。
S4r9-mcp-runtime-server-fault-isolation completed / focused-and-Gate-B-validated root .lime/refactor-v2/claims/S4r9-mcp-runtime-server-fault-isolation-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s4r8-gate-b-runtime-server-failure.md + internal/research/refactor/v2/13-evidence/2026-07-14-s4r9-mcp-runtime-server-fault-isolation.md McpThreadRuntime 现在并发启动 typed enabled specs;optional failure 被记录并从 snapshot 排除,required failure 只关闭候选 manager、拒绝 replacement 并保留旧 generation。真实保留故障默认 Playwright MCP 的 Electron Gate B 已获得 provider 2 requests、Renderer form accept、resolved close 和 final text;无 legacy command/console error。
S4ak-mcp-elicitation-capability-advertisement completed / focused-full-Rust-static-and-Electron-Gate-B-validated / released root .lime/refactor-v2/claims/S4ak-mcp-elicitation-capability-advertisement-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s4ak-mcp-elicitation-capability-advertisement.md runtime client 广告 2025-06-18 + {"elicitation": {}},management/router-only client 保持 2025-03-26 + absent;Gate B 同 pid 绑定 initialize/accept,management pid 独立且 capabilityMissingCount=0。lime-mcp 140/140、static 4/4、Electron Gate B 与 scripts/legacy governance 通过。
S4am-spawn-agent-fork-turns implemented / hard-crash-recovery-and-home-hotpath-Gate-B-validated / aggregate-closeout-pending root .lime/refactor-v2/claims/S4am-spawn-agent-contract-alignment-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s4am-spawn-agent-v2-contract-gap.md + focused Rust/package tests + current Electron evidence Rust strict tool contract、Renderer 64 位 usize 边界、App Server canonical final-answer history、typed lineage/source mapping、返回错误清理与 durable pending-spawn crash recovery 已闭环;last-N/none/all、多个 final message、commentary/trace 过滤、terminal Item、稳定重试、cold restart 与并发 inflight pending 均有回归。tool-runtime 6/6、App Server AgentControl 23/23、projection 294/294、home-hotpath Electron Gate B 通过。GUI handoff 已从旧 584ms 失败修复为 stable=true、无闪回样本;identity 由真实 canonical agent_message ThreadItem 对齐 read model。项目级完整 contracts/current fixture/GUI smoke 仍待统一收口;role/model/reasoning/service-tier 未实现字段继续 fail closed。
S4an-dead-subagent-tool-exposure completed / dead-deleted / focused-Rust-validated root .lime/refactor-v2/claims/S4an-dead-subagent-tool-exposure-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s4an-dead-subagent-tool-exposure.md 零 caller 的历史 subagent whitelist API/常量/正向测试已删除;current tool surface 与 per-turn AgentControl gateway 未改。Rust 7/7,旧符号零引用。
S4ao-spawn-canonical-path-output completed / focused-Rust-and-projection-validated root .lime/refactor-v2/claims/S4ao-spawn-canonical-path-output-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s4ao-spawn-canonical-path-output.md spawn 结果 task_name 返回 canonical full path;空 nickname 删除,message_id 保留。App Server 1/1、projection 1/1。
S4-approval-restart-production completed / focused-and-approval-Gate-B-validated coordinator -> root .lime/refactor-v2/claims/S4e-approval-restart-production-coordinator.md S4e evidence/handoff + resolved-blocker audit handoff RuntimeCore 直接从 StoredSession current event 恢复 type/scope/descriptor;restart reopen、not-resumable、cancel waiter、terminal reason 与 processor error.data 均通过。S4h raw fixture 已关闭;真实 Electron 证据覆盖 resume 内 allow_for_session -> action.resolved、decline、cancel 与 fresh cancel closeout。Skills Provider 鉴权仍是独立 aggregate residual,不再归为 S4e blocker。
S5 refinement-active / canonical-read-control-and-type-retirement-validated / workspace-owner-split-complete / fresh-gates-pending coordinator .lime/refactor-v2/claims/S5-coordinator.md + S5 current-owner migration/S5ag claims S5 canonical read evidence + S5g-S5ag evidence/handoffs canonical read/control、root/type retirement 与 Workspace owner split 已收敛;入口 13 行、主 runtime 41 行、Entry/Setup/Command/Scene 均低于 800 行。仍需 fresh current-tree gates、架构确认和既有 i18n blocker 治理。
S5a completed / host-capability-and-S5-Gate-B-validated gui-s5a-host-capabilities .lime/refactor-v2/claims/S5a-host-capabilities-gui-s5a-host-capabilities.md S5a + S5 canonical read evidence typed host facade 通过 unit/focused/related tests 与 ESLint,最终 GUI Gate B 已由 S5 canonical read/control product chain 关闭。
S5c-canonical-read-consumer completed / focused-contracts-and-Gate-B-validated gui-s5-canonical-read -> coordinator .lime/refactor-v2/claims/S5c-canonical-read-consumer-gui-s5-canonical-read.md 20260712T162548Z-S5c-canonical-read-consumer-minimal-audit.md + 20260712T200156Z-S5c-canonical-read-consumer.md + internal/research/refactor/v2/13-evidence/2026-07-13-s5-canonical-read-consumers.md package/Renderer queue control 只读 canonical thread/read narrow projection;queued promotion Gate B 解析唯一 active Turn,并完成 promote、真实 cancel、resume 与 reload queue restore;focused 77 tests、typecheck、contracts 289 checks 通过
S5d-plugin-canonical-thread-read completed / coordinator-fresh-reviewed / focused-typecheck-and-contracts-validated / released plugin-canonical-thread -> coordinator -> root .lime/refactor-v2/claims/S5d-plugin-canonical-thread-read-plugin-canonical-thread.md + .lime/refactor-v2/claims/S5d-plugin-canonical-thread-read-coordinator.md 20260713T041500Z-S5d-plugin-canonical-thread-read.md + .lime/refactor-v2/handoffs/20260715T074247Z-S5d-plugin-canonical-thread-read-review-closeout-root.md + internal/research/refactor/v2/13-evidence/2026-07-13-s5-canonical-read-consumers.md canonical threadId 已贯穿 start/get/cancel/reload;缺失、冲突、错误 identity、queued/terminal/multiple-active 全部 fail closed;fresh Plugin focused 26/26、typecheck、700 protocol types、288 client checks 与完整 contracts 通过,静态守卫只接受 canonical Thread/Item。
S5e-terminal-queue-history completed / focused-and-unified-Gate-B-validated canonical-terminal-queue .lime/refactor-v2/claims/S5e-terminal-queue-history-canonical-terminal-queue.md 20260712T202403Z-S5e-terminal-queue-history.md + internal/research/refactor/v2/13-evidence/2026-07-13-s5-canonical-read-consumers.md terminal Turn 可保留 historical Running/NotQueued 且 activeTurnId 为 null;terminal+Queued 仍 fail closed;projection + adapter + flow 与同一 Electron queued promotion Gate B 通过
S5f-active-stream-queue-intent completed / focused-contracts-and-Gate-B-validated coordinator .lime/refactor-v2/claims/S5f-active-stream-queue-intent-coordinator.md 20260712T215632Z-S5f-active-stream-queue-intent.md + internal/research/refactor/v2/13-evidence/2026-07-13-s5-canonical-read-consumers.md 同会话真实 active turn 强制 queue intent;queued listener 不覆盖 active binding,accepted 后立即 canonical hydrate;Gate B 约 5 秒完成且 backend ledger 真实 cancel,focused 77 tests、typecheck、contracts 与 GUI smoke 通过
S5g-managed-objective-current-owner-migration completed / focused-32-tests-eslint-typecheck-governance-validated managed-objective-current-owner .lime/refactor-v2/claims/S5g-managed-objective-current-owner-migration-managed-objective-current-owner.md S5g evidence + handoff Managed Objective 类型已直连 sessionTypes,行为与 mocks 已直连 objectiveClient;focused 32/32、ESLint、typecheck、legacy 0/0/0 与 diff check 通过,无 blocker。
S5h-execution-runtime-type-only completed / focused-eslint-typecheck-governance-validated / released s5-execution-type-only .lime/refactor-v2/claims/S5h-execution-runtime-type-only-s5-execution-type-only.md internal/research/refactor/v2/13-evidence/2026-07-15-s5h-execution-runtime-type-only.md + handoff 两个 execution runtime type-only production consumer 已直连 agentExecutionRuntime,boundary guard 防止 root compat import 回流;本切片精确净减 2,focused 1/1、ESLint、Prettier、typecheck、legacy 0/0/0 与 diff check 通过。
S5-session-types-root-barrel-residual completed / focused-typecheck-and-governance-validated / released root .lime/refactor-v2/claims/S5-session-types-root-barrel-residual-root.md evidence + handoff history、Task Rail、Harness 三个 production consumer 直连 sessionTypes;focused 23/23、typecheck、ESLint、legacy 0/0/0 与 diff check 通过。
S5-session-types-status-surface-residual completed / focused-typecheck-and-governance-validated / released root .lime/refactor-v2/claims/S5-session-types-status-surface-residual-root.md evidence + handoff 五个 status/timeline/projection consumer 直连 sessionTypes 与 queuedTurn;focused 29/29、typecheck、lint/format、legacy 0/0/0 与 diff check 通过。
S5-components-current-owner-clean-remainder completed / focused-typecheck-and-governance-validated / released s5-components-current-owner .lime/refactor-v2/claims/S5-components-current-owner-clean-remainder-s5-components-current-owner.md evidence + handoff 三个 component type consumer 直连 current owner;focused 79/79、lint/format、typecheck、legacy 0/0/0、root import 0 与 diff check 通过。
S5-session-hooks-current-owner-migration completed / focused-import-boundary-validated / released root-session-hooks-current-owner .lime/refactor-v2/claims/S5-session-hooks-current-owner-migration-root.md evidence + handoff 四个 session hook consumer 拆到 client/request/session/queued/execution/protocol owner;6 files / 66 tests、lint/format、typecheck、root scan 与 diff check 通过。
S5-workspace-current-owner-clean-remainder completed / focused-typecheck-and-governance-validated / released root .lime/refactor-v2/claims/S5-workspace-current-owner-clean-remainder-root.md evidence + handoff 五个 Workspace consumer 的六处 root specifier 已迁到 session/execution/thread/protocol current owner;focused、lint/format、typecheck、legacy 0/0/0 与 diff check 通过。
S5i-root-barrel-dynamic-type-residual completed / focused-typecheck-and-governance-validated / released root .lime/refactor-v2/claims/S5i-root-barrel-dynamic-type-residual-root.md S5i evidence + handoff 最后三处 dynamic root type query 已删除,guard 同时封住 static/dynamic exact root specifier;focused 30/30、lint/format、typecheck、legacy 0/0/0 与 diff check 通过,src/** production root consumer 为 0。
S5j-history-test-session-type-owner completed / focused-typecheck-validated / released root .lime/refactor-v2/claims/S5j-history-test-session-type-owner-root.md S5j evidence + handoff 三个 history tests 的 AgentSessionDetail 已直连 sessionTypes;focused 23/23、lint/format、typecheck、root scan 与 diff check 通过,test consumer 净减 3。
S5k-session-detail-test-owner completed / focused-typecheck-validated / released root .lime/refactor-v2/claims/S5k-session-detail-test-owner-root.md S5k evidence + handoff 五个 session/history tests 的 AgentSessionDetail 已直连 sessionTypes;focused 52/52、lint/format、typecheck、root scan 与 diff check 通过,test consumer 净减 5。
S5l-session-presentation-test-owner completed / focused-typecheck-validated / released s5l-session-presentation-tests .lime/refactor-v2/claims/S5l-session-presentation-test-owner-s5l-session-presentation-tests.md internal/research/refactor/v2/13-evidence/2026-07-15-s5l-session-presentation-test-owner.md + handoff 三个 presentation tests 已直连 sessionTypes;focused 38/38、lint/format、typecheck、root scan 与 diff check 通过。
S5m-history-state-test-owner completed / coordinator-recovered-focused-validated / released s5m_history_state_tests -> root .lime/refactor-v2/claims/S5m-history-state-test-owner-s5m_history_state_tests.md internal/research/refactor/v2/13-evidence/2026-07-15-s5m-history-state-test-owner.md + handoff 五个 history/state tests 已直连 sessionTypes;focused 41/41、lint/format、root scan 与 diff check 通过,shared typecheck 由 S5q 统一完成。
S5n-read-checkpoint-test-owner completed / focused-typecheck-and-governance-validated / released s5n-read-checkpoint-tests .lime/refactor-v2/claims/S5n-read-checkpoint-test-owner-s5n-read-checkpoint-tests.md internal/research/refactor/v2/13-evidence/2026-07-15-s5n-read-checkpoint-test-owner.md + handoff timeline/read-checkpoint tests 已直连 sessionTypes;focused 60/60、lint/format、typecheck、legacy 0/0/0 与 diff check 通过。
S5o-prepared-send-test-owner completed / focused-and-shared-typecheck-validated / released root .lime/refactor-v2/claims/S5o-prepared-send-test-owner-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s5o-prepared-send-test-owner.md + handoff 四个 prepared-send tests 已直连 agentExecutionRuntime / queuedTurn;focused 12/12、lint/format、root scan 与 diff check 通过。
S5p-event-binding-test-owner completed / focused-and-shared-typecheck-validated / released root .lime/refactor-v2/claims/S5p-event-binding-test-owner-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s5p-event-binding-test-owner.md + handoff 三个 event-binding tests 已拆到 session/execution/queue current owners;focused 27/27、lint/format、root scan 与 diff check 通过,static test root consumer 归零。
S5-client-factory-test-mock-owner completed / coordinator-recovered-focused-typecheck-validated / released root .lime/refactor-v2/claims/S5-client-factory-test-mock-owner-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s5-client-factory-test-mock-owner.md + handoff 两个 test mocks 已直连 clientFactory,boundary guard 禁止 root mock 回流;focused 204/204、lint/format、typecheck 与 diff check 通过。
S5q-root-barrel-retirement completed / focused-typecheck-client-contract-governance-validated / released root -> coordinator recovery .lime/refactor-v2/claims/S5q-root-barrel-retirement-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s5q-root-barrel-retirement.md + handoff 四个 root aggregate 文件已物理删除,真实 static/dynamic/mock consumer 为 0,retired shell guard 禁止恢复;focused 125/125 + 204/204、typecheck、client contract 288、legacy 0/0/0 与 docs boundary 通过。完整 contracts 后续只被独立 active i18n modality guard 阻断。
S5s-automation-managed-objective-type-owner completed / focused-typecheck-validated / released root .lime/refactor-v2/claims/S5s-automation-managed-objective-type-owner-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s5s-automation-managed-objective-type-owner.md + handoff 五个 Automation consumers 已直连 sessionTypes;focused 6/6、lint/format、typecheck、compat scan 与 diff check 通过。
S5t-plugin-respond-request-type-owner completed / focused-typecheck-validated / released root .lime/refactor-v2/claims/S5t-plugin-respond-request-type-owner-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s5t-plugin-respond-request-type-owner.md + handoff 两个 Plugin consumers 已直连 requestTypes;focused 18/18、lint/format、typecheck、compat scan 与 diff check 通过。
S5u-experts-type-owner completed / focused-and-shared-typecheck-validated / released s5u-experts-type-owner .lime/refactor-v2/claims/S5u-experts-type-owner-s5u-experts-type-owner.md internal/research/refactor/v2/13-evidence/2026-07-15-s5u-experts-type-owner.md + handoff 六个 Experts consumers 已直连 toolInventoryTypes / evidenceTypes;focused 27/27、lint/format、compat scan、shared typecheck 与 diff check 通过。
S5v-evidence-normalizer-type-owner completed / focused-typecheck-validated / released root .lime/refactor-v2/claims/S5v-evidence-normalizer-type-owner-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s5v-evidence-normalizer-type-owner.md + handoff 六个 evidence projection/normalizer modules 已直连 evidenceTypes;focused 16/16、lint/format、typecheck、compat scan 与 diff check 通过。
S5w-workspace-skill-binding-type-owner completed / focused-typecheck-validated / released root .lime/refactor-v2/claims/S5w-workspace-skill-binding-type-owner-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s5w-workspace-skill-binding-type-owner.md + handoff 三个 clean Workspace consumers 已直连 toolInventoryTypes;focused 25/25、lint/format、typecheck、compat scan 与 diff check 通过;脏的 useWorkspaceSendActions.ts 继续避让。
S5x-agent-client-type-owner completed / focused-typecheck-validated / released root .lime/refactor-v2/claims/S5x-agent-client-type-owner-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s5x-agent-client-type-owner.md + handoff 两个内部 Agent client consumers 已直连 sessionTypes / agentExecutionRuntime;focused 4/4、lint/format、typecheck、compat scan 与 diff check 通过。
S5y-session-read-types-owner completed / focused-and-shared-gates-validated / released s5y_session_read_types_owner .lime/refactor-v2/claims/S5y-session-read-types-owner-s5y_session_read_types_owner.md internal/research/refactor/v2/13-evidence/2026-07-15-s5y-session-read-types-owner.md + handoff 九个 session/read client/projector/test consumers 已直连 session/request/execution owners;focused 88/88、lint/format、compat scan、shared typecheck 与完整 contracts 通过。
S5z-declaration-types-owner completed / declaration-boundary-and-shared-gates-validated / released s5z-declaration-types-owner .lime/refactor-v2/claims/S5z-declaration-types-owner-s5z-declaration-types-owner.md internal/research/refactor/v2/13-evidence/2026-07-15-s5z-declaration-types-owner.md + handoff 九个手写 declaration consumers 已拆到 session/request/evidence/tool/execution 与 app-server-client owner;format、no-ignore lint、compat scan、shared typecheck 与完整 contracts 通过。
S5aa-protocol-media-types-owner completed / focused-typecheck-full-contracts-validated / released root .lime/refactor-v2/claims/S5aa-protocol-media-types-owner-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s5aa-protocol-media-types-owner.md + handoff 三个 protocol/media consumers 已直连 execution/session/media/package owners;focused 39/39、lint/format、typecheck 与完整 contracts 通过。
S5ab-workspace-article-request-types-owner completed / focused-typecheck-full-contracts-validated / released root .lime/refactor-v2/claims/S5ab-workspace-article-request-types-owner-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s5ab-workspace-article-request-types-owner.md + handoff 三个 Workspace request consumers 已直连 requestTypes;focused 46/46、lint/format、typecheck 与完整 contracts 通过。
S5ac-inventory-export-types-owner completed / focused-typecheck-full-contracts-validated / released root .lime/refactor-v2/claims/S5ac-inventory-export-types-owner-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s5ac-inventory-export-types-owner.md + handoff inventory/export clients 已直连 tool/evidence owners;focused 17/17、lint/format、typecheck 与完整 contracts 通过。
S5ad-workspace-skill-binding-type-residual completed / focused-typecheck-full-contracts-validated / released root .lime/refactor-v2/claims/S5ad-workspace-skill-binding-type-residual-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s5ad-workspace-skill-binding-type-residual.md + handoff 最后一个 GUI skill-binding compat consumer 已直连 toolInventoryTypes;focused 159/159、lint/format、typecheck 与完整 contracts 通过。
S5ae-types-barrel-retirement completed / deleted-forbidden-to-restore / typecheck-full-contracts-validated / released root .lime/refactor-v2/claims/S5ae-types-barrel-retirement-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s5ae-types-barrel-retirement.md + handoff types.ts 35 行 facade 与 types.d.ts 2026 行手写镜像已删除;session roster 不再读镜像,ESLint recommendation 已反转,两路径进入 physical guard。真实 consumer 0,boundary 4/4、typecheck、client contract 288、legacy 0/0/0 与完整 contracts 通过。
S5ag-workspace-command-wiring active / owner-split-complete / fresh-gates-pending root .lime/refactor-v2/claims/S5ag-workspace-command-wiring-root.md focused guards + typecheck green;GUI/current fixture fresh rerun pending/blocked by parallel protocol drift 公共 Workspace 入口 13 行,主 runtime 41 行,Entry/Setup/Command/Scene 四个 current owner 均低于 800 行;边界守卫已绑定 current owner。下一步只做 fresh current-tree gates、架构确认和 blocker 对账,不新增平级 runtime。
S6 completed / raw-sidechain-and-legacy-roster-contract-deleted / production-reader-zero-retired-key / canonical-GUI-and-export-validated refactor-v2-coordinator -> root S6a-S6v2 narrow claims S6a-S6v2 handoffs/evidence runtime 与 Renderer Team sidecar、专用 status/stream channel、raw parser/type/projector/package/fixture、legacy child/sibling/parent session roster DTO/state/normalizer/fallback 已迁出并受回流守卫保护;S6u/S6v2 继续删除 Team memory/selection 与 Workspace agentTeam DTO,S6n2 删除 synthetic Team projection/evidence producer。canonical child roster/navigation/Harness/Task Rail/Inputbar、canonical parent identity、AgentGraph export stats 和 Gate B/GUI smoke 已完成。
S6a-thread-store-dead completed / coordinator-validated thread-store-dead-a -> coordinator .lime/refactor-v2/claims/S6a-thread-store-dead-thread-store-dead-a.md 20260712T124908Z-S6a-thread-store-dead-thread-store-dead-a.md + internal/research/refactor/v2/13-evidence/2026-07-12-s6a-thread-store-dead.md 六个零 crate 外 consumer 的 transcript/search/runtime-store/insight 模块及内嵌正向测试共 1923 行已删除,八个旧路径纳入 forbidden-to-restore 守卫;三个反向依赖 check 与 coordinator 定向复核通过
S6b-dead-default-playwright-mcp-seed completed / focused-and-governance-validated root .lime/refactor-v2/claims/S6b-dead-default-playwright-mcp-seed-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s6b-dead-default-playwright-mcp-seed.md + S6b handoff migration_v3、module export 与 startup dispatch 已删除;fresh database regression 证明不再写默认 Playwright MCP。旧 npm package、migration marker 与调用已纳入 dead guard;用户显式配置的 MCP 不迁移、不删除、不改名。lime-core 全量、related Rust、治理目录册、legacy report、rustfmt/diff 全部通过;GUI/bridge wire 未变化,Gate B 不适用。
S6c-dead-agent-session-store completed / focused-and-governance-validated root .lime/refactor-v2/claims/S6c-dead-agent-session-store-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s6c-dead-agent-session-store.md + S6c handoff session_store、12 个 sibling、session_state_snapshot 与 crate-root CRUD/read/DTO export 共 4182 行已删除;App Server RuntimeCore -> ThreadStore/ProjectionStore 保持唯一 session owner。lime-agent 265/265、app-server/lime-scheduler/lime-server check、目录册 200、删除路径守卫和 legacy report 0/0/0 通过;GUI/bridge wire 未变化,Gate B 不适用。
S6e-dead-rust-execution-strategy-compat completed / focused-and-governance-validated root .lime/refactor-v2/claims/S6e-dead-rust-execution-strategy-compat-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s6e-dead-rust-execution-strategy-compat.md 无 caller 的 Rust execution_strategy_compat module/normalizer 已删除并受 dead guard 保护;React typed request/lowering 保持 current,仍有三个 renderer consumer 的 TypeScript compat helper 未混删。
S6f-dead-agent-subagent-sidecars completed / focused-and-governance-validated root .lime/refactor-v2/claims/S6f-dead-agent-subagent-sidecars-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s6f-dead-agent-subagent-sidecars.md 无 caller 的 local subagent control/profile sidecar、旧 extension 与专属 DTO 已删除;App Server canonical graph/mailbox 与 agent-runtime/session_execution 保持唯一 current owner。
S6g-dead-agent-runtime-aggregate completed / focused-and-governance-validated root .lime/refactor-v2/claims/S6g-dead-agent-runtime-aggregate-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s6g-dead-agent-runtime-aggregate.md 无 caller aggregate execution runtime builder、metadata parser、permission fallback 与专属 DTO 已删除;AgentEvent task/routing/limit/cost DTO 及 App Server read-model projection 保持 current。
S6h-dead-agent-runtime-session-query completed / focused-and-governance-validated root .lime/refactor-v2/claims/S6h-dead-agent-runtime-session-query-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s6h-dead-agent-runtime-session-query.md direct agent_sessions execution-runtime query、module、alias/re-export 已删除;App Server session_metadata read model 与 agent-runtime generic projection 是唯一 current owner,lime-agent 259/259、反向依赖 compile、215 governance tests 和 legacy report 0/0/0 通过。
S6i-dead-team-formation-preview completed / focused-typecheck-governance-and-GUI-smoke-validated root .lime/refactor-v2/claims/S6i-dead-team-formation-preview-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s6i-dead-team-formation-preview.md 输入长度/正则 + selected Team 的本地 formation、虚拟 member AgentUI event、runtime-team-dispatch:* 伪消息、send preview state 与 layout preview flag 已删除;发送不再等待或记录 Renderer 组队结果。focused 188、typecheck、legacy report 0/0/0、diff guard 与 GUI smoke 通过;canonical child Thread/Item GUI 未删除。
S6j-dead-team-runtime-sidecar completed / S6k-S6l-followup-validated root .lime/refactor-v2/claims/S6j-dead-team-runtime-sidecar-root.md S6j/S6k/S6l evidence 第二 Team runtime 与 dead i18n 已删除;follow-up 发现的 project-thread ENOENT 和 ThreadId 直传 session bug 已由 S6k/S6l 修复并补 Gate。
S6k-canonical-child-roster completed / focused-Rust-contracts-validated root .lime/refactor-v2/claims/S6k-canonical-child-roster-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s6k-canonical-child-roster.md + S6k handoff App Server canonical read/list join AgentGraph/Identity;selector/hook/Harness 只读 canonical child roster/status,保留 threadId/sessionId 和 notFound。Rust 精确 4、app-server check、unified focused 91、typecheck、contracts 290 与 GUI smoke 通过;当时 synthetic Team run 不再计产品 Gate,canonical Gate 由 S4ah 补齐。
S6l-thread-first-subagent-navigation-guards completed / focused-contracts-governance-validated root .lime/refactor-v2/claims/S6l-thread-first-subagent-navigation-guards-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s6l-thread-first-subagent-navigation-guards.md + S6l handoff canonical roster sessionId 优先,缺失时 thread/read(notLoaded) 严格解析;project-thread/dead/i18n/scenario/docs 已收口。unified focused 91、stop 1、typecheck、contracts 290、i18n/legacy 与 GUI smoke 通过;当时 synthetic Team run 已撤销为产品 Gate。
S6m-raw-subagent-channel-retirement completed / focused-typecheck-contract-core-governance-and-current-fixture-validated third-worker -> root S6m third-worker + continuation claims S6m partial + continuation handoffs/evidence status/stream 专用 channel、listener API、adapter alias、sync effect 与 DevBridge truth policy 已删除,stale adapter fixture 清理并补 negative guard。continuation focused 25/25、typecheck、legacy 0/0/0,contracts 290 与主体 gate 通过;最终 docs boundary 只被并行 release plan 阻断。current aggregate 通过此前全部场景后在 Inputbar pending-steer 首跑超时,精确 Electron 场景复跑通过。
S6n1-raw-subagent-status-parser-retirement completed / focused-typecheck-validated root .lime/refactor-v2/claims/S6n1-raw-subagent-status-parser-retirement-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s6n1-raw-subagent-status-parser-retirement.md + S6n1 handoff parseAgentEvent 对 raw status fail closed,Agent UI dispatcher 不再投影;精确 2/2、dispatcher 全量 22/22、typecheck/diff 通过。完整 agentProtocol 的 1 个 action request id fixture 漂移与本切片无关。
S6n-raw-subagent-type-package-fixture-retirement completed / focused-typecheck-i18n-governance-contract-core-validated root .lime/refactor-v2/claims/S6n-raw-subagent-type-package-fixture-retirement-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s6n-raw-subagent-type-package-fixture-retirement.md + S6n handoff raw status local/package projector、TS type、barrel/helper、runtime facts、summary/i18n/fixture 正向口径已物理删除;package 295/295、focused 136/137(唯一失败为既有 action request id 漂移)、guards 16/16、typecheck、i18n、legacy 0/0/0 与 GUI smoke 通过。当时 synthetic Team run 已撤销为产品 Gate。
S6n2-synthetic-team-projection-retirement completed / focused-package-ui-rust-contracts-gui-validated root + s6n worker .lime/refactor-v2/claims/S6n2-synthetic-team-projection-retirement-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s6n2-synthetic-team-projection-retirement.md + handoff runtime lifecycle/team-control synthetic Team snapshot、raw App Server status replay、Team summary label 和 dead runtime-facts helpers 已删除;projection package 293/293、agent-runtime-ui 18/18、Vitest 41/41、Rust evidence 1/1、typecheck、contracts 290、legacy 0/0/0、Electron GUI smoke 通过。
S6u-post-s6-team-memory-shadow-and-selection-retirement completed / focused-contracts-core-and-GUI-validated root .lime/refactor-v2/claims/S6u-post-s6-team-memory-shadow-and-selection-retirement-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s6u-team-memory-selection-retirement.md team memory shadow、TeamDefinition、selected-team metadata 与 recent selection 已从 Renderer/App Server/Rust current 构建图删除;typed team_memory_refs、AgentControl/canonical child Thread 保持 current。
S6v2-workspace-agent-team-settings-retirement completed / focused-core-typecheck-contracts-and-GUI-validated root .lime/refactor-v2/claims/S6v2-workspace-agent-team-settings-retirement-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s6v-workspace-agent-team-settings-retirement.md Workspace agentTeam/selectedTeam/customTeams DTO、Rust serde 正向测试与 GUI fixture 已删除;Rust 14/14、typecheck、contracts 290、legacy 0/0/0 与 Electron GUI smoke 通过。
S6o-legacy-subagent-roster-dto-retirement completed / memory-shadow-and-canonical-GUI-fallback-retired root .lime/refactor-v2/claims/S6o-legacy-subagent-roster-dto-retirement-root-memory-shadow.md + .lime/refactor-v2/claims/S6o-legacy-subagent-roster-dto-retirement-root-canonical-gui-fallback.md internal/research/refactor/v2/13-evidence/2026-07-14-s6o-legacy-roster-memory-shadow.md + internal/research/refactor/v2/13-evidence/2026-07-14-s6o-canonical-gui-fallback-retirement.md + S6o handoffs team-memory child/sibling roster shadow 与 Harness/AgentRuntimeStrip GUI fallback 均已删除;focused、typecheck、legacy 0/0/0、diff 与 GUI smoke 通过。剩余 session contract 已由 S6s/S6t 物理删除。
S6p-a-canonical-navigation-and-runtime-strip-fallback-retirement completed / focused-typecheck-governance-and-GUI-smoke-validated root .lime/refactor-v2/claims/S6p-a-canonical-navigation-and-runtime-strip-fallback-retirement-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s6p-a-canonical-navigation-and-runtime-strip-fallback-retirement.md + S6p-a handoff 导航删除 legacy known-session 直达分支,runtime strip 删除 legacy roster 统计;navigation/guard 5/5、strip 10/10、typecheck、legacy report 0/0/0、GUI smoke 与 diff check 通过。Harness fallback 已由 S6o canonical GUI slice 收口,Task Rail stats 已由 S6q 收口。
S6q-canonical-task-rail-subtask-stats completed / focused-typecheck-governance-and-GUI-smoke-validated root .lime/refactor-v2/claims/S6q-canonical-task-rail-subtask-stats-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s6q-canonical-task-rail-subtask-stats.md + S6q handoff Task Rail 从 Workspace scene 到 Toolbar/ViewModel 只透传 canonical children;七态映射锁定 interrupted 为需处理。focused 78/78、最终映射 7/7、typecheck、legacy 0/0/0、GUI smoke 与 diff check 通过。Inputbar/Harness/session DTO 未混入。
S6r-canonical-inputbar-subtask-stats completed / focused-typecheck-governance-and-GUI-smoke-validated root .lime/refactor-v2/claims/S6r-canonical-inputbar-subtask-stats-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s6r-canonical-inputbar-subtask-stats.md + S6r handoff landing、MessageList、Inputbar runtime status 已从 legacy roster 收敛到 canonical children;七态统计回归 total=7, active=2, queued=1, completed=2, failed=3。focused 41/41、typecheck、ESLint/Prettier、legacy 0/0/0、GUI smoke 与 diff check 通过。后续 S6s/S6t 已删除 session DTO/state/normalizer/API fixture/metrics fallback。
S6s-legacy-subagent-session-contract-retirement completed / focused-typecheck-governance-and-GUI-smoke-validated root -> react/api/rust narrow owners .lime/refactor-v2/claims/S6s-legacy-subagent-session-contract-retirement-root.md + React/Rust subclaims + S6t internal/research/refactor/v2/13-evidence/2026-07-14-s6s-legacy-subagent-session-contract-retirement.md + subclaim evidence/handoffs React/API 删除 child/sibling/parent roster DTO/state/normalizer/fixture;canonical thread family 独占 parent identity;Rust export active count 改读 canonical AgentGraph。React 255+5、API 60+1、Rust focused 2、typecheck、legacy 0/0/0 与 GUI smoke 通过;Rust related 被无关 MCP stack overflow 阻断。
S6t-legacy-session-roster-contract-retirement completed / focused-typecheck-governance-and-GUI-smoke-validated / sanitizer-residual-closed-by-S6v / parent-thread-residual-closed-by-S6t root .lime/refactor-v2/claims/S6t-legacy-session-roster-contract-retirement-root.md + .lime/refactor-v2/claims/S6t-canonical-parent-thread-identity-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s6t-parent-thread-residual-closeout.md + S6t/S6v handoffs session API 类型、normalizer、dead display leaf、projection parent identity 与 Evidence Pack team facts 已收口;parentSessionId(s) 不再进入 current contract。API focused 28/28、projection Node 10/10、fixture guards 71/71、Vitest 32/32、Rust 1/1、typecheck、治理与 GUI smoke 通过;旧 synthetic 41/41 仅是历史 fixture 结果,不再计产品 Gate。
S6v-retired-roster-sanitizer-removal completed / focused-typecheck-and-governance-validated / released root .lime/refactor-v2/claims/S6v-retired-roster-sanitizer-removal-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s6v-retired-roster-sanitizer-removal.md + handoff 两个 production session read sanitizer、正向 retired roster fixture 与允许规则已删除;production reader 对旧 key/函数零引用。focused 28/28、typecheck、ESLint/Prettier/diff 与 legacy 0/0/0 通过;未触碰 Rust app-data session fallback。
S7 completion-audit-reopened / workspace-structure-and-fresh-current-tree-gates-pending / architecture-confirmation-pending / not-archive-ready root .lime/refactor-v2/claims/S7-root.md + S7a-S7ag/S5ag claims S7 evidence + completion audit S7ag 证明当时工作树 verify:local 通过;后续 S4ak 改动使最终 current-tree 证据需要刷新。completion audit 同时发现 S5b <800 明确退出条件未关闭,现由 S5ag 继续拆分。完成结构退出和 fresh local gates 后,仍必须在真实 PR context 完成 architecture confirmation,禁止本地伪造 event。
S7ae-content-factory-synthetic-contract-probe-retirement completed / focused-and-Gate-B-validated / released / aggregate-independent-blocker-recorded root .lime/refactor-v2/claims/S7ae-content-factory-synthetic-contract-probe-retirement-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s7ae-content-factory-synthetic-contract-probe-retirement.md + S7ae handoff Content Factory 产品 Gate B 已删除额外 contract-mismatch Turn、waiter、summary、常量与 assertion;JS 71/71、Rust worker/read model 9/9 + contract boundary 1/1、scripts governance、format/diff 与 Electron Gate B 53/53 通过,console error 0,synthetic 符号/请求 0。聚合 fixture 后序暴露的 Coding Workbench recovery identity bug 归 S7af,不恢复本 slice。
S7af-code-artifact-recovery-turn-identity-fixture completed / focused-and-electron-Gate-B-validated / released root .lime/refactor-v2/claims/S7af-code-artifact-recovery-turn-identity-fixture-root.md internal/research/refactor/v2/13-evidence/2026-07-15-s7af-code-artifact-recovery-turn-identity-fixture.md + .lime/refactor-v2/handoffs/20260715T063354Z-S7af-code-artifact-recovery-turn-identity-fixture-root.md Coding Workbench recovery 的 tool/file/patch/command/test 与关联 refs 使用 recovery Turn-scoped execution identity;首轮失败 ID 只作 source refs,失败路径覆盖当前 ledger。focused 6/6、syntax/format/diff、scripts governance 与真实 Electron Gate B 通过;initial/recovery 均 completed,所有 assertion true,invoke/console/page error 0。App Server client contract guard 已对齐当前 persistBackendLedgerEvidence owner,npm run test:contracts 的 700 protocol types、288 client checks 与全套 governance checks 通过。
S7a-electron-ipc-contract-ordering completed / focused-and-smart-batch-validated root .lime/refactor-v2/claims/S7a-electron-ipc-contract-ordering-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s7a-electron-ipc-contract-ordering.md + S7a handoff truth-bridge production set 无缺项;只修正 test-only sorted expectation。focused 4/4、smart batch 9 的 16 files/132 tests 与 diff check 通过。
S7b-current-electron-guard-alignment completed / focused-and-smart-batch-validated root .lime/refactor-v2/claims/S7b-current-electron-guard-alignment-root.md internal/research/refactor/v2/13-evidence/2026-07-14-s7b-current-electron-guard-alignment.md + S7b handoff packaged renderer alias guard 跟随 browser.ts;规则 guard 不再强迫根/事实源复制 retired 细节或固定旧文案。focused 25/25,后续 smart batch 15/16 覆盖两 guard,batch 12 current run 16 files/151 tests 通过。
S7c-app-server-runtime-guard-currentization completed / focused-format-contract-and-governance-validated root .lime/refactor-v2/claims/S7c-app-server-runtime-guard-currentization-root.md S7c evidence/handoff stale guard 已对齐 current runtime owner,不增加 whitelist 或放宽真实体量阈值。
S7d-image-command-events-split completed / stale-recovered-and-released image-command-events .lime/refactor-v2/claims/S7d-image-command-events-split-image-command-events.md S7d evidence/handoff canonical image/tool/turn event projection 已迁入 image_command/events.rs,workflow facade 回到体量门槛内且行为不变。
S7e-runtime-value-fields-split completed / focused-validated runtime-value-fields .lime/refactor-v2/claims/S7e-runtime-value-fields-split-runtime-value-fields.md S7e evidence/handoff id/JSON/timestamp helpers 已迁入 runtime/value_fields.rs,runtime facade 职责与行为保持。
S7f-runtime-backend-execution-trait-split completed / focused-contract-and-rustfmt-validated root .lime/refactor-v2/claims/S7f-runtime-backend-execution-trait-split-root.md S7f evidence/handoff ExecutionBackend trait 适配迁入独立 current 子模块,root facade <=480 行;App Server check/contract/guard 通过。
S7h-S7s-current-fixture-and-ordering-closeout completed / focused-and-smart-validated / S7o-current-semantics-superseded root + narrow owners S7h-S7s claims S7h-S7s evidence/handoffs Approval、Plugin、stream/runtime、checkpoint 与 API fixtures 跟随 canonical Thread/Turn/Item 和 current module owner;S7o 的无 position Tool 原位排序结论已由 S7x 推翻,历史 evidence 不再作为 current 规则。
S7t-vitest-smart-targeted-state-isolation completed / governance-renumbered-and-validated root .lime/refactor-v2/claims/S7t-vitest-smart-targeted-state-isolation-root.md original runner evidence/handoff --only-batch / --list-batches 不覆盖 resumable state,unit 11/11 与 scripts governance 通过;旧 runner S7i claim 保留为 superseded。
S7u-image-title-current-owner-fixture completed / full-resume-typecheck-and-governance-validated / released root .lime/refactor-v2/claims/S7u-image-title-current-owner-fixture-root.md S7u evidence/handoff batch 101 的 title mock 对齐 current agentClient;focused 16/16、full resume、typecheck、lint/format、legacy 0/0/0 通过。
S7v-inputbar-objective-current-owner-fixture completed / focused-and-smart-validated root .lime/refactor-v2/claims/S7v-inputbar-objective-current-owner-fixture-root.md S7v evidence/handoff batch 108 的 objective mock 对齐 current objectiveClient;Inputbar 87/87 与 batch 108-110 通过。
S7x-canonical-reasoning-position-only completed / focused-and-reasoning-Gate-B-validated root .lime/refactor-v2/claims/S7x-canonical-reasoning-position-only-root.md S7x evidence/handoff canonical Tool/Reasoning ordinal 是唯一 ordering fact;无 position raw Tool 特判与 sentinel 正向 fixture 已删除。focused 55/55、ESLint/Prettier/diff 与真实 Electron reasoning-first-visible 通过;aggregate 首页场景另受 250ms sampling budget 阻断,实测 pending paint 为 21ms。
S7y-approval-cold-read-typed-response completed / focused-contracts-and-approval-resume-Gate-B-validated / released root .lime/refactor-v2/claims/S7y-approval-cold-read-typed-response-root.md S7y evidence + handoff canonical ThreadStore -> read model -> typed Renderer 保留五种 decision,GUI view-model 才 lower;Rust 47/47、Renderer 52/52、contracts 288、legacy 0/0/0 与 Approval resume Gate B 通过,无新增 request、IPC、mock 或第二响应 owner。

S2f 架构确认:

- [x] 本次属于重大架构变更
- [ ] 本次不属于重大架构变更
架构影响:改变 session start/delete 与 canonical Thread 的持久化时点和 identity 约束,不改变 ProjectionStore owner
架构图更新章节:internal/aiprompts/architecture.md 6.2 canonical persistence
责任开发者确认:refactor-v2-coordinator,2026-07-12
- [x] 已核对目录归属、数据流、依赖方向、协议边界和验证门禁

本地 npm run governance:architecture-confirmation 无 PR event/base SHA,无法完成 PR 级判定;进入 PR 时必须把上段复制到 PR body,并由门禁基于 committed diff 复核。

只有 coordinator 可以修改此表。worker 的实时状态以 .lime/refactor-v2/claims 和 handoff 文件为准。

9.1 S1c 架构确认

架构影响:重大;新增 canonical Thread/Turn/Item live-event contract,并改变 Rust/TypeScript client 的事件消费优先级。
架构图已更新:internal/aiprompts/architecture.md 第 7 节 Agent 产品主链与 7.1 事件边界。
责任开发者确认:refactor-v2-coordinator,2026-07-12
确认内容:已核对 Renderer -> Desktop Host -> App Server -> runtime -> canonical projection 依赖方向;raw event/typedEvent 明确为 deprecated,S6 删除条件已登记。

9.2 S1f canonical read edge 架构确认

架构影响:重大;新增四个 canonical Thread read method,并将分页、view 与 shared-read scope/access 收回 protocol + ThreadStore owner。
架构图已更新:internal/aiprompts/architecture.md 第 7 节 Agent 产品主链与第 8.1 节命令数据边界。
责任开发者确认:refactor-v2-coordinator,2026-07-12
确认内容:已核对 Renderer typed client -> App Server JSON-RPC -> direct ThreadStore read 的依赖方向;后续 S2q 已确认 `agentSession/read` 是同一 ThreadStore-backed current presentation endpoint,旧整段 namespace 删除条件已 superseded。

9.2a S2k canonical Message / Plan lifecycle 确认

架构影响:重大;把 user/agent Message 与 proposed Plan 收敛为 Codex 对齐的正式 canonical Item lifecycle,并改变 Plan history/revision 的持久化与 GUI 恢复语义;不新增 runtime owner、Electron 后端、JSON-RPC method、兼容层或第二 read model。
架构图更新章节:internal/aiprompts/architecture.md 第 6.2 节 Agent Runtime 组。
责任开发者确认:root,2026-07-14
确认内容:已核对 `message.created` 直接形成 completed UserMessage,AgentMessage 只在真实正文开始后创建并由同一 Item 在 `message.completed` 进入 terminal,取消映射 Interrupted;Plan delta/final 使用 `plan_{turnId}_{revisionId}` 稳定 identity,completed final snapshot 覆盖流式 delta 并保留首 ordinal。Codex `leading_whitespace_by_item` 语义已复制到 Plan parser,Plan-only 输出不产生空白 AgentMessage。canonical SQLite restart、read model、typed reader 与真实 Electron reload 均保留 revision、source、steps/status;GUI 实施确认绑定同一 revision,legacy update_plan Item 为 0。Gate B 通过;聚合 fixture 后续 Skills Provider 鉴权失败与本切片无关。

9.3 S4c production tool lifecycle 架构确认

架构影响:重大;current provider 工具执行从 direct executor + 手工 lifecycle 切换到 RuntimeTool/ToolCall/ToolLifecycleEmitter/NormalizedToolOutput 唯一生产 owner。
架构图已更新:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-12
确认内容:已核对 definition/exposure/executor 绑定、turn/call/environment identity、structured/duration/truncation/sidecar 保真与 ToolStart -> ActionRequired -> ToolEnd 确定性顺序;AgentEvent::ToolStart/ToolEnd 与 App Server raw mapper 明确为 S4d 必删 deprecated boundary。

9.4 S4d Approval canonical contract 架构确认

架构影响:重大;修改 canonical Approval Item 的 decision schema、request identity 与 GUI lowering,消除 available decision/result 混用和 scope 反推。
架构图已更新:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组、第 7.1 节事件与完成态。
责任开发者确认:refactor-v2-coordinator,2026-07-12
确认内容:已核对 requestId 与 Tool call identity 隔离、Approved/ApprovedForSession/Denied/Abort/TimedOut 保真、pending decision=null、Renderer 显式 lowering、raw action.required 固定列表删除及 Gate B 退出条件。

9.5 S4d-S4g canonical Tool wire 架构确认

架构影响:重大;live Tool lifecycle、image command、durable P0 consumers 与 approval identity 统一到 canonical Item + typed execution identity,旧 raw wire 物理删除。
架构图已更新:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-12
确认内容:已核对 session/thread/turn/call identity、typed arguments/output/error/duration/truncation/ref、provider history、sidecar hydration、read model、image command 与 approval resume;conversation import raw event 仅为冻结 compat,persisted restart data-source 与 structured JSON-RPC error 仍登记为 blocker。

9.6 S4 Approval restart production 架构确认

架构影响:重大;approval restart 从 backend AppDataSource/presentation JSON lazy read 改为 RuntimeCore StoredSession current event + typed descriptor 唯一恢复路径,并前置 canonical action type/scope 校验。
架构图已更新:internal/aiprompts/architecture.md 第 6.2 节 Agent Runtime 组。
责任开发者确认:refactor-v2-coordinator,2026-07-12
确认内容:已核对 store handle reopen、session/thread/turn identity、caller type/scope fail-closed、无 oneshot 时 action_not_resumable、JSON-RPC error.data、重复 terminal reason、ask-user canceled terminal 与 no fake resolved;Approval Electron fixture 仍需在 action.required 前修复 external backend 配置后复跑。

9.7 当前开工门禁

截至 2026-07-12,本轮并行施工暂停扩容,已有工作树必须原地保护:

  1. 构建缓存已按用户确认清理,当前 worker 必须使用自己的 claim 声明的独立 target;禁止重新依赖已删除的旧 target 或无声明共享缓存。
  2. 当前 active 写集以 .lime/refactor-v2/locks/**/owner 为准;S2e canonical write/read model/read handler、S4a tool core 与 S5b 必须保持窄写集。S1b 已因 request_serialization overlap 停止写入,后续只由 canonical handler owner 基于 S1b handoff 合并并验证。
  3. 后续任何缓存或锁目录删除仍属于文件系统危险操作,必须再次取得用户明确确认;本轮不得执行额外删除。
  4. 所有 ready-for-review dirty set 必须由下一 owner 从现有 diff 继续;禁止从空白重做、覆盖现有内容或把旧 raw/compat 路径重新接回 production。

9.8 S1c 非 Thread domain side-channel 确认

架构影响:保持既有 owner 的事件边界修复;不新增 transport、事实源或第二套 lifecycle。
架构图已更新:internal/aiprompts/architecture.md 第 7.1 节事件与完成态。
责任开发者确认:refactor-v2-coordinator,2026-07-12
确认内容:canonical Thread/Turn/Item 仍唯一经过 sequence gate;只有集中 allowlist 的 provider diagnostic、runtime.status 与 image_task domain notification 可旁路,且不得表达 lifecycle。未知 raw event 和 raw Thread lifecycle 继续 fail-closed;真实 Electron 图片命令与普通画图意图 Gate B 已验证 terminal preview 和 reload restore。

9.9 S1j Renderer canonical lifecycle 确认

架构影响:落实既有重大架构决策,不新增 transport、事实源或第二套 lifecycle;生产 Renderer 的 Thread/Turn/Item 投影从 raw payload 收敛到 canonical entity。
架构图已更新:internal/aiprompts/architecture.md 第 7 节 Agent 产品主链与 7.1 节事件边界。
责任开发者确认:refactor-v2-coordinator,2026-07-13
确认内容:已核对 canonical Thread/Turn/Item entity、Approval terminal、sequence gate、test-only raw fixture helper 与 provider/runtime status/image/media side-channel;未知 raw lifecycle 保持 fail-closed,Coding Workbench terminal/recovery artifact 已由真实 Electron Gate B 验证。

9.10 S4j Conversation import typed draft 确认

架构影响:落实既有 canonical Tool owner,不新增产品协议;Codex rollout Tool 从 raw source-local event envelope 收敛为 typed import draft,并保持 commit 后唯一 canonical Item wire。
架构图已更新:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-13
确认内容:已核对 ResponseItem/EventMsg/paginated TurnItem、typed phase/call/arguments/output/source metadata、structured content、unique missing ID、duplicate/terminal-only/incomplete lifecycle、budget、sidecar 和 commit identity;StoredSession/EventStore/ProjectionStore/read model/notification/GUI 继续禁止 raw Tool wire。

9.11 S4k Evidence canonical Tool consumer 确认

架构影响:落实既有 canonical Tool owner,不新增产品协议;provider history、context compaction 与 evidence/export 从不可达 raw lifecycle 兼容路径收敛到 typed nested Item。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-13
确认内容:已核对 provider transcript 顺序、typed output sidecar、ItemStatus terminal 语义、coding count、Skills metadata、MCP server/call identity、browser structured output、snapshot artifact、非 lifecycle side-channel 与 raw lifecycle 负向守卫;GUI wire 未变化,因此 Gate B 不适用。

9.12 S4l MCP sampling-step snapshot 确认

架构影响:落实 Codex 的 per-sampling-step 工具面冻结语义,不新增产品协议;tool-runtime 成为 MCP definitions、caller policy、route 与 connection handle 的唯一 snapshot owner,agent-runtime 只拥有通用 step contract。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-13
确认内容:已核对每次 provider request 前 capture、同 step exact executor、unknown call fail-closed lifecycle、per-server discovery isolation、Turn-local deferred next-step activation、per-tool caller 双重门禁、registry replace 后旧 handle/timeout 保持、raw tool.input.delta producer 删除,以及真实 Electron Context7 tool_search/query-docs。专用 localhost deferred fixture 已通过真实 Host/preload/App Server/runtime/read model 证明 old-step deny、same-Turn next-step visible/executed 与 Turn-local no-leak,runtime/read model `16/16`;同一 managed Electron run 已导航目标 session,并以 `12/12` visible-DOM assertions 证明 deferred Tool completed row、最终文本、`agentSession/read` electron-ipc 与零 invoke/console error。Codex `ThreadItem` 不包含 ToolSearch,`tool_search_call/output` 只留 provider/rollout history,因此 GUI 明确保持 discovery internal,不把 TUI/内部模型事件复制成 GUI product row。Resource/Prompt/status 归 App Server live management read,capability 归 initialized connection,server-originated elicitation归独立 reverse JSON-RPC 协议,均不扩张 sampling-step snapshot。

9.12a S2s Canonical AgentMessage content-part 确认

架构影响:重大;canonical AgentMessage 从 text/phase 扩展为 ThreadItem-owned typed Text/Media/reference content_parts,改变 ThreadStore/read model/schema/generated client 与 live Renderer projection 的数据边界,但不新增 runtime、provider 或 Electron 业务 owner。
架构图更新章节:internal/aiprompts/architecture.md canonical Message lifecycle 与 6.2 canonical persistence / 7.1 event boundary。
责任开发者确认:refactor-v2-coordinator / root,2026-07-15
确认内容:已核对 App Server materializer、ThreadStore durable payload、thread/read、agentSession/read、canonical notification、Renderer reader、schema/generated client 与 media Gate B 的同源链路;malformed/inline/provider raw content fail closed,presentation `contentParts` 不得反向成为事实源。PR 级 architecture confirmation 仍需在实际 PR body 中填写并由门禁复核。

9.13 S4m Canonical Tool output/media residual 确认

架构影响:落实既有 canonical Tool owner,不新增产品协议;App Server output sidecar、hydration、media projection 与 notification/materializer 内部结构从 raw/outer fallback 收敛到 typed nested Item。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-13
确认内容:已核对 tool_end 入口拒绝、Tool/MCP/Collab terminal output、stable outputRef、filesystem sidecar/read model/artifact/restart hydration、completed+succeeded image owner facts、pending/raw/无 sidecar fail closed、tool.progress/tool.output.delta 精确 side-channel allowlist,以及 event_store/thread projection/materializer/output_refs 文件体量拆分。Electron/JSON-RPC/Renderer wire 未变化,因此不重复执行 Gate B。

9.14 S4n Dead backend/core stream surface 确认

架构影响:删除与 Codex Item lifecycle 冲突的第二套零消费者 backend event-name mapper 和 core stream DTO,不新增协议或兼容层;canonical Thread/Turn/Item owner 不变。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-13
确认内容:已核对 App Server mapper/module/export 零消费者,core StreamEvent/ToolExecutionResult/StreamResult 无 import、构造、匹配、schema 或 fixture consumer;TokenUsage 仍有数据库/session current 消费故保留。Codex `item/started`、`item/completed` 和 Lime agent-protocol ThreadItem 是替代事实源;Electron/JSON-RPC/Renderer wire 未变化,因此 Gate B 不适用。

9.15 S4p MCP resource target identity 确认

架构影响:非重大;不新增 transport、owner 或产品 lifecycle,只修正现有 MCP management/native helper 命令契约,使单资源操作使用精确 (server, uri),并删除 manager 的 URI 扫描猜测路径。
架构图更新章节:不适用;现有 Electron Desktop Host -> App Server JSON-RPC -> RuntimeCore/management owner -> GUI 依赖方向不变。
责任开发者确认:refactor-v2-coordinator,2026-07-13
确认内容:已核对 Rust DTO/schema/generated TS、Rust/TS client、App Server handler/local data source、lime-mcp manager、native resource helper、Renderer gateway/Hook/GUI、同 URI 双 server read/subscribe/unsubscribe、非空 fail-closed、canonical Tool metadata、current smoke pair oracle 与 legacy 命令零命中。Prompt identity、server-originated elicitation 和 sampling capability 广告未混入本 slice。

9.16 S4o MCP control-plane owner split 确认

架构影响:收窄 MCP model bridge 的职责,不新增 transport 或兼容层;tool-runtime 只拥有 model-visible sampling-step Tool discovery、caller policy、exact route/connection handle 与 dispatch,App Server -> lime-mcp::McpClientManager 继续唯一拥有 GUI Prompt/Resource/status live management read。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-13
确认内容:已核对 model bridge management API 与 caller-unaware registry dispatch 的生产消费者为零,旧 resource/prompt/server-info/capability summary surface 已物理删除并补回流守卫;连接替换后既有 sampling step 仍持有原 immutable handle/timeout,GUI management 命令继续走 App Server JSON-RPC。sampling false advertisement 已由 S4s 删除,edge store 已由 S4t 建立;server-originated elicitation、AgentControl 生产接线与 mailbox delivery semantics 保持为独立后续 slice。

9.17 S4q MCP prompt target identity 确认

架构影响:同步修正现有 MCP Prompt management 协议与 GUI identity,使单次 get 使用 exact (server, name);不新增 transport、runtime owner 或兼容层。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-13
确认内容:已核对 Rust DTO/schema/generated TS、Rust/TS client、App Server handler/local data source、lime-mcp manager、Renderer gateway/Hook/GUI、同名双 server 路由、request generation 丢弃迟到结果、非空 fail-closed,以及后置 App Server processor/package client current fixtures。deterministic MCP fixture 不实现 prompt get,因此未冒充 Gate B。

9.18 S4s MCP sampling capability fail-closed 确认

架构影响:删除无 handler 支撑的 MCP client capability 正向广告,不新增协议或 provider 旁路;stdio/HTTP 继续共享 LimeMcpClient initialize owner。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-13
确认内容:已核对全仓不存在 sampling/createMessage handler 或产品 consumer,rmcp 默认只会 method not found;复制 Codex ClientCapabilities default 口径,sampling 保持 absent 并补 enable_sampling 回流守卫。App Server JSON-RPC/Electron/Renderer wire 未变化,Gate B 不适用。

9.19 S4t Agent graph edge persistence 确认

架构影响:新增 Multi-Agent parent/child topology 的 storage-neutral contract,并由既有 App Server ProjectionStore canonical SQLite owner 实现;不新增 crate、数据库、协议或 GUI owner。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-13
确认内容:已核对 Codex AgentGraphStore/types/schema provenance、child unique parent、Open/Closed audit、stable child/BFS descendants、reopen 与 missing-close no-op。该 slice 不把 mailbox 塞进 RuntimeQueuedTurn,不读取 legacy session metadata;第一段 AgentControl graph boundary 已由 S4v 落地,canonical mailbox Item consumer、Collab/SubAgent producer 和旧 Team surface 删除归后续独立 slice,GUI wire 未变化所以 Gate B 不适用。

9.20 S4u Durable mailbox and identity persistence 确认

架构影响:重大;新增 Multi-Agent durable identity/mailbox 的 storage-neutral contract,并由既有 App Server ProjectionStore canonical SQLite owner 实现;不新增 crate、数据库、JSON-RPC 或 GUI owner。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-14
确认内容:已核对 root-thread identity 的 thread/path 双唯一与 task-name 派生、message-id 幂等/冲突拒绝、QueueOnly/TriggerTurn durable mode、root+recipient FIFO 隔离、delivered audit/reopen。S4u 不消费 mailbox:canonical Item append-before-ack、Turn trigger 与 wait activity 归后续 S4w;六个 AgentControl tool 与 GUI 必须在该生产消费链稳定后另拆,不得回退 legacy session metadata、临时 map 或 RuntimeQueuedTurn。thread-store 21/21、App Server mailbox store 4/4、check、rustfmt/diff 通过;shared `LocalAppDataSource` fixture 已同步,原并行 MCP 编译阻塞已解除。

9.20a S4v RuntimeCore AgentControl boundary 确认

架构影响:重大;在既有 App Server RuntimeCore 与 ProjectionStore owner 内新增 Multi-Agent child lifecycle 的第一段控制面,不新增 crate、JSON-RPC、Electron 后端、GUI 或兼容层。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-14
确认内容:已核对 parent 仅从 loaded RuntimeCore session 解析,child session/thread 先由 canonical start 建立再持久化 Open edge;edge 错误时 child session 与 canonical Thread 必须补偿删除,补偿失败显式 fail closed。Closed edge 与 descendants traversal 归 `AgentGraphStore` contract;无 current consumer 的 RuntimeCore close/read 包装已在 S4x 删除,restart recovery 也不以 memory fallback 冒充实现。S4v 未接 mailbox、turn trigger、tool/catalog/JSON-RPC 或 GUI;S4w 后续接入 canonical Item-before-ack 与 TriggerTurn。原 App Server library check 与 `agent_control` 6/6 通过,S4x 当前 focused 11/11 继续覆盖生产边界。

9.20b S4w RuntimeCore durable mailbox consumer 确认

架构影响:重大;在既有 RuntimeCore、canonical EventLog 和 ProjectionStore owner 内新增 durable mailbox 的唯一内部消费链,不新增 crate、数据库、JSON-RPC、Electron 后端、GUI 或 compat 层。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:root,2026-07-14
确认内容:已核对 `message_id -> ItemId` 与 TriggerTurn deterministic turn identity;QueueOnly 不启动 turn,只在下一真实 turn 前写入 canonical history。canonical Item 必须在 mailbox delivered ack 前可读。canonical EventLog 仍是顺序事实源:EventLog-first 后 projection failure 保留 pending,只有 exact mailbox identity 与 contiguous durable tail 才允许补投影并 ack,任何 identity/sequence conflict fail closed。既有 Item retry 只 ack,不产生 duplicate visible Item;无 ProjectionStore 时 mailbox event 禁止静默成功。S4w 只提供 durable activity query,不注册六工具、JSON-RPC、GUI 或旧 Team 删除。focused 6/6、独立 App Server library check、rustfmt/diff 通过;Gate B 不适用,完整 restart/tool/GUI 产品链仍由后续 slice 负责。

9.20c S4x Per-turn AgentControl gateway 确认

架构影响:重大;在既有 RuntimeCore、ExecutionRequest、RuntimeBackend 与 current provider 间增加仅本 turn 有效的 opaque AgentControl capability,不新增 RuntimeBackend -> RuntimeCore 依赖、全局 registry、JSON-RPC、Electron 后端、GUI 或 compat 层。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:root,2026-07-14
确认内容:已核对六工具只在 per-turn gateway 存在时进入 sampling-step definitions,executor 用 canonical call/turn/thread identity 调用 RuntimeCore durable graph/identity/mailbox owner;RuntimeBackend 只 clone/pass-through handle。spawn 的 child/edge/identity/mailbox/trigger 失败均 fail closed,send_message 只 QueueOnly,followup_task 禁 root,interrupt 不关闭 Open edge,list 只读同 root Open graph/identity 并稳定排序。S4x 完成时 wait 仅观察 caller pending mailbox/new steer,尚缺 child terminal 回流;该历史缺口已由 S4aa 的 direct-parent Result、EventLog recovery 与 steer-first wait 关闭。tool-runtime 3/3、lime-agent 13/13、App Server focused 11/11、关键 spawn 重跑 1/1、App Server library check、rustfmt/diff 通过;无 JSON-RPC/GUI,Gate B 不适用。

9.20d S4y Dead Team tool surface 删除确认

架构影响:重大;物理删除与 per-turn AgentControl gateway 冲突的旧 Team/collab_agent 可执行工具实现和静态事实源,不新增协议、兼容层、fallback 或第二套 runtime。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:root,2026-07-14
确认内容:已核对 `tool-runtime::collab_agent` 仅模块内自引用,current provider 只在 gateway 存在时注册六个 V2 工具;旧 module、五工具 catalog/alias、prompt、discovery profile、native allowlist 与 Team smoke 已删除或迁移,并由治理目录册和 contract guard 禁止回流。canonical `CollabAgentToolCall` / SubAgent 历史展示 payload 仍由独立 protocol/projection slice 负责,本删除切片不把历史可读性误判为可执行旧 surface。JSON-RPC/GUI 与完整 restart recovery 未完成,Gate B 不适用于纯删除切片。

9.20e S4ab Legacy collab projection boundary 确认

架构影响:非重大;收紧既有共享 projection package 的 tool-name taxonomy 与 lineage validation,不新增协议、transport、runtime owner、GUI surface 或兼容层。
架构图更新章节:不适用;Agent 产品主链依赖方向不变。
责任开发者确认:root,2026-07-14
确认内容:已核对只有 spawn_agent/send_message/followup_task/wait_agent/interrupt_agent/list_agents 进入 current projection;裸 send_input/resume_agent/wait/close_agent 只产生 legacy_tool_name,不能计入 V2 coverage。followup_task/interrupt_agent visual name 保真,wait_agent/list_agents 无 target 时不要求 receiver lineage。Rust CollabAgentOperation/SubAgentActivity 历史 variant、canonical item_json decode、schema/import/evidence/display 未修改,继续只读兼容既有历史。

9.20f S4z AgentControl restart-on-demand 确认

架构影响:非重大;用跨 RuntimeCore 重建回归固定既有 durable graph/identity/mailbox 与 session hydration 的按需恢复语义,不新增 production owner、协议、队列、registry 或兼容层。
架构图更新章节:不适用;既有 App Server RuntimeCore -> ProjectionStore/EventLog 依赖方向不变。
责任开发者确认:root,2026-07-14
确认内容:已核对 root hydrate 不递归打开 Open descendants;send_message QueueOnly 不加载 child,followup_task/interrupt_agent 只 hydrate exact target;Closed edge 保留 audit 但不可寻址、不 reopen;grandchild 不因 root 或 sibling control 被加载。App Server library check 与 agent_control 12/12 在最终并行工作树通过,未引入 BFS restart、process-global registry、第二队列、JSON-RPC 或 legacy metadata fallback。

9.20g S4ac wait_agent canonical Collab Item 确认

架构影响:非重大;在既有 canonical ToolLifecycleEvent -> AgentEvent::Item* producer 内选择已有 CollabAgentToolCall payload,不新增 runtime owner、协议、transport、队列或兼容层。
架构图更新章节:不适用;Agent -> App Server generic Item event/store/read 依赖方向不变。
责任开发者确认:root,2026-07-14
确认内容:已核对 wait_agent Started/Completed 共享 call-derived Item identity 与 ordinal,operation 固定 Wait,target/message 为空,terminal ToolOutput 保留 text/structured content/duration。list_agents 与普通工具不被重分类;spawn/send/followup/interrupt 在 gateway 提供真实 target ThreadId 前不伪造 SubAgent activity。focused 1/1、protocol 19/19、current provider 13/13、lime-agent library check 与 rustfmt/diff 通过;无 schema/generated client/GUI/Gate B 变化。

9.20h S4aa Agent terminal mailbox activity 确认

架构影响:重大;在既有 RuntimeCore/EventLog/ProjectionStore 与 AgentGraph/Identity/Mailbox owner 内接入 canonical child terminal -> direct-parent durable Result,并增加 EventLog-first crash recovery 与 Codex-priority wait;不新增 crate、协议、JSON-RPC、队列、registry 或兼容层。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:root,2026-07-14
确认内容:已核对 completed/failed 先 canonical 后 direct-parent QueueOnly Result,interrupted/canceled 不写 FINAL_ANSWER;Result 以 assistant canonical Item 持久化并保留 sender/kind/sourceTurn/resultStatus metadata,completed 长 Unicode 不静默截断。canonical apply 前和 mailbox append 前两类 crash window 只沿 direct Open child EventLog 恢复 canonical 缺失 tail;session-scoped I/O lock 防止 repair 截断 in-flight append,repairable/empty-prefix tail、stable ID、pending->delivered SQLite CAS 与 RuntimeCore mailbox ID dedupe 共同保证单次 activity/EventLog。wait 对 pre-existing/new steer 均优先,active wait 使用有界退避且 deadline 前强制 final recovery。graph/mailbox 1+1、canonical graph 8、store/delivery/terminal/EventLog/control 7+6+13+24+12、最终 App Server library check 与通用 GUI smoke 通过;聚合 Agent fixture 的独立 Plan revision blocker 已记录,不冒充 JSON-RPC/Multi-Agent Gate B。

9.20i S4ad targeted SubAgent producer 确认

架构影响:重大;在既有 App Server AgentControl gateway -> RuntimeTool -> canonical ToolLifecycleEmitter -> Thread/Turn/Item 主链增加 success-only typed internal activity 与独立 SubAgent Item,不新增 JSON-RPC、队列、registry、Electron 后端或兼容层。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:root,2026-07-14
确认内容:已核对 spawn 使用真实 child ThreadId 产生 Started,send/followup 使用 durable identity 解析后的 target ThreadId 产生 Interacted,interrupt 产生 Interrupted;input target path 只作解析输入和 detail,不作为 ThreadId。typed fact 经 serde-skipped RuntimeToolExecutionResult/NormalizedToolOutput 传给 host emitter,不进入 model output、structured content 或普通 Tool metadata。四个 targeted 工具先完成普通 Tool Item,再追加 call-derived stable distinct SubAgent Item;失败、started phase、空/多 fact、tool/activity mismatch、wait/list 均 fail closed。Started/Interacted/Interrupted 是 current 写入值;S4ad 临时保留旧七值的历史兼容决定已由 S4ae 推翻,原因是仓库没有外部用户或历史数据兼容约束,且 Codex contract 只有三值。focused Rust 5+1+5+14+12、schema fixture 1 已通过;contracts/current fixture 与最终 rustfmt/diff 在 evidence 收尾记录。

9.20j S4ae canonical SubAgent GUI 确认

架构影响:重大;将 canonical SubAgent activity 收敛为 Codex Started/Interacted/Interrupted 三值,并让 GUI cold/live timeline、Harness 与状态文案只消费同一 Item identity;删除 synthetic sidecar 与 activity worker-result,不新增 Electron 后端、JSON-RPC、队列或兼容层。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:root,2026-07-14
确认内容:已核对 App Server cold read 从 canonical ThreadStore 回填 detail.items/thread_read.thread_items,Renderer live reader 保留相同 Item ID 与 child ThreadId;activity Item 的 completed 只表示事实落盘,started/interacted 投影 running/acting,interrupted 投影 cancelled/interrupted,child terminal 仍只由 S4aa Result mailbox/thread lifecycle 表达。GUI 使用五语言文案且 unknown wire 不直接显示;real:subagent:* producer/test、activity worker.notification 和 Harness child-terminal 推断已删除。协议已收口 Codex 三值并同步 schema/TS。spawn/followup 只等待 durable commit 与 child `turn.accepted` admission,child 后台执行并继承 parent 显式 runtime request;provider output identity 由 canonical Turn + sampling attempt + family + raw ID 唯一化,ThreadStore/EventLog fail-closed 未放宽。六个 AgentControl 工具真实 managed Gate B 全部 completed,15 项断言全真;该 batch 当时不含 SubAgent visible-DOM/console/invoke 断言,后续已由 S4ag/S4ah 关闭 effective route 与完整 visible DOM 缺口。

9.20j1 S4ag effective child route 确认

架构影响:重大;在既有 RuntimeBackend selection/request-context 与 RuntimeCore per-turn gateway 之间增加 effective options preflight,并回写唯一 StoredSession.turn_runtime_options,不新增 route map、resolver、session metadata 复制、compat 或 fallback owner。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:root,2026-07-15
确认内容:已核对 session-default/profile provider、model、effective reasoning、workspace 与 search policy 复用现有 resolver;gateway 只在 effective options 回写后构造,child 清除 event/queue/output contract。effective options 2/2、AgentControl 14/14、rustfmt/diff 通过。

9.20j2 S4ah AgentControl visible DOM Gate B 确认

架构影响:重大;把 canonical Collab Wait 的产品 presentation 从非 Codex subagent_activity(wait) 修正为普通 wait_agent Tool,并为六 Tool 与 distinct SubAgent activity 增加同一真实 Electron DOM 证据;不改变 storage payload、协议、Electron 后端或 activity 三值 contract。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:root,2026-07-15
确认内容:已核对 smoke 不再从 SubAgent status 反推工具执行;wait_agent storage 仍为 CollabAgentToolCall::Wait,agentSession/read 输出 tool_call。Gate B 28/28 assertions,六个 typed Tool row 均 completed/visible,Started/Interacted/Interrupted 均可见且绑定 child Thread,agentSession/read=electron-ipc,console/invoke error 0,localhost fixture 不冒充 live-provider proof。

9.20j3 S4ai dead synthetic Team fixture 确认

架构影响:非重大;物理删除 external backend 伪造 Team/subagent event 的 test-only scenario 及其 15 个直接 consumer,current evidence 改指 RuntimeCore AgentControl/canonical Item Gate B;不删除 remote task 等真实 structured-source worker.notification。
架构图更新章节:不适用;只删除与既有第 6.3 节 current owner 冲突的伪证据路径。
责任开发者确认:root,2026-07-15
确认内容:已核对 scenario、constants、flow、backend branches、assertions、summary、regression runner 与 production-files guard 引用均已清除;净删 707 行,fixture 54/54、regression 16/16、scripts governance、docs boundary 与 diff check 通过。

9.20j4 S4aj warm followup target route 确认

架构影响:非重大;只修正既有 RuntimeCore AgentControl gateway 的 TriggerTurn options 优先级,warm target 读取自身最近 effective Turn snapshot,cold/unloaded target 才使用 caller snapshot;不新增协议、持久化、resolver、route map、compat 或 fallback owner。
架构图更新章节:不适用;既有 App Server RuntimeCore -> RuntimeBackend/tool-runtime -> canonical Thread/Turn/Item 数据流与 owner 不变。
责任开发者确认:root,2026-07-15
确认内容:已对照 Codex live followup 与 cold resume 语义,核对 target session 的唯一 StoredSession.turn_runtime_options 反向选择、parent-only event/queue/output contract 清理和 caller cold fallback。focused 1/1、AgentControl 15/15、App Server check、exact rustfmt/diff 与修改后 S4ah Electron visible-DOM Gate B 28/28 通过。

9.20j5 S4ak MCP elicitation capability advertisement 确认

架构影响:非重大;既有 McpThreadRuntime -> LimeMcpClient -> App Server reverse JSON-RPC -> Renderer form owner 不变,只让 runtime initialize 如实广告已实现的 form capability,management connection 继续 absent;不新增协议、持久化、compat、mock 或第二 request owner。
架构图更新章节:不适用;当前 MCP runtime/control-plane owner 与产品链未变化。
责任开发者确认:root,2026-07-15
确认内容:已对照 Codex form-only capability,核对 runtime `2025-06-18 + {"elicitation": {}}`、management `2025-03-26 + {}`、同 stdio pid initialize/accept 关联和 capability_missing fail closed。lime-mcp 140/140、raw wire 1/1、static guard 4/4、scripts/legacy governance 与真实 Electron Gate B 通过;Provider 2 requests、Renderer form visible/submitted/closed、JSONL bridge 命中、console/legacy command 0。

9.20j6 S4al AgentControl cold-restart visible DOM 确认

架构影响:非重大;只扩展既有 managed Electron Gate B 的生命周期与 identity 对比,并把首页封面从 public file-root 路径收敛到 Vite/Electron bundle asset owner;RuntimeCore、App Server JSON-RPC、Thread/Turn/Item protocol 与 GUI projection owner 不变。
架构图更新章节:不适用;没有新增业务 owner、协议、存储或兼容层。
责任开发者确认:root,2026-07-15
确认内容:AgentControl batch 显式使用 `--cold-restart`,关闭旧 Electron/App Server 后复用同一 user data/runtime root 启动新进程;PID `8923 -> 9920`,六 Tool `(id,name,status)`、SubAgent `(itemId,kind,threadId)` 与唯一 child Thread identity 完全稳定;`agentSession/read`/`thread/list` 均 `electron-ipc/success`,console/invoke error 0。重复 public/组件 JPG 逐字节相同且无其他引用,已物理删除并由 12 个 WebP bundle asset 接管;9/9 unit、renderer build、Gate B 与 scoped diff/format 通过。

9.20k S6i Renderer fake Team formation 删除确认

架构影响:重大;删除 Renderer 在发送前按 selected Team、长度和正则构造的第二套 Multi-Agent formation/preview 事实源,不新增 compat、协议或替代状态机。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:root,2026-07-14
确认内容:已核对真实 Multi-Agent 成员与活动只由 RuntimeCore AgentControl -> canonical Collab/SubAgent ThreadItem 产生;本地 formed state、虚拟 member/work-board event、runtime-team-dispatch 伪消息、send preview state 与 layout preview flag 已删除。canonical child ThreadId 导航、timeline Item 和 SubAgent 工具开关保持 current。focused 188、typecheck、legacy report 0/0/0 与 GUI smoke 通过;aggregate fixture 的外部 Skills Provider 鉴权 blocker 单独记录。

9.20l S6j Renderer Team runtime sidecar 删除确认

架构影响:重大;删除 Renderer 重复订阅 raw subagent status/stream、维护本地 live/draft/tool/queue map 并再次写 projection store 的第二 runtime,不新增 compat、fallback 或替代事件总线。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:root,2026-07-14
确认内容:team-workspace-runtime 目录、useTeamWorkspaceRuntime、teamWorkspaceRuntime、wrappers、正向 tests 与 dead 五语言 keys 已删除,stop 直接委托 current owner;canonical reader、ThreadItem projection 和 timeline 卡片保持 current。2026-07-14 follow-up 发现原 focused 集漏跑仍读取已删文件的 project-thread guard,且 canonical activity ThreadId 被直接当 sessionId 导航,因此本确认只覆盖 sidecar 删除,不覆盖 navigation/guard 完成。S6k/S6l 必须完成 canonical roster、ThreadId -> sessionId 解析、补守卫和 Gate 后才能恢复完整完成声明。

9.20m S6k canonical child roster 确认

架构影响:重大;将 App Server durable AgentGraph/AgentIdentity 与 canonical Thread lifecycle join 为 typed child roster,并让 Workspace GUI 只消费该 roster,不新增协议 owner、Electron 后端、事件总线、compat 或生产 mock。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:root,2026-07-14
确认内容:`thread/list` 暴露 parentThreadId、agentPath/nickname/role、lastTaskMessage 与 Codex 七态 agentState;selector/hook 保留 threadId/sessionId,parent Item 引用缺失 child 显式 notFound。Harness 和 RuntimeStrip 显式传入 canonical roster 时不回退 raw sessions,pendingInit+running 才计 active,interrupted 独立;导航优先 canonical ThreadId -> sessionId,未知才 thread/read。unified focused 91、Rust 精确 4、app-server check、scoped ESLint、typecheck、contracts 290、五语言与 GUI smoke 通过。当时 multi-agent-team synthetic run 已由 S4ai 撤销为产品 Gate,canonical AgentControl Gate 见 S4ah。

9.20n S6l Thread-first SubAgent 导航与守卫确认

架构影响:非重大;复用既有 App Server thread/read 与 canonical child roster 修正 Renderer 身份转换,不新增协议、Electron 后端、事件总线、compat 或 fallback。
架构图更新章节:不适用;既有 canonical Thread/Turn/Item 主链未变化。
责任开发者确认:root,2026-07-14
确认内容:canonical roster 保留 threadId/sessionId,activity target 优先使用 roster sessionId,缺失时通过 `thread/read(turnsView=notLoaded)` 严格解析;真实 child session id 仍可直达,mismatch/空值/read 失败均 fail closed。unified focused 91、stop 1、project-thread 10、catalog/registry 213、typecheck、contracts 290、五语言/unused/legacy 与 GUI smoke 通过;当时 synthetic Team run 不再计 Gate,canonical AgentControl Gate 见 S4ah。

9.20o S6m raw SubAgent channel 退役确认

架构影响:非重大;删除无 producer/consumer 的 Renderer status/stream 专用事件通道、adapter alias 与 DevBridge truth policy,不改变 App Server JSON-RPC、Electron host、canonical read model 或 current event transport。
架构图更新章节:不适用;既有 Electron Desktop Host -> App Server -> RuntimeCore -> Thread/Turn/Item -> GUI 主链未变化。
责任开发者确认:root,2026-07-14
确认内容:`agent_subagent_status:*` / `agent_subagent_stream:*` 已从 production listener、sync effect、runtime adapter、event source API 和 bridge truth prefix 迁出;`agentSession/event`、generic local fanout、sequence gate、thread/read polling 与 canonical child roster 保持 current。negative guard 同时阻止两个 prefix、专用 getter/listener 和 `listenToTeamEvents` 回流。focused 25/25、typecheck、legacy report 0/0/0;contracts protocol/client 290 和主体 gates 通过,最终 docs boundary 仅被并行索引的 release-v1.102.0 plan 阻断。current aggregate 通过历史/stream/首页/Workbench/图片/停止继续/Approval/Inputbar rich restore,pending-steer 首跑输入稳定等待超时,精确 Electron 场景复跑通过。

9.20p S6n1 raw SubAgent status parser 退役确认

架构影响:非重大;让 Renderer 对无生产协议来源的 raw `subagent_status_changed` fail closed,并删除 Agent UI dispatcher 分支;不改变 canonical Item schema、runtime status team projection、历史 EventLog opaque read 或 GUI current owner。
架构图更新章节:不适用;canonical SubAgent Item -> ThreadItem projection 与 thread/list child roster 主链未变化。
责任开发者确认:root,2026-07-14
确认内容:`parseAgentEvent` 对旧 raw status 返回 null,绕过 parser 直接调用 dispatcher 也得到空投影;canonical `item_* -> subagent_activity` 和 `runtime_status -> team.changed` 保持 current。精确 2/2、dispatcher 全量 22/22、typecheck/diff 通过。本切片当时保留的 raw TS type、独立 helper/package、fixture/i18n 已由后续 S6n 物理删除。

9.20q S6n raw SubAgent type/package/fixture 退役确认

架构影响:非重大;物理删除已无 producer/consumer 的 raw status TS type、local/package projector、fixture producer 与 summary/i18n 正向口径,不改变 App Server JSON-RPC、canonical Item schema、thread/list child lifecycle、runtime status team projection 或历史 EventLog opaque read。
架构图更新章节:不适用;Electron Desktop Host -> App Server -> RuntimeCore -> Thread/Turn/Item -> GUI 主链与 owner 未变化。
责任开发者确认:root,2026-07-14
确认内容:`subagent_status_changed` 类型、`subagentStatusProjection`、projection package `subagentStatusEvents`、raw-only runtime facts、summary/i18n/fixture 正向输入已删除;barrel 和 current docs 不再导出或宣称 raw helper。`runtime_status -> team.changed`、canonical `item_completed -> subagent_activity`、child roster/navigation 与 generic EventLog/hydration 保持 current。package 295/295、focused 136/137(唯一失败为既有 `action_required.request_id` fixture 漂移)、governance guards 16/16、typecheck、五语言、unused、legacy report 0/0/0、Multi-Agent Electron Gate B 与 GUI smoke 通过;contracts 主体通过后被并行索引的 release plan 阻断,aggregate 仅在已知 Skills Provider 鉴权失败处退出。

9.20r S6p-a canonical navigation/runtime strip fallback 退役确认

架构影响:非重大;删除 Renderer 导航和 runtime strip 对无 current producer 的 legacy child session fallback,不改变 App Server JSON-RPC、canonical child roster、Thread/Turn/Item schema、Electron host 或 session state owner。
架构图更新章节:不适用;既有 canonical child Thread -> `readThreadSessionId` -> session navigation 与 Thread/Turn/Item -> GUI 主链未变化。
责任开发者确认:root,2026-07-14
确认内容:`useWorkspaceSubagentNavigationRuntime` 只从 canonical child ThreadId 命中 roster sessionId,缺失时调用 `readThreadSessionId`,不再检查 `childSubagentSessions` 或 `isKnownSession`;`AgentRuntimeStrip` 只接受 canonical child summaries 并将空 roster fail closed 为零计数。Harness delegation/status fallback、Task Rail subtask stats、session state 和 legacy DTO 仍明确留在后续写集。导航/guard 5/5、strip 10/10、typecheck、legacy report 0/0/0、`npm run verify:gui-smoke` 与 claimed diff check 通过。

9.20s S6q canonical Task Rail subtask stats 确认

架构影响:非重大;将 Task Center Task Rail 的子任务统计从无 current producer 的 legacy session detail roster 切换到既有 canonical child Thread summaries,不改变 App Server protocol、Thread schema、Electron host、MessageList 或 session state owner。
架构图更新章节:不适用;既有 canonical child Thread roster -> Workspace scene -> Task Rail GUI 数据流未新增 owner。
责任开发者确认:root,2026-07-14
确认内容:`canonicalChildren` 已贯穿 AgentChatWorkspace scene、`useWorkspaceConversationSceneRuntime`、`useWorkspaceTaskRailRuntime`、TaskCenterUtilityToolbar 与 Task Rail ViewModel;Task Rail 不再接受 `childSubagentSessions`。状态映射为 pendingInit/running -> active,completed/shutdown -> completed,errored/notFound/interrupted -> 需处理,保证七态不静默丢失。focused 四组 78/78、最终映射 7/7、typecheck、legacy report 0/0/0、`npm run verify:gui-smoke` 与 claimed diff check 通过。Inputbar、Harness 与 legacy DTO/state/metrics 仍属后续。

9.20t S6r canonical Inputbar and landing subtask stats 确认

架构影响:非重大;将 landing task card、MessageList 和 Inputbar runtime status 的子任务统计从无 current producer 的 legacy session detail roster 切换到既有 canonical child Thread summaries,不改变 App Server protocol、Thread schema、Electron host、session state owner 或用户可见文案。
架构图更新章节:不适用;既有 canonical child Thread roster -> Workspace scene -> landing/MessageList/Inputbar GUI 数据流未新增 owner。
责任开发者确认:root,2026-07-14
确认内容:`canonicalChildren` 已从 Workspace scene 贯穿 landing task card、MessageList timeline state 和 Inputbar runtime status;上述 surface 不再接受 `childSubagentSessions`,projection deferral 也不再搬运空 legacy roster。统一七态统计为 pendingInit/running -> active,completed/shutdown -> completed,errored/notFound/interrupted -> failed。focused 6 files/41 tests、typecheck、exact ESLint/Prettier、legacy report 0/0/0、`npm run verify:gui-smoke` 与 claimed diff check 通过。session DTO/state/normalizer/API fixture/export metrics 仍属后续 contract 删除切片。

9.20u S6s legacy SubAgent session contract retirement 确认

架构影响:非重大;删除无 current producer/consumer 的 Renderer session roster DTO/state/normalizer/fixture 与 raw export metrics fallback,并让已有 canonical thread family/AgentGraph 承接 parent identity 和 active child count;不改变 App Server protocol、Thread schema、Electron command、export response schema 或 RuntimeCore owner。
架构图更新章节:不适用;既有 App Server -> canonical Thread family/AgentGraph -> GUI/export 数据流未新增 owner。
责任开发者确认:root,2026-07-14
确认内容:React session snapshot/hooks/Workspace 不再持有 child/parent roster;session API 删除 AgentSubagentSessionInfo/ParentContext/SkillInfo 和 child/sibling/parent keys,两个 object-spread 边界只允许删除旧 key;Workspace parent visibility 只读 useCanonicalChildThreads.hasParentThread;export activeSubagentCount 只统计 canonical AgentGraph direct open children 中 PendingInit/Running 状态。React 255/255 + final 5/5、API 60/60 + related clientFactory 1/1、Rust focused 2/2、typecheck、exact lint/format/rustfmt/diff、legacy report 0/0/0 与 GUI smoke 通过。Rust related 被未触及 MCP stdio stack overflow/SIGABRT 阻断;完整 clientFactory 唯一失败为未触及 turn-lifecycle readThread 旧期望。

9.20 S4r2 App Server reverse JSON-RPC 确认

架构影响:重大;在既有 JSONL transport 上新增 App Server -> Renderer 的 typed server-request 方向、独立 method catalog kind、outer request waiter 与 Renderer dispatcher,不新增 Electron 业务后端或兼容层。
架构图更新章节:internal/aiprompts/architecture.md 第 4 节 Electron Desktop Host、第 6.1 节 App Server 与协议组、第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-13
确认内容:已核对 domain token 与 outer JSON-RPC id 双层 identity、boot UUID + counter、请求 `_meta` 保真、Response/Error exact remove-once、aborted wait remove-on-drop、ambiguous client fail closed、Renderer connection-scoped in-flight/settled at-most-once、unknown/duplicate/late/disconnect fail closed、notification/request 不偷 client response、Electron 仅 JSONL 转发、Renderer method dispatcher 与错误码、nullable turn/parent correlation,以及 generic Approval/request_user_input/mock fallback 禁止复用。S4r2 当时只交付 foundation;后续 S4r3-S4r9/S4ak 已完成 adapter、GUI、thread-owned runtime、fault isolation、runtime capability 与真实 Electron Gate B。按 Codex `5c19155cbd93`,server-originated elicitation 仍是瞬时 reverse request,不进入 canonical Item、`thread/read` 或 durable projection。

9.21 S4r5-S4r6 MCP elicitation GUI 闭环确认

架构影响:重大;在既有 reverse JSON-RPC 主链补 response `_meta` raw-wire 保真、connection-owned `serverRequest/resolved` terminal notification、Renderer AbortSignal 撤销语义与主窗口全局 GUI 表单,不新增 Electron 业务后端、兼容层、Approval/ask-user 复用或生产 mock fallback。
架构图更新章节:internal/aiprompts/architecture.md 第 6.1 节 App Server 与协议组、第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-13
确认内容:S4r5-S4r6 protocol、renderer 和 GUI form foundation 已集成验证;公开 wire 固定为 required `threadId` + nullable `turnId` + required `serverName` + `mode: "form"`,不含 `sessionId`、`parentToolCallId` 或 raw MCP identity。该阶段的 per-Session runtime owner blocker 已由 S4r8 关闭,server startup blocker 由 S4r9 关闭,capability advertisement 与防假绿 Gate B 由 S4ak 关闭。全局 `McpClientManager` 仍只作控制面,management nested elicitation 在无可信 thread owner 时 fail closed。

9.22 S4r8 MCP runtime thread owner 确认

架构影响:重大;`AgentRuntimeState[sessionId] -> McpThreadRuntime` 在创建期固定 canonical threadId,且独立持有 runtime manager、RMCP connection 与 bridge registry。App Server reverse request 只公开 threadId、nullable turnId、serverName 与 form payload;per-call scope 只保留 turn correlation。全局 McpClientManager 继续只负责控制面,不新增 durable elicitation Item、read model、transport 或兼容层。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:refactor-v2-coordinator,2026-07-13
确认内容:已核对 runtime 只从 management typed server specs 创建自有 connection generation,配置不变则复用、变更则原子发布新 generation,旧 step 继续持有旧 handle。McpCallScope 只保留 nullable turn correlation;session/thread owner 不再随 call 传递或推断;management nested elicitation Decline。公开 wire 不含 sessionId/parentToolCallId/raw MCP id/progress token、session/turn thread mismatch fail closed、delete 按 exact (sessionId, threadId) close runtime、session A 取消不影响 B 且 forwarded waiter 必须等 serverRequest/resolved terminal。2026-07-14 发现的默认 Playwright MCP startup E404 已由 S4r9 per-server isolation 关闭;S4ak 后续只让具备 immutable runtime owner 的 client 广告 form capability,并以真实 Electron Gate B 证明 runtime/management 分流。

9.22b S4r9 MCP runtime server fault isolation 确认

架构影响:重大;runtime MCP generation 的 startup policy 从“任一 enabled server fail 整个 turn”改为 Codex 对齐的 per-server isolation:optional server absent,required server 才拒绝 candidate generation。MCP runtime owner、Electron/App Server JSON-RPC、Thread/Turn/Item 与 GUI 链不新增平行路径。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:root,2026-07-14
确认内容:已核对 runtime manager 只建立自有 RMCP connection,optional failure 无 bridge route,required replacement failure 关闭候选而不替换或取消旧 generation;真实 Electron/preload/app_server_handle_json_lines/App Server/runtime/Renderer Gate B 保留故障 Playwright server 且完整通过 provider tool -> form -> accept -> second provider request -> final text。

9.22a S4r8 LocalAppDataSource fixture sync 确认

架构影响:非重大;测试 fixture 与既有 LocalAppDataSource router owner 同步,trait implementation 直接读取已拥有的 router field;不新增 transport、runtime owner、协议、GUI、持久化或 mock fallback。
架构图更新章节:不适用;既有 Electron Desktop Host -> App Server JSON-RPC -> RuntimeCore/tool-runtime 的依赖方向不变。
责任开发者确认:refactor-v2-coordinator,2026-07-14
确认内容:真实 stdio MCP fixture、S4u mailbox store 与 S4v AgentControl focused test 已在 shared fixture 修复后分别 1/1、4/4、6/6 通过。默认 macOS test worker stack 对该既有 stdio fixture 会溢出,遵循仓库已有 RUST_MIN_STACK=8388608 test-runner 口径;这不是生产路径 fallback,也不改变 S4w 仍待 hot write set 释放的事实。

9.23 S7 v2 skeleton closeout 架构确认

架构影响:非重大;S7 不新增业务实现、协议、runtime owner、Electron 后端、compat 或 fallback,只汇总并确认 S0-S6 已落地的 Codex-first GUI 架构与当前工作树证据。
架构图更新章节:不适用;本轮只读复核 internal/aiprompts/architecture.md,既有 Electron Desktop Host -> App Server JSON-RPC -> RuntimeCore -> Thread/Turn/Item -> GUI 主链未变化。
责任开发者确认:root,2026-07-14
确认内容:已核对 Lime 作为 GUI 产品保留 Renderer 交互与可视投影,但 Agent loop、状态机、工具/MCP/Skills/Multi-Agent、历史恢复和 canonical read model 只向 Codex 语义收敛;provider capability/lowering 与多模态 part 继续按 OpenCode owner 边界收敛。fresh Approval cancel Gate B 证明 recordCount=1、Turn canceled、pendingRequestCount=0 且 GUI composer 恢复;GUI smoke、lint、typecheck、legacy 0/0/0、scripts governance 和 diff 通过。S7 只标记 skeleton closeout,因 verify:local baseline assertion、release docs boundary、Skills Provider 鉴权、PR architecture context、S5 compat consumer 与 S6o GUI/session roster refinement 未关闭,不标记 archive-ready 或 v2 全部完成。

9.24 S2o-S2q per-item lifecycle 与 canonical presentation boundary 确认

架构影响:重大;provider Text/Reasoning 的 Start/Delta/End 从 turn-family fallback 收敛为 canonical-Turn-and-sampling-attempt-scoped per-item identity,并把 agentSession/read 明确定义为 ThreadStore-backed 产品 presentation endpoint。未新增协议 method、Electron 后端、第二 read model、compat 或生产 mock fallback。
架构图更新章节:internal/aiprompts/architecture.md 第 6.2 节 Agent Runtime、Thread 与持久化,第 7.1 节事件与完成态,第 8.1 节 Turn 请求字段归属。
责任开发者确认:root,2026-07-15
确认内容:已对照 Codex ResponseItem lifecycle,核对 provider raw ID 会在 sampling attempt 间及同一 Thread 的后续 Turn 复用,故 current Agent Item ID 必须同时包含 canonical Turn、sampling attempt、family 与 source item;Message/Reasoning state 按 item identity 隔离,Plan 使用独立 revision identity 并仅记录 sourceItemId,terminal Item 拒绝 late delta,turn terminal 不合成 Item completion。thread/read/list/... 继续负责 canonical identity/control;agentSession/read 从同一 ThreadStore read model 组织 GUI detail。缺失 detail 的 Renderer synthesis 已删除,production App Server 只能显式 with_runtime 构造;event/app-data fallback 与 AppServer::new 只存在于 test build/evidence。focused/related Rust、Renderer、typecheck、真实 Electron history fixture、通用 GUI smoke与 AgentControl managed Gate B 已验证。

9.25 S3g-S3i provider 单代数退役确认

架构影响:重大;删除 runtime-core 与 model-provider 中重复的旧 provider-neutral request/event algebra 和 generic mapper,使 OpenCode 对齐的 canonical content/capability/lowering 保持唯一 owner。未新增协议、Electron 后端、GUI 状态、compat 或 fallback。
架构图更新章节:internal/aiprompts/architecture.md 第 6.3 节 Provider 与工具组。
责任开发者确认:root,2026-07-15
确认内容:已核对 current chat/responses/anthropic provider 只由 model-provider current_client 消费 runtime-core canonical Request/ContentPart/LlmEvent;图片和视频只调用 canonical media body builder。旧 LlmRequest、ProviderWireRequest、LlmEvent -> LlmRuntimeEvent mapper、generic chat/gemini/ollama lowering无生产 consumer,8 个 pure-old文件已删除并受 physical/symbol guard 保护。runtime-core 43/43、model-provider 126/126、media-runtime 51/51、route integration 9/9 与 client contract 288 通过;全 workspace cargo fmt 仅被 active MCP slice 的非本写集格式差异阻断,S3 claimed files exact rustfmt 通过。

9.26 S2t-S2v canonical persistence closeout 确认

架构影响:重大;删除 app-data session hydration/read fallback,统一 canonical Item ordinal owner,并把普通 ThreadStore projection 失败从 warning-and-continue 收紧为 EventLog-first fail closed。未新增协议 method、Electron 后端、第二 read model、compat、store renumbering 或生产 mock fallback。
架构图更新章节:internal/aiprompts/architecture.md 第 6.2 节 Agent Runtime、Thread 与持久化,第 7.1 节事件与完成态。
责任开发者确认:root,2026-07-15
确认内容:已核对 RuntimeCore/EventLog/ProjectionStore/ThreadStore 是 session read/resume 唯一 current owner;首次 Item 对应的 Lime outer AgentEvent.sequence 是 canonical ordinal 唯一事实源,后续 lifecycle 保留首次 ordinal,Codex sourceEventSeq 仅为 provenance。EventLog append 后只有 canonical ThreadStore apply 成功才允许返回 notification 与推进内存 history,失败 tail 留给 restart/repair。S2t focused 100/100、S2u projection 40/40 + store 10/10 + import 13/13、S2v focused 1/1 + external sequence 5/5、App Server 1118/1118、GUI smoke、legacy 0/0/0 与 scoped rustfmt/diff 通过;PR 级 architecture confirmation 仍须在实际 PR body 中填写并由门禁复核。

9.27 S7ae Content Factory synthetic contract probe retirement 确认

架构影响:非重大;只删除 Content Factory 产品 fixture 尾部额外制造的 contract-mismatch Turn、专用 waiter/summary/常量/assertion,并把 contract fail-closed 与通用 worker failure projection 保留在既有 App Server focused Rust owner。不改变 Electron/App Server 协议、RuntimeCore、Thread/Turn/Item schema、Renderer、生产 mock policy 或 GUI 产品结构。
架构图更新章节:不适用;既有 Electron Desktop Host -> App Server JSON-RPC -> RuntimeCore -> read model -> GUI 主链未新增或迁移 owner。
责任开发者确认:root,2026-07-15
确认内容:Content Factory Electron Gate B 53/53 通过,actionable console error 为 0;真实 worker dogfood、既有失败 worker evidence、Article Editor、artifact read、编辑恢复与 workflow read/cancel/retry 均保留。contract-reject request、summary、常量与 assertion 为 0。聚合门禁后序发现的 Coding Workbench recovery 跨 Turn fixture identity 复用已独立分配给 S7af,不恢复本 synthetic probe。

9.28 S7af Coding Workbench recovery Turn identity fixture 确认

架构影响:非重大;修复 deterministic Electron external backend fixture 的跨 Turn canonical Item/operation identity 复用,并让失败路径覆盖当前 backend ledger evidence。不改变 RuntimeCore、ThreadStore、read model、协议、Renderer 或生产 GUI owner。
架构图更新章节:不适用;S2v EventLog-first canonical projection fail-closed 保持 current,fixture 改为遵守既有 Thread/Turn/Item identity 约束。
责任开发者确认:root,2026-07-15
确认内容:recovery Turn 的 tool/file/patch/command/test execution ID 与 output/diff/content/checkpoint refs 绑定真实 recovery turnId;首轮失败 command/test/output ID 只保留为 recovery source refs。focused 6/6、syntax/format/diff、scripts governance 与 Coding Workbench Electron Gate B 通过;initial/recovery latest Turn 均 completed,recoveryExecutionIdsTurnScoped=true,invoke/console/page error 为 0。

9.29 S7ag 最终本地门禁与 ProjectShell 环境归一化确认

架构影响:非重大;ProjectShellManager 仍是项目 Shell PTY 的唯一 current owner,只把已定义但为空的颜色环境变量归一化到既有默认值。不新增协议、Electron IPC、App Server method、runtime owner、compat 或 mock fallback。
架构图更新章节:不适用;Electron Desktop Host -> App Server JSON-RPC -> RuntimeCore -> Thread/Turn/Item -> GUI 主链未变化。
责任开发者确认:root,2026-07-15
确认内容:`npm run test:resume` 真实完成 smart suite 110/110;修复前首次并发 Rust gate 的 3 个时序/PTY 失败已逐项 exact 复验,其中 ProjectShell 的空 `COLORTERM` 已在 current owner 修正;修复后 `npm run test:rust:changed` 通过(App Server 1119/1119),legacy report 0/0/0、rustfmt、diff check 与真实 Electron GUI smoke 全部通过。完整证据见 `internal/research/refactor/v2/13-evidence/2026-07-15-s7ag-final-local-gates-and-project-shell-env.md`。本地 architecture confirmation 因缺少 PR event/base 按预期阻塞,S7 保持 `not-archive-ready`。

9.30 S6t Canonical parent Thread residual 确认

架构影响:非重大;只把既有 canonical Thread parent identity 贯彻到 Agent UI projection、共享 projection package、Evidence Pack team facts 与 Multi-Agent fixture,不新增协议 method、Electron 后端、runtime owner、compat 或 fallback。
架构图更新章节:不适用;Electron Desktop Host -> App Server JSON-RPC -> RuntimeCore -> Thread/Turn/Item projection -> GUI 主链及 owner 未变化。
责任开发者确认:root,2026-07-15
确认内容:已核对产品 `parentSessionId(s)` 从 GUI/projection/Evidence Pack current contract 删除,parent identity 只读 canonical `parentThreadId(s)`;AgentControl 内部 `parent_session_id` 仍描述 RuntimeCore loaded-parent session 控制边界,不属于本切片 legacy surface。projection 10/10、Renderer/governance 32/32、fixture guards 71/71 与 Rust team facts 1/1 通过。原 synthetic Electron 41/41 与 scenario 11/11 只作为历史 fixture 结果,不再计产品 Gate;current proof 为 S4ah 28/28 canonical AgentControl visible DOM Gate B。

9.31 S4am spawn_agent.fork_turns canonical history 确认

架构影响:重大;为 Codex MultiAgentV2 `spawn_agent.fork_turns` 建立 `tool-runtime` typed contract,并让 App Server 把选中的 parent history 写入 child 自身 EventLog、ProjectionStore 与 ThreadStore。未新增 JSON-RPC method、Electron 后端、第二 history store、session metadata owner、compat 或生产 mock fallback。
架构图更新章节:internal/aiprompts/architecture.md 第 6.2 节 Agent Runtime 组。
责任开发者确认:root,2026-07-15
确认内容:已对照 `/Users/coso/Documents/dev/rust/codex` 的缺省/空白为 all、显式 none/all、非法值与 final-answer 过滤语义;字符串只在 `tool-runtime` 解析一次,Renderer 以 64 位 Rust `usize` 同边界 fail closed。App Server 消费 `SpawnAgentForkMode`,在 child 初始 mailbox task 前写 canonical history;只从 completed canonical UserMessage + 同 EventLog hydrated AgentInput 选 Turn,只从 completed `phase=final_answer` AgentMessage 重建 delta/completed。child 使用稳定新 identity,canonical metadata 保留 source Thread/Turn/Item mapping;非 none 同时持久化 parent/fork lineage。commentary、reasoning、tool lifecycle、inter-agent、parent trace/request/raw Team 旁路不复制;provider transcript 从同一 child EventLog 派生。history/lineage/graph/identity/mailbox 返回错误会清 ProjectionStore、EventLog/workflow audit、sidecar、approval cache 与内存 child。新增 durable pending-spawn crash transaction:child 前缀、identity、graph、mailbox 与初始 task 形成可回滚事务;App Server 启动只回滚残缺 Pending,运行期不做全局 reconciliation;Pending child 在 Thread/session read/list、roster、GUI/API 中隐藏,精确的 Open + pending TriggerTurn child 才恢复。App Server AgentControl 23/23、tool-runtime 6/6、projection 294/294;最新 home-hotpath Electron Gate B identity、canonical ThreadItem 与 handoff stability 全部通过,`submitToConversationStability.stable=true`、`unstableCount=0`。项目级完整 contracts/current fixture/GUI smoke 仍待统一收口,故本节不提前做架构 release 签字。

9.32 S1c typed turn/steer client skeleton

架构影响:非重大;只将已生成的 v2 `TurnSteerParams/TurnSteerResponse` 接入 `packages/app-server-client` 的 request client、Connection 和 AgentRuntime facade,不新增协议、Electron 后端、第二 runtime owner 或兼容包装。
架构图更新章节:不适用;当前 Electron Desktop Host -> App Server JSON-RPC -> RuntimeCore -> Thread/Turn/Item -> GUI 主链未因本刀改变。
责任开发者确认:root,2026-07-19
确认内容:`steerTurn` 统一使用 `turn/steer` 与 v2 typed input,request/connection/runtime facade 和回归断言已贯通;package typecheck、package 67/67、`check:protocol-types`、client contract 291 checks 与 diff check 通过。当前仅为 skeleton:App Server 入口仍先解析 v0 raw `AppServerClientRequest`,`turn/start`/`turn/interrupt` 与 thread 方法仍存在 v2 method + v0 payload 混合边界,Renderer `appServerClientMethods`/plugin client 尚未暴露 `steerTurn`;这些列入 OPEN_REF,不宣称 v2 production protocol 或 Gate B 完成。

9.33 Session submission loop foundation skeleton

架构影响:重大;为 `agent-runtime` 建立单 session 串行 task actor、FIFO/replace/interrupt、steer/mailbox phase、step context、token usage、响应 waiter 与有界 abort cleanup。App Server 继续通过 RuntimeCore 作为唯一消费链,未新增第二 runtime owner。
架构图更新章节:internal/aiprompts/architecture.md 第 6.2 节 Agent Runtime、Thread 与持久化。
责任开发者确认:root,2026-07-19
确认内容:response waiter 已接入 RAII 清理;final-answer 边界拒绝迟到 mailbox,并在同一 task 内重新接纳 steer;loader 失败不丢已接纳 steer;registry shutdown 串行化,避免关闭窗口重建 actor;abort hook 与 task join 均有界。`cargo check -p agent-runtime -p lime-agent -p app-server`、session loop 15/15、provider turn 16/16、rustfmt 与 diff check 通过。本段记录最初 foundation 状态;operation envelope、shared shutdown waiter、durable mailbox activity 与领域拆分已由 9.35 后续切片补齐。review lifecycle 与完整 typed operation 仍未完成。

9.34 S1c v2 Turn production skeleton 与 Renderer consumer cutover

架构影响:重大;`turn/start`、`turn/steer`、`turn/interrupt` 已切到 Codex v2 typed params/response,App Server 通过 canonical thread identity 解析现有 RuntimeCore session,Renderer 与 Plugin current gateway 直接消费 `threadId + UserInput[]`。未新增 Electron 后端、第二 runtime owner、生产 mock fallback 或长期 compat wrapper。
架构图更新章节:internal/aiprompts/architecture.md 第 8.1 节 Turn 请求字段归属。
责任开发者确认:root,2026-07-19
确认内容:v2 `ClientRequest` 对三条 Turn method fail closed decode;App Server start/steer/interrupt handler、packages client、Renderer AppServerClient/threadClient 与 Plugin consumer 已形成最小真实 JSON-RPC 骨架。`rendererEventName` 只在 Renderer 内部路由并在出 wire 前剥离;旧 `runtimeOptions`、`queueIfBusy`、`turnsView` 和 sessionId turn payload 不再进入 current Turn wire。已通过 v2 protocol 10/10、App Server turn_steer 3/3、Renderer AppServer API 36/36、完整 threadClient 47/47、Plugin consumer 8/8、Plugin gateway 4/4、agentProtocol 28/28、agent-runtime-client package 19/19 + typecheck、contracts 292、protocol generation drift check、legacy 0/0/0 与 diff check。
阶段性 OPEN_REF(当时):App Server 外层仍先经过 v0 raw catalog;`thread/start|resume|read|list` 尚未全部切成 v2 typed handler/response。后续收口已完成 Renderer 全量 typecheck,并将零生产消费者、恒返回 `null` 的 `canonicalApprovalItemProjection` 源文件与同名测试物理删除,client contract 锁定其为 `dead / deleted / forbidden-to-restore`;home-hotpath Gate B 已有 definitive 68/68 证据。本节仍只记录 S1c skeleton,不据此宣称整体 Codex parity 或 release-ready。

9.35 Session operation envelope 与 mailbox activity skeleton

主目标:继续把 session submission loop 收敛为单 actor、单 operation queue、单 pending-input owner;本刀不新增 compat、第二 runtime 或生产 mock。
架构影响:重大;普通用户输入的 steer-or-start 决策开始收回 session actor,App Server 只消费 typed receipt,未新增第二调度 owner。
架构图更新章节:internal/aiprompts/architecture.md 第 6.2 节 Agent Runtime 组。
责任开发者确认:root,2026-07-19
当前阶段:统一 operation envelope 已承载 UUIDv7 submission id、client user message id 与 W3C trace;task context、首次启动、queued task 和 FIFO promote 共享同一份不可变 metadata。shutdown 使用共享 termination watch,多个 handle 可以等待同一 actor 终止。
本刀:steer/mailbox 发布 typed activity;mailbox pending 使用单调 generation,loader 失败不确认,成功只确认调用前捕获的 generation。App Server durable direct mailbox append 在持久化成功后通知已经存在的 recipient session actor,不因通知创建空 actor。
typed user input:泛化 `Submit/Steer` operation 已由 `StartTask/UserInput` 取代。`UserInput` 同时携带输入和 optional candidate regular task;actor 有 active regular task 时只 steer 并返回 `Steered`,空闲时用同一输入启动 candidate 并返回 `Submitted`,candidate 不会在 steer 分支误启动。App Server 普通 turn start 与显式 steer 都已进入该 typed operation;通用 `StartTask` 只保留给非用户 task、replace 与底层生命周期测试。
typed inter-agent input:`Mailbox(Value)`、`Mailbox` operation 与无 identity 的 public activity notification 已删除。durable append 返回的完整 record 会转换为 typed `InterAgentCommunication` envelope,仅唤醒已经存在的 recipient actor;loader drain 再转换为 typed `RuntimeSessionInput::InterAgent`,provider prompt 保留 message/root/sender/recipient/source-turn identity、message/result kind、result status 与 queue/trigger delivery mode,不再从 JSON 猜字段。
验证:session loop 28/28、`agent-runtime` 全量 143/143、App Server direct typed activity 1/1、durable mailbox delivery 10/10、turn steer 3/3、queue 10/10、turn lifecycle 26/26、`cargo check -p agent-runtime -p lime-agent -p app-server` 与 scoped rustfmt 通过。三 crate check 曾短暂命中并行 `core/app_paths.rs` 热区的中间态,owner 完成后已基于最终工作树重跑通过,本轮未触碰该文件。
结构退出:root contract facade 222 行,actor 545 行,handle 371 行,input queue 787 行,typed inter-agent DTO 独立为 30 行模块;公开 API 通过 root re-export 保持不变,内部 state 只保持 `pub(super)`。没有生产文件越过 1000 行硬门禁,actor 与 handle 均保留继续拆分空间。
体量门禁:本轮新增的 `session_loop/inter_agent.rs`、`provider_turn/input.rs` 与 `runtime/inter_agent_input.rs` 均低于 800 行;全局 `governance:file-size` 仍报告共享工作树 96 处既有超线,包含尚未拆分的 `runtime/turn_execution.rs` 与 `agent_control_gateway.rs`,不把该全局 residual 伪装成本轮已完成。
分类:session actor、typed `UserInput`、typed receipt、typed `InterAgentCommunication`、durable loader conversion 与 App Server 消费链均为 current;旧 `Submit/Steer/Mailbox(Value)/MailboxActivity` operation 为 dead 且代码零引用;未新增 compat 或 deprecated wrapper。
后续状态:actor-first 两阶段 admission 已删除 RuntimeCore active-turn 预扫描与独立 steer 旁路;actor 未接纳 candidate 时,RuntimeCore 在返回错误前回滚已暂存 Turn。五类 typed response、terminal-result activity 与 event-driven wait 已闭环。七类仍演进的非用户 task 中 Compact 已有生产消费;Review、ThreadSettings、SetMemoryMode、RefreshMcp、ReloadConfig、RunShell 的真实生产 owner 与退出条件见 9.48,不能计完整收口。已退役的历史截断操作不再计入 current task。

9.36 S1c v2 ingress 与 schema owner skeleton

主目标:继续把 App Server 请求入口收敛为 Codex v2 typed decode,并让 schema 与未实现 lifecycle 语义 fail closed;不恢复 v0/agentSession compat,不接管并行 thread/start、turn、Electron 或 v1 写集。
本轮写集:lime-rs/crates/app-server-protocol/src/schema_export.rs、lime-rs/crates/app-server/src/processor/dispatch.rs、lime-rs/crates/app-server/src/processor/dispatch/v2_ingress.rs。
当前:bundle 中 9 个 v0/v2 顶层重名由显式 v2 owner 唯一插入,其他重复立即失败;9 个 v2 method 在进入 v0 raw catalog 前统一解码为 ClientRequest。thread/resume 的真实 load/subscribe owner 尚未建立,因此合法 v2 请求返回稳定 RUNTIME_ERROR,旧 sessionId payload 返回 INVALID_PARAMS,不再委托 queued-turn resume。
验证:schema export 6/6、v2 ingress 5/5、Plugin thread start consumer 4/4、752 个 protocol types 无生成漂移、contracts 292、scoped rustfmt、git diff check 与 governance legacy report 0/0/0 通过。首次 contracts 运行命中并行 Plugin runtime 迁移与旧文本 marker 的短暂漂移;本进程未夹写该热区,对应 owner 同步后基于最终工作树重跑通过。
分类:schema owner 与 v2 ingress 为 current;生产入口继续经过 v0 AppServerClientRequest 属于待删除 compat;旧 handle_session_thread_resume_impl 对 thread/resume 已不可达,归 dead-candidate,待其文件 owner 删除并补负向守卫。
OPEN_REF:当前 typed ClientRequest 仍只承担 ingress validation,尚未直接穷尽 dispatch;thread/start 的并行 skeleton 仍会用 unknown/Null/空值拼 response,和 canonical thread/read 事实可能漂移。下一刀应在热区释放后改为 typed request 直接 match,删除 v0 中 9 个 v2 method,建立真实 thread/start/resume lifecycle owner,再接 standalone v2 notifications 与 Electron ACK。

9.37 Plugin canonical identity cutover 与 Gate B fixture blocker

主目标:让 Plugin page/current client 直接消费 v2 thread/start、turn/start、turn/steer、thread/read 与 turn/interrupt,不再把 sessionId 当作 threadId,也不通过 ThreadStartParams.config 携带业务 metadata。
架构影响:非重大;没有新增 protocol method、runtime owner、Electron 后端或持久化边界,只把既有 Plugin consumer 对齐 architecture.md 第 7.2 节与第 8.1 节的 canonical identity/Turn 字段归属。
本轮写集:src/features/plugin/runtime/agentRuntimeAppServerClient.ts、agentRuntimeCapabilityHost.ts、agentRuntimeClientApi.ts、对应测试与 PluginRuntimePage fixture;Plugin task request 增加显式 threadId,已有 Thread 只允许 sessionId/threadId 成对复用。
当前:thread/start 返回的 canonical sessionId + thread.id 作为不可混用的 identity;turn lifecycle 只消费 threadId,action respond 继续消费 sessionId;Plugin 业务 metadata 只进入 turn/start.responsesapiClientMetadata.pluginRuntime。Workspace 抽取 owner 的 optional defaults 同步收口,Renderer/Node typecheck 通过。
验证:Plugin runtime/page 42/42、Capability Host 12/12、Renderer 与 Node typecheck、contracts 292、protocol generation drift、scripts/docs contracts、legacy report 0/0/0 与 diff check 通过。current fixture 的 unit/streaming/fixture guards 通过,并完成真实 Renderer/App Server sidecar 重建。通用 Electron smoke 在隔离 HOME 且保留真实 RUSTUP_HOME/CARGO_HOME 时通过,证明 Desktop Host、preload、App Server 初始化、Claw shell reload 与 Memory Settings 可用;默认 smoke 仍会把迁移源解析到真实用户 DB,并在活跃 WAL 下按预期 fail closed,测试环境需补完整 HOME 隔离。
Gate B blocker:Claw current fixture 仍以调用方常量构造 sessionId/threadId,再向 v2 thread/start 发送已删除的 v0 payload,随后 agentSession/update 固定 sessionId,真实 App Server 因 canonical identity 独立生成而返回 session not found。不得通过恢复 agentSession/start、给 v2 ThreadStartParams 增加 caller-supplied identity 或 session/thread fallback 修复;下一刀应迁移 fixture 为读取 thread/start 返回 identity,并把该 identity 显式传入 sidebar/read/update/turn/assertion helpers。
分类:Plugin v2 gateway 与双 identity 为 current;旧 Plugin session-only reuse 为 dead;Claw fixture 的 caller-owned identity 为 test-only deprecated,迁出后删除常量依赖。整体仍是 skeleton,不标记 Gate B 或 release-ready。

9.38 S1c v2 entity schema convergence skeleton

主目标:先解除 v0/v2 Thread/Turn/Item 异构 schema 冲突,并让现有 live envelope 不再发送与生成类型不一致的旧 entity;本刀不把 deprecated envelope 误报为 direct notification 完成。
架构影响:重大;公开 v0 schema 删除已由 v2 request catalog 接管的 thread read/list params/response 根,`agentSession/event.canonicalEvent` 的 entity owner 改为 v2 Thread/Turn/ThreadItem。事件仍沿 App Server 集中 projector 输出,不新增 Electron 后端、第二 read model、生产 mock 或平行 codegen。
架构图更新章节:internal/aiprompts/architecture.md 第 7.1 节事件与完成态。
责任开发者确认:root,2026-07-19
确认内容:已核对 App Server 从内部 agent-protocol entity 经现有 thread projector 产生 v2 DTO;protocol wrapper、生成 schema 与 TypeScript 类型不再把旧 itemId/sessionId/毫秒 record 伪装成 v2 tagged union。v0 schema registry/schema type names 物理移除 8 个 Thread*Params/Response 根,v2 是唯一公开 entity owner;generator 的异构 nested collision 守卫保持 fail closed。
验证:app-server-protocol agent session 9/9、schema export 6/6、schema fixture 1/1、protocol catalog 4/4;App Server event notification 4/4、streaming canonical item 1/1、request cancel/resume 5/5、thread_v2_jsonrpc 3/3、cargo check -p app-server;protocol types 737 个生成无漂移、contracts 292 checks、legacy report 0/0/0、scripts/docs contracts、rustfmt 与 git diff check 通过。
并行协调:本轮未触碰 internal/refactor/v1、Electron、Renderer/Plugin consumer 或 session_loop 热区;thread.rs 只增加 projector 转发点,保留隔壁 thread/start 实现。验证结果针对最终共享工作树,不声明其它并行 diff 归属。
分类:v2 Thread/Turn/Item schema 与集中 projector 为 current;v0 Thread* public schema roots 为 dead/deleted;agentSession/event.canonicalEvent wrapper 为 deprecated,只能运输同一 v2 entity,禁止新增 consumer。
OPEN_REF:TS 生产侧尚无 standalone v2 ServerNotification consumer;packages/app-server-client、packages/agent-runtime-client、Renderer router/pipeline 仍消费 nested canonicalEvent。下一刀应补 item/agentMessage/delta direct DTO,迁移五类 lifecycle + delta consumer,再删除 canonicalEvent/typedEvent wrapper 与旧正向 fixture。thread/resume 仍只有取消/初始化/fail-closed 骨架,真实 load/subscribe owner 未完成。本节完成度为 entity/schema 骨架 100%,direct notification cutover 约 20%,不标记 Gate B 或 release-ready。

9.39 S1c direct v2 notification skeleton 与 wrapper 清理

主目标:让 Thread/Turn/Item live lifecycle 沿 Codex v2 standalone notification 进入 App Server、typed client 和 runtime pipeline;不恢复 v0 lifecycle DTO、第二套 projector 或生产 mock/fallback。
架构影响:重大;六个 direct notification 进入统一 method catalog/schema manifest/generated client,App Server projector 增加 direct/side-channel/reject 三态,旧 v0 notification schema 与 TypeScript canonical/typed wrapper 删除。
架构图更新章节:internal/aiprompts/architecture.md 第 7.1 节事件与完成态。
责任开发者确认:root,2026-07-19
确认内容:direct thread/started、turn/started、turn/completed、item/started、item/completed、item/agentMessage/delta 已形成 Rust projector -> JSON-RPC catalog/schema -> app-server-client -> agent-runtime-client -> Electron/Renderer pipeline;malformed covered event fail closed,side-channel 仅保留 raw media/diagnostic;delta 不合成 verifier sequence。已删除六个旧 v0 notification schema/registry entries、package typedEvent/canonicalEvent fields and helpers;契约守卫同步为 direct lifecycle 断言。
验证:app-server-protocol catalog/schema、App Server v2 projector/event notification、cargo check -p app-server、两个 package build/test、npm run test:contracts 292 checks 与 npm run governance:legacy-report 0/0/0 均通过。最终 sidecar 与 Electron Host 已重建;Claw direct-v2 guard 63/63,真实 complete Gate B 为 ok=true、52/52 assertions、console/invoke error 0,动态 probe 的 direct lifecycle、Tool Item 与 thread/read identity 对齐。
分类:direct v2 catalog/projector/client/runtime/Electron/Renderer pipeline 为 current;旧 v0 lifecycle DTO、TypeScript typedEvent/canonicalEvent wrapper、Claw agentSession/event 正向 consumer 为 dead/deleted;agentSession/event 只剩明确 raw media/diagnostic side-channel,属于 deprecated 迁出边界,不能承载 lifecycle/action。
OPEN_REF:旧 `appServerEventPayloadProjection.ts` 与正向 canonical/raw lifecycle fixture 已物理删除并进入 forbidden guard;`canonicalEvent`/`typedEvent` 只允许存在于负向 fail-closed 断言。home-hotpath 已接回 firstTextDelta/firstTextPaint/clientLocalOutput,diagnostics trace rows、providerWait 与 server emission timestamp 仍未闭环。后续应把剩余 raw media/diagnostic side-channel 迁入各自 typed notification owner,再物理删除 wrapper method。

9.39a S1c canonical submit/read admission 与 Claw Gate B skeleton

主目标:让 Renderer submit、RuntimeCore user input projection 与 Claw current fixture 共享 canonical threadId/turnId/clientUserMessageId 语义;不恢复 Electron admission 猜测、agentSession v0 Turn wire、session/thread fallback 或 caller-owned identity。
架构影响:非重大;只贯彻既有 Electron Desktop Host -> App Server JSON-RPC -> RuntimeCore -> Thread/Turn/Item -> GUI 主链与 Codex v2 userMessage.clientId 语义,不新增协议 method、runtime owner、Electron 业务后端、compat 或生产 mock fallback。
架构图更新章节:不适用;owner 与依赖方向不变。
责任开发者确认:root,2026-07-19
当前:Renderer submit op 显式携带 threadId,缺失时 fail closed;v2 additionalContext 使用 typed {value, kind},theme context search 使用 typed context。Claw fixture 从 thread/start response 读取 canonical sessionId + thread.id,turn/start、thread/read(includeTurns=true)、thread/resume 与 evidence export 显式消费 threadId;read model 从 thread.turns[].items 读取,不再把 sessionId 冒充 threadId。
admission:App Server v2 turn/start 由 RuntimeCore actor admission 后立即返回 canonical Turn,Electron Host 只做 generic JSON-RPC 转发,不消费 notification 或 thread/read 来伪造 response。turn/start.clientUserMessageId 继续投影为 userMessage.clientId;canonical Item id 与 clientId 保持两个 identity 域,不做前缀猜测。RuntimeCore 首个 message.created 从 Turn runtime metadata 投影 clientId,Thread projector 再输出 v2 userMessage.clientId。
守卫:Claw event/read probe 显式携带 clientUserMessageId,只订阅 thread/started、turn/started、turn/completed、item/started、item/completed、item/agentMessage/delta;fixture parser、等待器和断言均为 direct-v2-only。旧 agentSession/event 正向订阅、wrapper parser 与三处 deferred 成功放行已删除,fixture 中再次出现 wrapper lifecycle 会由 source guard 阻止。
验证:Renderer/Node typecheck 通过;Electron fallback 删除前 appServerHost 30/30、删除后 current suite 22/22 与 Electron tsc 通过;RuntimeCore clientId lifecycle 1/1;Claw fixture direct-v2 guard 63/63;npm run test:contracts 通过(292 checks);node --check、scoped rustfmt 与 diff check 通过。重建无 fallback Electron Host 后复跑 complete Gate B,ok=true、52/52 assertions、console/invoke error 0、app_server_handle_json_lines hit 45;动态 probe turn_f71537d4c074457eb4f63a3d2f224abf 观察 10 条同 turn direct event,包含 text delta、Item started/completed 与 turn.completed,thread/read 的 WebFetch Item completed/output/turnId 全部对齐。证据:.lime/qc/gui-evidence/claw-chat-current-fixture/claw-chat-current-fixture-direct-v2-no-host-fallback-summary.json。
分类:threadId submit/read、userMessage.clientId、direct v2 lifecycle 与 turn/started admission 为 current;sessionId-as-threadId、caller-owned Turn identity、item.id/clientId 混用、Claw agentSession/event 正向消费和 deferred bypass 为 dead/deleted;未新增生产 compat。
OPEN_REF:session loop 的旧 response variant 引用已经由 9.40 删除,App Server v2 notification producer/subscriber、Claw strict complete 与 home-hotpath Gate B 已闭环。home-hotpath 通过同 run 增量 collector 保留真实 handle IPC trace,重建无 Electron fallback Host 后 regression 为 ok=true、68/68 assertions、IPC hit 51 且包含 turn/start;未把 drain 当成 handle 证据放宽。firstTextDelta/firstTextPaint/clientLocalOutput 已进入 current Renderer evidence;diagnostics trace 仍无 rows,providerWait 与 server emission timestamp 继续显式 deferred,不伪造证据。剩余 agentSession/update 与明确 raw side-channel 应按独立 owner 继续迁出,不能回流 lifecycle wrapper。

9.40 Session typed dispatcher 与 step rollover

主目标:继续把 session submission loop 收敛成单 actor、单 operation queue 与单 step state;本刀先补齐调度骨架和状态语义,不越过 App Server 领域 owner 直接实现 thread/config/MCP/shell 副作用。
架构影响:重大;通用 response operation 已删除,五类 response 和七类仍演进的非用户 task 进入同一 dispatcher,context rollover 由下一次 sampling snapshot 原子消费。
架构图更新章节:internal/aiprompts/architecture.md 第 6.2 节 Agent Runtime 组。
责任开发者确认:root,2026-07-19
本轮写集:agent-runtime session_loop root、actor、handle、input_queue、tests 与新增 step DTO 模块;internal/aiprompts/architecture.md;本执行计划。未触碰 internal/refactor/v1、App Server v2 notification 热区、Electron 或 Renderer。
typed task:Review、Compact、ThreadSettings、SetMemoryMode、RefreshMcp、ReloadConfig、RunShell 各自拥有 operation variant;actor 统一提交到现有 FIFO/Busy/interrupt/shutdown lifecycle,handle admission 校验 operation 与 task kind 一致,拒绝空 turn identity 和错误 kind。当前只完成 dispatcher contract,App Server 对应领域副作用尚未逐项迁入。
typed response:通用 Respond variant 与公开 respond handle 已物理删除;Approval、UserInput、Permission、DynamicTool、MCP elicitation response 分别路由到独立 waiter kind,并继续校验 active turn generation、request identity、重复/迟到 response。新增覆盖证明五类 waiter 不串线。
step state:request_context_rollover 只设置 pending;capture_step_context 原子消费 pending、context epoch +1、清除 pending;后续 snapshot 不重复推进。显式 advance_context_epoch 同样清除 pending,step index 与 token usage 保持 turn scoped 单调。
结构退出:session_loop.rs 345 行、actor.rs 681 行、handle.rs 503 行、input_queue.rs 783 行、step.rs 17 行;所有生产模块保持 800 行以内。未新增 compat、deprecated wrapper、生产 mock 或第二调度 owner。
验证:agent-runtime 全量 146/146;cargo check -p agent-runtime -p lime-agent -p app-server;scoped rustfmt、git diff check、docs boundary;governance legacy report 0/0/0;新增 typed task、typed response、rollover 定向测试均通过。App Server check 首次命中共享工作树 processor/v2_notifications.rs 的并行 match 中间态,本轮未改该热区;owner 收口后已基于最终工作树重跑通过。
分类:typed task/response operation、step rollover、step DTO 与 Compact 生产消费为 current;通用 Respond operation/handle、active-turn 预扫描、独立 steer 旁路与已退役历史截断 operation 为 dead/deleted;六类未接线 operation 仍为 current skeleton。
OPEN_REF:下一刀需要在 App Server 既有 owner 内逐项接入 Review、thread setting、memory mode、MCP refresh、config reload 与 shell。action-required live waiter、terminal-result mailbox activity、actor-first admission 与 event-driven wait 已由后续切片关闭;整体仍因六类生产入口缺失而不标记完成或 release-ready。

9.41 v2 turn/start immediate admission skeleton

主目标:把 v2 turn/start 从“等待 backend completion”改成 Codex 式“session actor admission 后立即返回”,并让后台 completion 继续沿 RuntimeCore state/event-log/ProjectionStore -> RuntimeEventHub -> 单一 v2 projector 投影;不新增 Electron 业务后端,不伪造 response,不恢复旧 admission compat。
架构影响:重大;改变 App Server 请求完成边界与 RuntimeCore 到 transport 的事件 ownership。
架构图更新章节:internal/aiprompts/architecture.md 第 13 节。
责任开发者确认:root,2026-07-19。
当前:新增 RuntimeCore::start_turn_admitted,仅 v2 processor 使用;session actor submission 与 completion driver 已拆开,owned AppendingRuntimeEventSink 在后台继续写入 state、event log、trace 和 ProjectionStore;RuntimeEventHub 由 App Server 单 pump 消费,使用单实例 V2NotificationProjector fan-out direct v2 notifications。RequestProcessor 已删除 turn/start admission oneshot、streaming callback 特判与旧 native admission guard;turn/start 不再被 transport streaming 特判拦截。
删除:`is_turn_admission_notification`、`run_until_released` 及其只服务旧请求边界的正向测试;strict sidecar Gate B 后继续物理删除 Electron `requestStreamingTurnStart`、250ms ACK grace、thread/read identity retry、recent turn inference、伪造 accepted response 和 8 组正向 fallback tests。bounded recent notification replay 保持 current;client contract `absentSnippets` 已锁住 8 个 fallback 符号,禁止回流。
验证:Rust `cargo check -p app-server`、定向 rustfmt、`git diff --check` 已通过;Electron Host 删除后 22/22、Electron tsc、contracts 292 checks 与 scoped diff/format 通过。App Server lib test 的历史并行 `local_data_source/**` blocker 已由最终工作树 check 和 strict Gate B supersede。
未完成:admitted 后的 managed-objective auto-continuation 尚未迁入后台 owned task;这是明确 blocker,不能标记完整迁移或 release-ready。blocking-backend public JSON-RPC integration 仍应补 response-before-completion 的 owner 级回归,不能靠 Electron fallback 测试替代。
分类:RuntimeCore admission、session actor submission、RuntimeEventHub、App Server projector 与 Electron generic JSON-RPC forwarding 为 current;旧 admission inference/streaming fallback 为 dead/deleted;未新增 compat 或 deprecated wrapper。
下一刀:补 blocking-backend App Server JSON-RPC integration,迁移 managed-objective auto-continuation,再运行 current fixture 与风险匹配的 Gate B;不得恢复 Electron ACK/read inference。

9.42 Terminal result typed activity

主目标:让 child terminal result 的 durable mailbox append 与普通 inter-agent append 一样唤醒已经存在的 recipient actor;durable mailbox 保持唯一 payload 事实源。
架构影响:重大;normal event append、EventLog durable replay 与 restart terminal repair 三条结果落库路径统一返回 typed activity,并提交到同一个 session registry;不新增队列、fallback 或第二 mailbox owner。
架构图更新章节:internal/aiprompts/architecture.md 第 6.2 节 Agent Runtime 组。
责任开发者确认:root,2026-07-19
实现:ProjectionStore terminal append 在 canonical Turn 与 result mailbox 成功持久化后返回 recipient session identity + typed inter-agent input;RuntimeCoreEventAppender、live AppendingRuntimeEventSink、durable replay 与 restart repair 统一发布。registry 只通知已经存在的 parent actor;通知失败只告警,不能回滚 durable record或创建空 actor。
验证:新增 existing parent actor 真实唤醒回归 1/1;agent terminal activity 16/16;agent mailbox delivery 10/10;cargo check -p agent-runtime -p lime-agent -p app-server;scoped rustfmt、diff check、docs boundary。全量 agent-runtime 146/146 已在 9.40 同一最终代码链通过。默认 HOME 的 GUI smoke 按预期因真实用户数据库存在活动 WAL 而 fail closed,未触碰该数据库;隔离 HOME 且保留 RUSTUP_HOME/CARGO_HOME 后完整 GUI smoke 通过,summary 为 `.lime/qc/project-gates/standalone-shell-01-20260719063639-32679/shell-01-electron-smoke/summary.json`。
分类:terminal result durable append、typed activity 与三路径 publisher 为 current;只落库不唤醒 active parent 的行为为 dead/deleted;未新增 compat 或 deprecated wrapper。
OPEN_REF:wait_agent 的 activity/generation 边界仍含轮询,需继续收敛;本节只完成 terminal result wakeup,不把完整 session loop 标记完成。

9.43 v2 admitted turn 的 managed-objective owned continuation

主目标:补齐 9.41 immediate admission 后的 managed-objective 自动续跑,使终态后的下一轮仍由 RuntimeCore 唯一 owner 提交,并沿同一 RuntimeEventHub 投影;不恢复 Electron admission 推断或新增 compat。
架构影响:重大边界内的增量;只补后台 completion driver 到 objective owner 的连接,不新增 runtime、队列或持久化事实源。
本轮写集:`lime-rs/crates/app-server/src/runtime/turn_execution.rs`、`runtime/objectives.rs`、`runtime/tests/objectives.rs`、`runtime/thread_item_projection/materializer/lowering.rs`、`materializer/lifecycle.rs`、`typed_tests.rs`,以及 Coding Workbench current fixture/guard。
当前:后台 completion 成功后调度 owned continuation worker;worker 以 hub callback 发布续跑 turn/item 事件,复用既有 objective guard、budget 与 audit,不捕获请求期 borrowed callback。同步 `start_turn` 继续使用同一 objective owner,但通过 no-op callback 保持原返回语义。Coding Workbench fixture 已删除 caller-owned session/thread/turn identity、`agentSession/update`、v0 `runtimeOptions` 与 sessionId read,改为读取 `thread/start` canonical identity、typed `turn/start`、`thread/read(includeTurns=true)`;代码/文档 `artifact.snapshot` 在 canonical history 中 lower 为 completed `FileChange`,不恢复胖 detail。
验证:`cargo check -p app-server`、artifact snapshot lowering 1/1、admitted objective hub 1/1、objective 9/9、immediate admission/request serialization 15/15、Coding Workbench guard 6/6、真实 Electron direct-session fixture ok=true、scoped rustfmt、`git diff --check`、contracts 与 governance legacy report 通过。测试曾短暂命中共享工作树 `agent-runtime/src/action_required.rs` 与 session input activity 的并行编译中间态;对应 owner 收口后已基于最终工作树重跑通过,本轮未覆盖这些文件。
分类:owned continuation、RuntimeEventHub publication 与 explicit v2 fixture route 为 current;缺 route 的默认模型/旧 session fallback 为 dead/deleted;未新增 compat 或 deprecated wrapper。
OPEN_REF:Coding Workbench `gui-coding-input` recovery 的 canonical input、第二个 completed Turn/FileChange/CommandExecution 与真实 Outputs/Logs 产品面证据已由 9.47 关闭;Outputs/Logs 仍是 current GUI,不得以“已退场”为由删除。blocking-backend public JSON-RPC response-before-completion integration 已由 9.46 关闭。

9.44 v2 diagnostics trace metadata admission skeleton

主目标:让 v2 turn/start 携带的 application metadata 进入既有 RuntimeRequest trace owner,使 RuntimeCore event store 能附加真实 provider/server trace;不在 Renderer 伪造 providerWait 或 server timestamp。
架构影响:非重大;不新增 method、trace store、provider event 或第二 metadata owner,只补齐 v2 AdditionalContextEntry 到现有 RuntimeRequest.metadata 的 admission lowering。
本轮写集:lime-rs/crates/app-server/src/processor/turn.rs;未触碰正在并行迁移的 protocol/schema/generated client、request_trace、Renderer event projection 与 internal/refactor/v1。
当前:lower_runtime_options 仅从 additionalContext.metadata 的 application entry 解析 JSON object,只提升 agentUiPerformanceTrace/agent_ui_performance_trace 对象,同时保留完整 additionalContext。untrusted entry、非法 JSON 与非对象 trace 不生成 trace context。runtime/trace 与 trace_store 已有的 provider elapsed_ms、checkpoint 和 server_event_emitted_at 继续作为唯一事实源。
验证:精确 rustfmt 与 git diff check 通过;application trace lowering 1/1、untrusted trace fail-closed 1/1。Renderer direct-v2/projection/thread/stream/sync 定向 101/101、client contract 292 checks、legacy report 0/0/0 已在同一 current 工作树通过。
分类:v2 application trace metadata lowering、runtime trace/event store 与 provider elapsed facts为 current;v0 runtimeOptions.metadata 专属 admission 与 Renderer 本地伪造时间为 dead/forbidden;未新增 compat/deprecated wrapper。
验证闭环:source-built sidecar 重建后,真实 Electron home-hotpath `.lime/qc/gui-evidence/claw-chat-current-fixture/claw-chat-current-fixture-home-hotpath-v2-trace-timing-final-summary.json` 为 `ok=true`、72/72 assertions;`diagnostics/trace/list` 返回 `traceCount=1`、8 个事件,包含 `provider.first_text_delta.received` 与 `app_server.message_delta.emitted`。压缩 evidence 保留 `elapsedMs`、`serverEventEmittedAt`,顶层 `providerWaitMs=90`、`serverEventEmittedAt=1784448387417`,均来自真实 trace metrics;summary-only export/support bundle、W3C carrier、legacy/mock/page error=0。补充 `claw-chat-current-fixture-agent-ui-trace.test.mjs` 正/负向 2/2,fixture guard 与既有相关验证通过。本 skeleton 的 instrumentation OPEN_REF 已关闭;后续按 V1-15 继续补 restart/resume/compaction/model-switch/approval/MCP/child-agent/cold-read 等产品面,不把本证据扩大解释为整体 Codex parity。

9.45 Session actor activity subscription and wait wakeup

主目标:把 AgentControl wait 从固定间隔扫描收敛到既有 session actor 的 typed activity receiver,并让 late subscriber 能读取 active steer、mailbox 与 queued admission 的 pending snapshot;不创建冷 actor,不新增 queue 或旁路 owner。
架构影响:重大边界内的增量;session loop 增加只读 activity subscription command,App Server wait 仅消费该 receiver,child terminal/mailbox durable payload 仍由既有 loader/read owner 提供。
本轮写集:agent-runtime `session_loop/{actor,handle,input_queue,activity_tests}.rs` 与模块声明;App Server `runtime/agent_control_gateway/wait.rs`;架构 6.2。本轮避让 `internal/refactor/v1/**`、App Server `turn_execution.rs` 与并行 action fixture。
实现:RuntimeSessionRegistry 只向已存在 actor 提供 activity receiver;actor 先订阅 watch,再计算 active context/queued snapshot,避免 admission 与 subscription 竞态丢通知。UserInput queued admission 发布 Steer activity;wait 同时处理 Steer、Mailbox、deadline、取消和低频 child-terminal recovery,移除 25ms fixed polling。
验证:`cargo test --manifest-path lime-rs/Cargo.toml -p agent-runtime --lib` 149/149;session activity 定向 2/2;App Server `wait_gateway_returns_interrupted_when_the_turn_is_cancelled` 1/1、`wait_agent_wakes_for_new_runtimecore_queued_steer` 1/1;rustfmt、git diff check、禁止字样扫描通过。
分类:session actor activity subscription、queued admission activity、event-driven AgentControl wait 为 current;旧 wait 25ms state polling 为 dead/deleted;未新增 compat、deprecated wrapper 或 mock。
关闭项:App Server `try_steer_active_turn` 旁路已物理删除;actor-first 两阶段 admission 只向已有 actor 尝试 steer,未接受时再进入 canonical new-turn/queue 校验。`respond_action_without_pending_descriptor_fails_closed` 已改用内存数据库并锁定真实 descriptor fail-closed,不再读取用户数据库/WAL。

9.46 v2 turn/start public transport immediate admission contract

主目标:用公开 JSONL transport 证明 v2 turn/start 在 backend completion 前返回 canonical inProgress Turn,并由后续 direct turn/completed 表达终态;不以 processor 单测或 Electron fallback 替代传输层证据。
架构影响:非重大;只补 current transport contract 回归,不修改 method、runtime owner、notification ownership 或生产路径。
本轮写集:lime-rs/crates/app-server/tests/turn_start_transport_jsonrpc.rs;未触碰 internal/refactor/v1、Electron Host、protocol/generated client 或 Renderer 热区。
实现:测试直接运行 run_json_lines + duplex transport,完成 initialize -> initialized -> thread/start -> turn/start。blocking backend 发出 turn.started 后等待 release;release 前 500ms 内必须收到同 request id、status=inProgress 且带 canonical turn.id 的响应。release 后必须收到同 threadId/turnId、status=completed 的原生 turn/completed notification。响应与 turn/started notification 允许自然交错,不增加错误顺序约束。
验证:cargo test -p app-server --test turn_start_transport_jsonrpc -- --nocapture --test-threads=1,1/1 通过;scoped rustfmt 与 git diff check 通过。此前同一最终工作树的 request serialization/immediate admission 15/15、objectives 9/9、cargo check -p app-server、contracts 292 checks 与 real Electron Coding Workbench direct-session Gate B 均通过。
分类:public JSONL immediate admission 与 direct v2 completion 为 current;completion-gated response 语义和 Electron admission inference 为 dead/deleted;未新增 compat、deprecated wrapper 或 mock production path。
OPEN_REF:lib.rs 中仍有两条旧 external backend transport 测试按“events before response / completion after response”组织,需由该热区 owner 改写到 v2 identity 与 immediate-response 语义,不能继续作为 current contract。

9.47 Coding Workbench canonical detail reader skeleton

主目标:让 App Server Codex v2 ThreadItem 的 commandExecution/fileChange 项贯通 Renderer session hydrate 与 Coding Workbench,恢复 changes、Outputs、Logs 和 recovery 主链;不新增 compat、第二 read model 或 mock production fallback。
架构影响:非重大;只修 current v2 Thread/Turn/Item 到既有 AgentThreadItem projection 的类型映射,不改变 Electron/App Server method、RuntimeCore、ThreadStore 或 GUI owner。Rust AgentSession snake_case detail 仅服务内部 read model/load context,不是 Renderer v2 reader 输入。
本轮写集:src/lib/api/agentRuntime/appServerCanonicalItemReader.ts、对应 focused test、Coding Workbench current fixture 与本执行计划;未触碰 internal/refactor/v1、protocol/generated client 或隔壁 9.45 session actor 热区。
实现:canonical reader 只识别 Codex v2 顶层 camelCase tagged union,保留 wire 中既有的嵌套 snake_case 例外;已删除 command_execution/file_artifact/tool_call 等内部 detail 半兼容,并补负向回流守卫。reader 骨架保留 user clientId、reasoning content、command process/source/actions、结构化 file changes 与 subagent agentPath。fixture backend 不再从 harness metadata 决定 recovery PASS,改由 canonical recovery prompt + 首轮失败事实触发第二个 completed Turn;recovery success 只接受最新 completed Turn 的 completed FileChange、completed CommandExecution、exitCode=0 与 PASS output。
验证:此前 canonical reader/thread projection 19/19;fixture guard 6/6、Node syntax、Prettier 与 diff check;真实 Electron gui-coding-input Gate B 通过,session=sess_8aae0d187b294fdfa7e9ff68b80ce17b。首次恢复后 Changes 显示 src/coding-target.ts 和已编辑 2 个文件,Outputs 显示 npm test -- coding-target、exit=1 与 FAIL,Logs 显示文件/命令/测试;继续修复后第二回合显示 PASS coding-target.test.ts: codingWorkbenchSmoke is true,三面板 expectedTextsPresent 均为 true。本轮 v2-only reader 收口后的重跑结果见后续验证记录。
分类:Codex v2 ThreadItem reader、Coding Workbench changes/Outputs/Logs/recovery 为 current;snake AgentSession detail 仅是 Rust 内部 current read model,不进入 Renderer;Renderer snake alias、metadata 自证 recovery、JSON 字符串扫描 fallback 与 backend 直接发对外 Item DTO 为 dead/deleted;未新增 compat 或 deprecated wrapper。
REVALIDATION:v2-only reader 收口后 canonical reader/thread projection 19/19、fixture guard 6/6、v2 notification 6/6、ESLint、Prettier、diff check 与 governance legacy report 均通过;direct-session Gate B 通过,session=sess_31bee73941df473f9a7b4180d636aa92。gui-coding-input 基于最终工作树连续两次稳定失败,backend ledger 仍发 message.delta/item lifecycle/message.completed/turn.completed,但 Renderer 首个可见 runtime event 为 item_started 或 item_completed,未收到 text_delta,随后正确报“模型未输出最终答复”;证据为 code-artifact-workbench-v2-only-reader-summary.json 与 code-artifact-workbench-v2-only-reader-final-summary.json。该阻塞发生在 reader 之前,属于当前 App Server direct v2 live notification/route identity 热区;本轮不夹写并行持有的 Rust processor/runtime owner,也不以恢复 side-channel compat 掩盖。
OPEN_REF:本节只完成快速 reader skeleton 与 direct-session 真实闭环;gui-coding-input recovery 因上述 direct v2 live notification blocker 不得标记完成。完整 MCP/collab、WebSearch structured result、nested multimodal parts 与第二套 raw reader 收敛也继续落在现有 canonical reader/projection owner。

9.48 Session operation production owner audit

主目标:在继续扩展 session dispatcher 前逐项确认 App Server 生产 owner,禁止用同名不同义方法或空 handler 伪造接线完成;本刀同时补齐 inline operation 的 canonical handler context。
架构影响:重大边界内的增量;operation handler 现在沿同一 actor queue 接收 sessionId、submissionId、activeTurnId、clientUserMessageId 与 W3C trace,不新增协议、队列、runtime、compat 或生产 mock。
本轮写集:agent-runtime session_loop root、actor、tests;internal/aiprompts/architecture.md;本执行计划。只读 App Server protocol/processor/runtime owner 与上游 Rust 参考实现;未触碰 internal/refactor/v1、protocol/schema/generated client、Electron 或 Renderer 热区。
已接线:Compact 由 agentSession/compact -> RuntimeCore::compact_agent_session_with_trigger -> RuntimeSessionOperation::Compact -> canonical context compaction/event/read model 形成真实生产链,分类为 current。
未接线分类:Review 是代码审查 task,不能委托现有 memory/export review;ThreadSettings 与 SetMemoryMode 尚无同语义 App Server method 和持久化事务;RefreshMcp 是活动 session 的配置/工具快照刷新,不能委托 MCP 管理面 sync;ReloadConfig 尚无 active session config reload owner;RunShell 是用户触发的一次性 Turn/Item 流,不等于 ProjectShell 会话管理。六项 dispatcher contract 保持 current skeleton,但不能计 production-complete;它们不是 compat/deprecated,也不允许用无副作用 handler 放行。上游已把历史截断协议标记为即将移除,本仓库又没有生产 method、消费者或兼容数据,因此对应 dispatcher variant、孤立 projection 与正向测试均按 `dead / deleted / forbidden-to-restore` 清除。
actor-first admission:RuntimeSessionRegistry::get_existing 是唯一 steer 探测入口;actor 接受后必须反查 canonical active Turn,缺失时 fail closed;未接受才进入 new-turn/queue 状态检查。旧 RuntimeCore active-turn 预扫描和 try_steer_active_turn 旁路为 dead/deleted。
验证:agent-runtime 修改后全量 149/149;App Server session operation 2/2、重复 active turn 1/1、无 active steer 1/1、existing actor mailbox activity 1/1、typed action descriptor fail-closed 1/1、wait activity 2/2;三 crate `cargo check` 通过;legacy report 0/0/0。`npm run test:contracts` 的 protocol generation 无漂移,但被相邻 App Server data/plugin 热区缺少 `resolve_plugin_runtime_dir(&state)` 与 `list_plugin_installed_state().map_err(data_error)` 阻塞,本轮未夹写该 owner。`smoke:agent-runtime-current-fixture` 的历史/缓存 31/31、流式收尾 32/32、fixture guards 76/76、renderer/Host/App Server 重建均通过;真实 Electron home-hotpath 的 Turn 完成且显示 canonical assistant 文本,但 fixture 期待的两段新闻正文未出现,最终 `ok=false`,证据为 `.lime/qc/gui-evidence/claw-chat-current-fixture/claw-chat-current-fixture-home-hotpath-regression-summary.json`。该失败归类为 external fixture output/expectation drift,不作为本轮 session actor 通过证据,也未修改生产路径规避。
退出条件:每项 operation 只有在 typed App Server method、领域副作用、持久化/投影、成功与 fail-closed 测试、真实 consumer 同一切片闭环后才能从 skeleton 升为 production-complete;协议热区未释放前不夹写。下一刀优先 ThreadSettings,先锁定活动 session 更新、后续 Turn 继承、持久化重放和通知投影的原子边界。
分类:session actor、operation envelope、handler context、actor-first admission 与 Compact 生产链为 current;旧 steer 旁路和历史截断 operation/projection 为 dead/deleted;六项未接线 operation 为 current skeleton,未新增 compat 或 deprecated surface。

9.49 Session control 退役清理与 owner 矩阵

主目标:继续收紧 session submission loop 的生产边界;删除已明确退役且没有本仓库消费者的历史截断操作,同时把六项仍演进的 control operation 锁定到真实入口、领域副作用和退出条件。
架构影响:重大边界内的减法;session actor、App Server JSON-RPC、RuntimeCore 与 projection 仍是唯一主链,没有新增协议版本、队列、runtime、compat 或 mock fallback。
本轮写集:agent-runtime session loop root/actor/tests;agent-runtime-projection 的历史截断源码、正向测试、barrel、settings/review projection 命名与负向守卫;架构 6.2;本执行计划。避让 internal/refactor/v1、并行 v2 protocol/processor/runtime、plugin/data 与 projection coding 热区。
退役清理:历史截断协议已被参考实现标记为即将移除,本仓库又没有 JSON-RPC method、RuntimeCore 副作用、持久化事务或 GUI consumer。对应 RuntimeSessionOperation variant、actor dispatch、孤立 projection、barrel export 与正向测试已物理删除;package-local guard 只保留旧文件名作禁止回流断言。
命名收口:thread settings 与 review projection 的四个公开 helper 已改为无品牌领域命名,没有保留旧导出 alias 或 compat wrapper;对应源码与定向测试中的品牌字样为零。
owner 矩阵:Review 对应 review/start,必须创建 review Turn 并投影 entered/exited review Item;ThreadSettings 对应 thread/settings/update + thread/settings/updated,ack 只表示排队,active Turn 不变,后续 Turn 继承更新,permissions 与 sandboxPolicy 组合必须 fail closed;SetMemoryMode 对应 thread/memoryMode/set,只更新 thread metadata 并持久化,不启动模型;RefreshMcp 由 MCP/config 变更驱动,为每个已加载 session 构建最新 snapshot 后进入 actor,不新增 Renderer 公共方法;ReloadConfig 同样由 config owner 驱动,只更新活动 session 的 config-derived state;RunShell 对应 thread/shellCommand,必须形成一次性 Turn/Item 流并与 ProjectShell 会话管理严格分离。
验证:agent-runtime 149/149;agent-runtime-projection 288/288;退役 guard 1/1;scoped rustfmt、git diff check 与 settings/review projection 禁止品牌字样扫描通过;governance legacy report 为 0 个零引用候选、0 个分类漂移候选、0 个边界违规。
分类:session actor、Compact、六项 owner contract 与无品牌 settings/review projection 为 current;历史截断 operation/projection 为 dead/deleted/forbidden-to-restore;未新增 compat 或 deprecated surface。
OPEN_REF:六项 operation 尚未 production-complete。下一刀必须在 v2 protocol/processor/runtime 热区释放后,以 ThreadSettings 的 method、actor dispatch、持久化、notification、typed client consumer、成功和 fail-closed 回归为同一垂直切片;不能只补任一单侧。

9.49 Canonical delta identity and single live notification owner

主目标:关闭 Coding Workbench gui-coding-input 的 direct v2 live delta blocker,并把 Renderer 生命周期投递收敛为单一 drain owner;不恢复 agentSession/event lifecycle side-channel,不增加 raw/canonical 双轨。
架构影响:非重大;Rust 只修正现有 v2 notification projector 的 ItemId 边界,Renderer 只删除 request result 与 mirrored drain 的重复投递,并在首个 direct event 到达时锁定 route turnId。
本轮写集:lime-rs/crates/app-server/src/processor/v2_notifications.rs、tests/turn_start_transport_jsonrpc.rs、src/lib/api/agentRuntime/threadClient.ts、appServerEventStreamRouting.ts、对应 focused tests 与本执行计划;未触碰 internal/refactor/v1、protocol/schema/generated client 或相邻 session/thread runtime owner。
根因:RuntimeCore durable enrichment 会把 external payload 的 raw itemId(例如 assistant-1)规范为 canonical ThreadItem.id(item_assistant-1)并附回 message.delta.payload.item;旧 projector 直接比较 raw 与 canonical 字符串,误判 identity drift 后拒绝 message.delta,因此 ledger 有 durable delta,但 wire 没有 item/agentMessage/delta。现 projector 先通过 agent_protocol::ItemId::new 规范 outer identity,真实漂移仍 fail closed,并始终向 wire 发布 projected canonical id。
单一投递:AppServerConnection 已把 request 捕获的 notifications 按 FIFO 镜像给 drain。turn/start 注册 drain route 后不再二次发布 result.notifications/error.notifications;无 drain route 的测试/非 Electron caller 仍消费 request result。wildcard route 首次收到 turnId 后立即绑定,避免同 thread 后续 turn 串流。
验证:projector delta 正/负向 3/3;public JSONL external backend transport 2/2,证明 release 前 turn/start 返回 inProgress,release 后 raw assistant-1 依次生成 item/started(item_assistant-1) -> item/agentMessage/delta(item_assistant-1) -> command item lifecycle -> turn/completed;Renderer route/thread client 36/36;source-built app-server 与 Electron renderer 重建通过;真实 gui-coding-input Gate B ok=true,session=sess_219949bd6a5e47749d3677399465ed08,26/26 assertions,首轮 Changes/Outputs/Logs、recovery、第二回合 PASS、canonical identity、console/page/invoke error=0。证据:.lime/qc/gui-evidence/code-artifact-workbench-electron-fixture/code-artifact-workbench-canonical-delta-single-owner-summary.json。
治理:npm run governance:legacy-report 通过,零引用候选=0、分类漂移=0、边界违规=0;Renderer TypeScript、ESLint、Prettier、rustfmt 与 git diff --check 通过。追加扩大到 app-server lib test filter 时,被相邻未收口的 runtime/tests/pending_work_recovery.rs 缺 AgentControlSpawnRequest/SpawnAgentForkMode import 和 runtime/session_operations.rs 调用 private persist_session_metadata 阻塞;本轮未夹写这些 owner,已通过的 projector 3/3、public transport 2/2 与 Gate B 不受影响。
分类:canonical ItemId normalization、direct v2 notification、EventBus/drain single owner 与 turn-scoped route 为 current;raw/canonical 字符串直比、request result + drain 双投递、agentSession/event lifecycle fallback 为 dead/deleted/forbidden-to-restore;未新增 compat 或 deprecated wrapper。
关闭项:9.47 gui-coding-input OPEN_REF 已关闭。后续仍需把 appServerCanonicalThreadProjection.ts 的第二套 raw reader 收敛到 readCanonicalThreadItem,并补 MCP/collab、WebSearch structured result 与 nested multimodal parts;这些不影响本 Gate B 完成,但整体 Codex parity 仍未完成。

9.50 Canonical ThreadItem 单 reader 骨架

主目标:继续对齐 Codex v2 Thread/Turn/Item 主链,把 thread/read 历史恢复与 direct v2 notification 收敛到同一个 canonical Item reader;不保留 raw reader 双轨、unknown extension fallback 或兼容包装。
架构影响:非重大;未改变 App Server method、wire schema、Electron bridge 或 GUI owner,只收紧 Renderer typed projection 内部的 owner 与 fail-closed 语义。
本轮写集:src/lib/api/agentRuntime/appServerCanonicalItemReader.ts、appServerCanonicalThreadProjection.ts、appServerEventTimelineReaders.ts、agentProtocolCoreTypes.ts/agentProtocol.d.ts、appServerReadModelClient.test.ts、对应 focused tests 与本执行计划;未触碰 internal/refactor/v1、Rust pending-work/session owner、App Server protocol/schema/generated client 或 Electron 热区。
单一 owner:canonicalThreadItems 对每个 Codex ThreadItem 只合成 durable read event envelope,再无条件委托 readCanonicalThreadItem。原 isCustomCanonicalItem 分流、projectCodexThreadItem 重复 tagged-union switch、unknown-to-extension、ordinal/tool-name/空字段宽松 fallback 已删除。
生命周期与字段:history 只按 Codex direct v2 的 item.started/item.completed 合成状态;command/file 只接受 inProgress/completed/failed/declined,MCP/dynamic/collab 只接受 inProgress/completed/failed,已删除 running/pending/in_progress/interrupted/cancelled 与模糊 event suffix fallback。raw history 只读 id 和 Unix 秒字段,threadId/turnId/itemId/*Ms alias、缺失 Thread.status -> unknown 和 MCP structured_content alias 已删除。未知或畸形 ThreadItem 使整个 thread/read fail closed,不再静默返回残缺历史。
工具与搜索骨架:MCP 保留 appContext/pluginId/result.content/result._meta/structuredContent,明确忽略 deprecated mcpAppResourceUri;collab 保留 sender/receivers/prompt/model/reasoningEffort/agentsStates;WebSearch 保留 opaque results 与完整 action_data,同时提供 action type 供现有 GUI 摘要消费。三类工具共用 canonical_type metadata,不新增平行 GUI reader。
多模态骨架:UserInput text/image/localImage/skill/mention 逐 part 严格解析,任一未知或畸形 part 整项 fail closed;textElements、image detail、data URL base64、remote/local source 与未知 MIME=image/* 被保留,skill/mention 保持 typed part,不再压成提示词文本。canonical reader 不读取本地文件、不访问网络、不做 provider capability/lowering;这些继续归 model-provider,并参考 OpenCode 的 typed part -> provider lowering 边界。
验证:canonical reader、thread/read typed gateway、direct v2 notification 与 event stream 聚合 8 files / 73 tests 全通过;Prettier、focused ESLint、git diff --check 与 governance legacy report 通过,治理结果为零引用候选 0、分类漂移 0、边界违规 0。Renderer TypeScript 完整运行后失败,但报错全部位于并行 thread/settings/updated 与 AgentRuntimeClient 新接口未同步:eventVerifier.ts、runtimeClient.ts、sessionGateway.ts;本轮未夹写该 owner,本写集无 TypeScript 报错。
分类:readCanonicalThreadItem、durable event envelope、strict tagged union、typed UserInput parts、MCP/collab/WebSearch passthrough 为 current;第二套 raw reader、unknown extension fallback、history 静默丢项、模糊 status/字段 alias 与 skill/mention 文本化为 dead/deleted/forbidden-to-restore;未新增 compat 或 deprecated surface。
OPEN_REF:下一刀转向 model-provider 的多模型 multimodal capability/lowering 与这些结构化 Item 在 GUI projection 的真实消费;并行 thread/settings owner 需先收口其 TypeScript 接口漂移。整体 Codex parity 仍未完成。

9.51 Session metadata control durable closure

主目标:继续把 session submission loop 收敛为单 actor、单 operation queue 和单 durable truth;本刀关闭 ThreadSettings 与 SetMemoryMode 两项生产缺口,不新增 compat、第二 runtime、第二 metadata writer 或生产 mock。
架构影响:重大;session metadata 的 durable owner 从 SQLite/RuntimeCore 双写补齐为 rollout first、SQLite projection second、memory state last,空库重建不再丢 settings 或 memory mode。
本轮写集:App Server v2 thread control protocol/processor/runtime、session actor operation、canonical rollout metadata record、projection session settings、typed client 与定向测试;internal/aiprompts/architecture.md 第 6.2.1 节;本执行计划。未触碰 internal/refactor/v1、Electron、Renderer 或相邻 archive/unarchive owner。
生产链:thread/settings/update 与 thread/memoryMode/set 通过 typed v2 method、serialization scope、processor、RuntimeCore 和 RuntimeSessionOperation::{ThreadSettings, SetMemoryMode} 进入同一 session actor。actor 内读取最新 session、合并 partial update、持久化后才替换 RuntimeCore state;operation 不创建 Turn/Item,不打断 active Turn,后续 Turn 继承 model/cwd/approval/sandbox/effort/serviceTier/collaborationMode/personality。memory disabled 时后续 Turn 跳过 memory prompt 注入。
协议语义:serviceTier 使用双层 Option 区分省略、显式 null 与具体值;空 update、空 identity、未知 thread、非法 memory mode、permissions + sandboxPolicy 组合均 fail closed。permission profile resolver 尚不存在,单独 permissions 同样明确拒绝,不伪造生效。
durable truth:RolloutRecord::ThreadMetadata 保存 identity、updated_at_ms、previous/content digest 与完整 metadata,可与 history record 交错。scan 按顺序校验 identity、摘要链和时间单调性,把最新 metadata 应用到 rebuild initial Thread。ProjectionStore 在 IMMEDIATE transaction 内读取 expected canonical Thread,先 append/verify rollout,再同事务更新 canonical_threads 与 projected_sessions,commit 后 RuntimeCore 才更新内存状态。
故障原子性:rollout append 成功、SQLite commit 失败后,同 metadata 重试复用已落盘时间戳并补齐 DB;不同 metadata 不能覆盖未投影 record。启用 AgentRoot 时缺 rollout_path 直接拒绝。摘要被篡改时空库 rebuild fail closed。
验证:thread_control_jsonrpc 5/5;rollout metadata 故障注入 3/3;完整 rollout 过滤组 29/29;typed client 71/71 与 typecheck 通过;scoped rustfmt、git diff --check 和本写集禁用字样扫描通过。既有 session_control.rs dead-field warning 不属于本写集。
结构退出:canonical_rollout.rs 当前 879 行,未越过 1000 行硬门禁;在增加下一种 rollout record 或继续扩展 scan 逻辑前,必须把 record parsing/digest chain 拆入职责单一子模块,避免继续堆叠。
完成状态:ThreadSettings 与 SetMemoryMode 从 current skeleton 提升为 current / production-complete。Review、RefreshMcp、ReloadConfig、RunShell 仍是 current skeleton;下一刀优先 Review 与 RunShell 的真实 Turn/Item 垂直切片,不允许空 handler 或同名不同义委托。
分类:typed methods、session actor operations、metadata digest chain、SQLite projection、RuntimeCore state 和 typed client 均为 current;未新增 compat/deprecated;没有恢复 dead surface。
架构影响:重大变更,第 5 项(session/thread metadata 持久化、ProjectionStore 与历史恢复事实源)。
架构图已更新:internal/aiprompts/architecture.md 第 6.2.1 节。
责任开发者确认:root,2026-07-19
确认内容:已核对目录归属、数据流、依赖方向、协议边界和验证门禁。

9.52 Typed runtime user input ordered skeleton

主目标:继续对齐 Codex `Vec<UserInput>` 主链,先建立 runtime/current 的有序 typed input 骨架;不把 textElements、skill、mention 压成文本,不把图片拆到第二个并行集合。
架构影响:非重大;不改变 crate owner 或依赖方向,只替换 agent-runtime 内部 reply input contract 并新增 agent-protocol 领域类型。App Server JSON-RPC、Thread/Turn/Item owner 和 provider 网络边界不变。
本轮写集:agent-protocol input/lib;agent-runtime reply input/message、session/provider adapter 及定向测试;agent current provider adapter/skill input builder;App Server provider_history 的单一 legacy-to-current lowering;本执行计划。未触碰 internal/refactor/v1、v2 processor/common/schema/generated client、App Server turn execution、model-provider current_client/lowering 或 Electron/Renderer 热区。
领域骨架:agent-protocol::input 定义 Text{text,text_elements}、Image{uri,detail}、LocalImage{path,detail}、Skill{name,path}、Mention{name,path},并强类型化 ByteRange、TextElement 和 ImageDetail::{Auto,Low,High,Original}。UTF-8 byte range 必须落在 char boundary 内,媒体与结构化引用的 identity 为空时 fail closed。
runtime contract:RuntimeReplyInput 已从 `text + images` 双集合直接替换为单一有序 `parts`;textElements、image detail、skill 和 mention 保留到 runtime/provider adapter 边界。provider adapter 只 lowering text/image 且保持相对顺序,skill/mention 不被伪造成 provider 文本;它们必须由后续 runtime/core injection owner 消费。
旧路减法:RuntimeReplyInput.text、RuntimeReplyInput.images 和所有 workspace consumer 已删除,没有增加 inputParts、metadata 逃生字段、compat wrapper 或双读。现存 v0 AgentInput 只能在 App Server 单一 lowering 边界按其已丢失的 text-first/image-second 语义转换,不成为 current 扩展点。
验证:agent-protocol typed input 3/3 通过;agent-runtime 全量 153/153 通过,包含 ordered provider adapter 测试;lime-agent 的图片 capability 回归 1/1 通过。三 crate cargo check 已证明本写集依赖可编译,但 App Server 组合检查被并行新增 runtime/session_shell.rs 的 ExecutionBackend 缺 cancel_turn/respond_action 阻塞;另一并行变体仍读取 private RuntimeSessionTaskContext.turn_id。本轮不夹写这些 owner。
分类:agent-protocol typed AgentInput、RuntimeReplyInput ordered parts、UTF-8 range validation 和 provider-order lowering 为 current skeleton;RuntimeReplyInput 旧 text/images 字段为 dead/deleted/forbidden-to-restore;未新增 compat 或 deprecated wrapper。
OPEN_REF:v2 `UserInput -> agent_protocol::AgentInput -> RuntimeReplyInput` 尚未接线,当前 turn.rs 仍拒绝 textElements/skill/mention 并丢失 part 顺序;LocalImage 尚未由 App Server media owner 读取、校验并 sidecar 化;image detail 尚未进入 CurrentProviderContent 及 OpenAI/Anthropic/Gemini/xAI 各自 wire lowering。下一刀必须在对应热区 owner 释放后完成这三个垂直接线,不能恢复平坦 AgentInput 或增加 metadata 旁路。

9.53 User shell submission durable closure

主目标:继续收紧 session submission loop 的底层保障;关闭 RunShell 从 typed JSON-RPC、session actor、真实本地进程、canonical Command Item、durable read model 到 direct v2 notification 的垂直切片,不增加兼容层、第二 shell runtime 或生产 mock fallback。
架构影响:重大;RunShell 从 current skeleton 提升为 current / backend-production-complete。架构 6.2.1 已补 active/idle 调度、取消绑定、进程与 durable Item 顺序。
本轮写集:agent-runtime session_loop facade/actor/tests;App Server v2 shell protocol/processor/client、RuntimeCore session_shell、command canonical metadata、v2 notification/projector 与定向测试;schema/TypeScript 生成物;架构 6.2.1 与本执行计划。internal/refactor/v1 全程避让。
actor 语义:active 时 auxiliary 绑定当前 Turn identity,并共享 active task cancellation token;idle 时 actor 启动 RunShell task、持有 busy/cancel/completion 生命周期,不排队、不游离。operation/task kind 与非空 canonical Turn identity均在 handle 边界 fail closed。
执行与事件:显式用户命令使用平台 shell argv 和 ExecutionProcessServer 的 never + danger-full-access 请求;进程 start 成功后立即 durable append/publish command.started,poll 只消费同一 process identity,终态统一写 command.exited。idle 模式额外拥有一次性 Turn accepted/started/terminal;active 模式不创建第二 Turn。内部没有新增 completed/failed/canceled command event family。
canonical projection:command started/exited 继续复用现有 command materializer和重建 owner;nested metadata 进入 canonical Item,保留 commandExecutionSource=userShell、processId、durationMs。v2 边界把两类 current command event 映射为 item/started 与 item/completed,thread read/restart read 保留 cwd、聚合输出、exitCode、processId、duration 与 UserShell source。
协议与命名:thread/shellCommand 已进入 v2 method/envelope/schema/catalog/serialization/processor、Rust typed client 和 TypeScript request client。新 v2 source/schema 的历史品牌字样已清零;TurnError 的新字段使用 errorInfo,不保留旧字段 alias。
fail closed:空 command、未知 Thread、archived Thread、无本地 execution environment、session/thread identity 漂移和 actor receipt 异常均拒绝。真实简单命令已证明 ExecutionProcess policy 可在显式 user shell 参数下执行,不回退 mock。
验证:agent-runtime session_loop 36/36;RuntimeCore shell 三条行为回归全部通过(active、idle durable/restart、validation);thread_shell_jsonrpc 1/1;v2 notification 9/9;thread projection 5/5;protocol v2 17/17;Rust client facade 1/1;四 crate cargo check 通过;schema/TypeScript generation 无漂移;npm run test:contracts 全通过;governance legacy report 为零引用候选 0、分类漂移 0、边界违规 0;scoped rustfmt、git diff check 和新 v2 source/schema 禁用字样扫描通过。
并行避让:测试编译曾被未跟踪 current route 文件的一处 and_then 类型错误阻断,本轮只做一行机械 Some(options) 适配;后续扩大 projection 测试时又遇到隔壁 provider credential_ref 参数迁移未完成,因此使用刚生成且包含当前 projection 的 App Server test binary完成 5/5,不改 provider 热区。
分类:RunShell operation、ExecutionProcessServer、canonical Command Item、direct v2 item notification、typed clients 与 schema 为 current;旧 runtime queue 和第二 command terminal family 为 dead / forbidden-to-restore;未新增 compat 或 deprecated surface。
OPEN_REF:底层闭环已完成,但 Renderer 尚无显式用户 shell 入口,不计为 GUI production-complete。下一刀应先接唯一 GUI consumer 并补 Electron Gate B,再建立 canonical Review Item family 与 inline Review task;不得用普通聊天 Turn 或空 handler 冒充 Review。
架构影响:重大变更,第 4、5 项(session operation 调度、Thread/Turn/Item 投影与 durable read)。
架构图已更新:internal/aiprompts/architecture.md 第 6.2.1 节。
责任开发者确认:root,2026-07-19
确认内容:已核对目录归属、数据流、依赖方向、协议边界和验证门禁。

9.54 Typed image detail provider lowering

主目标:继续对齐 Codex typed UserInput 多模态主链,关闭 image detail 从 ordered runtime input 到 provider wire 的尾段;不使用字符串 metadata 作为 current contract,不为 Anthropic 伪造协议字段。
架构影响:非重大;provider 网络边界仍归 model-provider,canonical request 仍归 runtime-core,ImageDetail 唯一类型来源仍为 agent-protocol。
本轮写集:runtime-core canonical media contract;model-provider current content/canonical/OpenAI lowering 与 capture tests;agent-runtime、lime-agent、App Server history 和 lime-server 的既有图片构造点;本执行计划。未触碰 internal/refactor/v1、v2 processor/common/schema/generated client、App Server turn execution、Electron 或 Renderer;保留并验证了 model-provider 同文件内隔壁 circuit-breaker/endpoint 改动。
上游语义:参考 Codex protocol ContentItem::InputImage 和 Vec<UserInput> lowering,保留 ImageDetail::{Auto,Low,High,Original}。RuntimeReplyInputImage.detail 经 CurrentProviderContent::Image 进入 ContentPart::Media.detail;canonical 构造器同时提供无 detail 和显式 detail 两条强类型入口,inline bytes 仍禁止进入 canonical reference。
provider wire:OpenAI Chat Completions 写 image_url.detail,Responses 写 input_image.detail;无 detail 时不发字段。Anthropic Messages 继续只发其原生 image source 与 base64 media_type,不把 detail 塞入 content/source。provider_data 继续只在 request payload map 中解析,不进入 canonical serialization。
旧路减法:没有新增 provider-specific detail 枚举、metadata key、inputParts 逃生字段或 compat wrapper。lime-server 的非 Agent 图片入口显式使用 detail=None,避免无意声明支持尚未接入的调用方参数。
验证:runtime-core canonical 6/6;model-provider lowering 3/3;current client/capture 35/35,包含 High Chat wire、Original Responses wire、Low canonical roundtrip 和同文件 circuit-breaker 回归;agent-runtime ordered adapter 1/1;lime-agent image capability 1/1;lime-server cargo check 通过;scoped rustfmt 与 git diff --check 通过。App Server persisted history 定向测试被并行 processor/thread.rs 的 Option<ThreadStatus> 三处未同步阻塞,本轮未夹写;全量 cargo fmt --check 仅被并行 agent-runtime/session_loop/handle.rs 的一处 import 换行阻塞,本写集 scoped rustfmt 通过。
分类:agent-protocol ImageDetail、canonical Media.detail、CurrentProviderContent::Image.detail 和 OpenAI native wire lowering 为 current;字符串 metadata 仅残留在 v0 AgentAttachment -> current 的单一旧边界,属于待 v2 ingress 替换的 deprecated lowering;无 provider detail 的旧尾段为 dead/deleted/forbidden-to-restore;未新增 compat surface。
OPEN_REF:v2 UserInput 仍在 processor/turn.rs 压成旧 AgentInput,textElements/skill/mention 仍被拒绝且 LocalImage 仍未由 App Server media owner 读取。下一刀必须建立内部 RuntimeTurnStartParams + ordered RuntimeReplyInput current truth,并让 v2 逐项构造;v0 只允许在方法边界一次性转换,不能给旧 AgentInput 增加可选 typed 字段。typed v2 输入全链当前约完成 30%,不可标记完成。

9.55 Typed input builder and LocalImage media resolver skeleton

主目标:为 v2 UserInput current ingress 准备唯一的逐项 builder 与 App Server media resolver,避免后续 processor 再实现一套 text/image/skill/mention switch;LocalImage 不得以本地路径进入 provider。
架构影响:非重大;ordered input owner 仍为 agent-protocol/agent-runtime,文件读取与 sidecar 仍归 App Server input_media,provider 网络 lowering 不变。
本轮写集:agent-protocol input;agent-runtime reply_input;App Server runtime/input_media;本执行计划。未触碰 internal/refactor/v1、未跟踪的 app-server-protocol v2 目录、processor/turn.rs、turn execution、schema/generated client、Electron 或 Renderer。
builder contract:RuntimeReplyInput::try_from_user_parts 逐项调用 AgentInput::validate,空列表、非法 UTF-8 byte range 和空 identity fail closed;text/textElements、skill、mention 保持原顺序。媒体只以 RuntimeReplyInputMedia::{Image,LocalImage} 交给调用方 resolver,runtime 不读文件、不猜 MIME、不接触 sidecar。media owner 错误原样返回,不回退路径 URI。
wire 细节:TextElement 内层字段按 Codex 序列化为 byteRange;AgentInput 外层仍保持 current snake_case tag/text_elements,v2 外层 camelCase variant 与字段类型由对应 protocol owner接线,不在本刀夹写未跟踪目录。
media resolver:resolve_runtime_input_media 对 http/https 保留 remote URL并从后缀识别 MIME,未知后缀使用 image/*;data URL 解码、限制 32 MiB、校验声明 MIME 与 PNG/JPEG/GIF/WebP 魔数一致后写 sidecar;LocalImage 先校验 regular file/文件长度,再读取、识别格式、写 sidecar并生成 provider data URL。返回值只含 sidecar/remote URI、MIME、provider payload 与 typed detail,不暴露本地路径。既有 v0 persist_inline_input_media 继续维持原行为,等待 current ingress 替换后删除,不在本刀扩大旧链测试语义。
验证:agent-protocol input 3/3;agent-runtime reply_input 5/5;agent-runtime 全量 156/156;App Server input_media 5/5,并在并行 canonical_thread_store lifetime 修复后复跑通过;canonical Renderer reader 19/19;scoped rustfmt、Prettier、ESLint 与 git diff --check 通过。App Server 非测试 cargo check 曾被并行 canonical_thread_store.rs 的 statement lifetime 错误阻塞;本轮定向 App Server test binary 已完整编译。modality contracts 通过;本刀后治理扫描文件 2378、零引用候选 0、分类漂移 0、边界违规 0。
并行避让:app-server-protocol/src/protocol/v2/** 与 schema tree 当前整体为未跟踪 owner,processor/turn.rs 和 canonical_thread_store.rs 仍由隔壁进程修改;本轮只读审计。协议 owner下一步需把 UserInput.text_elements/detail 改为 agent_protocol::{TextElement,ImageDetail},并同步 processor 的机械 metadata serialization。Renderer canonical reader 已改为只读 text_elements,并对 textElements alias fail closed,不再迁就错误字段。
分类:typed builder、RuntimeReplyInputMedia 和 App Server resolver 为 current skeleton;v0 AgentInput/AgentAttachment -> persist_inline_input_media -> metadata detail 为 deprecated,只有迁出职责;本地路径直发 provider、第二套 media switch 与字符串 detail current contract 为 dead/forbidden-to-restore;未新增 compat。
OPEN_REF:resolver 尚无生产调用,真正 current ingress 仍需内部 RuntimeTurnStartParams + ordered RuntimeReplyInput 替换 StoredSession.turn_inputs/ExecutionRequest.input,并由 v2 processor 调用 try_from_user_parts(resolve_runtime_input_media)。接线后删除 lower_user_input/image_attachment 和旧 provider_history flat lowering。typed v2 输入全链当前约完成 40%,不可标记完成。

9.56 User shell GUI consumer current closure

主目标:关闭 9.53 的唯一 GUI consumer 缺口,把显式用户 shell 输入接入 Renderer typed gateway、App Server JSON-RPC、RuntimeCore、canonical Command Item 和既有 GUI timeline;不增加 Electron 业务命令、裸 bridge、第二 shell runtime 或生产 mock fallback。
架构影响:非重大;沿用既有 Desktop Host -> App Server -> RuntimeCore -> Thread/Turn/Item -> GUI 链,只补 Renderer consumer 与本地化错误呈现。架构 6.2.1 已记录输入 owner、identity、event route 和 ack/terminal 边界。
本轮写集:Renderer Agent Chat send/shell controller、runtime adapter、thread client;typed AppServerClient method mirror;canonical command item TypeScript fields;五语言 agent message copy;focused tests、架构与本执行计划。未触碰 internal/refactor/v1、Rust runtime/protocol/schema/generated client、Electron main/preload 或并行 Workspace 拆分 owner。
输入语义:输入首字符 ! 才进入显式 shell 分支;首字符后的内容 trim 后为空时只显示本地化提示,不创建 session、不发 JSON-RPC、不进入模型。skipUserMessage 明确绕过分流,普通文本与 slash command 保持原路径。
typed transport:controller 先 ensureSession,再从 session ref 读取 canonical threadId;缺失时只允许通过 current read model 刷新一次并重新解析,仍缺失则 fail closed。runtime adapter 只委托 thread client;thread client 规范化 identity/command/eventName,通过 AppServerClient.runThreadShellCommand 调用 thread/shellCommand,并在请求前注册同一 thread 的 drain route。页面和输入组件不接触 Electron、ExecutionProcess 或裸 request。
生命周期:ack 只表示 operation accepted,不在 Renderer 合成 completed。controller 在请求前订阅 agentSession event route;UserShell command item started/completed 或 Turn terminal 到达时读取 current session detail,completed 后释放临时 listener。请求后的首次 detail refresh 用于消除 started event 与 React render 之间的竞态;长命令继续由 current notification/read-model owner推进。
错误与文案:请求错误被消费并进入 toast error,不回退普通模型发送。空命令提示与错误前缀已覆盖 zh-CN、zh-TW、en-US、ja-JP、ko-KR;业务层不硬编码 locale 分支。
验证:新增 shell 分流/controller/runtime adapter/thread gateway/AppServer typed method 与既有同 owner 回归已收敛;本轮补齐 submit 成功结果和 RPC 失败携带的 direct v2 notification 投递,避免只注册 drain route 时丢失首字、失败前文本和终态,thread client/router 定向 40/40、App Server client 71/71、runtime client 21/21、node typecheck、Prettier、diff check 与治理 0/0/0 通过。schema/TypeScript generation 无漂移。Renderer terminal snapshot blocker 已在 `agentStreamRuntimeLifecycleEvents` 收口:生命周期快照属于同一 active item 且只是累计 delta 前缀时保留更长正文;生命周期单测 5/5、并发详情回归 1/1、`npm run smoke:claw-chat-current-fixture` Gate B 56/56、`npm run verify:gui-smoke` 通过,真实 IPC 59 次、mock/旧命令命中均为 0,最终正文包含“全球市场继续关注能源”和“国际组织呼吁”。shell opt-in fixture 已真实命中 `thread/shellCommand`,但当前 source-built sidecar 的异步 shell 事件未进入 thread/read Command Item;该证据保留为 blocker,不把 accepted ack 冒充 terminal。
分类:! 输入 consumer、shell controller、typed AppServerClient method、runtime adapter、drain route、canonical Item refresh 与五语言错误呈现为 current;裸 bridge、Electron shell command、ack 合成 terminal、空命令请求与模型 fallback 为 dead/forbidden-to-restore;未新增 compat 或 deprecated surface。
OPEN_REF:Renderer/typed gateway/route 及新闻主链 Gate B 已关闭;shell 仍未标 GUI production-complete。显式 `LIME_ENABLE_USER_SHELL_GATE=1` 的 test-only probe 已证明真实 Electron IPC 命中 `thread/shellCommand`,但 sidecar accepted 后没有稳定产出 `command.started`/`command.exited` 对应的 canonical Command Item、输出和 exit code,`thread/read` 随后可能超时。下一刀必须回到 `agent-runtime session submission loop -> RuntimeCore shell event append/publish -> App Server v2 notification/read model projection`,用同一 thread/turn identity 补 terminal evidence;不得在 Renderer 合成 completed、回退旧命令或增加 mock。并行 protocol v2 ingress 的未跟踪 goal match 收口后,需重建最终 sidecar,再复跑该 opt-in Gate B。shell 收口后主链转向 canonical Review Item family 和 inline Review task。

9.57 Structured Skill provider-context skeleton

主目标:继续 typed v2 input 主链,先关闭 RuntimeReplyInput 已携带 Skill 后仍被 provider adapter 静默丢弃的骨架缺口;严格复制 Codex 的控制输入语义,不把 Skill/Mention 拼进普通用户文本。
架构影响:非重大;Skill snapshot、路径选择和 SKILL.md 完整正文读取归 lime-skills,lime-agent 只负责把已解析 instructions 投影为独立 user context,model-provider 不读取本地文件。
本轮写集:lime-skills agent_selection/agent_body/lib public surface;lime-agent current_provider_turn;Renderer runtime warning presentation、五语言 agentRuntime 资源及定向测试;本执行计划。未触碰 internal/refactor/v1、App Server protocol/processor/runtime、schema/generated client 或 Electron,并保留 current_provider_turn 内隔壁 pending-input/session-loop 接线。
Codex 语义:真实用户 text/image 先形成一个 ordered user message;显式 Skill 按 canonical path 去重后追加 <skill><name>...<path>...完整 SKILL.md</skill> user context。Skill-only 输入不生成空 user message。current snapshot 缺失、disabled、路径漂移和正文读取失败只 warning + skip,不终止 turn。结构化 Mention 仍是 connector/plugin/skill control input;当前 resolver 未接通前过滤并告警,原始 name/path 不下发 provider。
owner 收敛:结构化选择复用 current AgentSkillSnapshot 的 enabled exact-path selection;正文复用 agent_body 的 instructions reader,且不会提前读取 SKILL.md 引用的 references。旧全局 skill_loader registry 未承接新语义,lime-agent 不再手写 find/canonicalize/read 链。provider 目前仍仅在输入含显式 Skill 时按 working directory 临时构建 snapshot;这只是骨架,不能成为第二个目录事实源。没有新增 compat wrapper、metadata 旁路或普通文本 fallback。
验证:本轮 `lime-skills --lib` 全量定向测试 68/68(使用独立 `/tmp/lime-structured-skill-target`,避免共享 target artifact race);`agent_selection/agent_body/lib` 与 `lime-agent/current_provider_turn` scoped rustfmt --check、scoped git diff --check 通过。首次 lime-skills 定向测试唯一失败为 macOS `/var` 与 canonical `/private/var` 路径断言,已改为 canonical path 比较后 68/68 通过;`lime-agent structured_skill` 曾在同一独立 target 启动,但首次 workspace 编译耗时过长且无源码错误,已主动停止,未清共享 target、未终止隔壁进程。Renderer warning presentation 定向测试 7/7、ESLint、Prettier 与 i18n coverage 100%(5 locales)通过。
分类:selected Skill loader、ordered user/context projection 与五语言 warning presentation 为 current skeleton;旧 App Server selected-skill system-prompt injection 为 deprecated,仅允许在 typed turn owner 接通后删除;旧 provider-side silent drop 为 dead/deleted/forbidden-to-restore;Mention 原始文本 lowering 为 dead/forbidden-to-restore;未新增 compat。
OPEN_REF:v2 processor 仍拒绝 Skill/Mention,ExecutionRequest/StoredSession 仍压成旧 AgentInput,因此本骨架尚无 public JSON-RPC 生产消费链。当前 provider snapshot 只覆盖 working directory/default roots;必须由 turn owner 传递包含显式 project root 与 plugin skill roots 的同一 snapshot,并删除旧 App Server selected-skill system-prompt injection,以 canonical path 完成唯一一次注入。Codex 对照已确认 durable/queue/history 保留 ordered `Vec<UserInput>`,LocalImage 只在 provider request 构造时解析;Lime 对应事实源固定为 durable `Vec<agent_protocol::AgentInput>` + transient `RuntimeReplyInput`,不为含 provider_data/base64 的 transient 类型补 serde。热区释放后先建立该 durable wire 与 RuntimeTurnStartParams,再以 RuntimeReplyInput 替换 transient ExecutionRequest.input;随后迁移 provider history、read model、session title/media refs 和内部 mailbox/queue/fork/retry 调用,最后由 v2 processor 只做一次 typed conversion 并删除 lower_user_input/image_attachment。RuntimeBackend/tool-runtime 仍需接通 app://、plugin://、skill:// Mention control resolver。typed v2 输入全链仍约 40%,不可标记完成。

9.58 Unified Skill snapshot and provider Mention lowering

主目标:继续对齐 Codex structured UserInput,把 Skill snapshot 收敛到 App Server turn owner,并让 provider adapter 消费同一份 snapshot;删除旧 system-prompt selected Skill 正文注入,不保留双 owner。
架构影响:非重大;App Server 仍负责 workspace/project/plugin roots 与 turn context,lime-skills 仍负责 snapshot/path selection,lime-agent 只负责 provider user-context lowering,model-provider 不读取本地文件。
本轮写集:lime-skills agent_selection/lib;App Server agent_skills_context、session_config 与 session_skill_context tests;lime-agent current_provider_turn tests;本执行计划。未触碰 internal/refactor/v1、protocol/schema/generated client、Electron 或 Renderer。
事实源:App Server `agent_skills_context_for_turn` 一次构建包含 working directory、explicit project root、plugin package roots 的 `AgentSkillSnapshot`,同时渲染 available catalog 并序列化到 `TurnContextOverride.metadata[skill_snapshot]`。provider 不再按 working directory 扫描第二份 snapshot。
provider 语义:用户 text/image 先形成 ordered user message;结构化 Skill 与 `skill://`/`SKILL.md` Mention 按 exact canonical path 读取并追加独立 `<skill>` user context;plain `$name`/linked path 作为显式 fallback;按 canonical path 去重。`app://`、`plugin://`、`mcp://` Mention 只保留 control surface,不把原始 mention 文本发给模型;未知 Mention warning,读取失败 warning + skip。
旧路减法:`append_selected_agent_skill_bodies` 及所有生产 selected body system-prompt 注入已删除;system prompt 只保留 available catalog、plugin guidance 和 expert refs。旧 body selection/evaluation 仅保留给 App Server runtime telemetry owner,不能再作为 provider 消息事实源。
验证:`cargo check -p app-server --tests` 通过;lime-agent Skill/Mention 定向 2+17+1 tests 通过;App Server agent_skills_context 14/14、session_skill_context 7/7 通过;`npm run test:contracts` 全部通过;`npm run governance:legacy-report` 零引用候选 0、分类漂移 0、边界违规 0;scoped rustfmt 与 `git diff --check` 通过。共享工作树已有 canonical thread/session control dead-code warnings,不属于本写集。
结构退出:`current_provider_turn.rs` 与 `agent_skills_context.rs` 已超过 1000 行,本轮只完成 owner 收敛;在下一次增加 provider input lowering 或 Skill selection 规则前,必须分别拆出 structured input context、snapshot transport 与 App Server catalog rendering 子模块,避免继续堆叠业务逻辑。
分类:AgentSkillSnapshot metadata、exact structured selection、provider `<skill>` context 和 control-only Mention lowering 为 current skeleton;旧 system-prompt selected Skill body 为 dead/deleted/forbidden-to-restore;v0 flat ingress 与旧 AgentAttachment lowering 仍是 deprecated,等待 v2 processor 接线后删除;未新增 compat。
OPEN_REF:v2 processor 仍未把 public UserInput 接入 ordered RuntimeReplyInput,LocalImage resolver、Skill/Mention 仍没有 public JSON-RPC 生产消费链。下一刀回到 `RuntimeTurnStartParams -> RuntimeReplyInput` ingress,把 snapshot metadata 与真实 v2 turn 接通,再删除 v0 flat lowering;不要恢复 provider-side directory scan 或 system prompt body 注入。

9.59 Provider input module split and v2 ingress audit

主目标:在不夹写相邻 protocol/processor owner 的前提下,完成 provider 输入 lowering 的职责拆分,并用当前工作树证据复核 v2 public ingress 已经接通。
本轮写集:lime-agent current_provider_turn、current_provider_turn/structured_input.rs、current_provider_turn/input_tests.rs;本执行计划。避让 internal/refactor/v1、app-server-protocol v2、processor/turn.rs 和 schema 未跟踪 owner。
结构收敛:provider orchestration 从 1396 行降至 977 行;user message、Skill snapshot 解析、Skill/Mention selection、图片 capability guard 与 7 项输入回归迁入独立模块/测试文件。行为保持不变,structured Skill、skill:// Mention、control-only app/plugin/mcp Mention、$name fallback、canonical 去重和 text-only image guard 均继续由 current owner 承担。
v2 ingress 证据:相邻 owner 已提供 `protocol::v2::UserInput::into_core`,`turn/start` 与 `turn/steer` 通过 `lower_user_input` 保持 ordered `AgentInput`;processor lowering 5/5、app-server-protocol v2 13/13 通过。v2 不再拒绝 Skill/Mention/LocalImage,也不把结构化输入压成普通文本。
验证:lime-agent `current_provider_turn::` 21/21;processor turn 5/5;app-server-protocol v2 13/13;scoped rustfmt、`git diff --check` 通过。`current_provider_turn.rs` 已低于 1000 行;App Server `agent_skills_context.rs` 仍约 1020 行,下一次新增 Skill catalog 逻辑前必须继续拆出 rendering/selection 子模块。
分类:provider structured input module、v2 UserInput -> AgentInput lowering 为 current;provider 内旧目录扫描和 system-prompt Skill body 为 dead/deleted/forbidden-to-restore;v0 AgentSession flat input、旧 event payload fallback 为 deprecated,仅允许在历史读取/一次迁移边界;未新增 compat。
OPEN_REF:仍需清理 v0 JSON-RPC 入口及旧 event fallback 的退出条件,并把 `app://`/`plugin://` Mention 从 control-only 过滤推进到真实 tool/plugin surface;这应在相邻 processor 热区释放后完成,不恢复第二套 ingress。

9.60 Structured Mention control transport skeleton

主目标:先建立 Codex-style 结构化 Mention 的内部控制传输,不等待相邻 v2 protocol/processor 热区释放,也不把未校验的 app/plugin/mcp 标识伪装成 provider 用户文本或已启用工具。
本轮写集:runtime_backend/request_context.rs、request_context/session_config.rs、tests/session_prompt_context.rs;本执行计划。继续避让 internal/refactor/v1、app-server-protocol v2/schema、processor/dispatch/v2_ingress.rs、processor/turn.rs、runtime/turn_start.rs 和 Rust app-server-client 热区。
当前骨架:从 ordered RuntimeReplyInput 中只收集 app://、plugin://、mcp:// Mention,保持输入顺序并按 kind/path 去重,写入 TurnContextOverride.metadata[input_mentions]。provider user message 与 system prompt 均不包含原始 Mention URI;skill:// 与 SKILL.md Mention 继续由 Skills owner 处理,不进入此 control list。
Fail-closed:未经过 registry 校验的 control Mention 不自动扩大 compact/full tool surface、不 seed deferred tools、不合成 plugin activation。Codex app Mention 当前只要求 validated connector selection/Explicit telemetry;plugin Mention 后续必须精确匹配 installed && !disabled plugin,并复用 manifest.runtimeCapabilities,未知、禁用或 capability pluginId 漂移都必须拒绝。
v0 审计:RuntimeCore durable turn_inputs、TurnStartRequest 与 transient RuntimeReplyInput 已是 typed current;`automation_execution`、`runtime/gateway_runner`、mailbox TriggerTurn 与 objectives 调度均已直接构造 typed `TurnStartRequest`。剩余生产 flat surface 只保留 `turn_start.rs` 的 `AgentSessionTurnStartParams -> legacy_user_input` v0 边界转换;Rust app-server-client 错误旧 API、v0 schema roots 和旧 event/read fallback 仍待成组删除。旧 fallback 删除必须覆盖 turn_input_events、provider_history、read_model/messages、session_title、projection_store 及其 flat JSON fixtures;AgentAttachment 仍由 ConversationImport 使用,不能随 turn input 一起删除。
验证:scoped rustfmt 与 git diff --check 通过;`lime-agent current_provider_turn::` 21/21 通过,automation/gateway 的 typed request 迁移已通过静态边界检查。App Server 定向测试已启动,但最终工作树被相邻 v2 ClientRequest 新增 ThreadGoalSet/ThreadGoalGet/ThreadGoalClear、processor/dispatch/v2_ingress.rs 尚未覆盖的 E0004 编译错误阻断;本轮未夹写该热区,不能把测试标记为通过。9.59 的 `npm run test:contracts` 与 governance legacy report 仍基于骨架修改前的最终树;本轮追加的 governance legacy report 仍为零引用候选、零分类漂移、零边界违规。
分类:typed Mention input、input_mentions turn control metadata、provider text filtering 为 current skeleton;validated plugin/app resolver 尚未完成;v0 flat adapter与旧 event fallback 为 deprecated;AgentSessionTurnStartParams public schema和无消费者 Rust client start_turn API 为 dead/delete-pending;未新增 compat。
OPEN_REF:下一刀新增 runtime_backend/mention_selection.rs,并在 handle_turn_start_with_provider_history 的 route ready 后、session_config_from_request 前通过 AppDataSource::list_plugin_installed 校验 plugin Mention;只把匹配 installed、enabled 且 runtimeCapabilities.pluginId 一致的 capability 投影给现有 plugin_runtime_context。app Mention 在 connector registry owner 完整前只允许 validated selection/telemetry,禁止猜工具名。processor 热区释放后,再成组删除 v0 flat schema/client/adapter/fallback。

9.61 Current turn/start naming cleanup

主目标:快速删除 package current 文档与测试中已失真的 lime.agent / agentSession/turn/start 正向命名,统一到 v2 turn/start;不夹写相邻 Rust protocol/runtime/client 与 Renderer typed API 热区。
本轮写集:packages/agent-capability-catalog/README.md、packages/agent-workbench-adapter/README.md、packages/agent-workbench-adapter/tests/adapter.test.mjs;本执行计划。避让 internal/refactor/v1、v2 protocol/schema/processor、objectives、历史 fallback、App Server Rust/TS client 和所有已脏 typed API 文件。
旧路减法:capability catalog 的非 owner 声明改为“不启动 turn/start”;workbench adapter 只声明构造 turn/start payload;测试名称删除 lime.agent 品牌化旧入口。上述 package 范围已无 lime.agent 或 agentSession/turn/start 正向文本。
验证:npm --prefix packages/agent-workbench-adapter test,13/13 通过;scoped rg 与 git diff --check 通过。
分类:turn/start payload naming 为 current;lime.agent / agentSession/turn/start package 正向文档和测试命名为 dead/deleted/forbidden-to-restore;protocol v2 对旧 method 的负向拒绝测试继续保留;未新增 compat。
OPEN_REF:下一阶段回到细致处理,不再扩大文档清扫。objectives 调度已迁到 typed `TurnStartRequest`,生产 flat 构造只剩 `turn_start.rs` 的 v0 conversion。优先等待共享 owner 释放后成组删除 AgentSessionTurnStartParams schema/client/adapter、legacy_user_input 和旧事件 fallback,并完成 validated plugin/app Mention resolver 与 App Server/Gate B 验证。

9.62 Validated Mention selection and flat producer cutover

主目标:完成快速清理后的第一轮细化,把 control-only Mention 推进到 installed registry 校验,并先迁掉阻塞旧 reader 删除的 mailbox/conversation import flat input producer;继续避让 v2 protocol/schema/processor 与 Rust client 热区。
本轮写集:runtime_backend/mention_selection.rs、runtime_backend.rs 的单点接线;runtime/agent_mailbox_delivery.rs、runtime/conversation_import/commit.rs、runtime/conversation_import/codex/canonical_items.rs、turn_input_events.rs、provider_history.rs、read_model/messages.rs、session_title.rs、projection_store.rs 及对应 typed fixture;本执行计划。未触碰 internal/refactor/v1、protocol/v2、schema/v2、processor/dispatch/v2_ingress.rs、processor/turn.rs 或 app-server-client。
Mention resolver:只从 ordered RuntimeReplyInput 收集 app:// 与 plugin://;有请求时才读取 AppDataSource::list_plugin_installed。plugin Mention 必须唯一匹配 installed state、disabled=false、runtimeCapabilities schemaVersion=plugin-runtime-capabilities/v0.1 且 pluginId 与 appId 精确一致;app Mention 只允许唯一匹配已声明 provider=connector:* 的 tool key。registry 缺失/失败、disabled 缺失、重复、未知、能力漂移均 fail closed,不扩大工具面、不 seed deferred tools。通过校验的 plugin 只复用现有 plugin runtime guidance;app selection 只写内部 turn metadata,不猜 live tool 名。原始 Mention URI 不进入 provider/system prompt。
flat producer cutover:mailbox message.created 复用 turn_input_events typed Vec<agent_protocol::AgentInput> payload;conversation import 在准备阶段一次把 AgentAttachment 转为 Text/Image/LocalImage typed input,同时把同一 Vec 写入 durable turn_inputs 与 imported user rollout。canonical lowering 优先保留该 typed input,历史 source 没有 typed input 时只回退顶层文本。AgentAttachment 继续归 import preview/media 使用,不整体删除。
reader cleanup:turn_input_events、provider_history、read_model/messages、session_title、projection_store 已删除对 app_server_protocol::AgentInput 的 flat object/attachments 双读;projection/read-model/import 正向 fixture 已改为 typed input array。projection_rebuild 等旁路仍需要的 generic content/text recovery 和顶层 attachments 投影继续保留,它们不反序列化旧 AgentInput 对象。
验证:上述 Rust 文件 scoped rustfmt --check、cargo fmt --all -- --check、git diff --check 和 typed/flat 静态边界扫描通过;最终工作树 governance legacy report 通过,零引用候选、分类漂移和边界违规均未报告。mention_selection 独立 target 冷编译约 20 分钟、默认 target 再编译约 8 分钟后仍未完成 app-server test binary,均已停止避免与共享编译争抢资源,因此本轮不把 Cargo 定向测试标为通过。
分类:validated Mention selection、typed mailbox/import producer与 typed reader 为 current;旧 app/plugin 原始 Mention provider lowering、五个 flat AgentInput object reader fallback为 dead/deleted/forbidden-to-restore;v0 AgentSession adapter与 Rust client 错误 start_turn API为 deprecated/delete-pending;未新增 compat。
OPEN_REF:下一刀批量迁 61 个 test-only AgentSessionTurnStartParams 调用,删除 turn_start.rs adapter、legacy_user_input 和 turn_execution 泛型 Into;随后协调 protocol owner删除 v0 AgentSessionTurnStartParams/AgentInput 类型、schema roots与无消费者 app-server-client start_turn API。AgentAttachment继续保留给 ConversationImport media owner。完成后再集中补 App Server 定向 Cargo、contracts、agent current fixture与 GUI Gate B。

9.63 Renderer canonical timeline / replay / pending 收口

主目标:把 V2 Renderer 的 live、cold read、production resume、Turn render 与 reverse request 收敛到唯一 owner,删除 canonical Item -> Message、通用 extension 和重复 pending store;不把 V2-05 planned notification 提前标记完成。

架构影响:重大。Renderer Item 状态继续由 request-scoped ConversationProjection 持有;thread/read/items/turns 与 thread/resume 都经 canonical reader 进入同一 reducer,resume reducer 安装到 active stream state 后由后续 live notification 复用。MessageList 只从该状态纯派生 canonical Turn render entries;pending reverse request 只由 PendingInteractionController 承接。Electron 仍只做 Desktop Host,App Server/RuntimeCore/ThreadStore owner 与 model-provider/tool-runtime 边界不变。

本轮写集:src/lib/api/agentRuntime/conversationProjection/replay*、pendingInteractionController*、canonical Item reader/protocol DTO;agentRuntimeAdapter、agentStreamResumeBinding;chat projection/turnTimelineRenderProjection*、ConversationTurnTimeline、MessageList/PendingInteractionLayer/MCP form/timeline renderer;五语言 agent 文案;internal/refactor/v2、architecture 与本执行计划。共享工作树其余 V1/Rust 热区不由本切片改写。

direct timeline:canonical UserMessage、AgentMessage、Media 与连续 Process segment 按 Item sequence 进入 ConversationTurnTimeline。未被 canonical Item 覆盖的 optimistic/imported/local product surface 只保留 residual Message,不建立第二 store。canonicalItemsToMessages、tool/agent/reasoning Message content-part 合成与 canonical compatibility branch 已删除,禁止恢复。

replay:thread/resume response 经 readCanonicalThreadDetail 创建 ConversationProjection reducer;adapter 校验 canonical thread identity,resume binding 把 reducer 安装到当前 request state,随后 live event 继续复用同一实例。live/cold/replay 的 Item identity、顺序和 terminal 等价由同一 reducer 回归证明。

pending:command approval、file approval、requestUserInput、MCP elicitation 四类 reverse request 只注册到 PendingInteractionController。transport id/action token 留在 dispatcher closure,React 只持 semantic interaction identity;唯一可操作表面位于 Composer 上方。turn/completed、thread/closed、abort/detach 统一终结 pending,重复提交 fail closed。旧两个 server-request controller、MCP 根部 Dialog/controller 与独立 pending store 已删除。

typed Item:HookPrompt、Sleep、entered/exited Review 分别使用 hook_prompt、sleep、review_boundary DTO 和低干扰 renderer;Hook runtime identity 不泄露到 DOM。MCP result/error 与 DynamicTool inputAudio 继续走真实 typed protocol。UserMessage audio/localAudio 因 Lime Rust UserInput/AgentInput 无产品 owner,删除前端 reader/type/正向断言并补 malformed fail-closed 测试;两类音频边界不得混写。

drift:V2-00 pinned upstream schema/hash/method gate 已实际读取指定 Codex revision 并校验 SHA/字段/method inventory。unknown Item 与 unknown/known-unprojected notification recorder 已接线;recorder 只是诊断 owner,不等于 V2-05 planned notification 已实现。

架构确认:architecture.md 7.1.1 已更新 live/read/resume reducer、direct TurnTimeline 与 PendingInteraction 数据流。责任人 root 于 2026-07-29 确认:无第二 timeline/pending store、无生产 mock fallback、无 compat wrapper、无 raw request id Renderer owner;重大架构变更确认完成,PR body 仍需在真实提交时复述。

定向验证:canonical reader + timeline 2 files / 57 tests;production replay 4 files / 45 tests,stream projection/runtime handler 扩圈 2 files / 63 tests;pending interaction 7 files / 227 tests,controller 修复后 5/5;typecheck、目标 ESLint 与 git diff --check 在各 owner 交接时通过。

分类:ConversationProjection live/read/resume、direct TurnTimeline、PendingInteractionController、typed Hook/Sleep/Review、typed MCP/DynamicTool 为 current;无 compat;fileChange outputDelta、thread/compacted 与未迁完的旧 notification 裁决为 deprecated/迁出中;canonical Item -> Message 合成、通用 extension fallback、UserMessage 音频半实现、重复 pending owner 为 dead/deleted/forbidden-to-restore。

OPEN_REF:先完成 Renderer 重建后的 contracts、current runtime fixture、session-history Electron fixture、MCP elicitation Gate B、GUI smoke、fresh verify:local 与 test:resume。V2-05 仍有大量 planned notification/host capability/recovery 场景,必须逐项从真实 producer 到 Gate B 实现;不能用 drift warning、fixture 或 current 四类 pending handler冒充完成。按六阶段退出条件保守估算总体 68%,不得标记整体完成或 release-ready。

9.64 Renderer integration gate closure

主目标:关闭 9.63 留下的 Renderer 整合门禁,把 session detail、direct Item timeline、production replay 与 MCP elicitation 的真实跨层证据写回唯一事实源;不把门禁通过扩张为 V2-05 planned surface 已完成。

写集:session history/MCP Gate B fixture 与守卫、canonical session/detail 与 AgentMessage phase 回归、legacy catalog;internal/refactor/v2/IMPLEMENTATION-PLAN.md 与本执行计划。共享工作树其余 Rust/Renderer 热区保持既有 owner,不做无关重写。

session detail:详情读取必须先发 `thread/read {threadId, includeTurns:false}`;`thread/list` 只作为摘要与列表事实,不得提供详情替代。响应直接消费 canonical `items`,兼容字段固定为 `messages: []`,禁止恢复 Item -> Message 合成。AgentMessage terminal phase 统一为 `final_answer`,旧 `final` 只允许历史 evidence 或负向守卫。

session history Gate B:真实 Electron preload 启动 App Server,archive/unarchive 后从 canonical storage 读回;`thread/read`、`thread/turns/list`、`thread/items/list` 与 `thread/resume` 使用相同 thread/turn/item identity。三组 Turn、九个 Item 在 GUI 保序,图片附件保持唯一,console/page errors 为空。证据:`.lime/qc/gui-evidence/agent-session-history-electron-fixture/agent-session-history-electron-fixture-summary.json`。

MCP elicitation Gate B:真实 Electron preload 与 `app_server_handle_json_lines` 命中,runtime initialize 宣告 elicitation capability;Renderer 表单可见、提交后 resolved 关闭,MCP ledger 接受选择,provider 继续完成最终文本。legacy MCP command 命中为零,console errors 为空。证据:`.lime/qc/gui-evidence/mcp-elicitation-gate-b/mcp-elicitation-gate-b-summary.json`,`ok=true`、`proofLevel=Gate B`。

守卫:MCP/session-history source guard 改为格式无关正则,避免 Prettier 展开数组后误报,10/10 通过。legacy catalog 将 `rust-app-paths-root-fetch-duplication` 收口为 `dead/maxCount=0`;集中 output media sidecar writer 更新显式 owner allowlist。canonical direct Item、`messages: []`、`final_answer` 与 exact `thread/read` 请求均有稳定回归。

验证:`npm run test:contracts`、`npm run smoke:mcp-elicitation-gate-b`、`npm run verify:gui-smoke` 通过;`npm run test:resume` 112/112 批通过;fresh `npm run verify:local` 通过 i18n、lint、typecheck、112/112 Vitest、Rust changed-scope、Electron renderer/host build 与真实 GUI smoke;legacySurfaceCatalog 223/223 通过;governance legacy report 为零引用候选 0、分类漂移 0、边界违规 0;`npm run governance:scripts` 与 `git diff --check` 通过。

分类:canonical session detail、direct Item timeline、production replay、PendingInteraction MCP elicitation 与真实 Electron/App Server 证据为 current;无 compat;fileChange outputDelta、thread/compacted、未迁完旧 notification 与未完成 producer/Gate B 的 product-scope reverse request 为 deprecated/迁出中;Item -> Message 合成、旧 `phase:"final"`、重复 pending/dialog owner、旧 MCP Desktop commands、app_paths 重复 root 获取样板为 dead/deleted/forbidden-to-restore。

当时 OPEN_REF(后续由 9.65 关闭):整合门禁关闭后,下一刀是 V2-02 图片/音频异常态 fail-visible Gate B;V2-03 长列表性能证据、V2-04 剩余 product-scope reverse request / multi-agent 场景,以及 V2-05 planned notification、host capability 与 recovery 仍继续开放。drift recorder 只诊断 unknown/known-unprojected notification,不得据此标记 planned surface 完成。当时按六阶段退出条件保守估算总体 74%,不表示整体完成或 release-ready。

9.65 Media read v2 cutover and abnormal-state Gate B

状态:completed(2026-07-29)。

主目标:关闭 V2-02 媒体异常态主链 blocker,把唯一 GUI sidecar 读取从 v0 `agentSession/media/read` 直接迁到 Lime-owned v2 `media/read`,请求/响应只使用 canonical `threadId`;复用既有 bounded SidecarStore reader,不新增 compat、第二 reader 或生产 mock fallback。

本轮窄写集:app-server-protocol v2 media method/envelope/schema 与 v0 删除;App Server media reader/dispatcher/cancel tests;packages/app-server-client 与 Renderer typed gateway;media reference preview owner/tests;session-history Electron fixture/oracle/guard;legacy catalog、architecture、internal/refactor/v2 与本执行计划。共享工作树其它 provider、turn/item、MCP、pending 与 V2-05 notification 热区不做无关改写。

边界裁决:`media/read` 是 Codex 未提供同名 method 的 Lime-owned host-safe sidecar extension,owner 仍是 App Server read model + SidecarStore。`media.read.chunk` / `media.read.completed` 现有 transient event 旁路本轮只做字段同步,继续列为 deprecated/V2-05 迁出项;不能以本切片冒充 notification 全面收口。

退出条件:旧 method/type/client symbol 物理删除并有回流守卫;Rust producer、schema、generated client、Renderer request 使用同一 `threadId`/range/size/digest 语义;真实 Electron fixture 命中 preload、`app_server_handle_json_lines`、`media/read` 和用户可见媒体 fallback,console/page error 为空;定向 Rust/TS、contracts、GUI smoke、治理扫描与 diff check 通过。

完成事实:v0 `agentSession/media/read`、`AgentSessionMediaRead*`、`agent_session_media_read`、`readSessionMedia` 与 `buildAgentSessionMediaReadParams` 已从生产面物理删除;schema、generated/package client、App Server dispatcher/reader 与 Renderer gateway 统一使用 `threadId`。负向 contract guard 是这些旧符号唯一允许保留的位置。

失败语义:SidecarStore 继续在 App Server 内执行 Thread scope、range、max-bytes 与 digest 校验;读取缺失或权限拒绝时 Renderer 保留脱敏 metadata fallback,不展示底层路径或错误。图片、音频、视频在浏览器解码失败后切到共享 `unsupported` 兜底面,不再留下空白媒体元素。object URL 保持替换、卸载和预算淘汰释放。

Gate B:controlled Electron fixture 经真实 Electron preload/contextBridge、`electron-ipc`、`app_server_handle_json_lines`、App Server JSON-RPC、read model 与 GUI 读取 471-byte PNG;两次 `media/read` 请求均只含预期 `threadId`、无 `sessionId`。sidecar 置空后,同一媒体入口展示 Markdown metadata fallback。legacy command hit、mock fallback、console error、page error 均为 0;截图和 summary/ledger 位于同一 run 目录。证据:`.lime/qc/gui-evidence/claw-chat-current-fixture/claw-chat-current-fixture-media-read-v2-gate-b-summary.json` 与 `.lime/qc/gui-evidence/claw-chat-current-fixture/claw-chat-current-fixture-media-read-v2-gate-b-chat.png`。

证据边界:真实 Gate B 证明图片成功读取和 sidecar 不可用 fallback;权限拒绝、图片/音频格式解码失败、过大结果、range 与 digest 异常由 Rust/TS 定向回归覆盖。它不证明 live Provider,也不冒充所有音频、视频或平台异常都已取得真实 Electron 证据。

验证:`npm run smoke:agent-runtime-current-fixture` 通过;fresh `npm run verify:local` 通过 i18n、lint、typecheck、112/112 Vitest、`test:contracts`、Rust changed-scope、Electron renderer/host build 与真实 GUI smoke;最终版异常态定向回归 2 files / 29 tests passed,定向 ESLint 与 `npm run typecheck` 通过;`npm run governance:legacy-report` 为零引用候选 0、分类漂移 0、边界违规 0;`npm run governance:scripts` 与最终 `git diff --check` 通过。

治理分类:`media/read`、Thread-scoped SidecarStore reader、typed client 与 fail-visible Renderer 为 current;无 compat;`media.read.chunk` / `media.read.completed` 为 deprecated/V2-05 transient bypass;v0 method/type/client symbols 为 dead/deleted/forbidden-to-restore。

9.66 V2-03 bounded TurnTimeline and long-list Gate B closure

状态:completed(2026-07-29);v2 总体仍为 in-progress,不是 release-ready。

主目标:关闭 V2-03 长列表性能退出条件。canonical 历史继续由 bounded Turn window 直接渲染,不恢复 Item -> Message 合成;已完成的历史 assistant 长正文复用唯一 preview owner,显式展开前不挂载全文。

本轮窄写集:ConversationTurnTimeline、MessageList history chrome 与 direct timeline 回归;session-history Electron fixture 的 240 Turn / 720 Item canonical SQLite seed、DOM/performance oracle 与证据;architecture、internal/refactor/v2 与本执行计划。共享工作树中的 provider、protocol、pending interaction、multi-agent 和 V2-05 notification 热区不做无关改写。

实现事实:恢复窗口中的 canonical assistant 纯文本超过 900 字先进入 compact preview,超过 24,000 字使用 2,000 字 long preview;streaming、A2UI 和含非文本 part 的 Item 不折叠,用户可显式展开全文。history chrome 暴露稳定 evidence attributes,便于 fixture 读取 hidden/rendered/restored 状态。首帧继续由现有 Turn render window 限定,没有新增第二 store、compat wrapper 或生产 mock fallback。

Gate B:controlled Electron fixture 从 canonical SQLite seed 恢复 240 Turn / 720 Item。首帧 DOM 只挂载 10 个 canonical Turn,最终扫描 30 个 Item,residual Message 为 0;长正文 preview 可见而 tail marker 未进入 DOM。首次 MessageList paint 37ms、稳定 paint 200ms,long task 0,console/page error 0。历史数据读取命中 current `thread/read`、`thread/items/list`、`thread/turns/list`,未命中旧 AgentSession 历史方法。证据为 `.lime/qc/gui-evidence/agent-session-history-electron-fixture/agent-session-history-electron-fixture-summary.json` 与 `.lime/qc/gui-evidence/agent-session-history-electron-fixture/agent-session-history-electron-fixture-long-list.png`。

证据边界:这是 `APP_SERVER_BACKEND_MODE=unavailable` 下的受控 Gate B,证明真实 Electron、preload/IPC、`app_server_handle_json_lines`、App Server JSON-RPC、canonical read model 与 GUI;不调用 live Provider,也不代表真实用户历史数据或 macOS 之外平台的普遍性能。

验证:direct timeline 与历史预览扩圈 5 files / 61 tests passed;定向 ESLint、`npm run typecheck`、`npm run test:contracts`、`npm run governance:scripts`、`git diff --check` 通过;`npm run smoke:agent-session-history-electron-fixture` 通过;`npm run smoke:agent-runtime-current-fixture` 完整通过且 `liveProviderUsed=false`;独立 `npm run verify:gui-smoke` 通过,证据为 `.lime/qc/project-gates/standalone-shell-01-20260729161109-71996/shell-01-electron-smoke/summary.json`;最终 fresh `npm run verify:local` 通过 i18n、lint、typecheck、112/112 Vitest、contracts、scripts/docs governance、Rust changed-scope 与第二次真实 Electron GUI smoke,后者证据为 `.lime/qc/project-gates/standalone-shell-01-20260729163104-57139/shell-01-electron-smoke/summary.json`;最终 `npm run governance:legacy-report` 为零引用候选 0、分类漂移 0、边界违规 0,`npm run test:contracts` 与 `git diff --check` 再次通过。

治理分类:direct canonical TurnTimeline、bounded restored Turn window、canonical long-message preview 与 Electron long-list fixture 为 current;无 compat;V2-05 planned notification/transient bypass 继续为 deprecated/迁出中;canonical Item -> Message 合成、首帧无界历史挂载和 canonical 长正文绕过 preview 为 dead/deleted/forbidden-to-restore。

OPEN_REF:下一刀进入 V2-04 剩余 product-scope reverse request / multi-agent 场景,再按 EVENT-PROJECTIONS 推进 V2-05 notification、host capability 与 recovery。V2 总体完成度保守估算约 82%。

9.67 V2-04 Multi-Agent AgentControl Gate B closure

状态:completed(2026-07-30);只关闭 V2-04 Multi-Agent 子切片,V2-04 与 v2 总体仍为 in-progress,不是 release-ready。

主目标:用真实 Electron Gate B 关闭六工具 AgentControl 的可见 DOM、parent-owned child 输入政策与 cold restart identity 退出条件;不恢复旧 Team 工具、raw output 推断、第二 roster/pending owner或生产 mock fallback。

本轮窄写集:App Server turn direct-input policy 与 public JSON-RPC 回归;canonical Item reader 的 wait_agent 投影;ModelSelector 稳定 test id;AgentControl managed smoke、Gate B assertions 与脚本回归;internal/refactor/v2、本执行计划和 evidence。共享工作树其他 Rust/Renderer 热区不做无关重写。

实现事实:spawn_agent、list_agents、send_message、followup_task、interrupt_agent、wait_agent 在 provider request、runtime inventory、canonical read model 与 GUI 使用同一 identity;六个 DOM Tool row 各出现一次且 completed。wait 不再投影为 subagent_activity(kind=wait),Started/Interacted/Interrupted 只来自 canonical SubAgent Item。parent-owned child 只读 canonical Thread canAcceptDirectInput=false,Composer、发送、access mode、model selector 与 task mode全部禁用,五语言 placeholder 有稳定回归;UI 尝试不发起 turn/start,App Server public JSON-RPC 仍以 -32600 拒绝直接输入。

Gate B:.lime/qc/agent-runtime-tool-execution-smoke.json 为 status=pass,39/39 assertions 全真且 failedAssertions=[]。Electron PID 40827 -> 42257,旧进程树 remainingPids=[];六个 Tool Item、四个 SubAgent activity、child Thread 与 wait_agent state 跨冷重启稳定。parent-owned child 与重启前后截图均落在 .lime/qc;invoke/console error 为 0。localhost provider fixture 只证明真实 Electron/preload/IPC/app_server_handle_json_lines/App Server/runtime/read model/GUI,不证明 live Provider。

验证:focused Vitest 3 files / 88 tests 与 AgentControl Gate assertions 13/13 通过;Rust App Server 1623 个单测及相关 integration targets 通过;npm run build、npm run test:contracts、npm run governance:legacy-report、npm run smoke:agent-control-cold-restart-gate-b、npm run smoke:agent-runtime-current-fixture、npm run verify:gui-smoke 通过。最新 shell Gate B-F 证据为 .lime/qc/project-gates/standalone-shell-01-20260730095250-16113/shell-01-electron-smoke/summary.json。npm run test:related 因 runner 把 electron/ 目录误当文件而报 EISDIR,随后以精确 Vitest 文件模式完成覆盖,不把 runner 错误记为通过。

架构确认:本切片没有改变 public owner 或依赖方向,只落实既有 Electron Desktop Host -> App Server JSON-RPC -> RuntimeCore -> Thread/Turn/Item -> GUI 边界,因此不构成新的重大架构变更;architecture.md 无需改写。

治理分类:六工具 AgentControl、typed wait states、canonical SubAgent activity、parent-owned policy、cold-restart identity 与真实 Electron GUI 为 current;无 compat;currentTime/read、item/permissions/requestApproval、item/tool/call 为 deprecated / producer-and-Gate-B-pending;裸旧 Team 工具、raw output 推断与生产 mock fallback 为 dead/deleted/forbidden-to-restore。

OPEN_REF:V2-04 只剩上述三项 product-scope reverse request 的真实 producer、PendingInteraction 与 Gate B;随后按 EVENT-PROJECTIONS 推进 V2-05 notification、host capability 与 recovery。总体完成度保守估算约 84%。

9.68 V2-04 Host Capabilities 与 Product-Scope Reverse Request closure

状态:completed(2026-07-30);V2-04 完成,v2 总体仍为 in-progress,不是 release-ready。

主目标:关闭 currentTime/read、item/permissions/requestApproval、item/tool/call 三项 product-scope reverse request,统一 Host/RuntimeCore/Thread-Item/GUI owner;不新增第二 pending store、第二 runtime、Renderer 执行路径或生产 mock fallback。

本轮窄写集:Electron current-time 与 dynamic-tool Host、App Server reverse-request dispatcher、agent-runtime permission waiter、tool-runtime capability owner、agent-protocol typed DynamicToolCall payload、provider history/read-model/projection、V2-04 文档与 Gate B evidence。保留工作树中其他 agent 的 dirty changes,不覆盖无关热区。

实现事实:Electron Host 独占系统时钟;permission profile 由 tool-runtime 解析、agent-runtime 注册 exact waiter、App Server 校验 server request、PendingInteractionController 承接 GUI grant;`desktop.appInfo` binding 在 thread/start/resume 后冻结,`item/tool/call` 校验 thread/namespace/tool/schema/arguments/call identity。DynamicTool route 只从可信 session metadata 建立,deferLoading、保留名、schema 非 object 和 native/MCP/gateway collision 均 fail closed。

canonical:新增 `ThreadItemPayload::DynamicToolCall` 与 `DynamicToolCallContentItem`,显式保存 namespace、tool、原始 JSON arguments、有序 text/image/audio content、success、duration。started/completed 使用同一 item identity;provider history、read model、App Server projection 直接读取 typed payload,不从 metadata 推断核心 contract。

Gate B:真实 Electron fixture 命中 preload/IPC、`app_server_handle_json_lines`、App Server JSON-RPC、RuntimeCore、read model 与 GUI;dynamic tool provider result、canonical started/completed 与 Renderer-hidden request 全部成立,provider request count=3,console/missing/legacy MCP 为 0。证据:`.lime/qc/gui-evidence/mcp-elicitation-gate-b/v2-04-host-capabilities-final-summary.json`、同目录 raw/png。该 Gate B 专门覆盖 DynamicTool;currentTime/permission 由 Electron 39 tests 与 Rust waiter/profile tests 覆盖,未把它们误写为独立真实 Gate B。

验证:`cargo check --manifest-path lime-rs/Cargo.toml -p agent-protocol -p lime-agent -p app-server`、typed DynamicTool 1+3+5、permission 3+1+2+1、current time 5+2、`npm run typecheck:electron`、Electron Vitest 3 files/39 tests、`npm run test:contracts`、`npm run verify:gui-smoke` 均通过。收尾复核追加:全量 Vitest 以 `npm test -- --resume` 完成 112/112 批;`npm run test:rust:changed` 因 `Cargo.lock` 改动自动扩大为 workspace `cargo test --lib --workspace` 并通过;`npm run smoke:agent-runtime-current-fixture` 通过受控真实 Electron 闭环。为保留已完成的 Vitest 批次,未从头直接执行 `npm run verify:local`;其非 Vitest 子项 `verify:app-version`、i18n check/unused/scan、lint、typecheck 均已通过。`npm run test:contracts` 同时覆盖 protocol type drift、286 app-server-client checks、command/harness/modality/scripts/docs/release guards;`git diff --check` 通过。

架构确认:本轮改变了 canonical Item contract 和 Host reverse-request boundary,已同步 `internal/aiprompts/architecture.md` 第 25 节;产品链仍为 Electron Desktop Host -> App Server JSON-RPC -> RuntimeCore -> Thread/Turn/Item -> GUI。责任开发者确认:root,2026-07-30。

治理分类:三项 reverse request、Electron Host binding、typed DynamicToolCall、permission/current-time waiter 为 current;无 compat;V2-05 notification/transient bypass、broader host capability 与 recovery 继续 deprecated/迁出中;旧 MCP Desktop command、Renderer 伪造 binding、metadata 核心字段推断、生产 mock fallback 为 dead/deleted/forbidden-to-restore。

OPEN_REF:进入 V2-05 notification、host capability 与 recovery;V2-04 owner 冻结。v2 总体完成度保守估算约 88%。

9.69 V2-05 media transient notification retirement

状态:completed(2026-07-31);media/read transient notification bypass 已迁出,只完成 V2-05 的这一切片,不代表 V2-05 或 v2 总体完成。

主目标:保留 current `media/read` bounded range response、分页预览与 `$/cancelRequest`,物理删除 `stream` 参数、`media.read.chunk` / `media.read.completed` raw `agentSession/event`、客户端专用 raw subscription 和 Renderer live-drain 旁路。GUI 进度只由每个已校验 range response 累计,不再从第二通知通道镜像同一数据。

窄写集:app-server-protocol v2 media schema/generated client;App Server media processor/reader/SidecarStore/transport cancellation;app-server-client 与 agent-runtime-client 的 media raw-event facade;Workspace media preview range projection及其 focused tests;对应 contract/governance/docs/evidence。避让 V2-04 reverse request、provider/model、Multi-Agent 与其他 V2-05 planned notification 热区。

实现与裁决:`MediaReadParams.stream`、`media.read.chunk`、`media.read.completed`、App Server streaming producer/transport branch、SidecarStore callback sibling、app-server-client 与 agent-runtime-client raw-event subscription、Renderer response notification envelope、streaming progress parser 和 live-drain helper均已物理删除。`media/read` 保留唯一 bounded range response、thread scope、digest/max-bytes 校验和 `$/cancelRequest`;GUI 只在每段 response 校验通过后累计 progress,并继续维护 object URL、预算、迟到请求与 metadata fallback。

验证:Rust media reader 6/6、public media task JSON-RPC 8/8、request cancel 5/5、protocol v2 48/48;Workspace media preview 28/28;app-server-client 94/94、agent-runtime-client 22/22;`npm run test:contracts` 287 checks 及 command/harness/modality/scripts/docs/release guards通过;`npm run governance:legacy-report` 为零引用候选 0、分类漂移 0、边界违规 0;`cargo fmt --check` 与 `git diff --check` 通过。`npm run smoke:agent-runtime-current-fixture` 完整通过并包含真实 Electron media item/imageView -> card/Workbench source preview,`liveProviderUsed=false`;`npm run verify:gui-smoke` 通过,证据为 `.lime/qc/project-gates/standalone-shell-01-20260730165204-31622/shell-01-electron-smoke/summary.json`。

架构确认:本切片删除第二 transient notification 通道,收敛 public media read boundary,已同步 `internal/aiprompts/architecture.md` 第 24 节;主链仍为 Electron Desktop Host -> App Server JSON-RPC -> RuntimeCore -> Thread/Turn/Item projection -> GUI。责任开发者确认:root,2026-07-31。

治理分类:bounded `media/read`、SidecarStore verified range reader、typed client、response-driven progress 与 fail-visible Renderer 为 current;无 compat;V2-05 其他 planned notification、host capability 与 recovery 仍为 deprecated/迁出中;media transient notification、raw subscription、response envelope、streaming parser/live drain 和 streaming transport branch 为 dead/deleted/forbidden-to-restore。

OPEN_REF:下一刀回到 `EVENT-PROJECTIONS.md` 中尚未裁决的 planned notification/host capability/recovery,保持 media read owner 冻结。v2 总体完成度保守估算约 89%,仍非 release-ready。

9.70 V2-05 configWarning current audit 与 guard closure

状态:completed(2026-07-31);只关闭 configWarning 的协议 owner、Renderer 消费与回流守卫,不代表 V2-05 或 v2 总体完成。

主目标:确认 configWarning 只由 app-server-protocol v2 与 App Server producer 继续演进,checked-in schema/generated client、Electron Host、Renderer typed gateway、五语言 toast 和文档裁决一致;不恢复 v0 DTO,不新增第二 warning channel 或设置页伪入口。

窄写集:app-server-client handshake/catalog tests、Electron App Server Host buffered notification test、i18n 五语言 key regression、app-server-client contract guard 与本执行计划。协议 owner、schema/generated、Renderer production 实现和 EVENT-PROJECTIONS 已由当前工作树同步,本切片只做审计与稳定回归,不重写无关脏热区。

实现事实:Rust initialize dispatch 保持 response 在前、configWarning notification 在后;stdio sidecar handshake 只消费 initialize response,后续 notification 留在同一 transport queue,Electron warmup 后由 drainEvents 投递 Renderer。turn/start warning 继续随 request response path 返回。Renderer 统一由 readAppServerConfigWarnings -> publishAppServerConfigWarnings -> AppServerConfigWarningToastBridge 消费,在 App 根挂载后按 summary/path/details/range 去重,并展示本地化 warning toast。

协议事实:ConfigWarningNotification、TextPosition 与 TextRange 已从 v0 owner 删除并进入 v2;schema fixture tree 与临时权威生成结果完全一致,manifest、METHOD_CONFIG_WARNING、ServerNotification union 与 generated TypeScript 无漂移。APP_SERVER_METHODS 将 configWarning 明确分类为 notification,client test 与跨层 source guard 均锁住该裁决。

验证:app-server-protocol schema fixture 1/1;App Server config_warning Rust tests 6/6;`npm run test:rust:related -- <configWarning paths...>` 自动扩展到 20 个反向依赖 crate 并全部通过;app-server-client 8 files / 94 tests;Electron Host、i18n、Renderer response/publisher/toast 5 files / 44 tests;`npm run test:contracts` 通过并包含 288 app-server-client checks;`npm run smoke:agent-runtime-current-fixture` 完整通过且 `liveProviderUsed=false`;`npm run verify:gui-smoke` 通过,证据为 `.lime/qc/project-gates/standalone-shell-01-20260730172753-14419/shell-01-electron-smoke/summary.json`;`git diff --check` 通过。证据等级为 Rust owner unit/related integration、真实 stdio sidecar process integration、Electron Host unit、Renderer component/locale regression、current Agent fixture 与通用真实 Electron smoke;本切片没有伪称专用 configWarning Electron Gate B。

架构确认:本切片把 public notification/schema owner 从 v0 迁到 v2,属于重大协议 owner 变更;已同步 `internal/aiprompts/architecture.md` 第 26 节。wire 与 runtime 行为保持不变,产品方向仍为 Electron Desktop Host -> App Server JSON-RPC -> RuntimeCore -> Thread/Turn/Item projection -> GUI。责任开发者确认:root,2026-07-31。

治理分类:v2 ConfigWarningNotification、App Server initialize/turn producer、generated catalog、Electron drain 与 Renderer toast 为 current;无 compat;EVENT-PROJECTIONS 中其余 planned warning/guardian/realtime/windows/recovery surface 继续开放;v0 ConfigWarningNotification/TextPosition/TextRange 为 dead/deleted/forbidden-to-restore。

OPEN_REF:继续按 EVENT-PROJECTIONS 推进其余 planned notification、Windows/realtime host capability 与 recovery,并补风险匹配的真实 Gate B。v2 总体完成度保守估算约 90%,仍非 release-ready。

9.71 V2-05 thread-scoped warning typed notification 与 recovery closure

状态:completed(2026-07-31);只关闭普通 warning 的 typed live/recovery 垂直切片,V2-05 与 v2 总体仍为 in-progress,不是 release-ready。

主目标:把 current AgentEvent::Warning 从 durable runtime.warning 投影为 v2 warning,并让同一 durable event 在 full canonical cold read 与 history-limit projection summary 中恢复;Renderer 只消费 typed warning,不恢复 raw agentSession/event wrapper、第二 persistence 或 canonical ThreadItem 变体。

窄写集:app-server-protocol v2 warning/method/envelope/schema/generated client;App Server V2NotificationProjector、read model 与 limited-history support event;Renderer v2 route/sequence gate/raw-wrapper guard;warning 五语言 presentation 的现有 owner;architecture、internal/refactor/v2 与本执行计划。v2_notifications.rs 超过 1000 行,本轮只加路由,业务 projector 落在独立 warning.rs;未改写其他 notification 热区。

实现事实:Codex 基础 contract 保持 threadId?: string|null 与必填 message;Lime 只增加可选 code,用于 skill_not_available、skill_load_failed、mention_not_available 的五语言展示,缺失时按 message 展示。current Agent Chat producer、live projector 与 Renderer 要求非空 thread identity;通用协议仍可解码 threadId:null,但不宣称全局 GUI owner。历史恢复只接受精确 message/code shape,并要求 event thread/turn identity 与当前 stored session/turn 匹配;畸形字段、旧 alias、缺失或错配 identity 均 fail closed。

恢复事实:runtime.warning 是唯一 durable fact,不伪装成 ThreadItemPayload。full cold read 与 history-limit projection summary 从同一事件派生 warning read item,保留 event id/sequence/thread/turn/message/code,再按既有 read-detail 顺序与 canonical items 合并;没有新增 compat、第二 store 或 production mock fallback。

验证:protocol v2 50/50、schema fixture 1/1、App Server warning 12/12、projection-summary recovery 1/1、Renderer 3 files / 61 tests、generated TypeScript drift check 通过。npm run test:contracts 通过,含 839 schema definitions、831 generated types、0 generation failure、289 app-server-client checks 及 command/harness/modality/scripts/release/docs guards。Rust related 覆盖 19 个 scoped packages、18 个 lib 目标,共 3597 项(3593 passed、4 个既有环境/live 测试 ignored、0 failed)。

产品证据:npm run smoke:agent-runtime-current-fixture 完整通过且 liveProviderUsed=false;它证明 current Agent/Electron fixture 主链无回归,但没有普通 warning 专项 DOM 断言,因此不冒充 warning 专项 Gate B。fresh npm run verify:local 通过 i18n、lint、typecheck、112/112 Vitest、contracts、Rust changed-scope、Electron renderer/host build 与真实 GUI smoke;后者通过 21/21 assertions,证据为 .lime/qc/project-gates/standalone-shell-01-20260730194114-24572/shell-01-electron-smoke/summary.json。该 Gate B-F 证明 Electron/preload/IPC/app_server_handle_json_lines/App Server/GUI shell 与零 mock fallback,不宣称实际命中 warning method。

治理与格式:cargo fmt --manifest-path lime-rs/Cargo.toml --all --check、定向 Prettier、git diff --check 与 npm run governance:legacy-report 通过;治理扫描为零引用候选 0、分类漂移 0、边界违规 0。

架构确认:本切片把普通 warning 的 live notification 与 durable recovery 统一到 v2 protocol/projector/Renderer 边界,已同步 internal/aiprompts/architecture.md 第 27 节。唯一产品链仍为 Electron Desktop Host -> App Server JSON-RPC -> RuntimeCore -> Thread/Turn/Item projection -> GUI。责任开发者确认:root,2026-07-31。

治理分类:v2 warning protocol/projector、thread-scoped Renderer toast、full/limited durable recovery 为 current;无 compat;raw runtime.warning agentSession/event wrapper 为 dead/forbidden-to-restore;guardianWarning 因没有真实 Guardian runtime producer 保持 planned。

OPEN_REF:下一刀审计 skills/changed 的真实 Skill catalog producer、GUI refresh consumer 与 recovery 语义;只有形成 typed producer -> GUI refresh -> 风险匹配 Gate B 的垂直链才转 current。v2 总体完成度保守估算约 91%,仍非 release-ready。

9.72 V2-05 skills/changed catalog invalidation closure

状态:completed(2026-07-31);只关闭 `skills/changed` catalog invalidation 垂直切片,V2-05 与 v2 总体仍为 in-progress,不是 release-ready。

主目标:按 Codex `skills/changed` 的严格空对象、进程级瞬时失效语义,在唯一产品链内形成默认 Skill root / 成功本地 mutation -> App Server typed notification -> Renderer 重新读取 current Skill catalog -> GUI 可见更新;不进入 Thread/Turn/Item、持久化或恢复重放,不新增 `skills/extraRoots/set`、第二 catalog owner 或生产 mock fallback。

本轮窄写集:app-server-protocol v2 notification/method/schema/generated client;lime-skills snapshot cache invalidation;App Server Skill mutation producer/default-root watcher/public JSON-RPC tests;app-server-client typed decoder;Composer Skill hook、current catalog projection 与 focused tests;Skills runtime Gate B fixture;EVENT-PROJECTIONS、architecture、refactor v2 实施计划与本执行计划。共享工作树其它 provider、warning、guardian、realtime、Windows host capability 与 recovery 热区未做无关改写。

退出条件:`skills/changed` 只接受 `{}` 且进入 protocol catalog/schema/generated client;默认 root 在启动时存在、启动后首次创建、修改和删除时均可失效并按 10 秒节流;成功 Lime catalog mutation 发通知,失败及其他 app mutation 不发;Renderer 只消费 typed event bus 并重新调用 current `skill/list`,重连仍主动 list;Rust/TS/contracts/governance 通过;风险匹配 Gate B 证明真实 Electron/preload/IPC/App Server notification drain、重新 list、GUI catalog 更新与零 mock fallback。

实现事实:v2 protocol、schema、generated client 与 typed decoder 只接受严格空对象 `skills/changed {}`。App Server 启动默认 Skill root watcher;已存在 root 的创建/修改/删除和启动后首次出现均失效 `lime-skills` snapshot cache 并按 10 秒节流广播 typed notification。成功的 Lime catalog mutation 在 processor 边界失效同一 cache 并附带 notification;失败 mutation 和其他 app mutation 不发。没有新增 `skills/extraRoots/set`。

Renderer 事实:Composer `useLimeSkills` 的初始加载与 notification refresh 统一调用 current `skill/list`,`skillsApi.getRuntimeCatalog()` 复用 `skillExecutionApi.listExecutableSkills()` 的既有 decoder,再经纯 projection 映射 GUI shape。管理中心 `skillManagement/list` 保持原语义,不成为 Composer catalog owner。Renderer 只消费 typed event bus;命中后写 console-only `skillsChanged.received { method, count }` marker 并自动重读;重连/重新挂载仍主动 list。该事件是进程级瞬时失效,不进入 Thread/Turn/Item、持久化或恢复重放。

验证:纯 projection、API、Hook 与 fixture guard 共 4 files / 99 tests 通过;npm run typecheck、npm run test:contracts(840 schema definitions、832 generated types、0 generation failures、290 app-server-client checks)、npm run governance:legacy-report、Prettier、MJS node --check、cargo fmt --all --check 与 git diff --check 通过。npm run test:related 因仓库既有 runner 将 electron/ 目录当文件读取而报 EISDIR,未记为通过;本轮精确 Vitest 已覆盖相关前端回归。Rust related 因 Cargo.lock 自动扩大到 workspace lib;首次运行只暴露 protocol::v2::tests::typed_v2_envelope_schema_names_are_stable 的稳定清单漏项,补入 skills/changed 后 app-server-protocol 95/95 通过;workspace lib 最终汇总为 32 个 suite、4670 passed、5 ignored、0 failed。

产品证据:npm run smoke:claw-chat-current-fixture -- --scenario skills-runtime 通过,proof level 为 Gate B controlled fixture。真实 Electron/preload/IPC/app_server_handle_json_lines/App Server 链先完成初始 skill/list;隔离 HOME 默认 root 新建 notification-refresh/SKILL.md 后,typed skills/changed marker 为 1,skill/list 自动由 1 次增至 2 次且 transport=electron-ipc,GUI 新 Skill 可见,手动刷新点击为 0;console/page/actionable errors 与 failed assertions 均为 0。证据位于 .lime/qc/gui-evidence/claw-chat-current-fixture/claw-chat-current-fixture-summary.json。

整合复验:npm run smoke:agent-runtime-current-fixture 完整通过且 liveProviderUsed=false,包含 skills/changed、Inputbar rich restore、Skills Runtime 三入口及其余 current Agent/Electron fixture。首次聚合运行暴露的 Inputbar 失败属于 fixture DOM 定位合同:夹具用展示名 Capability Report 大小写敏感匹配 current catalog 的 capability-report,候选已可见但 target.click 从未执行;生产 CharacterMention 与 catalog identity 无缺陷。夹具现统一折叠大小写、空格、连字符和下划线,并由 source guard 锁定候选与 @capability-report badge 的同一等价规则。独立 inputbar-rich-restore Gate B 随后通过,text/image/path/skill 在 output-free cancel 后全部恢复,console/page error 与 mock fallback 为 0;证据为 .lime/qc/gui-evidence/claw-chat-current-fixture/claw-chat-current-fixture-inputbar-rich-restore-regression-summary.json。

通用 npm run verify:gui-smoke 通过,真实 Electron renderer、App Server sidecar、Claw shell reload 与 memory settings 均就绪;证据为 .lime/qc/project-gates/standalone-shell-01-20260731043417-63564/shell-01-electron-smoke/summary.json。fresh npm run verify:local 通过版本一致性和 i18n unused 后,在全仓 lint 被非本切片脏文件 src/components/input-kit/ModelSelector.tsx:432 的既有 react-hooks/exhaustive-deps warning 阻断,故未记为通过;本切片未改该文件。后续独立 npm run typecheck、contracts、99 项精确测试、GUI smoke、Rust fmt 与 Gate B 均明确通过。

架构确认:本切片把 Skill catalog mutation/filesystem invalidation、App Server typed notification 与 Renderer current list refresh 收敛到单一产品链,已同步 internal/aiprompts/architecture.md 第 28 节。责任开发者确认:root,2026-07-31。

治理分类:v2 skills/changed protocol/schema、App Server watcher/mutation producer、lime-skills cache invalidation、typed Renderer event bus 与 current skill/list GUI refresh 为 current;无 compat;skillManagement/list 仅保留管理中心读取语义;持久化/replay、skills/extraRoots/set、第二 catalog owner 与生产 mock fallback 均未新增。

OPEN_REF:下一刀回到 EVENT-PROJECTIONS.md,审计下一项具备真实 producer/consumer 的 planned notification、host capability 或 recovery;guardianWarning 在 Guardian runtime producer 落地前保持 planned。v2 总体完成度保守估算约 92%,仍非 release-ready。

9.73 V2-05 typed error retry/terminal closure

状态:completed(2026-07-31);只关闭 typed error retry/terminal 垂直切片,V2-05 与 v2 总体仍为 in-progress,不是 release-ready。

主目标:在唯一产品链内证明 error(willRetry=true) -> turn/completed(completed) 与 error(true)* -> error(false) -> turn/completed(failed);typed error 负责重试/错误可见性,权威 turn/completed 独占 Turn terminal,live、durable recovery、read model 和 GUI 使用同一 identity,生产 mock fallback 为零。

本轮窄写集:app-server-protocol v2 error notification/schema/generated client;App Server error projector 与 canonical read-model runtime notification merge;app-server-client typed decoder;agent-runtime-client signal/lifecycle 分流;Renderer strict typed error controller/presentation;Claw typed-error external fixture、assertion/evidence guards;EVENT-PROJECTIONS、refactor v2 实施计划与本执行计划。保留共享工作树其它 updater、provider、guardian、host capability 与 planned recovery 改动,不做无关改写。

退出条件:typed error 从 protocol/schema/generated client 到 Renderer strict decoder 一致;willRetry=true 不结束 Turn,willRetry=false 也必须等待权威 turn/completed;durable runtime.error 可由 canonical full/limited read model 恢复且不抢占后续 failed terminal;SDK signal 不污染 lifecycle sequence;定向 Rust/TS、contracts、Agent fixture 与 GUI smoke 通过;success/failure 两条 Gate B 证明真实 Electron/preload/IPC/app_server_handle_json_lines/App Server/RuntimeCore/read model/GUI、同一 identity 和零生产 mock fallback。

实现事实:App Server 把 durable runtime.error 投影成 v2 typed error;Renderer 只接受 typed event bus。willRetry=true 显示重试状态,后续 completed terminal 清理并完成;一个或多个 retry error 后的 willRetry=false 显示最终错误,仍由 failed terminal 决定 Turn。canonical read model 的 runtime notification merge 同时恢复 warning 与 error;runtime error 只形成可见错误证据,Turn 在权威 terminal 前保持 running。没有新增第二 persistence、第二 terminal reducer 或 raw agentSession/event wrapper。

SDK/fixture:agent-runtime-client 将 typed error 作为独立 signal,不送入 lifecycle sequence verifier。common assertion 将 provider first-text/provider-wait 与 App Server message delta、server timestamp、Renderer client output/paint、current trace method、W3C、GUI/read model/identity 分开;typed-error 场景只豁免不存在的 provider 首文本证据。新增回归锁定普通文本流仍要求 provider trace,typed-error 缺 App Server、Renderer 或 current trace 证据仍失败。

验证:typed-error Renderer/fixture 6 files / 94 tests、packages/app-server-client 8 files / 98 tests、packages/agent-runtime-client 22 tests 通过;Rust canonical runtime error recovery 与 runtime_error_does_not_preempt_a_later_turn_failed_terminal 两项定向回归分别通过。npm run test:contracts 通过,app-server-client contract 为 292 checks;npm run smoke:agent-runtime-current-fixture 完整通过且 liveProviderUsed=false;npm run verify:gui-smoke 21/21 assertions 通过,证据为 .lime/qc/project-gates/standalone-shell-01-20260731104641-30858/shell-01-electron-smoke/summary.json。

Gate B:success 场景观察 error(willRetry=true) -> turn/completed(completed),证据 .lime/qc/gui-evidence/claw-chat-current-fixture/claw-chat-current-fixture-typed-error-retry-success-gateb-02-summary.json;failure 场景观察 error(true)* -> error(false) -> pending read model -> turn/completed(failed) -> GUI/read-model/backend terminal,证据 .lime/qc/gui-evidence/claw-chat-current-fixture/claw-chat-current-fixture-typed-error-retry-failure-gateb-03-summary.json。两者 ok=true、proofLevel=Gate B controlled fixture;聚合回归 evidence 为同目录的 claw-chat-current-fixture-typed-error-retry-success-regression-summary.json 与 claw-chat-current-fixture-typed-error-retry-failure-regression-summary.json,均 ok=true。

架构确认:本切片没有改变 public owner、唯一产品链或依赖方向,只补齐既有 notification/projector/read-model/Renderer 边界的 typed contract 与恢复语义;无需改写 internal/aiprompts/architecture.md。责任开发者确认:root,2026-07-31。

治理分类:v2 typed error protocol/projector、durable runtime error recovery、strict Renderer signal 与权威 Turn terminal ownership 为 current;无 compat;raw error wrapper、provider trace 对 current 主链证据的错误替代和由 error 抢占 Turn terminal 的第二状态机为 dead/forbidden-to-restore;其余 V2-05 planned notification、host capability 与全面 recovery 仍为开放项。

OPEN_REF:下一刀回到 EVENT-PROJECTIONS.md,审计下一项具备真实 producer/consumer 的 planned notification、host capability 或 recovery;guardianWarning 在 Guardian runtime producer 落地前保持 planned。v2 总体完成度保守估算约 93%,仍非 release-ready。

9.74 V2-05 turn/plan/updated canonical checklist 与 cold recovery closure

状态:completed(2026-07-31);只关闭 `turn/plan/updated` canonical checklist 与恢复垂直切片,V2-05 与 v2 总体仍为 in-progress,不是 release-ready。

主目标:在唯一产品链内把 canonical `update_plan` 的结构化输出派生为 typed `turn.plan.updated`,让实时和 canonical cold read 都显示同一份执行 checklist;保留 canonical `update_plan` 工具项用于恢复,但不生成 Plan ThreadItem、不展示 Plan UI/decision panel/tool card,也不新增 Message synthesis 或 renderer mock fallback。

本轮窄写集:App Server canonical `ToolOutput.structured_content` 到 `turn.plan.updated` 的 producer;Renderer strict notification parser;`appServerCanonicalThreadProjection` 的 update_plan cold recovery 与定向测试;App Server client contract guard;EVENT-PROJECTIONS、v2 实施计划与本执行计划。保留共享工作树其它 provider、warning、skills/changed、typed error、host capability 与 planned recovery 热区,不做无关改写。

退出条件:实时通知只接受 typed `turn.plan.updated`;冷读从成功 `update_plan` 的最新有效快照恢复;真实 App Server wire `[ { name: "plan", value: "[...]" } ]` 可解析;空数组可清空旧 checklist,失败/非法快照不覆盖;read model 只保留 canonical `update_plan` tool item;真实 Electron Gate B 证明实时与 reload 可见、Plan Item/Plan UI/decision panel/tool card 为零、同一 identity 与零 invoke/console error。

实现事实:App Server 从 canonical `ToolOutput.structured_content` 派生 `turn.plan.updated`,Renderer parser 严格消费 `turn_plan_updated`;`canonicalTurnPlanItems` 扫描 completed/successful `update_plan` tool item,按最新有效快照投影 `{ content, status }`,同时支持对象参数与真实 wire 参数数组。Malformed JSON、重复/缺失 `plan` 参数、非允许 status、失败或非 completed tool 均 fail closed;没有 Plan ThreadItem 或第二 checklist owner。

验证:`appServerCanonicalThreadProjection.test.ts` 10/10;`npm run test:contracts` 通过,app-server-client contract 为 292 checks;`npm run typecheck`、`npm run smoke:agent-runtime-current-fixture` 与 `npm run verify:gui-smoke` 通过。Gate B 证据 `.lime/qc/gui-evidence/claw-chat-current-fixture/claw-chat-current-fixture-summary.json` 的 `scenario=turn-plan-update`、`proofLevel=Gate B controlled fixture`、`ok=true`:`turn.plan.updated` `methodCount=1`,事件 drain `messageCount=28`、`planIndex=16`、`terminalIndex=27`;实时和 reload checklist 各有 2 项,`updatePlanToolCount=1`、`planItemCount=0`,`visiblePlanBlockCount=0`、`visiblePlanDecisionCount=0`、`visibleUpdatePlanToolRowCount=0`,Electron/preload/IPC/App Server/read model/GUI identity 一致,invoke/page/console error 均为 0。

治理分类:typed `turn.plan.updated` producer/parser、canonical `update_plan` recovery 与 run-control checklist 为 current;无 compat;`update_plan` 场景下的 Plan ThreadItem、Message/tool card checklist synthesis、Plan UI/decision panel/tool card 和 renderer mock fallback 为 dead/deleted/forbidden-to-restore;独立 Plan mode 的现役 UI 不在本切片范围内。

架构确认:本切片没有改变 public owner、唯一产品链或依赖方向,无需改写 `internal/aiprompts/architecture.md`。责任开发者确认:root,2026-07-31。

OPEN_REF:下一刀回到 EVENT-PROJECTIONS.md,审计下一项具备真实 producer/consumer 的 planned notification、host capability 或 recovery;guardianWarning 在 Guardian runtime producer 落地前保持 planned。v2 总体完成度保守估算约 94%,仍非 release-ready。

9.75 V2-05 MCP OAuth typed completion notification closure

状态:completed(2026-07-31);只关闭 mcpServer/oauthLogin/completed 垂直切片,V2-05 与 v2 总体仍为 in-progress,不是 release-ready。

主目标:把 MCP OAuth callback completion 从旧 Desktop event 收敛到 App Server v2 typed notification,使成功/失败、Renderer 自动刷新与 GUI 可见状态走唯一产品链;不保留 mcp:oauth_completed compat、不新增第二 OAuth 状态 owner或生产 mock fallback。

本轮窄写集:lime-mcp OAuth completion handle;App Server MCP notification producer;app-server-protocol v2 notification/schema/generated client;app-server-client strict decoder;Renderer useMcp typed event subscription 与回归;MCP OAuth 专用 Electron fixture;contract guard;MCP/V2 文档与本执行计划。保留共享工作树其他 V2-05 notification、host capability、recovery 与版本改动,不做无关重写。

退出条件:callback success/failure 都产生 mcpServer/oauthLogin/completed;name 非空、threadId 必填可空、success 必填、error 可选可空且 decoder fail closed;Renderer 在任何 await 前同步订阅 typed event bus,完成后自动刷新 server/tool;生产路径无 mcp:oauth_completed;Rust/TS/contracts/governance/scripts 通过;真实 Electron Gate B 证明 preload/IPC、app_server_handle_json_lines、App Server event drain、OAuth callback、GUI 授权状态/toast 与零 mock fallback。

实现事实:lime-mcp 返回 McpOAuthLoginHandle completion future,不再发 legacy OAuth event。App Server 等待 handle 后把 success/error 投影为 ServerNotification::McpServerOauthLoginCompleted;protocol、schema、generated TypeScript 与 app-server-client strict decoder 使用同一 payload。Renderer setupMcpEventListeners 在串行 Desktop safeListen 前同步注册 App Server notification,避免快速 callback 竞态;成功/失败都刷新 mcpServerStatus/list 与 mcpTool/list,成功显示 completion toast,失败显示 typed error。

验证:lime-mcp OAuth 22 passed、app-server-protocol v2 59 passed、App Server MCP processor 4 passed、app-server-client 101 passed、useMcp 9 passed。npm run test:contracts 通过,包含 847 schema definitions、839 generated protocol types、0 generation failures、292 app-server-client checks,以及 command/scripts/docs/legacy guards。

Gate B:npm run smoke:mcp-oauth-notification-electron-fixture 通过,proofLevel=Gate B、ok=true。真实 Electron/preload/IPC、app_server_handle_json_lines、App Server OAuth login/event drain、本地 provider redirect/callback/token exchange 与 Renderer GUI 全部命中;oauthRequiredVisible=true、oauthAuthorizedVisible=true、completionToastVisible=true,authorizeRequestCount=1、tokenRequestCount=1、scope=fixture.read,appServerHandleJsonLinesHitCount=3、appServerDrainEventsHitCount=4、openExternalUrlHitCount=1、electronIpcHitCount=8、mockFallbackHitCount=0、failedInvokeCount=0,console/page/invoke errors 为 0。自动刷新 methods 为 mcpServer/oauth/login、mcpServerStatus/list、mcpTool/list。证据:.lime/qc/mcp-oauth-notification/mcp-oauth-notification-fixture-summary.json 与同目录 PNG。

架构确认:本切片没有改变 public owner、唯一产品链或依赖方向,只把既有 OAuth completion 从 legacy Desktop event 迁到 App Server v2 typed notification,并补齐 Renderer/Gate B;无需改写 internal/aiprompts/architecture.md。责任开发者确认:root,2026-07-31。

治理分类:typed protocol/schema、App Server completion producer、strict client decoder、Renderer typed event bus、自动刷新与专用 Gate B 为 current;无 compat;mcp:oauth_completed 为 dead/deleted/forbidden-to-restore。

OPEN_REF:下一刀回到 EVENT-PROJECTIONS.md,继续审计具备真实 producer/consumer 的 planned notification、host capability 或 recovery;guardianWarning 在 Guardian runtime producer 落地前保持 planned。v2 总体完成度保守估算约 95%,仍非 release-ready。

9.76 V2-05 MCP startup status typed notification closure

状态:completed(2026-07-31);只关闭 mcpServer/startupStatus/updated 垂直切片,V2-05 与 v2 总体仍为 in-progress,不是 release-ready。

主目标:把 MCP server startup lifecycle 从旧 Desktop events 收敛到 App Server v2 typed notification,使 starting/ready/failed、Renderer 连接态、终态自动刷新与失败可见错误走唯一产品链;不保留 mcp:server_started/stopped/error compat,不新增第二 MCP 状态 owner或生产 mock fallback。

本轮窄写集:lime-mcp lifecycle legacy event 删除;App Server mcpServer/start notification producer;app-server-protocol v2 notification/schema/generated client;app-server-client strict decoder;Renderer useMcp typed event subscription 与回归;MCP startup 专用 Electron fixture;共享 MCP fixture delay;contract guard;MCP/V2 文档与本执行计划。保留共享工作树其他 V2-05 notification、host capability、recovery 与版本改动,不做无关重写。

退出条件:mcpServer/start 在 runtime 调用前发 starting,成功发 ready,失败发 failed 后保留原 JSON-RPC error;threadId/error/failureReason 必填可空、name 必填非空、status 为 starting|ready|failed|cancelled,decoder 对缺字段和未知字段 fail closed;Renderer 同步订阅 typed event bus,starting 投影连接态,终态自动刷新 status/tools,failed 显示 typed error;生产路径无 mcp:server_started/stopped/error;Rust/TS/contracts/governance/scripts 通过;真实 Electron Gate B 证明 preload/IPC、app_server_handle_json_lines、App Server event drain、runtime MCP server、GUI 状态与零 mock fallback。

实现事实:App Server processor 在 mcpServer/start 边界发布 ServerNotification::McpServerStatusUpdated;protocol、schema、generated TypeScript 与 app-server-client strict decoder 使用同一五字段 payload。Renderer setupMcpEventListeners 在串行 Desktop safeListen 前同步注册 App Server notification;starting 更新 connection phase,ready/cancelled/failed 复位 phase 并刷新 mcpServerStatus/list 与 mcpTool/list,failed 同步 server error 与 global error。lime-mcp 删除旧 start/stop/error payload、emitter 与生命周期调用;资源和工具更新事件保持 current。

验证:lime-mcp 151/151、App Server protocol MCP 6/6、App Server MCP processor 6/6、useMcp 10/10、app-server-client 102/102、MCP workspace fixture 3/3。npm run test:contracts 通过,包含 850 schema definitions、842 generated protocol types、0 generation failures、292 app-server-client checks,以及 command/scripts/docs guards;npm run test:rust:related、npm run governance:legacy-report、npm run governance:scripts 与 npm run verify:gui-smoke 均通过。

Gate B:npm run smoke:mcp-startup-notification-electron-fixture 通过,proofLevel=Gate B、ok=true。真实 Electron/preload/IPC、app_server_handle_json_lines、App Server event drain、runtime stdio MCP server 与 Renderer Settings GUI 全部命中;startingVisible、readyVisible、failedVisible 均为 true,通知序列分别为 starting->ready 与 starting->failed,自动刷新 methods 为 mcpServerStatus/list、mcpTool/list。appServerHandleJsonLinesHitCount=4、appServerDrainEventsHitCount=7、electronIpcHitCount=11、mockFallbackHitCount=0、failedInvokeCount=0,legacy MCP commands 与 console/page/invoke errors 为 0。证据:.lime/qc/mcp-startup-notification/mcp-startup-notification-fixture-summary.json 与同目录 PNG。

架构确认:本切片没有改变 public owner、唯一产品链或依赖方向,只把既有 MCP startup lifecycle 从 legacy Desktop events 迁到 App Server v2 typed notification,并补齐 Renderer/Gate B;无需改写 internal/aiprompts/architecture.md。责任开发者确认:root,2026-07-31。

治理分类:typed protocol/schema、App Server startup producer、strict client decoder、Renderer typed event bus、GUI 连接态与专用 Gate B 为 current;无 compat;mcp:server_started、mcp:server_stopped、mcp:server_error 为 dead/deleted/forbidden-to-restore。

OPEN_REF:下一刀回到 EVENT-PROJECTIONS.md,继续审计具备真实 producer/consumer 的 planned notification、host capability 或 recovery;guardianWarning 在 Guardian runtime producer 落地前保持 planned。v2 总体完成度保守估算约 96%,仍非 release-ready。

9.77 V2-05 unknown Item fail-visible Gate B closure

状态:completed(2026-07-31);unknown canonical Item 的真实 Electron fail-visible 与恢复证据已关闭;不改变 Codex 72 notification 裁决,也不新增 unknown Item 业务 fallback。V2-05 与 v2 总体仍为 in-progress / 非 release-ready。

主目标:通过受控 external backend 产生一个未来 Item type,使真实 Electron/preload/IPC、app_server_handle_json_lines、App Server runtime/read model 与 direct TurnTimeline 使用同一 thread/turn/item identity;GUI 只显示 upstream type 与脱敏字段名,禁止显示原始字段值、secret、raw payload 或 unknown_item 内部类型名。

实现事实:App Server canonical owner 新增 typed Unknown payload,只保留 upstream type 与排序、限量、敏感名脱敏后的字段名;raw values、metadata 与 Extension escape hatch 均不得承接未知协议数据。v2 ThreadItem、thread/read 与 Agent read model 使用同一 typed identity。Renderer 终态刷新此前只更新 threadRead、没有把 canonical thread_items 合入 direct timeline,导致 live Unknown 在完成后消失;现由 applyReadModelSnapshot 合并 read-model items 到 threadItems,完成态历史摘要持续显示同一安全诊断。

测试与守卫:定向 Vitest 66/66,unknown fixture/合并/UI 回归 23/23;typecheck、test:contracts、governance:scripts、governance:legacy-report 与 git diff --check 通过。npm run smoke:agent-runtime-current-fixture 聚合门禁完整通过且 liveProviderUsed=false;npm run verify:gui-smoke 21/21 assertions 通过,证据为 .lime/qc/project-gates/standalone-shell-01-20260731194839-48452/shell-01-electron-smoke/summary.json。npm run test:rust:related 按协议反向依赖扩圈并以退出码 0 完成,关键结果包括 agent-protocol 41/41、app-server 1659/1659、app-server-protocol 99/99、lime-mcp 151/151。

Gate B:npm run smoke:unknown-item-recovery-electron-fixture 通过,proofLevel=Gate B controlled fixture、ok=true。真实 Electron/preload/IPC、app_server_handle_json_lines、App Server external runtime/read model 与 direct TurnTimeline 使用同一 thread/turn/item identity;item.started -> item.completed -> turn.completed 稳定。GUI 仅有 1 个 Unknown,futureCapability 与 [redacted]/label/opaquePayload/status 可见,raw values、secret 与 unknown_item 内部名不可见;thread/read 恢复同一 completed Item,console/page/invoke errors 与生产 mock fallback 均为 0。证据:.lime/qc/gui-evidence/claw-chat-current-fixture/claw-chat-current-fixture-unknown-item-regression-summary.json。

架构确认:本切片没有改变唯一产品链、public owner 或依赖方向,只补齐既有 canonical Item -> v2 read model -> direct TurnTimeline 的 typed 安全投影和终态恢复;无需改写 internal/aiprompts/architecture.md。责任开发者确认:root,2026-07-31。

治理分类:typed Unknown protocol/canonical payload、App Server materializer/read model、Renderer terminal merge、GUI fail-visible 与专项 Gate B 为 current;无 compat;unknown Item null drop、raw payload/metadata 透传、Extension fallback 与生产 mock fallback 为 dead / deleted / forbidden-to-restore。

OPEN_REF:下一刀回到 EVENT-PROJECTIONS.md,继续审计具备真实 producer/consumer 的 planned notification、host capability 或 recovery;guardianWarning 在 Guardian runtime producer 落地前保持 planned。v2 总体完成度保守估算约 97%,仍非 release-ready。

9.78 V2-05 product-scope-excluded notification classification

状态:completed(2026-07-31);本刀只收口三项 upstream notification 的产品范围裁决,不把 exclusion 误报为 current 实现。V2-05 与 v2 总体仍为 in-progress / 非 release-ready。

主目标:将 Codex `turn/diff/updated`、`process/outputDelta`、`process/exited` 从 Lime planned notification surface 移出。Codex turn diff payload 是整段 raw unified diff,而 Lime current 事实源是 canonical structured FileChange;Codex process 通知属于标记为 experimental 的 standalone `process/spawn`,且在 app server host 上无 Codex sandbox。Lime 当前没有该 upstream notification 的产品 producer/consumer,不能新增 Renderer 面板、protocol facade、compat wrapper 或生产 mock 来制造支持;未来若 standalone process 成为产品需求,必须重新建立独立 typed owner,不得复用本次 excluded 事件。

实现事实:EVENT-PROJECTIONS 与 render projection coverage 将三项标为 `product-scope-excluded`,仅保留 `diagnostics` outlet;`isAppServerV2NotificationMethod` 不接入三项,notification drift recorder 仍识别 upstream method 但只记录方法、路径和脱敏 field names,`projectAppServerNotificationDriftPayload` 不生成用户级 warning。canonical FileChange / `item/fileChange/patchUpdated` 继续是 Lime diff owner,`item/commandExecution/*` 与既有 execution-process 内部投影继续承接产品命令生命周期。

守卫与验证:coverage boundary 断言三项仅 diagnostics 且不在 current projector;drift test 断言 raw diff、process output、process exit 不生成 Renderer payload,且不保留原始值。同步更新 V2 分类表、coverage fixture 与本执行计划;不改 Codex upstream inventory、schema hash、Lime manifest 或 v1 method count。

治理分类:canonical FileChange 与 item/commandExecution lifecycle 为 `current`;无 `compat`;三项 upstream notification 为 `product-scope-excluded`;raw unified diff renderer、standalone process panel、process notification facade 与生产 mock fallback 为 `dead / deleted / forbidden-to-restore`。本刀没有改变唯一产品链、public owner 或依赖方向,无需改写 `internal/aiprompts/architecture.md`。责任开发者确认:root,2026-07-31。

OPEN_REF:继续审计 EVENT-PROJECTIONS 中仍有真实 producer/consumer 的 planned notification、host capability 或 recovery;`guardianWarning` 在 Guardian runtime producer 落地前保持 planned。三项 excluded surface 不再作为 planned 实现目标,v2 总体完成度保守估算约 97%,仍非 release-ready。

9.79 V2-05 remaining planned notification producer audit

状态:审计完成(2026-07-31);本轮没有把缺少真实 producer/consumer 的通知错误升格为 current,也没有新增协议或 compat。V2-05 与 v2 总体仍为 in-progress / 非 release-ready。

审计范围:`app/list/updated`、`thread/environment/connected`、`thread/environment/disconnected`、`fs/changed`、`fuzzyFileSearch/sessionUpdated`、`fuzzyFileSearch/sessionCompleted`、`guardianWarning`、`thread/realtime/*`、`windows/worldWritableWarning`、`windowsSandbox/setupCompleted` 与 `hook/started` / `hook/completed`。

事实:这些 method 在 Lime current 代码中没有 App Server typed producer、manifest contract、Renderer consumer 和 Gate B 证据;工作树中唯一相近的 Hook producer 是 `workflow.hook.started/completed`,由插件宿主追加到 `workflow-events.jsonl` 的 audit-only 旁路,不进入普通 runtime event stream、worker evidence 或 Article Workspace。Realtime projection 仅提供 `not_current` 安全守卫,明确要求 current owner 后才能进 Thread/Turn/Item;当前没有该 owner。其余通知只有 upstream drift recorder 诊断命中。

治理裁决:上述仍属于 Lime 产品候选的通知继续保持 `planned`,因为 Apps、environment、filesystem/search、Guardian、Realtime、Windows sandbox 与 Hook 仍需独立产品 owner 决策;当前没有 `compat`。`workflow.hook.*` audit-only 事件、realtime guard-only projection 与 drift recorder 为诊断/旁路,不得冒充 Codex notification current 实现;没有证据支持将它们标为 current 或恢复第二事件流。

验证:`node --test packages/agent-runtime-projection/tests/realtimeConversationItem.test.mjs` 4/4;`rg` producer/consumer 盘点确认除 drift recorder 外无匹配 current producer;前一刀的 boundary/drift 8/8、contracts、governance report 与 typecheck 均通过。未运行 Electron Gate B,因为当前没有可执行 producer/consumer 垂直链;这不是测试失败,而是本轮明确记录的 blocker。

OPEN_REF:下一刀只从上述 planned 集合中选择能同时提供 typed producer、真实 consumer、持久化/恢复语义与风险匹配 Gate B 的垂直切片;在 owner 出现前,不扩展 protocol、Renderer 或 fixture。v2 总体完成度保守估算仍为 97%,仍非 release-ready。

9.80 V2-05 unified exec terminal interaction closure

状态:completed(2026-08-01);本刀只关闭 unified exec `write_stdin` 的 canonical lifecycle、typed notification、cold read 与真实 GUI recovery,V2-05 与 v2 总体仍为 in-progress / 非 release-ready。

主目标:让 `write_stdin` 归属其原始 `exec_command` Command Item,不创建第二个工具项;只暴露脱敏摘要 `sent N chars`,通过 App Server typed `item/commandExecution/terminalInteraction`、canonical `terminalInteractions` 和 GUI timeline 以同一 thread/turn/item identity 显示,reload 后仍可从 canonical read 恢复。禁止写入原始 stdin、恢复 retired shell tool 或生产 mock fallback。

实现事实:tool-runtime 将 terminal interaction 绑定原始 exec call identity;agent lifecycle emitter 忽略 `write_stdin` 的 Started 事件并在终态后释放绑定;App Server 只投影 active Command Item 的 typed interaction,并把脱敏数据写入 canonical CommandExecution metadata。Renderer live timeline 与 historical direct timeline 都消费同一 `terminalInteractions` 字段。Electron fixture 在导入续聊前走 current `thread/resume` 建立 thread subscription,再经真实 `app_server_drain_events` 等待 typed notification;这修正了 fixture 仅读取同步 JSON-RPC response、遗漏后台通知的观察缺口,不改变生产协议。

验证:tool-runtime 定向回归覆盖跨 thread `write_stdin` 归属与原 `exec_command` 完成;Renderer 定向测试 7 files / 159 tests、`npm run build:renderer:electron` 与 fixture guard 6/6 通过;`git diff --check` 通过。`npm run smoke:codex-import-continuation-electron-fixture -- --timeout-ms 240000` 通过:本地 provider 共 6 次请求,导入和普通会话的 completed Command Item 同构,分别保存 `sent 9 chars`,导入侧 terminal interaction typed notification count=1;普通会话实时 GUI 与 reload GUI 均显示摘要、隐藏原始 stdin、各有一个 completed command row,console errors 为 0。通用 `npm run verify:gui-smoke` 也以退出码 0 通过,真实 Electron renderer、App Server sidecar、Claw shell reload 与 memory settings 均就绪;证据为 `.lime/qc/project-gates/standalone-shell-01-20260801154238-47878/shell-01-electron-smoke/summary.json`。

Gate B:证据 `.lime/qc/gui-evidence/codex-import-continuation-fixture/codex-import-continuation-fixture-summary.json` 为 `ok=true`。真实 Electron/preload/IPC、`app_server_handle_json_lines`、`app_server_drain_events`、App Server runtime/read model 和 GUI 都已命中;`rendererTurnStart.transport=electron-ipc`,`commandShapesIsomorphic=true`,导入与普通会话使用独立 canonical identity,生产 mock fallback 为零。

架构确认:本切片未改变唯一产品链、public owner 或依赖方向;只补齐既有 `tool-runtime -> agent -> App Server -> Thread/Turn/Item -> GUI` 的 lifecycle 投影、冷恢复与 Gate B 观察,故无需修改 `internal/aiprompts/architecture.md`。责任开发者确认:root,2026-08-01。

治理分类:unified exec、canonical CommandExecution `terminalInteractions`、typed terminal interaction notification、Renderer live/historical projection 与 Electron Gate B fixture 为 current;无 compat;原始 stdin、独立 write_stdin Tool Item、retired Bash/PowerShell tools 与生产 mock fallback 为 dead / forbidden-to-restore。

OPEN_REF:继续审计 EVENT-PROJECTIONS 中有完整 producer/consumer 的 notification/recovery 链;不能因本刀 fixture 通过而把无 producer 的 planned surface 升格为 current。v2 总体完成度保守估算仍为 97%,仍非 release-ready。

9.81 V2-05 remaining planned producer/consumer audit

状态:审计完成(2026-08-02);本轮没有发现可安全升格为 current 的 planned notification,也没有新增 protocol facade、compat 或生产 mock。V2-05 与 v2 总体仍为 in-progress / 非 release-ready。

审计范围:`item/autoApprovalReview/started`、`item/autoApprovalReview/completed`、`app/list/updated`、`thread/environment/connected`、`thread/environment/disconnected`、`fs/changed`、`fuzzyFileSearch/sessionUpdated`、`fuzzyFileSearch/sessionCompleted`、`guardianWarning`、`thread/realtime/*`、`windows/worldWritableWarning`、`windowsSandbox/setupCompleted` 与 `hook/started` / `hook/completed`。

事实:当前代码中这些 Codex method 仍没有同时具备 App Server typed producer、current manifest/schema contract、Renderer consumer、canonical persistence/recovery 与风险匹配 Gate B。Guardian 现有能力是 `thread/approveGuardianDeniedAction` 与 evidence/projection 读写,不是 `item/autoApprovalReview/*` producer;插件侧 `workflow.hook.started/completed` 只是 `workflow-events.jsonl` audit-only 旁路,不进入普通 runtime event stream、worker evidence 或 Article Workspace。Realtime 只有 `packages/agent-runtime-projection` 的 `not_current` guard,明确禁止把 transcript/audio/raw payload 接入 Thread/Turn/Item;Apps、environment、filesystem/search 与 Windows sandbox 只有 drift recorder 或静态 UI 资料,没有 current App Server producer。

治理裁决:上述仍属于 Lime 产品候选的通知继续保持 `planned`;无 `compat`。`workflow.hook.*` audit-only、Guardian denied-action/evidence、realtime guard-only projection、旧 scene/app catalog 与 notification drift recorder 都不能冒充 Codex notification current owner,也不能恢复第二事件流、第二 catalog 或 renderer mock fallback。

验证:`rg` producer/consumer/owner 盘点确认除 drift recorder、guard-only projection、插件 audit-only hook 与 Guardian denied-action/evidence 外无匹配 current producer;现有 `packages/agent-runtime-projection/tests/realtimeConversationItem.test.mjs` 4/4 继续通过。未运行 Electron Gate B,因为本轮没有可执行的 typed producer/consumer 垂直链;这是明确的 owner blocker,不是测试失败。

下一刀:只有当某一 planned 项同时提供唯一 current owner、typed producer、真实 consumer、持久化/恢复语义与 Gate B 场景时才继续实现;在此之前保持 fail closed,v2 总体完成度保守估算仍为 97%,仍非 release-ready。

10. 完成定义

v2 实施不能因为“几个进程都有改动”而标记完成。每个 slice 必须同时具备:

  1. 唯一 owner 和不相交写集。
  2. copy/adapt/delete 记录和上游 provenance。
  3. positive/negative tests、协议/fixture 同步。
  4. 正常、失败、中断、队列、stale event、resume/pagination 中与 slice 相关的证据。
  5. handoff 已发布、锁已释放、下一 owner 已明确。

最终完成由 coordinator 统一执行 npm run verify:local、相关 GUI Gate B 和治理扫描,并在 internal/research/refactor/v2/13-evidence/ 写入不可变 evidence。