AIDAWORK / SEQUENCE

Local Executor 本机委派

独立图页 ↗
机制说明(SoT)图是辅读 · 结论以说明与证据为准

ExecutionHostRouter 决定工具交给哪个执行宿主。本机宿主完成能力调用并交回结果,Agent 继续组织后续执行。应沿请求和回执两条方向阅读,不能把本机能力调用理解成另一个企业 Agent loop。

本页可直接往下读完整机制说明,不需要「演示 / 播放故事」。术语不熟先看 术语表。

先读机制说明,结论以说明与证据为准 · 基于固定代码版本核验 · 部署状态另行确认

机制说明(全文)

Local Executor 本机委派

工具跨到本机后怎样返回

ExecutionHostRouter 决定工具交给哪个执行宿主。本机宿主完成能力调用并交回结果,Agent 继续组织后续执行。应沿请求和回执两条方向阅读,不能把本机能力调用理解成另一个企业 Agent loop。

Local File 架构族仍称 V4;独立的 Local File 协议版本与 local-files-v5 capability 已随 Desktop 协议 v3 删除,V4 就绪只看 localFileCapability。request/receipt 账本位于 Agent,Desktop Main 负责一次本机执行与对话级附件组装。绝对路径不出 Main,wire 使用 relativePath / attachmentId 等 path-free 字段。LE primitives 与普通文件 Local File 路径需要分开,Server session 与 Desktop session 的配对也是恢复时的边界条件。

本机原语收敛到 Skill 与 Local File(Desktop 协议 v3,钉点 Agent e2adc9a3c325 / Desktop 8eecd12081db)

Agent ADR-0090 D1 与 Desktop ADR-0087 D1/D2 把 Agent 下发给 Desktop 的工具收敛为:readSkillFile、runSkillScript(官方 Skill 另有 runOfficialSkillScript)、Skill 管理四件套(list_skills / inspect_skill / prepare_skill_change / apply_skill_change)与 Local File V4 工具。readFile / writeFile / listDirectory / runBundledScript 从 SERVER_SUPPORTED_LOCAL_PRIMITIVE_SET 与 DESKTOP_LOCAL_EXECUTOR_PRIMITIVES 删除,durable 本机读工具只剩 readSkillFile;Desktop 侧同时删掉 shell / visionExtract 等从未由 Agent 下发的分支和 Full access / Trusted host User Skill 运行时。runSkillScript 是唯一脚本入口,入口 ABI 为 aida-json-file-v1 或 aida-argv-v1(Desktop ADR-0086),platforms 加入 linux。Desktop 删除面依据 ADR 与提交说明,未逐文件核对;Desktop Electron / E2E 未运行。

  • aida-agent · packages/agent/src/gateway/local-executor-schemas.ts L39–43 · SERVER_SUPPORTED_LOCAL_PRIMITIVE_SET · e2adc9a3c325
  • aida-agent · packages/tool-client/src/types/desktop-tools.ts L34–55 · DESKTOP_LOCAL_EXECUTOR_PRIMITIVES · e2adc9a3c325
  • aida-agent · packages/agent/src/shared/durable-local-execution.ts L37–39 · DURABLE_LOCAL_READ_TOOL_NAMES · e2adc9a3c325
  • aida-agent · docs/adr/0090-desktop-protocol-v3-and-retired-local-primitives.md L17–19 · readSkillFile · e2adc9a3c325
  • aida-desktop · docs/adr/0087-local-capability-convergence-and-protocol-v3.md L22–28 · runSkillScript · 4346d79eb364

交付端口移出门面(钉点 8eecd12081db)

Skills「另存为」的交付操作不再是 LocalExecutionGateway(钉点 Desktop 8eecd12081db 由 LocalExecutorService 改名,文件 local-executor-service.ts → local-execution-gateway.ts)的公开方法,而是收进一个只读的 deliveries 端口,只给 Main 启动恢复和 aida-local-executor:* IPC 用。行为不变,只是收窄了谁能调用。另:Desktop 的 AgentLoopHost 早在 91a25b75(2026-10-10,上一钉点之前)就已删除;本窗口只是让关停测试断言不再出现 agent-loop 关停项。

