escalation-gate

From a GitHub issue to a checked root cause and the open PR that fixes it.

Give it a repo and one issue. It reads the code, cites every claim as file:line and checks each citation against the code. Then it narrows the open pull requests to the ones that touch the bug and tells you which one to merge, with a real merge check.

interviewstreet/hiring-agent · issue #424 · scores swing between runs

Recommended: merge #425

Fixes the cause · judged from diffMerges clean · git check
6/6
code citations verified
192 → 25
open PRs cut to the ones that touch a cited line
2 fix
only one of them merges clean
$0.41
total model cost, one command

Watch it

Two short videos: what it is, and a live run on a real HackerRank bug. Narration is synthetic (Kokoro TTS); every screen is from a real run.

What it is · 1:37
Live test on hiring-agent #476 · 1:28

It caught a mistake in my own review.

Before building the tool, I reviewed issue #424 by hand: 30 scoring runs, the root cause traced through four files, and all 191 open PRs checked against it. That review took about 1.5 hours and became the tool's test target.

My review said #415 only partly fixes the bug.

The tool said #415 fixes it fully. I opened the diff: #415 adds resolve_selected_projects, which rebuilds each selected project from the fetched data. The tool was right.

It also found #242, a partial fix that my review missed.

Both PRs touch the exact lines where the bug lives, which is why the shortlist caught them. The verdicts are labelled as judged from the diff, because nothing was run.

Found with it, fixed upstream

Investigating a second hiring-agent bug, it cited github.py:239: contributor counts are looked up with the candidate as the repo owner, so team and org repos score as solo projects with zero commits. On one public profile that mislabels 25 of 99 repos. I filed it and sent the two-line fix.

Repo boards

Point it at a repo and it lists every open issue with its status. Pick an issue number and it investigates that one; the board updates with a link to the packet.

# the board: every open issue, ⬜ not yet · ✅ verified · ⚠️ needs a human
uv run python -m gate.cli --repo owner/name --list

# investigate one by number; the board updates
uv run python -m gate.cli --repo owner/name --issue 476

How it works

One command: python -m gate.cli --repo owner/name --issue N. Six stages, each a small Python module with its own tests.

1

Collect

Open issues, open PRs and every PR's diff, from gh into Postgres.

2

Investigate

Claude Code, read-only (Read, Grep, Glob), finds the cause and cites file:line:quote plus the chain from cause to symptom.

3

Check

Every citation is matched against the code. On failure, it retries once in the same session with the exact failures. If that fails too, the run goes to a human.

4

Shortlist

SQL plus diff hunk ranges keep only the PRs that change a cited line or mention the issue. No AI, no cost.

5

Judge

One model call with no tools reads the shortlisted diffs and labels each fixes, partly or no, with one reason.

6

Packet

Citations re-checked, git merge-tree per candidate PR, one HTML page an engineer can act on in five minutes.

What is proven, and what is opinion

The packet says which is which. A tool that hides the difference is worse than no tool.

Part of the packetStatus
Citations: file, line, quoteChecked against the code, mechanically
"Merges clean" / "conflicts"Checked with a dry-run git merge-tree
The chain from cause to symptom, and the explanationModel reasoning each box is a checked citation, but the arrows are not
PR verdicts: fixes / partly / noJudged from the diff not run
"No other PR fixes this"Not claimed. A fix in an uncited file is not shortlisted.

Run it on your repo

Needs Python 3.11 with uv, a local Postgres, the GitHub CLI and Claude Code, all logged in. About $0.30–0.45 per issue on Sonnet.

# once
git clone https://github.com/rdeepak-711/escalation-gate && cd escalation-gate
createdb escalation_gate && uv sync

# per issue, or describe a symptom in plain words instead
uv run python -m gate.cli --repo owner/name --issue 123
uv run python -m gate.cli --repo owner/name --symptom "what the user saw"

Limits

Tested end to end on two unrelated repos so far (an LLM résumé scorer and a PySpark utility). Runs vary: the same model can search more narrowly one time than another, and a narrower search gives a narrower verdict. The citation checker catches false quotes, not shallow reasoning. Next: apply the recommended PR to a throwaway copy, run the reproduction before and after, and put the measured result in the packet.