feat(ack): worker 模型固定与 worktree 决策说明 (v0.6.2)

This commit is contained in:
2026-07-07 01:45:55 +08:00
parent f33992a0aa
commit d11f90fd66
5 changed files with 90 additions and 3 deletions
+43 -1
View File
@@ -28,7 +28,9 @@
```text
Coordinator 发现或读取 open 任务
-> prepare:写/补全 tasks.yaml 验收信号
-> dispatch 给 Developer
-> 决定 worktree:当前 worktree 起子 agent,还是新建隔离 worktree(见下节「子任务放哪」)
-> 起 worker:按档位建 worker 终端(如 cursor-agent --model auto,见 model-routing.md
-> dispatch 给 Developer--to <worker handle>
-> waitDeveloper 的 worker_done / escalation
-> writeback fixed_by_dev
-> dispatch 给 Testretesting
@@ -41,6 +43,46 @@ Coordinator 发现或读取 open 任务
```
一次派发只修一个明确问题(细则见 `optimization-method.md` §「每轮派发只修一个明确问题」)。
「决定 worktree」「起 worker」两步的决策见下节与 `model-routing.md` / `orca-adapter.md`
---
## 子任务放哪:新 worktree 还是当前 worktree
Coordinator 派发前先决定 Developer/Test 在哪工作。两种方式:
**方式 1:当前 worktree 起子 agent(终端)**
```bash
orca terminal create --worktree active --command "cursor-agent --model auto" --json
```
- 适合:串行闭环、一次一个 Developer 任务、小改动、Test 要复测的正是 Developer 改的那棵树。
- 优点:单一服务实例、无跨 worktree 对齐困扰、开销小。
- 风险:多个 agent 同时改同一棵树会互相踩(半构建状态、git 冲突)。
**方式 2:新建隔离 worktree,再在其中起子 agent**
```bash
orca worktree create --name <feature> --base-branch <base> --json
# 然后在新 worktree 内 orca terminal create --worktree path:<new> --command "cursor-agent --model auto"
```
- 适合:并行多个互不依赖的子任务、大/高风险/实验性改动、要保持基线分支干净(如 prod 不动、feature 走独立分支)、要独立 build 或跑独立服务实例、best-of-N 尝试。
- 优点:隔离 + 并行 + 易回滚(删 worktree 即可)。
- 成本:各自 build/依赖、服务要用不同端口、必须处理下节的 worktree/服务对齐。
**决策速查:**
| 情况 | 选择 |
|------|------|
| 一次一个任务、串行修复 | 当前 worktree 子 agent |
| 多个任务并行、互不依赖 | 每个任务一个新 worktree |
| 高风险 / 实验 / 可能整体丢弃 | 新 worktree |
| 要保持基线分支干净 | 新 worktreefeature 分支)|
| 小改动、追求快 | 当前 worktree |
**任务板(SSOT)只落一处**:无论开几个 worktree`tasks.yaml` 只认一个权威副本(通常在基线/协调所在 worktree),由 Coordinator 单写。不要每个 worktree 各留一份会分叉的任务板。模型固定方式见 `model-routing.md``orca-adapter.md`
---