新增: 多Agent并行执行与仲裁合并设计文档

- 数据模型:混合方案(messages加FK列 + Plan/SubTask/Conflict独立表)

- 并行策略:层间串行+层内并行,写SubTask降级串行,token预算池

- 上下文隔离:子Agent独立ContextManager+fork快照,合并产出落回主对话

- 事件协议:4个新事件(Plan创建/SubTask状态/合并完成/冲突解决)

- UI交互:PlanProgress发送即展示+工具卡分组+冲突徽章非阻塞

- 状态机:Plan/SubTask/Conflict各自状态流转图

- 前端类型:PlanRecord/SubTaskRecord/ConflictRecord TypeScript定义

- INDEX.md注册 + 批次记录同步明细
This commit is contained in:
2026-07-01 15:18:02 +08:00
parent f04d47b09d
commit 583058acd6
3 changed files with 509 additions and 8 deletions

View File

@@ -433,15 +433,37 @@
## 后续规划批次(待推进)
### Batch 37 — 多 Agent 并行执行
1. PlanExecutor JoinSet 真并行:process_tool_calls 内并行执行同层工具
2. 子 Agent 调用链路:SubTask → 独立 agentic loop → 产出 + 错误传播
3. DAG 进度实时更新:PlanProgress.vue 接入真实状态
> 设计文档:[多Agent并行执行与仲裁合并设计-2026-07-01.md](docs/02-架构设计/专项设计/多Agent并行执行与仲裁合并设计-2026-07-01.md)
### Batch 38仲裁合并 + 技术债
1. Reviewer 仲裁合并:并行 Agent 产出冲突检测 + 合并建议
2. 交互式审批:冲突 diff 展示供用户裁决
3. 扫尾技术债:SMELL-P1-6 / 编译警告 / 注释清理
### Batch 37数据层 + 并行执行
| # | 任务 | 文件 |
|---|------|------|
| 1 | V36 迁移(ai_plans/ai_subtasks/ai_conflicts 3 新表 + ai_messages/ai_tool_executions 加 subtask_id 列) | migrations.rs |
| 2 | PlanRepo / SubTaskRepo / ConflictRepo CRUD | 新 repo 文件 |
| 3 | Coordinator.dispatch 改 JoinSet 层内并行(写 SubTask 降级串行) | coordinator.rs |
| 4 | Token 预算池(超限拒绝新 SubTask) | coordinator.rs |
| 5 | 子 Agent 独立 ContextManager + fork 快照(隔离上下文) | coordinator.rs |
| 6 | 4 个新事件类型(AiPlanCreated/AiSubTaskStatusChanged/AiMergeCompleted/AiConflictResolved) | AiChatEvent |
| 7 | PlanProgress 接入真实状态 + 发送即展示 | PlanProgress.vue |
| 8 | 工具卡按 subtask_id 折叠归组(带 persona 徽章) | MessageList.vue |
| 9 | 前端 PlanRecord/SubTaskRecord/ConflictRecord 类型 | api/types.ts |
### Batch 38 — 仲裁合并 + UI 完善
| # | 任务 | 文件 |
|---|------|------|
| 1 | Coordinator.merge 冲突检测(按文件路径) | coordinator.rs |
| 2 | Reviewer Agent 仲裁(persona.rs 扩展) | persona.rs + coordinator.rs |
| 3 | 冲突 diff 展示 + resolution 按钮 | 新 ConflictResolver.vue |
| 4 | AiConflictResolved 事件闭环 | AiChatEvent |
| 5 | 技术债扫尾(编译警告 / unused import) | 各文件 |
### Batch 39-40 — P1 模板系统 + Git/CI(远期)
1. YAML 模板加载器 + SubflowNode
2. GitNode(分支/PR/合并) + DockerNode(容器构建/测试)
3. 从模板加载工作流 → Git 分支 → 代码生成 → PR → CI 全链路
---