← Back to Pull requests

Require the AI pass on every tier, merge T0 pull requests, and measure KPI 2 #850

Closed
unknown closed this pull request without merging on Dec 01, 2026 12:45 UTC
View on GitHub
unknown unknown commented on Dec 01, 2026 10:32 UTC
Author

What changed

  • AI pass on every tier. The review-policy check waits for a review by [review] ai_reviewers (cliponaut[bot]) on the latest commit. Its last approval or change request counts, so its replies in review threads don't take it back. A review of an earlier commit still counts while the pull request makes exactly the same changes, as after a clean base merge. T0 then needs the AI reviewer's approval, or a maintainer's. When the AI reviewer declines a commit (too large), a maintainer's approval stands in for every tier. Bot pull requests are exempt. require_ai_pass = false turns it off per repo.

  • T0 auto-merge. t0-automerge.yml runs every half hour and merges T0 pull requests in core, data, security and serialization once the AI reviewer approved them and every check passed. It needs the T0 label from the risk-tier check or another maintainer, an author with write access, and no file on the fixed T2 paths from #826.

  • KPI 2. kpi-report.yml runs weekly. Of the merged pull requests the AI reviewer reviewed, it reports the share where people found a correctness defect afterwards, as Jev judges the comments. Results are given overall and per tier.

  • MAINTAINING.md documents all three.
  • Why

    Álvaro approved requiring the AI pass, T0 auto-merge, and automating KPI 2, which decides when T1 can go AI-only.

    This is a behaviour change where the policy is enforced: data and security now, core and serialization once their sync pull requests merge. Pull requests there wait for the AI review. Nothing auto-merges until the Reviewer approves clean pull requests (plugin 0.35).

    How to test

  • python3 .github/scripts/test_risk_tier.py: 184 tests pass, and the new ones fail on master.

  • I ran these live with a real token. The automerge dry run reports the template's #846 as waiting for AI approval. kpi2 --no-jev counted 7 merged pull requests in core and data on 30 Nov, 6 to classify.
  • Checklist

  • Tests added

  • Documentation updated

  • Targets the right branch
  • 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: 300 lines (+225 / -75) across 3 files Reviewer: alvarosanchez Review duration: 133m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 300 lines diff across 3 files
    0.40
    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.341
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #850"
    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: 40.1% (MEDIUM) · Higher = larger blast radius
    40.1%
    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.8% · Safe to merge
    15.8%