Skip to content

0011: Score each pull request by its risk, in shadow mode ​

Status: accepted

Date: 2026-12-04

PR: #10

Context ​

The amount of review that a pull request gets must match what can break. A count of lines makes a small risky change look safe and a large rename look risky.

Options considered ​

  • A size from S to XL, from the worst of effort, risk, breadth and novelty: size, not risk, decided the review.
  • Score instruction files as docs: with a Severity of 1, they could merge with no review.
  • Build the schema and contract checks with real tools now: it was much bigger, and this repository uses none of it.
  • Enforce the verdicts now: the thresholds need real outcomes before they block a pull request.

Decision ​

prisk scores each changed file as Severity × Occurrence × Detection, from the rules in risk-map.yml. The pull request takes the highest score, and its band is auto, review, elevated or blocked. A pull request that mixes Effects, or that hides a little high risk in many low-risk lines, gets a split plan. Files that steer agents are an instruction Surface with a Severity of at least 4. The schema and contract checks are adapters, and this repository configures none. The scan runs in shadow mode: it posts a comment, a risk: label and a status that always passes.

Consequences ​

A 5-line change to authentication outranks a 3,000-line rename. The verdict comes from the diff and the risk map only, so a rerun always gives the same answer. A mixed pull request gets a split plan, and a pull request that is safe can later merge with no review. Each pull request shows its risk and why, and nobody runs anything. Branch rulesets can later read the risk: label to ask for the right reviewers.

Code ​