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
+4 -4
View File
@@ -1,7 +1,7 @@
# Orch `dep add` Test Plan Index
## Status
## Case Files
No command case files are authored yet.
Use [../ROADMAP.md](../ROADMAP.md) for planned case slugs and document progress.
| Case Slug | File | Coverage Note |
| --- | --- | --- |
| `dep-add-blocks-dependent-task-until-prerequisite-completes` | [dep-add-blocks-dependent-task-until-prerequisite-completes.md](./dep-add-blocks-dependent-task-until-prerequisite-completes.md) | adds a dependency edge that keeps the dependent task out of the ready set |
@@ -0,0 +1,38 @@
# Case: `dep-add-blocks-dependent-task-until-prerequisite-completes`
## 用例意义
验证 `dep add` 会建立依赖边,并让被依赖任务在前置任务完成前保持不可调度。
## 前置条件
- 已存在 run `run_blog_002`
- run 下已存在任务 `T1``T2`
## 输入
```bash
orch --db TMPDIR/coord.db --json run init --run run_blog_002 --goal "Build dependency-aware workflow"
orch --db TMPDIR/coord.db --json task add --run run_blog_002 --task T1 --title "Build backend" --default-to worker-a
orch --db TMPDIR/coord.db --json task add --run run_blog_002 --task T2 --title "Build frontend" --default-to worker-b
orch --db TMPDIR/coord.db --json dep add --run run_blog_002 --task T2 --depends-on T1
orch --db TMPDIR/coord.db --json ready --run run_blog_002
```
## 预期输出
- `dep add` 退出码为 `0`
- `data.dependency.task_id == "T2"`
- `data.dependency.depends_on_task_id == "T1"`
- 后续 `ready` 只返回 `T1`
- `T2` 不出现在 `ready.data.tasks`
## 断言结论
- `dep add` 会立刻影响 ready 计算结果
- 依赖关系属于调度门控,而不是仅供展示的元数据
## 补充约束
- `--task` 不能依赖自己;自依赖应返回 `invalid_input`
- 重复添加同一条依赖边应返回 `invalid_state`