docs: add inbox markdown test plans
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
# Inbox `cancel` Test Plan
|
||||
|
||||
## Scope
|
||||
|
||||
This document covers thread cancellation via `inbox cancel`.
|
||||
|
||||
Shared conventions live in [../_shared/README.md](../_shared/README.md).
|
||||
|
||||
## case: cancel-marks-thread-cancelled
|
||||
|
||||
### 用例意义
|
||||
|
||||
验证 `cancel` 可以把非终态线程推进到 `cancelled` 终态,并生成控制消息。
|
||||
|
||||
### 前置条件
|
||||
|
||||
- 已存在一个非终态线程 `THREAD_ID`
|
||||
|
||||
### 输入
|
||||
|
||||
```bash
|
||||
inbox --db TMPDIR/coord.db --json cancel --agent leader --thread THREAD_ID --reason "Task superseded by a larger refactor"
|
||||
```
|
||||
|
||||
### 预期输出
|
||||
|
||||
- 命令退出码为 `0`
|
||||
- `thread.status == "cancelled"`
|
||||
- `message.kind == "control"`
|
||||
|
||||
### 断言结论
|
||||
|
||||
- `cancel` 是线程级终态转换
|
||||
- 取消时会释放活跃 lease
|
||||
|
||||
## case: cancel-persists-reason-and-artifact
|
||||
|
||||
### 用例意义
|
||||
|
||||
验证 `cancel` 的原因文本与附件会被完整持久化。
|
||||
|
||||
### 前置条件
|
||||
|
||||
- 已存在一个非终态线程 `THREAD_ID`
|
||||
- `TMPDIR/cancel.md` 已存在
|
||||
|
||||
### 输入
|
||||
|
||||
```bash
|
||||
inbox --db TMPDIR/coord.db --json cancel --agent leader --thread THREAD_ID --reason "Task superseded by a larger refactor" --artifact TMPDIR/cancel.md --artifact-kind brief
|
||||
inbox --db TMPDIR/coord.db --json show --thread THREAD_ID
|
||||
```
|
||||
|
||||
### 预期输出
|
||||
|
||||
- `cancel` 成功
|
||||
- 取消消息 `summary` 与 `body` 都保留取消原因
|
||||
- 取消消息包含 1 个 artifact
|
||||
|
||||
### 断言结论
|
||||
|
||||
- `cancel` 既保留人类可读原因,也支持附带上下文材料
|
||||
|
||||
## case: cancel-rejects-when-thread-missing
|
||||
|
||||
### 用例意义
|
||||
|
||||
验证 `cancel` 对不存在线程返回稳定的 not-found 错误契约。
|
||||
|
||||
### 前置条件
|
||||
|
||||
- 空数据库已完成 `init`
|
||||
|
||||
### 输入
|
||||
|
||||
```bash
|
||||
inbox --db TMPDIR/coord.db --json cancel --agent leader --thread thr_missing
|
||||
```
|
||||
|
||||
### 预期输出
|
||||
|
||||
- 退出码为 `40`
|
||||
- JSON 错误码为 `not_found`
|
||||
|
||||
### 断言结论
|
||||
|
||||
- `cancel` 不会为缺失线程隐式创建控制消息
|
||||
Reference in New Issue
Block a user