4.6 KiB
4.6 KiB
Case: strict-worktree-dispatch-launches-worker-through-codex-bridge
Test Type
This is a forward-test and a worktree launch-bridge validation.
The goal is to verify that a leader using the packaged orch skill can dispatch a code task, render a standardized worker brief from the saved dispatch JSON, and launch a worker subagent that respects the assigned worktree contract.
Purpose
Validate that all of the following can be true at the same time:
- the leader can dispatch a code task with
--execution-mode codethrough the bundled orch skill - the leader can turn that dispatch JSON into a stable worker brief through
./assets/orch-worker-brief - the launched worker subagent uses
skills/inbox/and reports through inbox - the launched worker observes the assigned
worktree_pathand completes the attempt - the leader can reconcile the finished task and clean the attempt worktree
Preconditions
- orch skill path exists:
ORCH_SKILL_PATH=skills/orch - inbox skill path exists:
INBOX_SKILL_PATH=skills/inbox - bundled CLI executables exist at
ORCH_SKILL_PATH/assets/orchandINBOX_SKILL_PATH/assets/inbox - the helper asset exists at
ORCH_SKILL_PATH/assets/orch-worker-brief - use an empty temporary directory
TMPDIR - initialize
TMPDIR/coord.dbbefore launching role agents throughINBOX_SKILL_PATH/assets/inbox --db TMPDIR/coord.db --json init - create
TMPDIR/repoas a Git repository with one committed file before launching agents
Agent Topology
leader
The leader is responsible for spawning the code-writing worker subagent after dispatch.
Inputs
Leader Prompt
Use $orch at ORCH_SKILL_PATH to act as leader on the already initialized SQLite DB TMPDIR/coord.db. Only coordinate through the bundled orch CLI from the skill. Workflow: 1) create run run_blog_skill_launch_worktree_001, 2) add one code task T1 for worker-a, 3) dispatch it with --execution-mode code --repo-path TMPDIR/repo --workspace-root .orch/worktrees while saving --json to TMPDIR/dispatch.json, 4) render a worker brief with ORCH_SKILL_PATH/assets/orch-worker-brief into TMPDIR/worker-brief.txt, 5) spawn one worker subagent that uses INBOX_SKILL_PATH and the generated worker brief, 6) wait until the worker completes, 7) inspect final status, 8) clean up attempt 1, 9) stop after reporting RUN_ID, THREAD_ID, and WORKTREE_PATH. Do not use ordinary chat to coordinate with the worker; the launched worker must use inbox only and should respect the assigned worktree.
Execution Parameters
- use the shared execution contract from README.md
- use the shared timeout defaults from README.md
- do not override the default cleanup policy
Execution Steps
- Initialize
TMPDIR/coord.dbonce through the bundled inbox CLI before launching agents - Create
TMPDIR/repowith an initial commit before launching agents - Inject
skills/orch/intoleader - Ensure
leadercan also referenceskills/inbox/by path when it spawns the worker subagent - Point the leader at the same database path
TMPDIR/coord.db - Launch
leader - Wait for
leaderand any spawned worker subagent(s) to finish - Resolve
THREAD_IDandWORKTREE_PATHfrom the leader output - Independently run the validation commands from the main thread
Validation Commands
ORCH_SKILL_PATH/assets/orch --db TMPDIR/coord.db --json status --run run_blog_skill_launch_worktree_001
INBOX_SKILL_PATH/assets/inbox --db TMPDIR/coord.db --json show --thread THREAD_ID
test -f TMPDIR/dispatch.json
test -f TMPDIR/worker-brief.txt
test ! -d WORKTREE_PATH
Expected Outcomes
- the leader reports a non-empty
WORKTREE_PATHfrom dispatch - the rendered worker brief includes that same
worktree_path - the launched worker subagent claims the assigned thread and completes it through inbox
- the final run status is
done - the cleanup step removes the worktree directory
Assertions
status.data.run.status == "done"status.data.tasks[0].status == "done"status.data.tasks[0].latest_attempt.worktree_path == WORKTREE_PATHshow.data.thread.status == "done"- the task-side thread history includes a payload field or body content referencing the worktree path
TMPDIR/worker-brief.txtmentions the expectedWORKTREE_PATHWORKTREE_PATHdoes not exist after cleanup
Cleanup
- use the default cleanup policy from README.md
- if the run fails, retain
TMPDIR,coord.db, and the Git repo fixture for replay and manual inspection
Recorded Example Run
- no recorded run yet
- this case should be captured with a real leader agent plus leader-launched worker subagent after the launch bridge assets are adopted