Skill 脚本:可准备 ≠ 可信,旧 root 效应冻结(钉点 Agent e2adc9a3c325 / Desktop 8eecd12081db)

  • canPrepareSkillScriptEntry:条目 ready,或原因是 execution_untrusted / dependency_preparation_required / runtime_unavailable 时,允许走到 Main 的准备检查并返回绑定的前置回执——不授予信任、不启动进程。用户答复后原 Work 可就同一已准入版本与输入范围重新准备,Main 重新核对信任、运行时、依赖和审批。Agent 与 Desktop(生成的合同副本)用同一函数(28a6ec920 / 9fdc200c)。
  • 旧 root 效应冻结:已有 C0 命令原样保留受理时的效应和摘要,答复或 Main 就绪刷新都不能给旧 root 加 execute_script;纠错沿用前驱的效应族与重试栅栏。
  • 证据:aida-agent · packages/tool-client/src/types/skill-script.ts L431–437 · canPrepareSkillScriptEntry · e2adc9a3c325;aida-agent · packages/agent/src/runtime/README.md L97–106 · execution_untrusted · e2adc9a3c325;aida-desktop · apps/desktop/electron/local-executor/local-skill-catalog.ts L50–57 · canPrepareSkillScriptEntry · 4346d79eb364;aida-agent · packages/agent/src/runtime/work/run-work-effects.ts L4–32 · Existing C0 commands · e2adc9a3c325;aida-agent · packages/agent/src/runtime/README.md L108–118 · Existing C0 commands · e2adc9a3c325

Runtime Work 挂起拉取、二次复核与产物执行证明(deliverRuntimeWorkSkill)

当 Work 在 Agent 侧挂起(work.status === 'suspended')等待本机 Skill、管理原语或 Plugin 工具时,Desktop Main 通过 deliverRuntimeWorkSkill 拉取并投递,不引入第二套模型循环或租约状态机:

  1. 绑定强校验:调用 queryPendingLocalReadRequest 获取待办请求后,严格核对 workBinding 的 rootRunId、carrierRunId、invocationId、skillExecutionPolicy、workStepRef(^model:[0-9]+:tool:0$)与 effectRef。
  2. Plugin 派发前二次复核(assertDispatchAllowed):在本地确认后、真正交由 pluginRouter.settle 执行前,Main 再次检查 expiresAt 未到期并重调 queryPendingLocalReadRequest,比对 canonicalJson(fresh.request.pluginToolCall) 与 workBinding 完全未变,且重新验证 assertPluginSkillSource。
  3. 本机产物执行证明(executionProof):脚本生成的本地产物写入 ArtifactRegistry(LocalArtifactRecord),其中 executionProof(processTreeStopped: true、outputsValidated: true、observedAtMs)仅在整个进程树停止、输出校验通过且产物完成注册后由原执行器写入,作为原 O1 执行成功的唯一本机证据。

配对父子任务锁序与续接(Paired Parent / Child Continuation)

当父 Run 将子 Agent 作为工具调用(Agent-as-Tool)并涉及本机文件或工具挂起时,父子状态迁移遵守严格锁序与所有权证明(paired-child-continuation.ts):

  1. 防死锁固定锁序(lockPairedRunsInTx):任何跨父子 Run 的状态或等待行迁移,必须在同一事务中先 SELECT ... FOR UPDATE 锁原 Parent 行,再锁 Child 行,然后才触碰任何 wait 或 effect 行。
  2. 持久化所有权白名单(parsePairedChildOwnerMetadata):仅允许固定的 8 个字段(parentRunId、childRunId、parentInvocationId、childInvocationId、childAgentId、childAgentVersion、capabilityId、executorRef)落库,且严禁把瞬态租约 token(parentRunLeaseToken / childRunLeaseToken)写入持久化 owner 元数据。
  3. 透明转发幂等键(transparentForwardKey):Child 恢复并产出结果后(ResumedChildRunResult),通过稳定的 insert-once transparentForwardKey 向 Parent 转发,防止重复唤醒或重复注入工具结果。

本机工作台三轮实况与 Transcript 投影安全门禁(local-workbench-transcript)

