Skip to content

docs(workflow): make parallel worktree lanes mergeable across Codex tasks #184

Description

@lidge-jun

Problem

Parallel OpenCodex rounds now have several independent PRs targeting dev at the same time. The repository has the pieces for this workflow, but the lane manifest, collision check, hosted-CI handoff, and merge ownership are spread across separate rules. That makes it easy to create duplicate work for one issue, let a lower layer drift while an upper layer is being reviewed, or recover the wrong worktree after a timeout or context compaction.

The current round is a concrete example: #4741, #4737, #4729, #4736, and #4743 are separate new PRs with different authors and overlapping integration pressure. The links below are evidence for the workflow design; they are not a request to merge those PRs automatically.

Existing evidence

These pages and the current authenticated GitHub state were researched through the Aside signed-in browser session on 2026-09-16.

Proposed workflow contract

  1. Create one isolated worktree task per implementation lane. Record lane id, task id, worktree path, branch, base SHA, source PR or issue, owner, touched-path summary, and current head SHA.
  2. Before writing, fetch origin/dev and check open PRs and existing worktrees for the same issue, branch, and dominant files. A collision must be resolved by choosing one owner or making the lanes explicitly disjoint.
  3. The thread owns its worktree. In-lane subagents may inspect or edit only the assigned scope and must not merge, retarget, rebase, or push another lane. The host owns rebase decisions and the final merge.
  4. Verify hosted CI at the exact head SHA. Record workflow event, ref, check-run IDs, and whether path filters omitted a required shard. A heartbeat or timeout is a wakeup mechanism, not evidence that work is complete.
  5. Merge an ordinary stack bottom-up. For a cumulative child chain, follow the DEV-STACK-08 top-down cascade into its parent before the parent lands in dev. After absorbing a newer dev head, rerun exact-head tip evidence before merging.
  6. Treat branch cleanup as a separate lifecycle decision. Never delete or recreate a long-lived integration branch as part of routine closed-PR cleanup.

Acceptance criteria

  • Add a concise lane-manifest and collision-preflight recipe to the relevant CodexClaw workflow documentation.
  • Define the ownership boundary between host, worktree thread, and in-lane subagent, including the rule that the host makes rebase and merge decisions.
  • Define exact-head hosted-CI evidence and the recovery procedure after timeout or context compaction.
  • Document ordinary bottom-up stacks, the DEV-STACK-08 cumulative-child exception, and the [WRONG BRANCH] expectation for stacked children.
  • Add a lightweight regression or fixture that detects duplicate issue ownership or a missing lane base/head record without running repository-wide tests.
  • Keep the workflow compatible with repositories that prohibit local suites and use hosted CI as the verification source.

Scope

This issue is for CodexClaw workflow guidance and its smallest supporting checks. It does not merge or rewrite the OpenCodex candidate PRs listed above, and it does not introduce a replacement runtime or a new GitHub-native stack dependency.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions