feat: T-1.21 + T-1.22 + P1-23 — 打通 dispatch→Worker→merge 全链路

T-1.21 (P1-22): Dispatch → Worker 桥接
- eng_mode: spawn_workers() 为每个 ready 任务生成标准 Skill 调用参数
- commands/eng.md: dispatch 段从意图描述改为可执行5步伪代码
  Agent 不再需要猜测工具名、参数格式、task-text 来源

T-1.22 (P1-24): Merge → TaskGraph 状态同步
- merge_worker_result Phase 6.5: 写回 task-graph.json 节点 status
- merge 后节点状态 DONE,ready_tasks() 过滤已完成任务

_select_ready_tasks 修复:
- DAG ready 为空时不再 fallback 到 todo.md(todo.md 状态陈旧时导致重复派发)

P1-23: commands/eng.md dispatch 指令操作化
- 保留 Eng 工具白名单不变(极端接管需要 Write/Edit)
- Arc/Eng 约束非对称性是刻意的设计决策

63+4 项测试全通过,含端到端全链路测试

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
AirLongDian
2026-06-11 14:58:04 +08:00
parent 4b8a21aee2
commit dd4aa6b345
3 changed files with 323 additions and 10 deletions

View File

@@ -31,11 +31,8 @@ python "$HOME/plugins/airplan/scripts/airplan.py" --mode eng --project . --sub s
```
然后:
- 无活跃波次 → 派发下一波次
- 有活跃 Worker → 监控,不要盲目重新派发
- 每个 dispatched 任务 spawn 一个 /do 子代理fork_context=false
- 只传递项目路径+任务 handoff 内容,不要 fork 完整父对话
- 最多 recommendedConcurrency 个 Worker 同时活跃
- 无活跃波次 → 执行 dispatch 流程(见下方 dispatch 段)
- 有活跃 Worker → 执行 monitor,不要盲目重新派发
- 就绪结果出现时merge through `--sub merge --result <path>`
### status
@@ -56,7 +53,23 @@ python "$HOME/plugins/airplan/scripts/airplan.py" --mode eng --project . --sub p
python "$HOME/plugins/airplan/scripts/airplan.py" --mode eng --project . --sub dispatch
```
读取 AirPlan/state/aireng/dispatch/ 中的派发清单,为每个任务 spawn 一个隔离的 /do Worker 子代理。
dispatch 返回 `{waveId, taskIds, dispatchPath}`。**然后按以下步骤操作,不可跳过**
1. 从 dispatch 返回值中取 `taskIds` 列表
2.`taskIds` 中的**每个** `tid`,顺序执行:
a. 读 `AirPlan/state/airarc/reviews/task-graph.json`,从 `nodes[tid].task` 取任务描述文本
b. 调用 `Skill` 工具启动子代理:
- `skill`: `"airplan"`
- `args`: `"do --sub enter --task-id {tid} --task-text '{task描述}' --project ."`
c. 每个 `Skill` 调用自动以 `fork_context=false` 运行,创建隔离的 Do Worker
3. 所有 Worker spawn 完成后,进入 monitor 状态
4. Worker 完成后,对其 `result.json` 调用 `--sub merge --result <path>`
5. merge 后 `task-graph.json` 节点状态自动同步为 DONE不会被重复派发
**注意**
- 一个 task 对应一次 `Skill("airplan", ...)` 调用,多个 task 可以在同一条消息中并发发起
- task-text 从 task-graph.json 获取,不是猜的
- Do Worker 子代理的 allowed-tools 是 `[Read, Glob, Grep, Bash, Write, Edit]`Agent 框架自动应用
### monitor