以 local_workbench.spreadsheet_ops 的典型三轮执行为例(见视图 workbench-multiround-trace):

  1. Round 0(readSkillFile)→ Round 1(runSkillScript):模型首轮调用 readSkillFile 挂起并由 Desktop Main 回传 SKILL.md 内容,经 resumeOriginalToolRound 零重调复跑后进入 Round 1 调用 runSkillScript;Desktop 执行完脚本且进程树完全退出后写入 ArtifactRegistry.executionProof 并回传 artifactCount。
  2. Round 2 投影安全门禁(safeProjectionText / LOCAL_WORKBENCH_TRANSCRIPT_UNSAFE_PROJECTION):在捕获模型响应或提交轮次 Transcript 时,local-workbench-transcript.ts 扫描凭证模式(credential)、原始异常栈(raw_exception)以及结构化值中的本机绝对/相对路径(fixed_local_path / relative_local_path)。一旦命中立即抛 LocalWorkbenchTranscriptError('LOCAL_WORKBENCH_TRANSCRIPT_UNSAFE_PROJECTION')(fail-closed)。
  3. 脱敏审计与诊断(reportProjectionRejection):WorkbenchWorkExecution 捕获该错误后,仅将代码自有枚举(ruleId、fixedPathMatchKind、relativePathMatchKind、partType 与位置索引)写入 workbench_assistant_projection_rejected / workbench_transcript_projection_rejected 审计事件,绝不把被拒文本、路径或原始结果写入审计日志。

Desktop 本机效应单次执行栅栏与崩溃补证(LocalEffectContinuationStore)

对于非幂等本机效应(runSkillScript、apply_skill_change,由 classifyLocalExecutorContinuation 标为 replaySafe: false),Desktop Main 通过 LocalEffectContinuationStore 保证至多执行一次、回执至少上送一次、崩溃绝不盲目重跑(见视图 local-effect-barrier):

  1. 三阶段持久化栅栏(executing → receipt_pending → settled):调用前 begin 以 identityScopeHash + recordId 原子落盘 executing(重复调用返回 duplicate);子进程启动前经 claimOriginalSkillDispatch 将 skillDispatch 从 unissued 推进到 issued(至多一次);执行完成后 stageReceipt 写入 receipt_pending 与 write-once executionProof,服务端确认后 acknowledge 推进到 settled。
  2. 崩溃恢复不自动重跑(load):Desktop 重启恢复时,任何遗留在 phase === 'executing' 的记录都会被立即转换为 phase: 'receipt_pending' 且结果为 outcome_unknown(「原脚本终结状态未确认,不能自动重跑。」),同时把未签发的 skillDispatch 置为 closed。
  3. 原执行器晚到完成补证(recordOriginalSkillCompletion → freezeSupplement → acknowledgeSupplement):若恢复已生成 outcome_unknown,但原执行器随后完成并观察到 processTreeStopped: true 与 outputsValidated: true,则写入 write-once executionProof,并冻结补证摘要(freezeSupplement)上送服务端 recordRuntimeWorkSupplementaryConclusion,确认后 acknowledgeSupplement 闭环。

证据与范围

  • aida-agent · packages/agent/src/execution-host/router.ts L50–80 · ExecutionHostRouter · e2adc9a3c325
  • aida-agent · docs/architecture/lifecycle-map.md L42–98 · e2adc9a3c325(历史引用:该文件在上一钉点与当前钉点均不存在,未能复核;见 ATLAS-DEBT)
  • aida-desktop · CONTEXT.md L1388–1418 · Dual session identity · 4346d79eb364(历史引用:该文件在上一钉点与当前钉点均不存在,未能复核;见 ATLAS-DEBT)
  • aida-desktop · apps/desktop/shared/generated/protocol-version.ts L1–8 · DESKTOP_PROTOCOL_VERSION · 4346d79eb364

