Skip to content

Consensus loop: PR review redispatch has no hard cap and can run unbounded rounds #41

@MarketingChronoAi

Description

@MarketingChronoAi

Problem

The review controller can keep dispatching review-pr<N>-<role>-r<R> indefinitely when required reviewer evidence remains stale, missing, invalid, pending-dead, or incomplete for the live PR head. Local artifacts showed extreme reviewer churn, including PR #37 continuing review artifacts up to about r98 after the PR was already merged.

Confirmed missing behavior

  • No max review rounds per PR.
  • No max review rounds per PR head.
  • No max review redispatch count for the same stale evidence condition.

Evidence

  • /Users/chronoai/.claude/skills/consensus-loop/scripts/codex_refactor_loop/controller_actions.py: dispatch_reviewers() computes the next review round and dispatches another reviewer.
  • /Users/chronoai/.claude/skills/consensus-loop/scripts/codex_refactor_loop/controller_actions.py: _next_review_round() returns max existing round plus one.
  • /Users/chronoai/.claude/skills/consensus-loop/scripts/codex_refactor_loop/wakeup_plan.py: review_evidence_redispatch_actions() emits redispatch actions when live-head review evidence is incomplete.
  • /Users/chronoai/.claude/skills/consensus-loop/scripts/codex_refactor_loop/wakeup_runner.py: wakeup runner dispatches reviewer actions through ControllerActions.dispatch_reviewers().

Suggested fix

  • Add a hard cap per PR/head, for example MAX_REVIEW_ROUNDS_PER_HEAD=3.
  • Add a broader hard cap per PR, for example MAX_REVIEW_ROUNDS_PER_PR=9.
  • When the cap is reached, stop spawning reviewers and write a durable blocker/audit record.
  • Route next action to review-fix, human-blocked, terminal merge-transition audit, or explicit no-progress/stale-evidence record.

Acceptance criteria

  • New reviewer prompts are not generated after the configured per-head cap.
  • New reviewer prompts are not generated after the configured per-PR cap.
  • The cap produces a durable status record naming PR, head SHA, roles, last blocker reason, and next action.
  • Tests cover stale reviewer evidence loops and repeated missing reviewer evidence.

Review status

This was independently reviewed in /Users/chronoai/Desktop/proposed-main-repo-issues-review-gate.md and classified high confidence.

⟦AI:AUTO-LOOP⟧
ISSUE_RAISED:review-gate-hardening:redispatch-hard-cap

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions