orch: require explicit dispatch execution mode

This commit is contained in:
2026-03-20 19:27:30 +08:00
parent 7840b2767f
commit 5859ff219e
43 changed files with 277 additions and 312 deletions
@@ -0,0 +1,31 @@
# Case: `dispatch-analysis-mode-skips-worktree`
## 用例意义
验证 `dispatch --execution-mode analysis` 会保持 thread-only,不会创建 worktree。
## 前置条件
- 已存在 run `run_blog_auto_worktree_002`
- 已存在任务 `T1`
## 输入
```bash
orch --db TMPDIR/coord.db --json run init --run run_blog_auto_worktree_002 --goal "Validate analysis-mode dispatch fallback"
orch --db TMPDIR/coord.db --json task add --run run_blog_auto_worktree_002 --task T1 --title "Review QA findings" --summary "Summarize test failures and next steps" --default-to qa-worker
orch --db TMPDIR/coord.db --json dispatch --run run_blog_auto_worktree_002 --task T1 --execution-mode analysis
```
## 预期输出
- `dispatch` 退出码为 `0`
- `data.attempt.worktree_path == ""`
- `data.attempt.workspace_status == ""`
- `data.message.payload_json.execution_mode == "analysis"`
- 仍会正常返回 `thread_id` 与首条任务消息
## 断言结论
- analysis mode 始终走标准 dispatch 路径,不会平白引入分支和工作目录
- worker brief 和桥接层可以从 payload 中读取显式的 `execution_mode`