workflow_agent_communication_protocol
Z3 全文↑ Z2 条目
道-方法 · 道层 skill 全文
本页是 <code>rules/skills/drafts/workflow_agent_communication_protocol.md</code> 的逐字投影(仅隐私清洗,零改写)。
时点提示:本页是仓内文件 rules/skills/drafts/workflow_agent_communication_protocol.md 的逐字投影(仅做隐私清洗:仓库根绝对路径→相对路径、家目录→~/;除此零改写)。若源文件后续有修订,以仓内真源为准。
Workflow:Agent 通信协议
元数据
- 类型: Workflow / Draft
- 适用场景: 需要设计或执行多 agent 信息隔离、固定上下文注入、交接产物传递、禁读策略、agent ledger 重放,而不是让 agent 通过隐藏聊天上下文互相污染
- 状态: Draft
- 参考实现:
adhoc_jobs/agent_communication_protocol_20260521/
目标
把 agent 之间的“读什么、不能读什么、收到什么固定指导、产出交给谁、谁能审查谁”从隐式提示词习惯,变成可落盘、可审计、可回放的通信协议。
这个 skill 解决的是通信基底,不解决任务分配算法、审查裁决、Loop 收束或 runtime 调度。
何时使用
适用:
- 用户要求 agent 提示词注入、信息隔离、agent 间交接、审查者只读特定 artifact、DDP oracle 隔离、AAU allocator / worker / reviewer 分层。
- Controller Loop 需要比
AGENT_RUNS/更严格的授权、交接和 ledger 结构。 - 需要证明审查者没有读取 worker 私有 trace、oracle、同级 scratchpad 或完整聊天历史。
- Codex 单入口场景需要用文件保存协调者、worker、审查者之间的交接。
不适用:
- 只需要单个 sub-agent 执行一个普通任务;用
workflow_parallel_subagents或 Controller task card 即可。 - 需要决定业务需求是否完成;转
workflow_controller_loop或 Loop 后审查。 - 需要实际启动 Codex/Claude 子进程;转对应 runtime skill。
- 需要定时唤醒或 resume;转
codex_schedule_loop。
职责边界
| 相邻对象 | 本 skill 负责 | 不负责 |
|---|---|---|
| Controller Loop | 提供授权、交接和 ledger 形态供任务卡使用。 | 需求定义、下一步反应、收束。 |
| AAU | 可作为 allocator / worker / reviewer 的通信基底。 | AAU runtime、AAU formal promotion、AAU task logic。 |
| Design Doc Protocol | 可表达 designer 与 coverage reviewer 的 oracle 隔离。 | DDP 协议本身、oracle 裁决。 |
| 运行时执行器 | 可给 runtime run 提供 prompt/read_paths/receipt 结构。 | CLI flags、quota/fallback、进程 resume。 |
| 审查 skill | 可限制审查者输入。 | 审查裁决语义。 |
推荐文件结构
agent_runs/
context_grants/
G-*.json
G-*.prompt.md
handoffs/
H-*.json
communication_ledger.jsonl
artifacts/最小授权字段:
grant_id:
agent_id:
role:
objective:
named_inputs:
may_read: []
forbidden_read: []
injected_guidance: []
output_contract:
decision_authority:
stop_conditions: []最小交接字段:
handoff_id:
producer_agent_id:
consumer_agent_id:
artifact_path:
artifact_sha256:
artifact_type:
non_authoritative_summary:
required_consumer_action:
source_grant_id:
target_grant_id:使用规则
- 协调者先写
AgentContextGrant,再渲染 agent 提示词。 - 提示词只列授权输入,不列禁读路径;禁读策略保留在 JSON grant,避免泄漏 oracle 或私有 trace 名称。
- Agent 之间不通过隐藏聊天上下文传递信息,只通过产物和
HandoffArtifact。 - 审查者的授权只包含待审 artifact、审查指南、需求锚点和允许的 oracle;默认不读 worker 私有 trace、分配方法或完整历史。
- Ledger 记录授权创建和交接记录,供后续重放和审查。
参考实现与测试
参考实现位于:
adhoc_jobs/agent_communication_protocol_20260521/核心文件:
agent_comm/protocol.pytests/test_protocol.pyDESIGN.mdreports/final_report.html
验证命令必须从该目录运行:
cd adhoc_jobs/agent_communication_protocol_20260521
python3 -m unittest discover -s tests -v已验证覆盖:
- 提示词隐藏禁读路径,而 JSON grant 保留策略;
- 必需输入槽位和禁读/授权重叠检查;
- 授权、交接、ledger 写入;
- DDP designer / coverage reviewer oracle 隔离形态;
- AAU allocator / worker / reviewer 不同上下文链路。
已知边界
- 当前仍是 draft / adhoc reference,不是生产 runner。
- 不能从 repo root 直接跑测试,除非设置 import path 或包装命令。
- 没有强制底层模型真的不越界读文件;执行环境仍需 sandbox、runtime wrapper 或 review 检查配合。
- 不替代
workflow_controller_loop的需求、任务卡、审查和收束。