8.6 KiB
8.6 KiB
Orch Workflow Test Plan
Scope
This document tracks cross-command scenarios where the main value is the interaction between multiple orch commands, and often between orch and inbox.
All examples assume:
- isolated temp database
orch --db TMPDIR/coord.db --jsonis used consistently- assertions follow the shared rules in ../_shared/README.md
case: run-dispatch-reconcile-status-happy-path
用例意义
验证 orch 的主干领导者流程可用:创建 run、加入 task、查看 ready、dispatch、通过 inbox 推进 worker 状态、reconcile,再用 status 看到最终完成态。
前置条件
- 空数据库路径
TMPDIR/coord.db - 执行者为
worker-a
输入
orch --db TMPDIR/coord.db --json run init --run run_blog_001 --goal "Build blog MVP" --summary "Public blog plus admin CRUD"
orch --db TMPDIR/coord.db --json task add --run run_blog_001 --task T1 --title "Implement retry policy" --summary "Add retry policy to HTTP client" --default-to worker-a
orch --db TMPDIR/coord.db --json ready --run run_blog_001
orch --db TMPDIR/coord.db --json dispatch --run run_blog_001 --task T1 --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 update --agent worker-a --thread THREAD_ID --status in_progress --summary "Implementation started"
orch --db TMPDIR/coord.db --json reconcile --run run_blog_001
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
预期输出
run init成功创建run_blog_001task add返回的新 task 初始状态为readyready只返回T1dispatch创建 attempt 与 inbox thread,并将 task 推进到dispatched- 第一次
reconcile后 task 状态变为running - 第二次
reconcile后 task 状态变为done status返回run.status == "done"
断言结论
orch的主干 happy path 不是单命令行为,而是orch与inbox共同完成的闭环reconcile是把 worker-side 线程状态折叠回 leader-side task 状态的关键步骤
case: dependency-blocked-answer-resume-flow
用例意义
验证依赖门控、blocked 列表、answer 反馈以及最终恢复到完成态的完整交互链路。
前置条件
- 空数据库路径
TMPDIR/coord.db worker-a负责T1worker-b负责T2
输入
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" --summary "Implement backend APIs" --default-to worker-a
orch --db TMPDIR/coord.db --json task add --run run_blog_002 --task T2 --title "Build frontend" --summary "Implement frontend flows" --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
orch --db TMPDIR/coord.db --json dispatch --run run_blog_002 --task T1
inbox --db TMPDIR/coord.db --json claim --agent worker-a --thread THREAD_BACKEND
inbox --db TMPDIR/coord.db --json done --agent worker-a --thread THREAD_BACKEND --summary "Backend complete"
orch --db TMPDIR/coord.db --json reconcile --run run_blog_002
orch --db TMPDIR/coord.db --json ready --run run_blog_002
orch --db TMPDIR/coord.db --json dispatch --run run_blog_002 --task T2
inbox --db TMPDIR/coord.db --json claim --agent worker-b --thread THREAD_FRONTEND
inbox --db TMPDIR/coord.db --json update --agent worker-b --thread THREAD_FRONTEND --status blocked --summary "Need logging decision" --payload-json '{"question":"stdout or stderr?"}'
orch --db TMPDIR/coord.db --json reconcile --run run_blog_002
orch --db TMPDIR/coord.db --json blocked --run run_blog_002
orch --db TMPDIR/coord.db --json answer --run run_blog_002 --task T2 --body "Use stdout for MVP."
inbox --db TMPDIR/coord.db --json update --agent worker-b --thread THREAD_FRONTEND --status in_progress --summary "Decision applied"
inbox --db TMPDIR/coord.db --json done --agent worker-b --thread THREAD_FRONTEND --summary "Frontend complete"
orch --db TMPDIR/coord.db --json reconcile --run run_blog_002
orch --db TMPDIR/coord.db --json status --run run_blog_002
预期输出
- 初始
ready仅包含T1 T1完成并reconcile后,T2才出现在readyblocked返回T2与最新 questionanswer向活跃 thread 追加一条kind=answer消息- 最终
status中 run 进入done
断言结论
- 依赖门控和 blocked-answer 机制在同一个 run 中可以顺序衔接
answer不直接改 task 状态;真正的状态恢复仍依赖 worker 继续推进线程并由reconcile采集
case: strict-worktree-dispatch-to-cleanup
用例意义
验证代码任务的 strict worktree 路径能从 dispatch 一直走到 cleanup,确保隔离工作区既会被创建,也能在完成后被移除。
前置条件
TMPDIR/repo是一个已提交初始内容的 Git 仓库worker-a负责代码任务
输入
orch --db TMPDIR/coord.db --json run init --run run_blog_worktree_001 --goal "Validate strict worktree dispatch"
orch --db TMPDIR/coord.db --json task add --run run_blog_worktree_001 --task T1 --title "Implement backend" --default-to worker-a
orch --db TMPDIR/coord.db --json dispatch --run run_blog_worktree_001 --task T1 --repo-path TMPDIR/repo --workspace-root .orch/worktrees --strict-worktree --body "Implement inside isolated worktree."
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 "Backend complete"
orch --db TMPDIR/coord.db --json reconcile --run run_blog_worktree_001
orch --db TMPDIR/coord.db --json cleanup --run run_blog_worktree_001 --task T1 --attempt 1
预期输出
dispatch返回非空的attempt.base_ref、attempt.base_commit、attempt.branch_name、attempt.worktree_pathattempt.workspace_status == "created"cleanup返回被清理的 attempt 记录- 清理后
worktree_path不再存在于文件系统
断言结论
- strict worktree 不是单次 dispatch 细节,而是完整 attempt 生命周期的一部分
cleanup的目标是已完成或废弃的工作区,不应误删仍在活动中的执行目录
case: council-review-end-to-end
用例意义
验证 orch council 高层工作流可从 reviewer dispatch 一直走到 final report,且 grouped recommendations 与最终输出衔接一致。
前置条件
- 空数据库路径
TMPDIR/coord.db - 三个固定 reviewer 分别为
architecture-reviewer、implementation-reviewer、risk-reviewer
输入
orch --db TMPDIR/coord.db --json council start --run council_blog_001 --target "Review the current blog architecture."
inbox --db TMPDIR/coord.db --json claim --agent architecture-reviewer --thread THREAD_CR1
inbox --db TMPDIR/coord.db --json done --agent architecture-reviewer --thread THREAD_CR1 --summary "Review complete" --body '{"reviewer_role":"architecture-reviewer","findings":[...]}'
inbox --db TMPDIR/coord.db --json claim --agent implementation-reviewer --thread THREAD_CR2
inbox --db TMPDIR/coord.db --json done --agent implementation-reviewer --thread THREAD_CR2 --summary "Review complete" --body '{"reviewer_role":"implementation-reviewer","findings":[...]}'
inbox --db TMPDIR/coord.db --json claim --agent risk-reviewer --thread THREAD_CR3
inbox --db TMPDIR/coord.db --json done --agent risk-reviewer --thread THREAD_CR3 --summary "Review complete" --body '{"reviewer_role":"risk-reviewer","findings":[...]}'
orch --db TMPDIR/coord.db --json council wait --run council_blog_001 --timeout-seconds 2
orch --db TMPDIR/coord.db --json council tally --run council_blog_001 --similarity normal
orch --db TMPDIR/coord.db --json council report --run council_blog_001
预期输出
council start创建 3 个 reviewer task 并完成 dispatchcouncil wait在 3 个 reviewer 全部完成后返回all_complete == truecouncil tally返回 grouped recommendations,并按consensus|majority|minority分桶council report返回默认show == ["consensus","majority"],并产出 markdown artifact
断言结论
- council workflow 是建立在
orch调度面之上的高层流程,而不是独立基础设施 - final report 依赖已持久化的 grouped recommendations,因此
tally与report必须在契约上连续