Skip to content
预计 1 分钟右侧目录可快速定位

Reliability / Approval ​

Side-effect surfaces ​

createAutoReviewGate() 同时管理 host shell、box shell、MCP、computer、automation write、cloud agent、subagent launch 等执行面。重点不是这些产品名称,而是:不同 capability surface 可以有不同 enforcement mode,但必须经过统一 Runtime owner。

Symbol语义
currentModes()读取当前 enforcement mode,并让 controller 过期掉不再 enforce 的 surface
assertNoPendingApproval()已有 pending approval 时禁止开始新的 side effect
userInstructions()allow/block instructions 的 Runtime 投影
shellApprovalState()为 shell approval state 生成稳定 identity
getIdentity()identity 包含 surface / box / generation
markSideEffectStart()side effect 开始后推进 generation

Pending approval invariant ​

text
request side effect
  ↓
assertNoPendingApproval()
  ├─ pending = 0 → continue
  └─ pending > 0 → reject new side effect start

这不是 UX 限制,而是一个并发/一致性 invariant:如果允许多个待审批副作用同时漂移,审批对象与实际执行状态很容易错配。

Generation identity ​

text
identity = surface + boxId? + generation
                         ↓
side effect starts
                         ↓
generation += 1

这里值得吸收的是“审批针对的执行状态必须有 identity”,而不是照抄它的字符串格式。

本地定位 ​

bash
rg -n "createAutoReviewGate|currentModes|assertNoPendingApproval|shellApprovalState|getIdentity|markSideEffectStart" source/host/runner/auto-review-gate.ts

固定源码 ​

关联知识文章 ​

AI Engineering · Agent · Harness · Backend Systems