← Back to Pull requests

Add the pull request template and risk tier workflow #823

Closed
unknown closed this pull request without merging on Nov 26, 2026 12:39 UTC
View on GitHub
unknown unknown commented on Nov 25, 2026 13:56 UTC
Author

Fixes #820
Fixes #821

What changed

  • A shared pull request template, synced to every repository, with short sections and a Review declaration table: AI use, AI tool, risk tier, and API or behaviour change. It asks for no tool footers. A synced .claude/settings.json stops Claude Code adding PR footers.

  • A "Risk tier" workflow (risk-tier.yml, risk-tier.py, standard-library Python) labels every ready pull request risk-tier: T0, T1 or T2 and ai-use: .... TypeSafe's Jev (jev-1.14.0) classifies it in one request from the title, description, changed files and main-source diff, and also answers whether public API changes or anything breaks.

  • Rules live in .github/risk-tiers.global.toml, kept only in this template and fetched on every run. A repository's optional .github/risk-tiers.toml overwrites it.

  • Bots skip Jev: Renovate is tiered by update type (patch T0, minor T1, major T2), other bots by path rules. Drafts are skipped. Jev's last answer is cached while the title, description and changed files are unchanged, and pushes wait 3 minutes.

  • Relabelling by a maintainer or the AI reviewer reclassifies. The check fails on a declared tier below the classified one, or on tool footers.

  • MAINTAINING.md documents tiers, rules and replay.
  • Why

    WP1 and WP2 of micronaut-projects/.github#18: review effort follows risk, and AI use is declared. Sampled October 2026 cost is about $6 for the organisation.

    How to test

  • 75 unit tests (risk-tier-tests.yml) and a live Jev dry run on this pull request pass.

  • Replays of serialization and security merged pull requests are in #824.
  • Checklist

  • Tests added

  • Documentation updated

  • Targets the right branch
  • Review declaration

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

    Diff: 254 lines (+190 / -64) across 3 files Reviewer: alvarosanchez Review duration: 1363m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.44) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.44 · 254 lines diff across 3 files
    0.44
    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.332
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #823"
    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: 44.1% (MEDIUM) · Higher = larger blast radius
    44.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: 17.4% · Safe to merge
    17.4%