Skip to content

Review Pass: wait until a pull request's head has been quiet before reviewing it #1974

Open

Description

@JacobStephens2

This was generated by AI during triage.

Problem

A review --author <login> Pass takes a pull request as soon as its head is unreviewed, even if the author pushed it seconds ago and is still working. A Review session runs for 20 to 45 minutes, so an author who pushes again in that time makes the run fail at delivery with the branch moved during Review run. Its fixes are stranded (#1961), and the session's work is wasted.

Observed on 2026-11-10 (thirdshift 0.27.0, a private repository, one Review Pass every two minutes):

Time (UTC) Event
17:08 Author commits head A
17:10 Review run starts on A
17:17 Author pushes B; the run later fails at delivery, and its fixes are stranded
18:46, 19:08 Author pushes twice more
19:14 The next Review run starts on the latest head, 6 minutes after it was pushed

An earlier run on another pull request failed the same way (pull request changed during Review run).

Proposed behavior (for triage to decide)

Treat a pull request's head as waiting only once it has been quiet for a while. This mirrors pickup.wait_minutes, which keeps an issue out of a Pickup run until 30 minutes after its latest shaping event (src/config.rs):

  • A new User config setting, review.wait_minutes (default to be decided, 0 disables). The Review Pass skips a pull request whose head was pushed less than that many minutes ago, and still takes a later eligible one.
  • review <PR URL> typed by hand ignores it, as pickup.wait_minutes is ignored for an Issue URL.

This prevents most #1961 cases. #1961 is still needed for the rest.

Decisions needed

Activity

  1. added
    enhancement
    needs-triage
    in-progress
    and removed
    needs-triage
    on Nov 10, 2026
  2. JacobStephens2 commented on Nov 11, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Investigation summary

    Confirmed against selected Base commit 6f4ba5d (thirdshift 0.28.0): Review Pass admission has no head-age check. src/github/review.rs:122 selects by author, eligibility, reviewed-head markers and stacked-base review status, then sorts by issue number. src/processes/review.rs:38 reserves and rechecks candidates before dispatch. A freshly pushed, unreviewed head can therefore start immediately.

    src/processes/review/delivery.rs:228 refuses publication when the remote head differs from the captured head. The existing regression address_mode_reports_a_moved_head_but_stops_publication_after_base_or_eligibility_changes confirms that fixes remain unpublished after concurrent head movement. src/worktree/review_recovery.rs:309 requires a retained checkout's captured head to match the requested head. A quiet period can reduce starts during active push bursts; it cannot prevent later pushes or replace #1961 recovery.

    The issue's Pickup analogy needs updating: src/config.rs:186 defaults pickup.wait_minutes to 5 minutes, not 30. src/config/review.rs currently supports only commands_by_repo and rejects unknown settings.

    Recommended direction

    Use branch activity as the primary push clock. GitHub's repository activity API supports branch filtering and returns timestamps with before/after SHAs. Read-only queries in this repository confirmed these fields for normal pushes and force pushes. Correlate the latest relevant activity with the current branch and head; account for pagination, branch creation, merges and rewinds.

    Do not substitute commit dates: the timeline committed event has no documented push timestamp (event documentation). Check suites can be reused across branches (check-suite documentation), and GraphQL pushedDate is unsupported (Commit documentation).

    After the Day shift settles the policies below, add review.wait_minutes as a nonnegative whole-minute duration, with 0 disabling waiting. Apply it to both addressing and recommendation-only author Passes; explicit PR URLs bypass it. Pass over settling candidates and continue to later eligible PRs. Recheck quietness for the actual captured head before starting a session: today's reservation recheck compares PR URLs, so adding an age check only to the initial listing would leave a selection race. Preserve Delivery's head checks and push lease.

    Cover threshold boundaries, old commits pushed recently, normal/force pushes, absent activity, pagination, head changes during selection, later-candidate selection, disabled waiting, explicit-URL bypass and the chosen draft policy. Update config defaults/setup coverage, GLOSSARY.md, docs/guide.md and the hand-written site's Review Pass description; regenerate the manual.

    Validation

    cargo test --test review_pass -- --test-threads=3: 14 passed, 1 ignored fixture entry point. cargo test --test review_run address_mode_reports_a_moved_head_but_stops_publication_after_base_or_eligibility_changes -- --exact --test-threads=1: passed. scripts/affected-tests main: no changed files; no affected tests.

    No duplicate quiet-period issue was found in open-issue searches. Keep #1961 retained-work recovery, #1962 conflict visibility, #1800 stale-start handling and #1965 Triage settling separate. Recommend ready-for-human for the remaining product decisions and proposed split, not for missing reporter evidence.

    Questionnaire

    For the Day shift deciding #1974: repository investigation confirms that Review Passes accept fresh unreviewed heads and that concurrent pushes prevent delivery. GitHub's branch activity API supplies a usable push clock. These decisions remain before implementation:

    1. What should review.wait_minutes default to? Recommend 30 minutes as an initial policy, with 0 disabling waiting. This is a latency tradeoff, not an empirically established optimum; Pickup currently defaults to 5 minutes.
    2. Should marking a draft ready for review restart the window even when its head is unchanged? Recommend yes, measuring from the later of head activity and readiness. This determines whether a long-lived draft can start immediately when published.
    3. What should happen when matching branch activity is absent or unreadable? Recommend a durable first-observed-head timer for missing history, reset when the branch/head changes, and holding the candidate with a diagnostic on API errors. Approve this conservative fallback or choose a different policy; commit and check-suite dates cannot reliably establish push time.
    4. Should settling skips name the PRs and their eligibility deadlines? Recommend a stable Activity-log reason listing PR numbers and deadlines, without a Run notification or Needs you row for ordinary settling. This keeps the wait visible without expanding Review Pass: name pull requests held by retained Review worktrees in the skip reason and Needs you #1962's conflict-work scope.
    5. Do you approve splitting implementation into two dependent Tickets: A, branch-activity/quietness evidence with the agreed fallback and deterministic tests; B, blocked by A, review.wait_minutes configuration, Pass admission and captured-head recheck, explicit-URL bypass, skip diagnostics and documentation? Keep Review run: a pull request that changes mid-run strands its fixes in a retained worktree and is never reviewed again #1961 recovery and Review Pass: name pull requests held by retained Review worktrees in the skip reason and Needs you #1962 conflict Inbox work in their existing issues.
  3. added
    ready-for-human
    and removed
    in-progress
    on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementready-for-human

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions