31 lines
1.0 KiB
Markdown
31 lines
1.0 KiB
Markdown
# 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`
|