Skip to content

Gate Checks the Worktree It Runs In, Not the Main Checkout (devops ci) #582

Closed

Description

@dan-petty

Problem

devops ci resolves its root with find_top_level_repo_root() (src/devops_cli/core/repo.py), which keeps the top-most parent directory holding .git or pyproject.toml. Every check then runs there. Claude Code and its workflow tool create agent worktrees under .claude/worktrees/, inside the main checkout, so from such a worktree the gate checks the main checkout's files instead of the branch being committed or pushed.

The same applies to the devops-ci-pre-push and devops-ci-test-changed pre-commit hooks, which call devops ci, and to the other commands that verify the current tree through the same resolver: devops test, devops uv, devops release and devops scan complexity.

Observed

Pushing #580 from a worktree at .claude/worktrees/roadmap-vibes failed the pre-push gate. Lint, typecheck and uv check failed on src/devops_cli/ai/schema_reflection.py, which is another session's uncommitted file in the main checkout and does not exist on the pushed branch. The same branch, checked out in a worktree outside the checkout, resolved to itself and passed.

The reverse case fails open: a broken branch in a nested worktree passes the gate whenever the main checkout is clean.

Expected

A gate run from a linked worktree checks that worktree. The main checkout, submodules and repositories cloned under repos/ keep resolving as they do today, and the shared data directory from #553 still resolves to the main worktree.

Roadmap: "Gate Checks the Worktree It Runs In, Not the Main Checkout (devops ci)".

Activity

  1. added this to the v0.2.23 milestone on Sep 25, 2026
  2. added
    type/bug
    scope/cli
    priority/p0-critical
    on Sep 25, 2026
  3. dan-petty commented on Sep 25, 2026

    @dan-petty
    OwnerAuthor

    Closed by #585, merged into release/v0.2.23.

    GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by devops gh issues close-merged.

  4. added a commit that references this issue on Sep 25, 2026
    28d9d81
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

    priority/p0-criticalscope/clitype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions