context-infra 检查与复盘infra.guiming.net · 全内容自包含呈现 · 生成于 2026-07-21 16:28 UTC

workflow_agent_communication_protocol

Z3 全文↑ Z2 条目

道-方法 · 道层 skill 全文

← 返回道层 skill 索引 · 返回方法论区

本页是 <code>rules/skills/drafts/workflow_agent_communication_protocol.md</code> 的逐字投影(仅隐私清洗,零改写)。

时点提示:本页是仓内文件 rules/skills/drafts/workflow_agent_communication_protocol.md 的逐字投影(仅做隐私清洗:仓库根绝对路径→相对路径、家目录→~/;除此零改写)。若源文件后续有修订,以仓内真源为准。

Workflow:Agent 通信协议

元数据

目标

把 agent 之间的“读什么、不能读什么、收到什么固定指导、产出交给谁、谁能审查谁”从隐式提示词习惯,变成可落盘、可审计、可回放的通信协议。

这个 skill 解决的是通信基底,不解决任务分配算法、审查裁决、Loop 收束或 runtime 调度。

何时使用

适用:

不适用:

职责边界

相邻对象本 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:

使用规则

  1. 协调者先写 AgentContextGrant,再渲染 agent 提示词。
  2. 提示词只列授权输入,不列禁读路径;禁读策略保留在 JSON grant,避免泄漏 oracle 或私有 trace 名称。
  3. Agent 之间不通过隐藏聊天上下文传递信息,只通过产物和 HandoffArtifact
  4. 审查者的授权只包含待审 artifact、审查指南、需求锚点和允许的 oracle;默认不读 worker 私有 trace、分配方法或完整历史。
  5. Ledger 记录授权创建和交接记录,供后续重放和审查。

参考实现与测试

参考实现位于:

adhoc_jobs/agent_communication_protocol_20260521/

核心文件:

验证命令必须从该目录运行:

cd adhoc_jobs/agent_communication_protocol_20260521
python3 -m unittest discover -s tests -v

已验证覆盖:

已知边界


← 返回道层 skill 索引 · 返回方法论区