结论来自固定版本的静态源码与合同阅读;实现存在、默认开关和生产启用分别判断。本站代码证据面板列出声明状态与具体限制。

  • aida-desktop · apps/desktop/electron/local-executor/local-execution-gateway.ts L197–209 · readonly deliveries · 4346d79eb364
  • aida-desktop · apps/desktop/electron/lifecycle/main-shutdown-coordinator.ts L96–113 · coreScope.register('local-executor' · 4346d79eb364

机制说明

Local Executor 本机委派

工具跨到本机后怎样返回

ExecutionHostRouter 决定工具交给哪个执行宿主。本机宿主完成能力调用并交回结果,Agent 继续组织后续执行。应沿请求和回执两条方向阅读,不能把本机能力调用理解成另一个企业 Agent loop。

Local File 架构族仍称 V4;独立的 Local File 协议版本与 local-files-v5 capability 已随 Desktop 协议 v3 删除,V4 就绪只看 localFileCapability。request/receipt 账本位于 Agent,Desktop Main 负责一次本机执行与对话级附件组装。绝对路径不出 Main,wire 使用 relativePath / attachmentId 等 path-free 字段。LE primitives 与普通文件 Local File 路径需要分开,Server session 与 Desktop session 的配对也是恢复时的边界条件。

本机原语收敛到 Skill 与 Local File(Desktop 协议 v3,钉点 Agent e2adc9a3c325 / Desktop 8eecd12081db)

Agent ADR-0090 D1 与 Desktop ADR-0087 D1/D2 把 Agent 下发给 Desktop 的工具收敛为:readSkillFile、runSkillScript(官方 Skill 另有 runOfficialSkillScript)、Skill 管理四件套(list_skills / inspect_skill / prepare_skill_change / apply_skill_change)与 Local File V4 工具。readFile / writeFile / listDirectory / runBundledScript 从 SERVER_SUPPORTED_LOCAL_PRIMITIVE_SET 与 DESKTOP_LOCAL_EXECUTOR_PRIMITIVES 删除,durable 本机读工具只剩 readSkillFile;Desktop 侧同时删掉 shell / visionExtract 等从未由 Agent 下发的分支和 Full access / Trusted host User Skill 运行时。runSkillScript 是唯一脚本入口,入口 ABI 为 aida-json-file-v1 或 aida-argv-v1(Desktop ADR-0086),platforms 加入 linux。Desktop 删除面依据 ADR 与提交说明,未逐文件核对;Desktop Electron / E2E 未运行。

  • aida-agent · packages/agent/src/gateway/local-executor-schemas.ts L39–43 · SERVER_SUPPORTED_LOCAL_PRIMITIVE_SET · e2adc9a3c325
  • aida-agent · packages/tool-client/src/types/desktop-tools.ts L34–55 · DESKTOP_LOCAL_EXECUTOR_PRIMITIVES · e2adc9a3c325
  • aida-agent · packages/agent/src/shared/durable-local-execution.ts L37–39 · DURABLE_LOCAL_READ_TOOL_NAMES · e2adc9a3c325
  • aida-agent · docs/adr/0090-desktop-protocol-v3-and-retired-local-primitives.md L17–19 · readSkillFile · e2adc9a3c325
  • aida-desktop · docs/adr/0087-local-capability-convergence-and-protocol-v3.md L22–28 · runSkillScript · 4346d79eb364

交付端口移出门面(钉点 8eecd12081db)

Skills「另存为」的交付操作不再是 LocalExecutionGateway(钉点 Desktop 8eecd12081db 由 LocalExecutorService 改名,文件 local-executor-service.ts → local-execution-gateway.ts)的公开方法,而是收进一个只读的 deliveries 端口,只给 Main 启动恢复和 aida-local-executor:* IPC 用。行为不变,只是收窄了谁能调用。另:Desktop 的 AgentLoopHost 早在 91a25b75(2026-10-10,上一钉点之前)就已删除;本窗口只是让关停测试断言不再出现 agent-loop 关停项。

Skill 脚本:可准备 ≠ 可信,旧 root 效应冻结(钉点 Agent e2adc9a3c325 / Desktop 8eecd12081db)

  • canPrepareSkillScriptEntry:条目 ready,或原因是 execution_untrusted / dependency_preparation_required / runtime_unavailable 时,允许走到 Main 的准备检查并返回绑定的前置回执——不授予信任、不启动进程。用户答复后原 Work 可就同一已准入版本与输入范围重新准备,Main 重新核对信任、运行时、依赖和审批。Agent 与 Desktop(生成的合同副本)用同一函数(28a6ec920 / 9fdc200c)。
  • 旧 root 效应冻结:已有 C0 命令原样保留受理时的效应和摘要,答复或 Main 就绪刷新都不能给旧 root 加 execute_script;纠错沿用前驱的效应族与重试栅栏。
  • 证据:aida-agent · packages/tool-client/src/types/skill-script.ts L431–437 · canPrepareSkillScriptEntry · e2adc9a3c325;aida-agent · packages/agent/src/runtime/README.md L97–106 · execution_untrusted · e2adc9a3c325;aida-desktop · apps/desktop/electron/local-executor/local-skill-catalog.ts L50–57 · canPrepareSkillScriptEntry · 4346d79eb364;aida-agent · packages/agent/src/runtime/work/run-work-effects.ts L4–32 · Existing C0 commands · e2adc9a3c325;aida-agent · packages/agent/src/runtime/README.md L108–118 · Existing C0 commands · e2adc9a3c325

Runtime Work 挂起拉取、二次复核与产物执行证明(deliverRuntimeWorkSkill)

当 Work 在 Agent 侧挂起(work.status === 'suspended')等待本机 Skill、管理原语或 Plugin 工具时,Desktop Main 通过 deliverRuntimeWorkSkill 拉取并投递,不引入第二套模型循环或租约状态机:

  1. 绑定强校验:调用 queryPendingLocalReadRequest 获取待办请求后,严格核对 workBinding 的 rootRunId、carrierRunId、invocationId、skillExecutionPolicy、workStepRef(^model:[0-9]+:tool:0$)与 effectRef。
  2. Plugin 派发前二次复核(assertDispatchAllowed):在本地确认后、真正交由 pluginRouter.settle 执行前,Main 再次检查 expiresAt 未到期并重调 queryPendingLocalReadRequest,比对 canonicalJson(fresh.request.pluginToolCall) 与 workBinding 完全未变,且重新验证 assertPluginSkillSource。
  3. 本机产物执行证明(executionProof):脚本生成的本地产物写入 ArtifactRegistry(LocalArtifactRecord),其中 executionProof(processTreeStopped: true、outputsValidated: true、observedAtMs)仅在整个进程树停止、输出校验通过且产物完成注册后由原执行器写入,作为原 O1 执行成功的唯一本机证据。

配对父子任务锁序与续接(Paired Parent / Child Continuation)

当父 Run 将子 Agent 作为工具调用(Agent-as-Tool)并涉及本机文件或工具挂起时,父子状态迁移遵守严格锁序与所有权证明(paired-child-continuation.ts):

  1. 防死锁固定锁序(lockPairedRunsInTx):任何跨父子 Run 的状态或等待行迁移,必须在同一事务中先 SELECT ... FOR UPDATE 锁原 Parent 行,再锁 Child 行,然后才触碰任何 wait 或 effect 行。
  2. 持久化所有权白名单(parsePairedChildOwnerMetadata):仅允许固定的 8 个字段(parentRunId、childRunId、parentInvocationId、childInvocationId、childAgentId、childAgentVersion、capabilityId、executorRef)落库,且严禁把瞬态租约 token(parentRunLeaseToken / childRunLeaseToken)写入持久化 owner 元数据。
  3. 透明转发幂等键(transparentForwardKey):Child 恢复并产出结果后(ResumedChildRunResult),通过稳定的 insert-once transparentForwardKey 向 Parent 转发,防止重复唤醒或重复注入工具结果。

本机工作台三轮实况与 Transcript 投影安全门禁(local-workbench-transcript)

以 local_workbench.spreadsheet_ops 的典型三轮执行为例(见视图 workbench-multiround-trace):

  1. Round 0(readSkillFile)→ Round 1(runSkillScript):模型首轮调用 readSkillFile 挂起并由 Desktop Main 回传 SKILL.md 内容,经 resumeOriginalToolRound 零重调复跑后进入 Round 1 调用 runSkillScript;Desktop 执行完脚本且进程树完全退出后写入 ArtifactRegistry.executionProof 并回传 artifactCount。
  2. Round 2 投影安全门禁(safeProjectionText / LOCAL_WORKBENCH_TRANSCRIPT_UNSAFE_PROJECTION):在捕获模型响应或提交轮次 Transcript 时,local-workbench-transcript.ts 扫描凭证模式(credential)、原始异常栈(raw_exception)以及结构化值中的本机绝对/相对路径(fixed_local_path / relative_local_path)。一旦命中立即抛 LocalWorkbenchTranscriptError('LOCAL_WORKBENCH_TRANSCRIPT_UNSAFE_PROJECTION')(fail-closed)。
  3. 脱敏审计与诊断(reportProjectionRejection):WorkbenchWorkExecution 捕获该错误后,仅将代码自有枚举(ruleId、fixedPathMatchKind、relativePathMatchKind、partType 与位置索引)写入 workbench_assistant_projection_rejected / workbench_transcript_projection_rejected 审计事件,绝不把被拒文本、路径或原始结果写入审计日志。

Desktop 本机效应单次执行栅栏与崩溃补证(LocalEffectContinuationStore)

对于非幂等本机效应(runSkillScript、apply_skill_change,由 classifyLocalExecutorContinuation 标为 replaySafe: false),Desktop Main 通过 LocalEffectContinuationStore 保证至多执行一次、回执至少上送一次、崩溃绝不盲目重跑(见视图 local-effect-barrier):

  1. 三阶段持久化栅栏(executing → receipt_pending → settled):调用前 begin 以 identityScopeHash + recordId 原子落盘 executing(重复调用返回 duplicate);子进程启动前经 claimOriginalSkillDispatch 将 skillDispatch 从 unissued 推进到 issued(至多一次);执行完成后 stageReceipt 写入 receipt_pending 与 write-once executionProof,服务端确认后 acknowledge 推进到 settled。
  2. 崩溃恢复不自动重跑(load):Desktop 重启恢复时,任何遗留在 phase === 'executing' 的记录都会被立即转换为 phase: 'receipt_pending' 且结果为 outcome_unknown(「原脚本终结状态未确认,不能自动重跑。」),同时把未签发的 skillDispatch 置为 closed。
  3. 原执行器晚到完成补证(recordOriginalSkillCompletion → freezeSupplement → acknowledgeSupplement):若恢复已生成 outcome_unknown,但原执行器随后完成并观察到 processTreeStopped: true 与 outputsValidated: true,则写入 write-once executionProof,并冻结补证摘要(freezeSupplement)上送服务端 recordRuntimeWorkSupplementaryConclusion,确认后 acknowledgeSupplement 闭环。

证据与范围

  • aida-agent · packages/agent/src/execution-host/router.ts L50–80 · ExecutionHostRouter · e2adc9a3c325
  • aida-agent · docs/architecture/lifecycle-map.md L42–98 · e2adc9a3c325(历史引用:该文件在上一钉点与当前钉点均不存在,未能复核;见 ATLAS-DEBT)
  • aida-desktop · CONTEXT.md L1388–1418 · Dual session identity · 4346d79eb364(历史引用:该文件在上一钉点与当前钉点均不存在,未能复核;见 ATLAS-DEBT)
  • aida-desktop · apps/desktop/shared/generated/protocol-version.ts L1–8 · DESKTOP_PROTOCOL_VERSION · 4346d79eb364

结论来自固定版本的静态源码与合同阅读;实现存在、默认开关和生产启用分别判断。本站代码证据面板列出声明状态与具体限制。

  • aida-desktop · apps/desktop/electron/local-executor/local-execution-gateway.ts L197–209 · readonly deliveries · 4346d79eb364
  • aida-desktop · apps/desktop/electron/lifecycle/main-shutdown-coordinator.ts L96–113 · coreScope.register('local-executor' · 4346d79eb364

代码证据

引用核验检查固定 commit 的文件与范围;实现结论来自代码阅读。自动检查不证明生产环境已启用。

已核验实现

工具通过 ExecutionHostRouter 分发;本机能力的执行与回执不能变成第二套企业 Agent 编排。

aida-agentpackages/agent/src/execution-host/router.ts:50–807f2e519936b57902d4907ed8026fe1ecdd146e82符号:ExecutionHostRouter
aida-agentpackages/agent/src/shared/interaction-kernel-state.ts:11–417f2e519936b57902d4907ed8026fe1ecdd146e82符号:INTERACTION_STATUSES
已核验实现

Local File 架构族仍称 V4;Protocol v3 删除了独立的 Local File 协议版本与 local-files-v5 capability,V4 就绪只看 localFileCapability 广告。request/receipt 账本在 Agent,Desktop Main 执行;绝对路径不出 Main,wire 用 relativePath/attachmentId;对话级附件由 Main 组装。

aida-agentpackages/agent/src/shared/interaction-kernel-state.ts:11–417f2e519936b57902d4907ed8026fe1ecdd146e82符号:INTERACTION_STATUSES
aida-desktopGLOSSARY.md:1361–13674346d79eb36402355e51118df0edf1f98586880c符号:Dual session identity
aida-desktopapps/desktop/electron/local-files-v4/capability.ts:12–194346d79eb36402355e51118df0edf1f98586880c符号:assembleLocalFileV4Capability
aida-agentpackages/agent/src/runtime/local/local-file-v4-negotiation.ts:30–567f2e519936b57902d4907ed8026fe1ecdd146e82符号:localFileV4Admitted
已核验实现

LocalExecutionGateway(desktop e2fdc7c7 起由 LocalExecutorService 改名,文件 local-executor-service.ts → local-execution-gateway.ts)把 Save-As 交付(saveArtifactCopy / recoverPreparedDeliveries / listArtifactDeliveries)收进只读 deliveries 端口,原公开方法改为私有;只供 Main 启动恢复与 aida-local-executor IPC 使用。

aida-desktopapps/desktop/electron/local-executor/local-execution-gateway.ts:204–2174346d79eb36402355e51118df0edf1f98586880c符号:LocalExecutionGateway
已核验实现

Protocol v3 收敛后 Agent 下发给 Desktop 的本机工具只剩 readSkillFile、runSkillScript(另有官方 Skill 的 runOfficialSkillScript)、Skill 管理四件套与 Local File V4 工具;readFile / writeFile / listDirectory / runBundledScript 等 primitive 从 SERVER_SUPPORTED_LOCAL_PRIMITIVE_SET 与 DESKTOP_LOCAL_EXECUTOR_PRIMITIVES 删除,durable 本机读工具只剩 readSkillFile。

aida-agentpackages/agent/src/gateway/local-executor-schemas.ts:40–447f2e519936b57902d4907ed8026fe1ecdd146e82符号:SERVER_SUPPORTED_LOCAL_PRIMITIVE_SET
aida-agentpackages/tool-client/src/types/desktop-tools.ts:36–577f2e519936b57902d4907ed8026fe1ecdd146e82符号:DESKTOP_LOCAL_EXECUTOR_PRIMITIVES
aida-agentpackages/agent/src/shared/durable-local-execution.ts:37–397f2e519936b57902d4907ed8026fe1ecdd146e82符号:DURABLE_LOCAL_READ_TOOL_NAMES
aida-agentdocs/adr/0090-desktop-protocol-v3-and-retired-local-primitives.md:17–197f2e519936b57902d4907ed8026fe1ecdd146e82符号:readSkillFile
已核验实现

Desktop 侧同步收敛(ADR-0087 D1/D2):Local File V4 是唯一模型可见的文件能力,readFile / writeFile / listDirectory 与 FileGrant / Transient grant 等旧路径删除;runSkillScript 是唯一脚本入口(ABI aida-json-file-v1 或 aida-argv-v1),runBundledScript / shell / visionExtract 等 Desktop 分支删除;Full access / Trusted host User Skill 运行时删除。

依据 ADR 文本与提交说明(ea79497f、fb0bf65a、312e095b),未逐文件核对删除面;未运行 Desktop E2E。

aida-desktopdocs/adr/0087-local-capability-convergence-and-protocol-v3.md:22–284346d79eb36402355e51118df0edf1f98586880c符号:runSkillScript
aida-desktopdocs/adr/0086-codex-skill-scripts-run-through-an-argv-abi.md:19–214346d79eb36402355e51118df0edf1f98586880c符号:aida-argv-v1
已核验实现

Skill 脚本可准备 ≠ 可信(28a6ec920 / 9fdc200c):canPrepareSkillScriptEntry 对 ready 或 execution_untrusted / dependency_preparation_required / runtime_unavailable 的条目返回 true,只允许到 Main 的准备检查并返回绑定的前置回执,不授予信任或启动进程;答复后原 Work 可就同一已准入版本与输入范围重新准备,Main 重新核对信任、运行时、依赖与审批。Desktop 本地 Skill 目录用同一函数(生成的合同副本)。

aida-agentpackages/tool-client/src/types/skill-script.ts:436–4427f2e519936b57902d4907ed8026fe1ecdd146e82符号:canPrepareSkillScriptEntry
aida-agentpackages/agent/src/runtime/README.md:143–1527f2e519936b57902d4907ed8026fe1ecdd146e82符号:execution_untrusted
aida-desktopapps/desktop/electron/local-executor/local-skill-catalog.ts:53–604346d79eb36402355e51118df0edf1f98586880c符号:canPrepareSkillScriptEntry
已核验实现

旧 root 的效应冻结:runtimeWorkEffects 对已有冻结 effects 的 C0 命令原样返回旧效应与摘要,答复或刷新后的 Main 就绪状态不能给旧 root 加 execute_script;新受理只有原始协商的 runSkillScript 就绪、指纹一致且目录里有可准备条目时才加 execute_script。纠错沿用前驱的效应族与重试栅栏。

aida-agentpackages/agent/src/runtime/work/run-work-effects.ts:94–1067f2e519936b57902d4907ed8026fe1ecdd146e82符号:Existing C0 commands
aida-agentpackages/agent/src/runtime/README.md:155–1657f2e519936b57902d4907ed8026fe1ecdd146e82符号:Existing C0 commands
已核验实现

deliverRuntimeWorkSkill 在 Work 挂起时拉取 queryPendingLocalReadRequest,核对 rootRunId / carrierRunId / invocationId / skillExecutionPolicy / workStepRef 绑定;Plugin 工具在派发前通过 assertDispatchAllowed 二次复核服务端等待未变且未过期;本地产物记录 LocalArtifactRecord 通过 executionProof(processTreeStopped 与 outputsValidated)记录原执行完成证明。

aida-desktopapps/desktop/electron/agent-loop/runtime-work-skill-delivery.ts:12–1254346d79eb36402355e51118df0edf1f98586880c符号:deliverRuntimeWorkSkill
aida-desktopapps/desktop/electron/local-executor/artifact-registry.ts:9–454346d79eb36402355e51118df0edf1f98586880c符号:executionProof
已核验实现

配对父子任务续接(paired-child-continuation):lockPairedRunsInTx 在事务中强制先 FOR UPDATE 锁 Parent 再锁 Child 以防死锁;parsePairedChildOwnerMetadata 严格校验 8 项持久化 owner 字段并排除瞬态租约 token;ResumedChildRunResult 以 transparentForwardKey 保证向父任务只转发一次。

aida-agentpackages/agent/src/runtime/local/paired/paired-child-continuation.ts:7–457f2e519936b57902d4907ed8026fe1ecdd146e82符号:lockPairedRunsInTx
aida-agentpackages/agent/src/runtime/local/paired/paired-child-continuation.ts:58–1167f2e519936b57902d4907ed8026fe1ecdd146e82符号:parsePairedChildOwnerMetadata
已核验实现

本机工作台 Transcript 投影门禁(local-workbench-transcript):safeProjectionText 拦截 credential、raw_exception 及结构化值中的 fixed_local_path / relative_local_path 并抛 LOCAL_WORKBENCH_TRANSCRIPT_UNSAFE_PROJECTION;WorkbenchWorkExecution.reportProjectionRejection 仅记录代码枚举 ruleId 与位置索引,不把敏感路径或正文写入审计。

aida-agentpackages/agent/src/runtime/local/local-workbench-transcript.ts:168–1947f2e519936b57902d4907ed8026fe1ecdd146e82符号:safeProjectionText
aida-agentpackages/agent/src/gateway/workbench-work-execution.ts:1516–15477f2e519936b57902d4907ed8026fe1ecdd146e82符号:reportProjectionRejection
已核验实现

LocalEffectContinuationStore 将 runSkillScript 与 apply_skill_change 标为 replaySafe=false,通过 executing → receipt_pending → settled 三阶段栅栏与 claimOriginalSkillDispatch 保证至多派发一次;启动 load() 将遗留 executing 转为 outcome_unknown 且不自动重跑;原执行器晚到完成可经 recordOriginalSkillCompletion 与 freezeSupplement / acknowledgeSupplement 闭环补证。

aida-desktopapps/desktop/electron/agent-loop/local-effect-continuation-store.ts:484–5054346d79eb36402355e51118df0edf1f98586880c符号:classifyLocalExecutorContinuation
aida-desktopapps/desktop/electron/agent-loop/local-effect-continuation-store.ts:1256–14444346d79eb36402355e51118df0edf1f98586880c符号:claimOriginalSkillDispatch
aida-desktopapps/desktop/electron/agent-loop/local-effect-continuation-store.ts:1688–18204346d79eb36402355e51118df0edf1f98586880c符号:acknowledgeSupplement