feat(work-items): specify autonomous orchestrator-dispatch PR lifecycle (#572)#1244
Conversation
…le (#572) Resolves the previously-deferred autonomous orchestrator-dispatch lifecycle seam that spanned work-items, implementation, and source-control. Adopts the posted decision brief's Option A (orchestrator-owned PR invocation), reconciled with work-loop's landed interim workaround. - work-items (0.23.0): `work`'s execute step now specifies the full lifecycle — worker-side worktree provisioning (materialize via git worktree add / the non-entering seam, work via `git -C`, never enter; orchestrator never invokes `/source-control:worktree create`), orchestrator-owned PR creation after the pre-PR diff gate via the new `create --pushed` entry (worker scope-fence forbids PR creation), and fresh-subagent fix re-dispatch into the same persisted worktree. `work-loop`'s interim #572 workaround (SKILL + evals) is reframed as the now-canonical behavior it inherits; `work`'s evals updated. - implementation (0.8.0): `implement-dispatch`'s brief-composition step gains an additive, autonomous-scoped worker-side provisioning clause; the interactive "brief supplies the worktree path / anchor with git -C" default is unchanged. - source-control (0.26.0): `pull-request` gains a `create --pushed --worktree` PR-only entry (create.md §2.7) that re-resolves branch/diff from the target worktree, passes the branch explicitly to parse-branch-issue.sh, skips commit/push/rebase, and passes explicit `--head`; `worktree`'s create action documents that orchestrated provisioning does not use it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 3m 19s —— View job PR ReviewTasks:
SummaryThis PR correctly resolves the multi-plugin autonomous dispatch lifecycle gap tracked in #572. The three-facet design (worker-side provisioning, orchestrator-owned PR, same-worktree fix re-dispatch) is internally consistent, and the supporting changes to Finding 1 —
|
|
Claude finished @kyle-sexton's task in 1m 48s —— View job Security Review — PR #1244
ScopeAll 14 changed files reviewed:
No shell scripts, GitHub Actions workflows, package dependencies, or credentials are added or modified. FindingsNo CRITICAL or IMPORTANT security issues found. SUGGESTION — Confidence: LOW The new No other injection surfaces, path traversal vectors, authorization gaps, supply-chain changes (no action pins or dependency versions loosened), dangerous GitHub Actions patterns, or secret/credential flows are present in this diff. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 300ad22b03
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…-attach (#572) Address two P2 review findings on the #572 lifecycle spec: - create.md §2.7 verified "nothing unpushed" via `git log @{u}..`, which exits 128 when the worker pushed without `-u` (no upstream configured) even though the branch is fully on the remote. Replace with an upstream-independent remote-tip-equals-HEAD comparison. - work SKILL's provisioning clause always used `git worktree add -b <name>`, which fails on an existing branch — including one the user created via the Suggest-branch-name step's existing-branch detection. Attach an existing branch without `-b` in that case. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 2m 3s —— View job PR Review (updated after fix commit
|
|
Claude finished @kyle-sexton's task in 2m 42s —— View job Security Review — PR #1244Scope: Both commits reviewed ( No CRITICAL or IMPORTANT security issues found.SUGGESTION — Worker-returned path/branch injection surface (Confidence: LOW)File: The new §2.7 entry constructs shell commands from two worker-supplied values: the WT="<path>"
BRANCH=$(git -C "$WT" branch --show-current)
REMOTE=$(git -C "$WT" config "branch.$BRANCH.remote" 2>/dev/null || echo origin)
git -C "$WT" fetch -q "$REMOTE" "$BRANCH"
git -C "$WT" rev-parse "$REMOTE/$BRANCH" 2>/dev/null
gh pr create --head "$BRANCH" ...The quoting discipline is correct in every example. The practical injection surface is narrow for two reasons: git's own branch-naming validation rejects most shell metacharacters in branch names (spaces, One nuance worth noting: What's clean
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad7b1479d2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… worktree path (#572) Address two more review findings on the #572 lifecycle spec: - implement-dispatch Prerequisites (P1): `/implementation:implement` Step 1 stops on the default branch, but under worker-side provisioning the orchestrator legitimately stays on the default branch (it never edits source) and each worker provisions its own non-default branch first. Add an explicit exception so the branch-correct check governs where the worker's edits land, not the orchestrator's checkout — a default-branch autonomous start no longer parks at the preflight. - work SKILL (P2): the orchestrator's PR-only invocation now passes `--worktree <returned-path>` explicitly, since it stays in its own checkout and the mode needs the path to resolve the worker's branch and diff. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 1m 28s —— View job PR Review (updated after fix commit
|
| Finding | Commit | Status |
|---|---|---|
F2: @{u} upstream dependency |
ad7b147 |
✅ Fixed |
Codex P2-#2: -b on existing branch |
ad7b147 |
✅ Fixed |
F1: missing --worktree <path> in work/SKILL.md |
a692d8f |
✅ Fixed |
| Codex P1: preflight blocks orchestrator on default branch | a692d8f |
✅ Fixed |
The three-commit sequence is internally consistent and complete. The two fixes in a692d8f also cross-reinforce each other: the implement-dispatch exception explains why the orchestrator legitimately stays on the default branch, and the work/SKILL.md invocation now correctly names the path flag that create.md §2.7 requires to resolve the worker's branch from that position.
Overall: all identified gaps are closed. Ready to merge.
|
Claude finished @kyle-sexton's task in 2m 13s —— View job Security Review — PR #1244 (all 3 commits:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a692d8ffc7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ed worktree (#572) Address two more P1 review findings (consequences of the orchestrator staying on the default branch under worker-side provisioning), plus a proactive sibling fix: - Build/test gate and return verification (implement-dispatch cadence steps 3-4) must run against the returned worktree, not the orchestrator's default checkout, which lacks the worker's changes — else a worker-branch failure could pass. `main-side` means the orchestrator runs the gate, not that it runs in the orchestrator's checkout. - The phase-boundary plan-mark commit must land on the worker's branch (committed in the worktree via `git -C <path>`), not the orchestrator's default checkout, which would diverge local default from the remote and divorce plan progress from the PR branch. - Consolidated the principle in the Prerequisites exception, and anchored work's pre-PR diff gate to the worktree for the same reason. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 2m 18s —— View job PR Review (updated after fix commit
|
| Finding | Commit | Status |
|---|---|---|
F2: @{u} upstream dependency |
ad7b147 |
✅ Fixed |
Codex P2-#2: -b on existing branch |
ad7b147 |
✅ Fixed |
F1: missing --worktree <path> in work/SKILL.md |
a692d8f |
✅ Fixed |
| Codex P1: preflight blocks orchestrator on default branch | a692d8f |
✅ Fixed |
| Codex P1 #1: validation runs in orchestrator's checkout | 35a7bf9 |
✅ Fixed |
| Codex P1 #2: phase-mark commit lands on default branch | 35a7bf9 |
✅ Fixed |
The four-commit sequence is internally consistent and complete. The principle paragraph in implement-dispatch's Prerequisites exception now consolidates the worktree-anchoring rule for all three orchestrator-run operations (step 3 verify, step 4 build/test, phase-boundary commit), with work's pre-PR diff gate also corrected for the same reason. All identified gaps are closed.
Overall: ready to merge.
|
Claude finished @kyle-sexton's task in 2m 0s —— View job Security Review — PR #1244 (all 4 commits:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35a7bf91be
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ays consistent (#572) Reconcile two earlier fixes that could deadlock: the phase-boundary plan-mark commit lands in the worker worktree (advancing HEAD past the pushed tip), while `create --pushed`'s precondition asserts HEAD equals the remote tip. Require the plan-mark commit to be pushed — it keeps the worktree tip in sync with the remote (satisfying the precondition) and keeps tracked plan progress on the PR branch. Also make the interactive Suggest-branch-name step explicit about the autonomous hand-off (name carried in the brief; the worker creates the branch; the orchestrator still never creates it). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 3m 17s —— View job PR Review (updated after fix commit
|
| Finding | Commit | Status |
|---|---|---|
F2: @{u} upstream dependency |
ad7b147 |
✅ Fixed |
Codex P2-#2: -b on existing branch |
ad7b147 |
✅ Fixed |
F1: missing --worktree <path> in work/SKILL.md |
a692d8f |
✅ Fixed |
| Codex P1: preflight blocks orchestrator on default branch | a692d8f |
✅ Fixed |
| Codex P1 #1: validation runs in orchestrator's checkout | 35a7bf9 |
✅ Fixed |
| Codex P1 #2: phase-mark commit lands on default branch | 35a7bf9 |
✅ Fixed |
Codex P1: phase-mark commit not pushed before create --pushed |
df34a89 |
✅ Fixed |
| Codex P1: multi-phase worktree reuse ambiguity | — | |
Codex P2: origin fallback in remote resolution |
— |
Seven of nine findings are resolved. The two open items are:
- A spec ambiguity for multi-phase autonomous plans (Codex P1) — the two-branch briefing model implicitly handles it but doesn't call out the phase-1→phase-2 transition
- A narrow edge case for non-
originremote names increate.md §2.7(Codex P2)
Neither is blocking if the intended consumer projects use standard remote naming and single-phase plans; both are low-cost prose fixes if a follow-up is warranted.
|
Claude finished @kyle-sexton's task in 1m 55s —— View job Security Review — PR #1244 (all 5 commits through
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df34a895e7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Convergence sweep addressing four review findings — the remaining operational surfaces of the "orchestrator on default branch, worker in its own worktree" model: - implement-dispatch: provisioning is once-per-item (first phase); later phases of the same item reuse the persisted worktree rather than re-provisioning an already-checked-out branch (which fails). Consolidated statement now also states the plan-mark commit is committed AND pushed. - create.md §2.7: resolve the push remote via the shared resolve-remote.sh --push (run from the worktree) instead of assuming `origin`, so a non-origin/`-o vendor` clone or triangular fork flow verifies the ref at the right destination; compare against FETCH_HEAD. - work: monitoring and the review pass run from the persisted worktree (which owns the PR branch) with the PR number passed explicitly — the orchestrator's default-branch session cannot host pull-request monitor's branch-owning watch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 2m 22s —— View job PR Review (updated after fix commit
|
| Finding | Commit | Status |
|---|---|---|
F2: @{u} upstream dependency |
ad7b147 |
✅ Fixed |
Codex P2-#2: -b on existing branch |
ad7b147 |
✅ Fixed |
F1: missing --worktree <path> in work/SKILL.md |
a692d8f |
✅ Fixed |
| Codex P1: preflight blocks orchestrator on default branch | a692d8f |
✅ Fixed |
| Codex P1 #1: validation runs in orchestrator's checkout | 35a7bf9 |
✅ Fixed |
| Codex P1 #2: phase-mark commit lands on default branch | 35a7bf9 |
✅ Fixed |
Codex P1: phase-mark commit not pushed before create --pushed |
df34a89 |
✅ Fixed |
| Codex P1: multi-phase worktree reuse ambiguity | 7a81507 |
✅ Fixed |
Codex P2: origin fallback in remote resolution |
7a81507 |
✅ Fixed |
| Codex P1: monitoring dispatched from orchestrator's own checkout | 7a81507 |
✅ Fixed |
The six-commit sequence is internally consistent and complete. The final commit's three fixes cross-reinforce each other: once-per-item provisioning (commit 1 is the first phase) feeds the persisted-worktree path into the monitoring dispatch (commit 2), and the push-remote resolver correctly verifies the push destination the first-phase worker used (commit 3). No remaining gaps.
Overall: all identified gaps are closed. Ready to merge.
|
Claude finished @kyle-sexton's task in 2m 48s —— View job Security Review — PR #1244 (commit
|
Closes #572
Summary
Resolves the previously-deferred autonomous orchestrator-dispatch lifecycle — the seam that spanned
/work-items:work,/implementation:implement-dispatch,/source-control:worktree, and/source-control:pull-request, where each sibling skill's preflight assumed the others already solved provisioning and PR-creation timing. Adopts the posted decision brief's Option A (orchestrator-owned PR invocation), reconciled with the interim worker-side-provisioning workaround already landed inwork-loop.The lifecycle is now specified end-to-end across its three facets:
/source-control:worktree's non-entering seam when installed, or a plaingit worktree add) and works it viagit -Cwithout entering it — matchingimplement-dispatch's existing worktree-cwd contract, and avoiding any dependency onEnterWorktree-in-a-subagent. The orchestrator never invokes/source-control:worktree create(itsEnterWorktreeterminal would transition the orchestrator's own session). The worker commits, pushes, and brings the branch current with the default branch before returning the worktree path + branch; a worker that cannot provision parks and escalates./source-control:pull-request create --pushed --worktree <path>PR-only entry that re-resolves branch and diff from the target worktree (ignoring the session-cwd pre-computed context), passes the branch explicitly toparse-branch-issue.shsoCloses #Nis parsed from the worker's branch, skips commit/push/rebase, and callsgh pr create --head <branch>. The worker scope-fence forbids PR creation; detection of a consuming project's own PR stage lives in the orchestrator (invoke-vs-defer).worklane.work-loop's former interim#572workaround (SKILL + evals) is reframed as the now-canonical behavior it inherits fromwork.Authority
The
needs-human+wayfind: designdecision was delegated to the session by the operator (sessiond557362fhandoff, "have you do ALL of these"); the delegation is the human decision. A decision-adoption comment is posted on #572. Labels are left in place — repo convention keepsneeds-human/wayfind: designon issues through close (e.g. #1065, #1041, #696, #695, #684 all retain them closed).Test plan
--check-bump origin/main: green — all three bumped plugins (work-items 0.22.1→0.23.0, implementation 0.7.8→0.8.0, source-control 0.25.1→0.26.0) carry a matching## [<version>]CHANGELOG entry.check-skill.sh) on all 5 changed skills (work,work-loop,implement-dispatch,pull-request,worktree): PASS, 0 errors (only pre-existing line-count / Gotchas / quote-style warnings inherited from base).check-skill-portability,check-skill-leaf-names,check-orphaned-fixtures,check-silent-skips: all green.evals.json(work,work-loop) validate againstplugins/skill-quality/reference/evals.schema.json.preflight.test.shand the shared-lib tests are unaffected.Related
userConfigcap scope.## Related) — no template scaffolds the required sections #462 — orchestrator-dispatch and PR-contract-forward lane lineage referenced by the execute step.🤖 Generated with Claude Code