Author orch Markdown test plan

This commit is contained in:
2026-03-19 16:27:28 +08:00
parent b448d98e71
commit a20bec1cac
68 changed files with 2225 additions and 160 deletions
@@ -0,0 +1,30 @@
# Case: `dispatch-rejects-dirty-repo-without-base-ref`
## 用例意义
验证 strict worktree dispatch 在仓库存在未提交修改且未显式指定 `--base-ref` 时,会拒绝继续执行。
## 前置条件
- `TMPDIR/repo` 是一个 Git 仓库
- 仓库工作区存在未提交变更
- 已存在 run `run_blog_worktree_002` 与任务 `T1`
## 输入
```bash
orch --db TMPDIR/coord.db --json run init --run run_blog_worktree_002 --goal "Validate dirty repo rejection"
orch --db TMPDIR/coord.db --json task add --run run_blog_worktree_002 --task T1 --title "Implement backend" --default-to worker-a
orch --db TMPDIR/coord.db --json dispatch --run run_blog_worktree_002 --task T1 --repo-path TMPDIR/repo --workspace-root .orch/worktrees --strict-worktree
```
## 预期输出
- `dispatch` 退出码为 `30`
- JSON 错误码为 `invalid_state`
- `.orch/worktrees/run_blog_worktree_002/T1/attempt-1` 不应被创建
## 断言结论
- strict 模式不会隐式吞掉未提交工作区状态
- 当 leader 依赖脏工作区时,必须显式给出 `--base-ref`