Repository navigation
fix(code-review-gate): give the headless and user lanes the root's range - #234
Merged
Merged
Conversation
The headless and user-run lanes invoked /code-review with an effort
level only, so the built-in picked its own base. It tries
@{upstream}...HEAD first; once the branch is pushed that range is
empty, and it either falls back to the default branch or reviews the
working tree alone, missing the branch's committed work. The gate held
the root but used it only to restrict those lanes to default-branch
roots, which excluded one wrong base without supplying the right one.
Both lanes now append <root-rev>...HEAD, which the built-in honors: a
branch cut from an integration branch is reviewed without that
branch's commits. With the base supplied, the chain is the same three
lanes for every root.
The gate scope - the committed range, uncommitted changes, and
untracked files - is now defined once and handed to the subagent lane
by reference. When all three are empty the gate halts before any lane,
so an empty range never reaches a reviewer whose "(none)" would pass
as a clean review.
Closes #229
Given a range alongside a non-empty committed diff, the built-in reviews the range and the uncommitted changes but can leave untracked files out of its findings, stating they are outside the diff. The subagent lane reads untracked contents explicitly, so while untracked files exist the chain is that lane alone; the other two lanes are neither entered nor abandoned and return once nothing is untracked.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The Lane 1 command permits shell evaluation of metacharacters in a substituted root ref.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Updates code-review-gate so every review lane uses the caller-supplied diff root.
Changes:
- Defines gate scope and empty-scope handling.
- Passes
<root-rev>...HEADto review lanes. - Bumps the plugin version.
| File | Description |
|---|---|
skills/code-review-gate/SKILL.md |
Revises review scope and lane selection. |
.claude-plugin/marketplace.json |
Bumps version to 2026.9.9. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
code-review-gateran Claude Code's built-in/code-reviewin its headless lane (Lane 1) and its user-run lane (Lane 2) with an effort level and nothing else, so the built-in chose its own base. It reaches for@{upstream}...HEADfirst; once the branch is pushed that range is empty, and it then reviews against the default branch or reviews the working tree alone. The gate held the root, the branch the work merges into, but used it only to keep those two lanes to runs whose root is the default branch, which ruled out one wrong base without supplying the right one. Both lanes now pass the root's range, so the base no longer depends on what the reviewer infers.Closes #229
Changes
git diff <root-rev>...HEAD, where<root-rev>isorigin/<root>for a branch root, after a fetch of the root), plus uncommitted changes, plus untracked files. The subagent lane (Lane 3) is handed it by reference.claude -p --model opus "/code-review <effort> <root-rev>...HEAD" --output-format text, and Lane 2 asks the user to run/code-review <effort> <root-rev>...HEAD.(none)would read as a clean pass.Verification
Each run below is
claude -p --model opus "/code-review <effort> <target>" --output-format textin a scratch repository whose root and branch were pushed to a bareorigin:intcarrying its own planted bug, targetorigin/int...HEAD: atlowand again atmediumthe review reported only the branch's own bug. The same repository with no target reported both bugs.origin/main...HEAD: twolowruns and onemediumrun each reported the committed and uncommitted bugs. The untracked bug was reported in onelowrun; themediumrun named it but did not report it, stating the file was untracked and outside the diff. With no target, the committed bug was missed, since the pushed branch left@{upstream}...HEADempty.origin/main...HEAD: twomediumruns each reported its bug.origin/main...HEAD: the output was(none)alone, without naming the range read.pre-commit(mdformat) passed onskills/code-review-gate/SKILL.mdand.claude-plugin/marketplace.json.Notes
(none)alone.