Skip to content

Worktree Gate Resolution Keeps repos/ Clones on the Workspace and Checks Stale Worktrees #612

Closed

Description

@dan-petty

Problem

#585 fixed #582 for nested worktrees, but its resolver stops at the first directory with its own .git. That changes two things #582 said must stay as they were ("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"). It also leaves stale worktrees on the old behaviour.

Run from Before #585: gate / data After #585: gate / data Expected: gate / data
Clone under repos/ workspace / workspace clone / clone workspace / workspace
Worktree of that clone workspace / workspace clone worktree / clone workspace / workspace
Nested worktree whose git directory was pruned or whose checkout moved main checkout / main checkout main checkout / main checkout that worktree / main checkout
  • Clones under repos/: main_worktree_root now puts a clone's reviews, caches and catalogue in repos/<org>/<repo>/.data, inside the clone's own working tree, instead of the workspace's shared data directory.
  • Stale worktrees: a worktree whose .git file names a missing git directory still resolves to the enclosing checkout, so the gate silently checks the main checkout again.

The gate also names its root only in the concurrent run's "Executing CI quality gates" line. A cache hit, and a single check such as devops ci test run by the pre-commit hook, never show which tree they judged. commands/ci.py keeps an import-time _ROOT snapshot, so a long-lived process that imported it from another directory cleans the wrong tree's coverage files.

Expected

  • Clones under repos/, their worktrees and submodules resolve as they did before fix(cli): gate checks the worktree it runs in, not the main checkout (#582) #585, for both the gate and shared data.
  • A stale linked worktree checks itself, and the gate warns with the fix for each cause.
  • The gate names its root before the cache lookup and for single checks.
  • The root is resolved when needed, not at import.

Activity

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

    @dan-petty
    OwnerAuthor

    Closed by #614, 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.

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/p1-highscope/clitype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions