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,29 @@
# Case: `dispatch-requires-explicit-execution-mode`
## 用例意义
验证 `dispatch` 不再做 worktree heuristics,而是要求 caller 显式声明 `--execution-mode analysis|code`
## 前置条件
- 已存在 run `run_blog_auto_worktree_001`
- 已存在任务 `T1`
## 输入
```bash
orch --db TMPDIR/coord.db --json run init --run run_blog_auto_worktree_001 --goal "Validate explicit execution mode"
orch --db TMPDIR/coord.db --json task add --run run_blog_auto_worktree_001 --task T1 --title "Implement backend API" --default-to worker-a
orch --db TMPDIR/coord.db --json dispatch --run run_blog_auto_worktree_001 --task T1
```
## 预期输出
- `dispatch` 退出码为 `30`
- JSON 错误码为 `invalid_input`
- 错误消息指出必须提供 `--execution-mode`
## 断言结论
- dispatch 的执行模式是显式契约,而不是由 runtime 根据任务元数据自行猜测
- leader 必须对 thread-only 与 worktree-backed 执行路径负责