A 0–1 risk score for every pull request

AI writes and reviews code faster than people can read it, so human review is now the bottleneck. opendrs measures each PR's blast radius and history and turns them into one calibrated score. Low-risk PRs that passed your AI review are approved and sent to the merge queue. Riskier ones wait for a person.

npx @error-path/opendrs score

Where four pull requests land

With the default thresholds, a score below 0.3 is green and 0.8 or above is red.

  • 0.04 Fix a typo in the README Comment and docs lines only. Nothing imports the file. Approved after the AI review passed
  • 0.21 Add a health-check endpoint with tests Two new files, tests included, no existing code depends on them. Approved and added to the merge queue
  • 0.47 Refactor the session middleware 38 files depend on it, and it needed three fixes in the last 90 days. Waits for a human reviewer
  • 0.86 Change the billing schema migration Migrations are a blocked path, and it is the author's first change here. Always goes to a human

What the score measures

Every signal comes from your own git history and code, and every one is reported with its evidence, so you can see why a PR scored what it did.

Blast radius
How many files transitively import the changed code, and whether exported or public declarations changed.
File history
Past fixes, reverts and recorded incidents in the touched files and folders.
Author experience
How much the author has changed these files before, and whether they wrote them.
Size and spread
Changed lines relative to file size, and how many files, folders and past authors are involved.
Tests
Source changed without test changes, or tests deleted.
Critical paths
Files you mark as critical, such as payments or auth, raise the score.

How a pull request gets approved

The Action checks these in order. A PR is approved only if it gets through all of them.

  1. No changed file is on a blocked path: workflows, build and install scripts, migrations, infrastructure, CODEOWNERS and the opendrs config itself.
  2. No safety rule fires: ignored files such as lockfiles, binary files, submodule changes, deleted tests, blocklisted code phrases, or a change larger than your size cap.
  3. The score is in the green tier, no freeze window holds it back, and no unknown signal could have changed the tier.
  4. The PR is not a draft, and no reviewer has requested changes.
  5. Your required AI-review check has passed on the latest commit.
  6. A random sample of eligible PRs (10% by default) still goes to a human, so you keep measuring what the gate lets through.
  7. The PR is approved and auto-merge is enabled, or it joins the merge queue. A later, riskier push withdraws the approval.

Why you can trust the number

It is measured on your historyopendrs backtest replays past commits and reports how many bug-introducing changes the score would have caught. opendrs calibrate fits the model to your repository. On nine open-source repositories, calibration improved accuracy on held-out commits in every one.

A PR cannot turn it offThe config and model are read from the base branch. The Action never approves changes to its own config or to CI, and never approves PRs from forks.

Unknown is never safeA signal that cannot be computed blocks approval whenever it could have changed the tier. A failed LLM answer counts the same way.

Ways to run it

WhereHow
GitHub Actionuses: error-path/opendrs@v0, from the GitHub Marketplace. Setup guide
CLInpx @error-path/opendrs score in any git repository
Claude Code plugin/plugin marketplace add error-path/opendrs, then /plugin install opendrs@opendrs
Agent skillnpx skills add error-path/opendrs for Claude Code, Cursor, Codex and others
MCP servernpx -y @error-path/opendrs mcp for any MCP client

Questions

What is the blast radius of a pull request?

It is how much can break if the change is wrong: how many files import the changed code, whether exported or public symbols changed, and whether the change reaches critical paths. opendrs measures it from your import graph and combines it with file history, author experience, size and missing tests into one 0-1 risk score. See What is PR blast radius?.

Can opendrs auto-approve and auto-merge pull requests?

Yes, when you turn it on. The GitHub Action approves a PR only when it scores in the green tier (below 0.3 by default), no safety rule fires, and your required AI-review check has passed. It can then enable auto-merge or add the PR to the merge queue. Everything else waits for a human. See Auto-approve low-risk pull requests.

How is this different from an AI code review tool?

An AI reviewer reads the diff and comments on correctness. opendrs estimates how risky the change is to ship, from git history and the dependency graph, and decides whether a human still needs to look. They work together: opendrs can require that your AI review (Claude, CodeRabbit, Copilot or any check run) has passed before it approves.

Does it need an LLM, an API key or a hosted service?

No. The score is computed from git alone and runs inside your CI or on your machine. An LLM judge is optional; when enabled it can only raise the score, never lower it.

How do I know a 0.3 threshold is right for my repository?

Measure it. opendrs backtest replays your past commits and reports how many bug-introducing changes the score would have flagged, and opendrs calibrate fits the weights to your history. On nine open-source repositories, calibration improved accuracy on held-out commits in every one. See Calibration and backtesting.

Which languages and code hosts does it support?

History, size and test signals work for any language. The import graph behind the blast-radius signals covers TypeScript, JavaScript, Python, Go, Java, Kotlin, Rust and Ruby; for other languages those signals are reported as unknown, and unknown never counts as safe. The Action runs on GitHub; the CLI and MCP server work in any git repository.