From 0787e337f6bc1dc28497ff17539482ed247e0cf8 Mon Sep 17 00:00:00 2001 From: Songhaoz666 Date: Thu, 11 Jun 2026 09:45:00 +0800 Subject: [PATCH] =?UTF-8?q?frontend-event-api=EF=BC=9A=E6=98=8E=E7=A1=AE?= =?UTF-8?q?=20run/task/event=20=E7=A8=B3=E5=AE=9A=20API=20+=20Agent=20?= =?UTF-8?q?=E8=B0=83=E5=BA=A6=E5=85=A5=E5=8F=A3=E5=B7=B2=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=EF=BC=88Refs=20#18=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增 §6「Swarm 侧冻结口径」:①「前端可渲染 run/task/event 稳定 API」本仓已冻结——REST (/{id}、/tasks、/events?after=、/workflow、/metrics、/diagnostics、/audit) + event-schema FROZEN v1 客户端事件集 + per-swarm sequence 去重续传;②「Agent Registry/调度入口 统一」蜂群内单实现——agent_registry(WS 注册) + swarm_dispatch 自选(能力+τ+负载+预算,见 agent-capability-schema/dispatch_score/decision_engine);③ 外部/后续(非本仓):SSE 传输 (HM Phase2 #46)、跨平台统一 registry/quota/routing(Infra #2)、cockpit 渲染(客户端仓)。 纯文档、纯追加 §6(不动 header/§4/§5),与 #34 对同文件的改动不重叠,可无冲突合并。 Refs #18 Co-Authored-By: Claude Opus 4.8 (1M context) --- docs/integration/frontend-event-api.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/integration/frontend-event-api.md b/docs/integration/frontend-event-api.md index c1c8be5..66793eb 100644 --- a/docs/integration/frontend-event-api.md +++ b/docs/integration/frontend-event-api.md @@ -56,3 +56,16 @@ - 🔴 蜂群 graph/timeline/cost 的统一前端 schema 未定义。 - 🟡 review/retry/collaboration 缺独立事件类型(当前借 `task.retried`/`timeline.updated`)。 - 待对齐:Frontend / Product Team 确认蜂群三视图(graph / timeline / cost)入口与事件流形态;与 HM 的 `/api/user/tasks/{id}/events` 通道如何衔接。 + +## 6. Swarm 侧冻结口径(#18:run/task/event API + Agent Registry/调度) + +回应 #18 两项 DoD,明确本仓**已满足**的范围与**外部/后续**项(按规则 #9 据实标注,不夸大): + +- **「前端可渲染 run/task/event 稳定 API」——本仓已冻结**:前端(经 HM 或受控读接口)用 §3 的 REST 即可稳定渲染:`GET …/{id}`(run 状态)、`/tasks`(task DAG)、`/events?after=`(事件流,**per-swarm 严格递增 `sequence` 去重/续传**)、`/workflow`、`/metrics`、`/diagnostics`、`/audit`。事件类型与 envelope 见 [`event-schema.md`](./event-schema.md)(**FROZEN v1**,客户端事件集 + `sequence`)。即 run/task/event 的**数据契约已稳定冻结**。 +- **「Agent Registry / 调度入口统一」——蜂群内已统一(单实现)**:Agent 经 WS `/ws/{agent_id}` 注册能力(`agent_registry`);调度由 `swarm_dispatch` **自选**(能力 + 信息素 τ + 负载 + 预算,见 [`agent-capability-schema.md`](./agent-capability-schema.md)、`orchestrator/dispatch_score.py`、`orchestrator/decision_engine.py`)。蜂群内**单一调度入口,无双实现**。 +- **外部 / 后续(非本仓范围)**: + - ① 统一 **SSE/WS 推送传输**:HM Phase2(见 #46 / runtime-contract §8);当前为 REST 轮询 + `events?after=` 续传,前端不丢步。 + - ② **跨平台统一 agent registry / capability center / quota / region·GPU / provider routing**:Infra/Scheduling Team(#2 对齐对象),非本仓编排器。 + - ③ cockpit 三视图(graph / timeline / cost)**渲染**:客户端仓子工单。 + +> 结论:#18 在**本仓范围内已满足**(run/task/event 稳定 API + 蜂群调度入口统一);SSE 传输与跨平台 registry 为外部/Phase2。建议 owner 据此关闭本仓部分,或保留 #18 跟踪上述外部项(同 #19 口径)。