Repository navigation
fix: reject --base combined with --scope working-tree - #128
Open
behruznassre wants to merge 1 commit into
Open
behruznassre wants to merge 1 commit into
behruznassre wants to merge 1 commit into
Conversation
resolveReviewTarget() returned a branch review for any --base before it read --scope, so `--base main --scope working-tree` reviewed main...HEAD and silently skipped the staged and unstaged changes it was asked to review. An unknown scope passed with --base also skipped validation. Validate the scope first, then refuse the base/working-tree pair with a message that says which flag to drop. --base with auto or branch scope is unchanged. The review skills now say not to combine the two. Fixes sendbird#126 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
resolveReviewTarget()validates--scopebefore it looks at--base, so an unknown scope is rejected whether or not--baseis given--base <ref>with--scope working-treeis refused with a message that says which flag to drop, instead of silently returning a branch review--basewithautoorbranchscope, and--scope working-treeon its own, behave as beforeRoot cause
The
if (baseRef)early return came first, so the scope check never ran when--basewas present. A working-tree review always compares againstHEAD, so there is no meaningful way to honor both flags. Picking one silently is how staged work went unreviewed.Validation
main(19e5651) returns{ mode: 'branch', baseRef: 'main' }for bothscope: "working-tree"andscope: "bogus"resolveReviewTargetrows intests/git.test.mjs: the two rejection rows fail onmainand pass with the fix; the branch-scope and working-tree-only rows pass on bothnode scripts/claude-companion.mjs review --base main --scope working-tree(andadversarial-review) now exits 1 with the message before any job is creatednpm run check: unit 518 passed, integration 45 passed, Codex E2E 23 passed; lint, typecheck, version-sync and changelog OKFixes #126
🤖 Generated with Claude Code