新增: 后续批次测试用例设计 + 批次规划同步worktree方案

- 测试用例:8大类共70+用例(迁移/Repo/拆解/worktree/并行/仲裁/模板/CI/审批/拆分/端到端/边界)

- 批次同步:数据层+worktree+并行(12项)/仲裁+冲突UI+编译检查(10项)/模板+节点(10项)/Git-CI+DockerNode(6项)/审批政策+小程序+收尾(8项)

- INDEX注册两份设计文档
This commit is contained in:
2026-07-01 21:30:58 +08:00
parent af2e085bea
commit 6833792de2
3 changed files with 315 additions and 21 deletions

View File

@@ -435,35 +435,76 @@
> 设计文档:[多Agent并行执行与仲裁合并设计-2026-07-01.md](docs/02-架构设计/专项设计/多Agent并行执行与仲裁合并设计-2026-07-01.md)
### Batch 37 — 数据层 + 并行执行
### 数据层 + Git worktree 隔离 + 并行执行
| # | 任务 | 文件 |
|---|------|------|
| 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 |
| 1 | V36 迁移(ai_plans/ai_subtasks/ai_conflicts 3 新表 + ai_messages/ai_tool_executions 加 subtask_id + subtasks.branch + conflicts.conflict_type) | migrations.rs |
| 2 | PlanRepo / SubTaskRepo / ConflictRepo CRUD + models 结构体 | 新 repo 文件 |
| 3 | Git worktree 生命周期管理(create/commit/merge/remove) | 新 git_worktree.rs |
| 4 | Coordinator.dispatch JoinSet 层内并行(每 SubTask 绑 worktree) | coordinator.rs |
| 5 | Token 预算池(AtomicU64 CAS,超限降级串行) | coordinator.rs |
| 6 | 子 Agent 独立 ContextManager + fork 快照 + worktree_path | coordinator.rs |
| 7 | 层间 merge 到 plan 分支 + 下一层基于 plan 创建 worktree | coordinator.rs |
| 8 | 4 个新事件 + 事件双写(emit + publish_event) | AiChatEvent |
| 9 | 前端类型定义(PlanRecord/SubTaskRecord/ConflictRecord) | api/types.ts |
| 10 | PlanProgress 接入真实状态 + 发送即展示 | PlanProgress.vue |
| 11 | 工具卡按 subtask_id 折叠分组 + persona 徽章 | MessageList.vue |
| 12 | 编译警告清理(coordinator_plan unused / audit 子模块 unused imports) | 各文件 |
### Batch 38 — 仲裁合并 + UI 完善
### 仲裁合并 + 冲突 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) | 各文件 |
| 1 | Coordinator.merge: git merge-tree 三方合并预检 | coordinator.rs + git_worktree.rs |
| 2 | 冲突检测:同文件路径(file) + 编译失败(semantic) | coordinator.rs |
| 3 | Reviewer Agent 仲裁(persona 扩展:读 diff → 推荐 resolution + 理由) | persona.rs |
| 4 | 合并产出落回主对话(可展开单条,默认折叠) | coordinator.rs + MessageList.vue |
| 5 | ConflictResolver.vue(git diff 展示 + resolution 按钮) | 新组件 |
| 6 | resolve_conflict IPC + AiConflictResolved 事件闭环 | AiChatEvent |
| 7 | 命令互斥锁(run_command 对同目录 npm/cargo 加 mutex) | audit/approval.rs |
| 8 | agentic/mod.rs 拆分(2222行 → 提取 compress/title/knowledge_inject 独立模块) | agentic/*.rs |
| 9 | AiChat 进度条补全(后端 AiAgentRound 补 max_rounds + 前端 completed 计数) | AiChat.vue |
| 10 | context.rs 拆分(1956行 → 提取 sanitize/budget/compress 独立模块) | context/*.rs |
### Batch 39-40 — P1 模板系统 + Git/CI(远期)
### 模板系统 + 节点补齐
1. YAML 模板加载器 + SubflowNode
2. GitNode(分支/PR/合并) + DockerNode(容器构建/测试)
3. 从模板加载工作流 → Git 分支 → 代码生成 → PR → CI 全链路
| # | 任务 | 文件 |
|---|------|------|
| 1 | YAML 模板格式定义(DagDef schema: nodes/edges/conditions/persona) | 新设计文档 |
| 2 | 模板加载器(YAML → DagDef 反序列化 + 校验) | df-workflow |
| 3 | SubflowNode(嵌套子工作流节点,递归调 Executor) | df-nodes |
| 4 | GitNode(分支创建/checkout/commit/merge,复用 git CLI) | df-nodes |
| 5 | HTTPNode(通用 HTTP 请求: GET/POST/PUT/DELETE) | df-nodes |
| 6 | NotifyNode(桌面通知 + Webhook: 飞书/钉钉/自定义) | df-nodes |
| 7 | 内置模板 3 个预设(代码审查 / bug修复 / 功能开发) | assets/templates/ |
| 8 | 前端模板选择入口(AiChat 输入框 /template 触发) | AiChat.vue |
| 9 | 模板 CRUD IPC + 前端管理 UI | 新模板管理页 |
| 10 | MessageList.vue 继续拆分(1386行 → 提取 StreamRenderer/ToolCardGroup/EmptyState) | MessageList.vue + 子组件 |
### Git/CI 集成 + DockerNode + God 文件收尾
| # | 任务 | 文件 |
|---|------|------|
| 1 | DockerNode(容器内构建/测试,CLI 模式起步: docker run/exec) | df-nodes |
| 2 | PR 创建链路(GitNode 创建分支 → 提交 → push → 创建 PR) | df-nodes + API |
| 3 | CI 状态读取(调 GitHub/Gitea API 读 PR check 结果) | 新 ci_status.rs |
| 4 | CI 状态面板(前端新组件展示 PR check 通过/失败/pending) | 新 CIStatus.vue |
| 5 | 全链路集成测试(模板加载 → 分支 → 代码生成 → PR → CI → 结果回显) | 集成测试 |
| 6 | ChatInput.vue 继续拆分(1155行 → 提取 MentionPopover/EnrichmentPanel) | ChatInput.vue + 子组件 |
### 审批政策 + 小程序完善 + 体验收尾
| # | 任务 | 文件 |
|---|------|------|
| 1 | 审批策略数据结构(Persona × Node × RiskLevel → Policy) | 新 policy.rs |
| 2 | 策略引擎(替代硬编码 auto_exec_mode 三档,支持细粒度规则) | policy.rs |
| 3 | 策略持久化(app_settings KV 或独立 policy 表 + 热加载) | migrations + repo |
| 4 | 前端策略配置 UI(设置页新增:规则列表 + 新建/编辑/删除) | 新 PolicyPanel.vue |
| 5 | 小程序 MentionInput 接真实数据(替换占位列表为真实技能路由/实体检索) | df-miniapp |
| 6 | 小程序长会话虚拟化(替代 MAX_RENDER_MSGS=200 截断,滚动入视口才 parse) | df-miniapp |
| 7 | 快捷键完善(Ctrl+N/Ctrl+R WebView2 实测 + 绑定决策) | AiChat.vue |
| 8 | ARCHITECTURE.md 状态同步 + 走查报告剩余项扫尾 | 文档
---