You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(source-control): ready's verify gate checks the shell's checkout, not the PR's worktree #9075
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.
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.
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).
melodic-automation-lanes commented on Oct 26, 2026
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 <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.
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.
Activity
github-actions commentedon Oct 22, 2026
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.
github-actions commentedon Oct 26, 2026
The triage sweep dispatched intake triage for this issue (attempt 1 of 2).
melodic-automation-lanes commentedon Oct 26, 2026
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).melodic-automation-lanes commentedon Oct 26, 2026
The latest triage verdict holds nothing: the issue is at
status: ready.melodic-automation-lanes commentedon Oct 26, 2026
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
bash scripts/check-affected.sh --testsrelative to the shell's working directory in the verify gate command (formerly line 204)git worktree list), and runs check-affected.sh with--testsfrom that tree's top level or with CHECK_DATA_ROOT set to it--headpassed to verify-gate.sh record isgit -C <pr-worktree> rev-parse HEAD, not the shell's HEADDependencies
Related work
Sources read
bash scripts/check-affected.sh --testsby a relative path and recordsgit rev-parse HEADfrom the shell's working directorygit worktree listfor a branch checked out in another worktreeAutomated refinement by the lanes App. Intake triages the issue again with it.