opendrs: a 0–1 risk score for every pull request
AI writes code and AI reviews it, so the final human review is now the bottleneck. opendrs scores each PR's risk from its blast radius and git history with a statistical model (no LLM needed; an LLM judge is optional), tells your AI reviewer where to look, and tells the last human reviewer how much attention the PR needs and what the editor and the AI rounds didn't show. Low-risk PRs can be approved and merged on their own.
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.
- No changed file is on a blocked path: workflows, build and install scripts, migrations, infrastructure, CODEOWNERS and the opendrs config itself.
- 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.
- The score is in the green tier, no freeze window holds it back, and no unknown signal could have changed the tier.
- The PR is not a draft, and no reviewer has requested changes.
- Your required AI-review check has passed on the latest commit.
- A random sample of eligible PRs (10% by default) still goes to a human, so you keep measuring what the gate lets through.
- 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.
Measured so far: on the public ApacheJIT benchmark, calibrated opendrs reaches AUC 0.823 and catches 67% of buggy commits in its riskiest 30%, on par with a regression on the classic JIT metrics (0.821, 66%). Untuned, it ranked later-fixed commits better than chance in 17 of 18 open-source repositories (median AUC 0.71). The labels come from reverts and bug-fix commits, not production incidents. Tables and caveats are in the benchmark results.
Ways to run it
| Where | How |
|---|---|
| GitHub Action | uses: error-path/opendrs@v0, from the GitHub Marketplace. Setup guide |
| CLI | npx @error-path/opendrs score in any git repository |
| Claude Code plugin | /plugin marketplace add error-path/opendrs, then /plugin install opendrs@opendrs |
| Agent skill | npx skills add error-path/opendrs for Claude Code, Cursor, Codex and others |
| MCP server | npx -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.
What does opendrs give the final human reviewer?
A priority (careful review, standard review or quick confirm), one named reviewer, and up to five facts the editor and the AI review rounds didn’t show: files that usually change together but weren’t this time, a new import between modules, a changed public contract or dependency, or what the PR picked up during its AI review rounds. It is advisory and never approves or blocks a PR on its own. See the captain brief.
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, decides whether a human still needs to look, and, for the human who does, says how much attention the PR needs and up to five architecture and history facts the editor and the AI review rounds didn’t show. They work together: opendrs can require that your AI review (Claude, CodeRabbit, Copilot or any check run) has passed before it approves. See the captain brief.
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.