# Case: `reconcile-maps-done-or-failed-thread-to-terminal-task-state` ## 用例意义 验证 `reconcile` 会把 worker 侧 thread 的终态同步到 `orch` 任务,并刷新 run 聚合状态。 这个 case 只覆盖两类终态: - worker `done` 且 task 没有 required checks - worker `fail` ## 前置条件 - 已存在 run 和已 dispatch 的任务 - 该任务没有 configured verification gate,或者输入使用的是 `fail` - worker 已对该 thread 完成 `done` 或 `fail` ## 输入 ```bash orch --db TMPDIR/coord.db --json run init --run run_blog_001 --goal "Build blog MVP" orch --db TMPDIR/coord.db --json task add --run run_blog_001 --task T1 --title "Implement retry policy" --default-to worker-a orch --db TMPDIR/coord.db --json dispatch --run run_blog_001 --task T1 --execution-mode analysis --body "Implement retry handling for the HTTP client." inbox --db TMPDIR/coord.db --json claim --agent worker-a --thread THREAD_ID inbox --db TMPDIR/coord.db --json done --agent worker-a --thread THREAD_ID --summary "Retry policy implemented" --body "The HTTP client now retries transient failures." orch --db TMPDIR/coord.db --json reconcile --run run_blog_001 orch --db TMPDIR/coord.db --json status --run run_blog_001 ``` ## 预期输出 - `reconcile` 退出码为 `0` - `data.updated_tasks` 包含 `T1` - `T1.status == "done"`;若输入是 `fail`,则应为 `failed` - 后续 `status.data.run.status` 与终态任务聚合结果一致 ## 断言结论 - 任务终态依赖 `reconcile` 落回 `orch`,而不是由 worker 直接改写 task 表 - run 级聚合状态会随终态任务一并刷新 ## 补充约束 - 如果 task 声明了 required checks,worker `done` 不应再直接进入 `done`;那条分支由 `reconcile-maps-done-thread-to-verifying-when-task-has-required-checks.md` 覆盖