Skip to content

Skip Review Repairs for foreign commits that leave the tree unchanged #722

Closed

Description

@JacobStephens2

From the Oct 11–16 2026 Run retrospective, finding 2. Tracking issue: #721.

The evidence below is historical and attributed to the supplied report (repository snapshot 5504c97); it has not all been independently reproduced. Limited current-checkout checks were made at 53bb9c6. This is filed for maintainer triage, not automatic Pickup.

Requested outcome and validation

After merging Foreign commits, compare the resulting tree with the Run's own head. If the trees match, record the upstream move but skip the Review Repair and do not spend a Repair slot on it. Keep the review for a changed tree, including a conflict resolution that changes files.

Change the Review Repair prompt so a review with no file changes makes no commit, especially no --allow-empty commit. With no new review information, leave the PR body alone. Preserve the existing requirement to record actual declined findings when there are any.

Validation should cover tree-identical Foreign commits, genuinely changed trees, and a review that needs no code change. Demonstrate that the two-writer empty-commit loop terminates without weakening review of changed code. This is distinct from the unchanged-head CI-fix case in #102 and complements #712.

Current checkout check: src/delivery/repair_loop.rs::take_in_foreign_commits unconditionally starts the Review Repair, and src/prompt.rs::review_repair ends with an unconditional commit-and-push instruction.

Original finding, including evidence, proposed fixes, and confidence

2. Review Repairs make empty commits, so two writers ping-pong (Factory)

Activity

  1. added
    bug
    needs-triage
    on Oct 17, 2026
  2. JacobStephens2 commented on Oct 17, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: bug
    Summary: Avoid Review Repairs and empty commits when merged Foreign commits leave the reviewed tree unchanged.

    Current behavior:
    The Repair loop starts a Review Repair after every nonempty batch of Foreign commits, without comparing the merged tree with its own previous head. The Review Repair prompt unconditionally requests a commit and push. The retro reports repeated tree-identical commits consuming Repairs and triggering extra CI cycles. Code inspection confirmed these missing guards; this triage did not independently reproduce the two-writer incident.

    Desired behavior:
    After reconciling Foreign commits, compare the resulting tree with the tree at the Run's own head before that reconciliation. When the trees match, skip the Review Repair while retaining the upstream-move accounting and normal reconciliation of commit history. When files differ, retain the review from that original head. A failed comparison must not be treated as proof that a review can be skipped.

    A Review Repair that changes no files creates no commit, including no empty commit. Leave the PR body alone when there is no new review information; continue recording actual declined findings under the existing review contract. Preserve ordinary pushes needed to reconcile real upstream commits.

    Key interfaces:

    • Repair loop Outside and its production Worktree adapter: expose the tree-comparison fact without moving orchestration into the adapter.
    • take_in_foreign_commits(), Budgets, and Repair::Review: keep upstream moves distinct from Repairs and retain the correct review baseline.
    • review_repair() and generated Factory prompts: make committing conditional on file changes.
    • The Foreign commit domain contract: document the exception for a tree already covered by the existing review.

    Acceptance criteria:

    • A clean Foreign merge with an identical resulting tree starts no Review Repair and consumes no Review Repair slot, while still counting the upstream move.
    • A Foreign merge with changed files starts the existing review against the Run's pre-merge head.
    • Conflict resolution that changes the tree still receives review; existing conflict-Repair accounting and merge-completion checks remain enforced.
    • Tree-comparison failure does not silently bypass review.
    • An empty-tree Foreign batch arriving during reconciliation does not cause another empty review commit; subsequent changed batches remain reviewable.
    • The Review Repair instructions prohibit empty commits when no files change and preserve required recording of actual declined findings.
    • Deterministic regression tests exercise the tree-identical and changed-tree paths, and the generated prompt checks pass after regeneration from their sources.

    Out of scope:

    Source and historical evidence: #721, finding 2. This brief defines the implementation scope; the original report remains supporting context.

  3. added
    ready-for-agent
    in-progress
    and removed
    needs-triage
    ready-for-agent
    on Oct 17, 2026
  4. removed
    in-progress
    on Oct 17, 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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions