Skip to content

fix(source-control): ready's verify gate checks the shell's checkout, not the PR's worktree #9075

Open

Description

@kyle-sexton

Problem

The ready phase's verify gate runs bash scripts/check-affected.sh --tests by a path relative to the shell's working directory (plugins/source-control/skills/pull-request/reference/ready-for-review.md:204). A session that runs /source-control:pull-request ready from the main checkout for a PR built in a worktree runs the main checkout's script against the main checkout, not the PR's tree. Before #9072 that printed "0 changed files" and recorded pass (#9051; seen on #9041, #9048, #9062, #9064). After #9072 it exits 2 when the main checkout is behind origin/main, and still passes over 0 files when it is exactly at origin/main.

Fix

Run the gate against the PR's tree: invoke the script from the PR worktree's top level (for example bash "$(git -C <pr-worktree> rev-parse --show-toplevel)/scripts/check-affected.sh" --tests, or CHECK_DATA_ROOT=<pr-worktree> once #9072 lands), and record the result against that tree's HEAD.

Acceptance

  • Ready run from the main checkout for a worktree PR lists the PR's changed files in the gate output.
  • The recorded head is the PR worktree's HEAD.

Related

Activity

  1. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 22, 2026
  2. github-actions commented on Oct 22, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: scoped
    Basis: automated intake triage; the lanes App applied this class.

    Size: Small
    Complexity: Low
    Uncertainty: Known
    Flags: none
    Blocked by: none

    Understood: the ready phase's verify gate runs check-affected.sh relative to the shell's checkout and records the shell's HEAD. For a PR built in a worktree, it checks the wrong tree. The fix is to run the gate from the PR worktree, or set CHECK_DATA_ROOT to it, and to record that worktree's HEAD. #9072 has already landed, so nothing blocks this. The refinement comment lists the acceptance criteria. No likely duplicates found. Related: #9051, #8994, #8753.

    Automated triage, applied by the lanes App.

  3. added
    priority: mediumReal value, no hard deadline; normal backlog flow.
    and removed
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 22, 2026
  4. github-actions commented on Oct 26, 2026

    @github-actions
    Contributor

    The triage sweep dispatched intake triage for this issue (attempt 1 of 2).

  5. added
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.
    status: confirmedA maintainer confirmed the item is real and in scope; ready to be worked.
    and removed
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    on Oct 26, 2026
  6. melodic-automation-lanes commented on Oct 26, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: no trusted-human acceptance criteria: a listed human must put the confirmed - [ ] criteria in the body or post them as their own comment, or, on an issue a listed human filed, intake's newest refinement comment must hold them unedited. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  7. melodic-automation-lanes commented on Oct 26, 2026

    @melodic-automation-lanes
    Contributor

    The latest triage verdict holds nothing: the issue is at status: ready.

  8. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    and removed
    status: confirmedA maintainer confirmed the item is real and in scope; ready to be worked.
    on Oct 26, 2026
  9. melodic-automation-lanes commented on Oct 26, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: Ready's verify gate and its record command run against the PR's worktree and record that worktree's HEAD, not the shell's checkout.

    Acceptance criteria

    • plugins/source-control/skills/pull-request/reference/ready-for-review.md no longer runs bash scripts/check-affected.sh --tests relative to the shell's working directory in the verify gate command (formerly line 204)
    • The gate command names the PR worktree, found from the PR's head branch (e.g. via git worktree list), and runs check-affected.sh with --tests from that tree's top level or with CHECK_DATA_ROOT set to it
    • The --head passed to verify-gate.sh record is git -C &lt;pr-worktree> rev-parse HEAD, not the shell's HEAD
    • The doc text below the command (formerly the 'Without scripts/check-affected.sh' fallback paragraph and the 2.5.3 completion criterion) also refers to the PR worktree's HEAD, not the shell's
    • The doc says what to do when the PR branch is checked out nowhere, or when the shell already sits in the PR worktree (same result as before)
    • A test or eval case in plugins/source-control/skills/pull-request (evals/evals.json or a script test) covers ready run from a different checkout than the PR worktree, expecting the PR's changed files in the gate output and the PR worktree HEAD recorded
    • Any repo markdown or lint check that covers the edited files passes (scripts/check-affected.sh run in the PR tree exits 0)

    Dependencies

    • #​9072 (CHECK_DATA_ROOT support in scripts/check-affected.sh): already in the base checkout (scripts/check-affected.sh:56-104), so nothing is waiting on it.

    Related work

    Sources read

    • plugins/source-control/skills/pull-request/reference/ready-for-review.md:188-217: the verify gate runs bash scripts/check-affected.sh --tests by a relative path and records git rev-parse HEAD from the shell's working directory
    • scripts/check-affected.sh:56-104: CHECK_DATA_ROOT names the tree to check, so #​9072 has landed
    • scripts/check-affected.sh:234: with 0 changed files and HEAD not at base it exits 2, telling the caller to run inside the tree or name it in CHECK_DATA_ROOT
    • plugins/source-control/skills/pull-request/SKILL.md:154: ready already pre-checks git worktree list for a branch checked out in another worktree

    Automated refinement by the lanes App. Intake triages the issue again with it.

  10. removed
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 26, 2026
  11. added
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    and removed on Oct 26, 2026
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

    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.priority: mediumReal value, no hard deadline; normal backlog flow.status: readyTriaged, unblocked, and fully specified; eligible to pick up.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions