Skip to content

fix: use three-dot diff for scope drift detection in /review#221

Open
roblambell wants to merge 1 commit intogarrytan:mainfrom
roblambell:fix/review-scope-drift-three-dot-diff
Open

fix: use three-dot diff for scope drift detection in /review#221
roblambell wants to merge 1 commit intogarrytan:mainfrom
roblambell:fix/review-scope-drift-three-dot-diff

Conversation

@roblambell
Copy link
Copy Markdown
Contributor

Summary

  • /review Step 1.5 (Scope Drift Detection) used two-dot git diff origin/<base> --stat, which shows the full tree difference between HEAD and the base ref
  • On rebased feature branches, this includes commits already on the base branch, producing false-positive "scope drift" findings for changes the author did not introduce
  • Switched to three-dot git diff origin/<base>...HEAD --stat (merge-base diff), which shows only changes introduced on the feature branch
  • This matches what /ship already uses for its line-count stat

How it was found

Contributor mode filed a field report after /review flagged unrelated version bumps and date changes as scope drift on a rebased feature branch. The changes came from main via rebase, not from the feature work.

Test plan

  • bun test passes
  • Validated live: ran /review on a rebased feature branch — scope drift step no longer flags rebased-in changes from main

The scope drift step (Step 1.5) used `git diff origin/<base> --stat`
(two-dot), which shows the full tree difference between the branch tip
and the base ref. On rebased branches this includes commits already on
the base branch, producing false-positive "scope drift" findings for
changes the author did not introduce.

Switch to `git diff origin/<base>...HEAD --stat` (three-dot / merge-base
diff), which shows only changes introduced on the feature branch. This
matches what /ship already uses for its line-count stat.
@roblambell roblambell force-pushed the fix/review-scope-drift-three-dot-diff branch from ec379fe to 8659b6d Compare March 19, 2026 18:53
garrytan added a commit that referenced this pull request Mar 23, 2026
24601 pushed a commit to 24601/gastack that referenced this pull request Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant