Add the a2a adapter module: Agent Card publishing and remote executor (Q3 WP4) #47

Merged
weichen merged 1 commits from feature/q3-a2a-wp4 into main 2026-10-08 03:41:55 +00:00
Owner

Why

Q3 WP4:A2A 1.0 互通从零建——发布侧把本团队能力渲染为 Agent Card,消费侧把远端智能体接成 squad.Executor(任务状态机对齐 ExecResult)。独立 go.mod,与 adapters/intent、adapters/native 同构。

What

  • card.go:AgentCard/AgentSkill 类型(protocolVersion 1.0);BuildCard 从 RoleRegistry(角色→技能,关键词→tags)与 BlueprintRegistry(蓝图→技能,match→examples)派生,缺 URL fail-closed;CardHandler well-known JSON 服务;FetchCard 发现+必备字段校验
  • executor.go:JSON-RPC 2.0 客户端——message/send 发起、tasks/get 轮询(PollInterval,ctx 取消传播);终态映射:completed→artifacts(FilePart bytes→patches、TextPart→目标文件兜底)Success;failed/canceled/rejected/input-required→Success=false fail-closed(跨进程人工输入不在适配面内);直接 Message 结果支持;协议/传输错误→error(引擎按瞬态评估)

Evidence(双向 conformance,本地假 A2A 服务端)

  • 卡片构建/服务/发现校验;状态机 submitted→working→completed 工件映射;failed+input-required 映射;直接 Message;协议错误与取消传播——7 测试全绿 + -race(SELF)
  • squad 根模块套件不受影响(SELF);根模块 CI 权威(GATE)

Refs

  • Q3 计划 WP4;Dev 卡 .task/feature-agent-stack-q3.md
## Why Q3 WP4:A2A 1.0 互通从零建——发布侧把本团队能力渲染为 Agent Card,消费侧把远端智能体接成 squad.Executor(任务状态机对齐 ExecResult)。独立 go.mod,与 adapters/intent、adapters/native 同构。 ## What - **card.go**:AgentCard/AgentSkill 类型(protocolVersion 1.0);BuildCard 从 RoleRegistry(角色→技能,关键词→tags)与 BlueprintRegistry(蓝图→技能,match→examples)派生,缺 URL fail-closed;CardHandler well-known JSON 服务;FetchCard 发现+必备字段校验 - **executor.go**:JSON-RPC 2.0 客户端——message/send 发起、tasks/get 轮询(PollInterval,ctx 取消传播);终态映射:completed→artifacts(FilePart bytes→patches、TextPart→目标文件兜底)Success;failed/canceled/rejected/**input-required**→Success=false fail-closed(跨进程人工输入不在适配面内);直接 Message 结果支持;协议/传输错误→error(引擎按瞬态评估) ## Evidence(双向 conformance,本地假 A2A 服务端) - 卡片构建/服务/发现校验;状态机 submitted→working→completed 工件映射;failed+input-required 映射;直接 Message;协议错误与取消传播——7 测试全绿 + -race(SELF) - squad 根模块套件不受影响(SELF);根模块 CI 权威(GATE) ## Refs - Q3 计划 WP4;Dev 卡 .task/feature-agent-stack-q3.md
weichen added 1 commit 2026-10-08 03:39:12 +00:00
Add the a2a adapter module: Agent Card publishing and remote executor (Q3 WP4)
ci / vet-and-test (pull_request) Successful in 25s
ci / docker-checkout-hostgateway (pull_request) Successful in 1s
424bfc0e29
Why: Q3 WP4 requires A2A 1.0 interop from zero: publish this team's
capabilities as an Agent Card and consume remote agents as squad.Executors
with the A2A task state machine mapped onto ExecResult.

Evidence: adapters/a2a conformance with a local fake A2A server (both
directions): card build from role/blueprint registries, well-known JSON
serving, FetchCard fail-closed validation, message/send -> tasks/get
polling through submitted/working -> completed with TextPart/FilePart
artifacts mapped to patches/targets, failed/canceled/rejected/input-required
mapped to Success=false fail-closed (no cross-process hold), direct Message
result, JSON-RPC protocol and ctx-cancel error propagation. Module green
with -race; squad root suite unaffected (SELF). CI authoritative (GATE)
for the root module; the adapter module follows the adapters/intent and
adapters/native separate-go.mod precedent.

Impact: new module agent-squad/adapters/a2a (card.go, executor.go); no
changes to the squad root module.

Refs: Q3 plan WP4 (2026-10-07-agent-stack-q2q3-plans.md); task card
.task/feature-agent-stack-q3.md
weichen merged commit 663e89ec58 into main 2026-10-08 03:41:55 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-Squad#47