← Back to Pull requests

Let the AI reviewer's check approve its own pull requests #853

Closed
unknown closed this pull request without merging on Dec 02, 2026 16:01 UTC
View on GitHub
unknown unknown commented on Dec 02, 2026 13:51 UTC
Author

What changed

  • On pull requests opened by an AI reviewer (cliponaut[bot], for the Engineer agent's fixes), review-policy and T0 auto-merge read the reviewer's check run on the head commit as its verdict, because it cannot review its own pull requests. The check name is in a new [review] ai_checks setting: "AI review".

  • Success counts as the AI approval. A T0 pull request then needs no person and merges on its own after CI. Failure blocks every tier until a new push passes. Neutral leaves the call to a maintainer. Cancelled or timed-out runs wait for a new run.

  • T1 and T2 still need their maintainer or code owner. Other bots, such as Renovate, still never auto-merge.

  • The check counts only if it names this pull request alone; a head commit shared with another open pull request falls back to a maintainer. require_ai_pass = false turns it off.

  • The reviewer submits its comment-only review after finishing the check, and that review re-runs review-policy, which now has checks: read.

  • "First pass" is renamed to "AI review" everywhere in the template; MAINTAINING.md documents the rule.
  • Why

    The Reviewer now posts its check only on its own pull requests, and approves or requests changes everywhere else. Without this change, an Engineer pull request could never pass the AI review, so no T0 fix could merge on its own.

    How to test

    python3 -m unittest test_risk_tier in .github/scripts: 203 tests pass. The new AiAuthoredTest tests fail without the change.

    Checklist

  • Tests added

  • Documentation updated (MAINTAINING.md)

  • Targets the right branch: master
  • Review declaration

    | Field | Value |
    |-----------------------------|-----------------|
    | AI use | agent-generated |
    | AI tool | Claude Code |
    | Risk tier | T2 |
    | API or behaviour change | yes |

    ---
    _Generated by Claude Code_

    Diff: 249 lines (+186 / -63) across 3 files Reviewer: alvarosanchez Review duration: 129m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 249 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.330
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #853"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.0% (MEDIUM) · Higher = larger blast radius
    39.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.4% · Safe to merge
    15.4%