Skip to content

Add explicit review target selection - #78

Open
dbrosio3 wants to merge 4 commits into
mainfrom
add-explicit-review-target-selection
Open

Add explicit review target selection#78
dbrosio3 wants to merge 4 commits into
mainfrom
add-explicit-review-target-selection

Conversation

@dbrosio3

Copy link
Copy Markdown
Member

Summary

  • keep review.target_branch as the configured default while detecting ambiguous review bases
  • offer an interactive review-target selector for stale targets, existing destination branches, and stacked branches
  • support arrow-key or numeric selection, custom refs, and the one-push pushgate.review-target=<ref> override
  • use the selected target consistently for deterministic checks, plugins, policies, and local AI review
  • print the selected review target and resulting review/scan ranges in the transcript
  • validate one-push overrides and preserve terminal input around escape sequences

Why

Choosing the wrong comparison base can produce an inflated changed-line count and incorrectly block a push through ai.max_changed_lines. This PR makes the comparison target explicit when local Git state offers multiple plausible bases.

Related investigation: https://app.notion.com/p/39f59347eba68032bb83e9fdafe8cad5

Developer impact

Unambiguous pushes continue using the configured target without prompting. Ambiguous interactive pushes ask the developer to choose a target; ambiguous non-interactive pushes fail closed with override guidance. Pushgate does not fetch or mutate refs during selection.

Validation

  • pnpm run typecheck
  • 26 focused tests across workflow-run-plan, terminal, pre-push-stdin, and warning-confirmation
  • pnpm run bundle
  • git diff --check

@dbrosio3
dbrosio3 marked this pull request as ready for review August 13, 2026 16:00
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