
culprit
io.github.noordeen123由 GitHub 账号 noordeen123 发布v0.4.0更新于 Oct 24, 2026
Deterministic, offline root-cause analysis and pre-commit fix verification for coding agents.
概览
为编码代理提供确定性的离线根因分析,并在提交前验证修复是否完整。
- 可以做什么
- 在本地 git 仓库上执行只读分析并返回结构化 JSON。工具包括 analyze 完整根因分析、find_suspects 排序引入缺陷的提交、verify_fix 提交前检查差异、check_completeness 查找未改动的调用点、get_blast_radius 查看依赖与覆盖测试、get_risk_score、get_test_impact、classify_change、get_evolution、get_intent,以及从堆栈跟踪分析的 from_trace。另附命令行工具和可选 HTML 报告。
- 适用场景
- 适合代理需要找出缺陷由哪次提交引入、在提交前判断自己的修复是否完整,或评估改动可能影响什么时使用。它是代理自身 git 排查的加速器而非替代品,适用于任何 git 可读取的仓库。
- 运行要求
- 以 uvx 从 PyPI 包 culprit 启动的本地进程;MCP 服务器需要 Python 3.10+ 和 uv(命令行工具支持 3.9+)。核心分析无需 API 密钥或网络;可选的 GITHUB_TOKEN 或 GITLAB_TOKEN 可提高 PR 元数据接口限额,示例 CI 工作流使用 GH_TOKEN。
安装
在 SourceWeft 中
- 打开 控制台中的 culprit,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
culprit
[CI] [PyPI] [Python versions] [License: MIT]
Root-cause analysis for agent-driven development.
Your coding agent finds what introduced a bug, and verifies its own fix is complete before it commits.
Quick start · Tools · Accuracy · Architecture · MCP registry
[An agent's fix scores partial with two missed call sites, then complete after patching them]
A real run. The fix patched one caller of parse_config and missed two, so it scores partial.
Why an agent needs this
An agent can dig through git history to find what broke, and it is good at it. What it will not reliably do is spend a dozen tool calls on that every time, or stop and check whether the helper it just changed has three other callers before it commits. culprit turns both into one deterministic call that returns structured JSON it can act on:
- ⚡️ Instant. No test runs, no bisect. Benchmarked at 41% fewer agent tool calls.
- 🔒 Read-only and offline. Never writes to your repo or PR. No API key, no network.
- 🔌 MCP-native. 11 tools over stdio, on the official MCP registry, plus a one-command plugin.
- 🗣️ Language-agnostic. Suspects work anywhere git does. Blast radius reads 12 language families.
Does it actually work?
Benchmarked against 50 real regressions, 25 from git and 25 from
systemd, where the introducing commit is known from each
fix's Fixes: trailer (author-verified ground truth). Given only the fix commit, culprit blames
the removed lines to rank the commits that introduced the bug.
Deterministic and offline, on large C codebases the engine has never seen. Reproduce with
python benchmarks/run.py, which clones the repos and scores every case.
But an agent can run git blame itself
It can, and it is good at it. So the honest question is not whether culprit is accurate, but whether it beats or helps an agent that has git and no culprit. Same 10 regressions, three arms, isolated so no arm can read the answer from the fix commit:
The agent wins on accuracy, and culprit does not make it more accurate. What culprit does is get it there in roughly half the steps for about 8,000 fewer tokens per investigation. Tool calls dropped in 10 of 10 cases, tokens in 7 of 10. On the hardest case the agent needed 42 tool calls and 124k tokens alone, against 16 calls and 84k with culprit.
Those savings are already net of reading culprit's output, which is counted in the third column. culprit's own run is one deterministic call, no model, under a second.
So culprit is an accelerator for an agent, not a replacement for one, and not a smarter
blamer than one. Method, caveats (n=10, and this slice is easier than the full 50), and
reproduction: benchmarks/agent/.
Quick start
Claude Code plugin (installs the MCP server plus a skill that tells the agent when to use it):
Any MCP client (Cursor, Windsurf, VS Code, Codex CLI, Zed, Continue, Cline, Amazon Q, Goose):
CLI, no agent required:
Needs Python 3.10+ and uv for the MCP server. The CLI runs on 3.9+.
The tools
verify_fix, the pre-commit gate
The agent runs this on its own diff before committing:
verdict:completewhen no untouched call site is left behind,partialwhen one was missed,riskywhen risk is high. The verdict is the completeness axis; test coverage is the separate confidence axis onrisk_level.untouched_references: the exact files that still use the changed symbol. This is the list the agent goes and patches.skipped_symbols,adds_test,notes: what was too widely used to check, whether a test shipped, and what to do next.
Loop until complete, then commit. That is the whole idea.
CLI and CI
CI gate: risk via exit code only, no PR comments, no writes. Copy
examples/github-actions/culprit-pr.yml into
.github/workflows/:
HTML report
--html writes one self-contained file. No CDN, opens offline, attaches to CI. It opens with the
verdict: a scored QA risk with the factors behind it, and the prime suspect with how long the bug
lived.
Then it reconstructs how the bug got there. Every commit that touched the buggy line, from creation through the commit that broke it (red, with the exact diff) to the fix (green):
Every node expands to its diff. See the full report.
vs git bisect
--bisect "<cmd>" runs a real bisect as an optional confirmation layer, in a throwaway
git worktree so your checkout is never touched. When the first failing commit matches the
blamed suspect, the report stamps it confirmed by git bisect.
Architecture
One normalized context in, one structured JSON result out. The only non-deterministic step is the optional LLM narrative, isolated behind an adapter so the engine runs with no API key.
Two lanes, one engine. Every module writes one slice of the result, so nothing cares whether
the target came from gh, the REST API, local git, or a pasted stack trace. Full module map:
docs/ARCHITECTURE.md.
Configuration
The base branch resolves in order: the --base flag, then CULPRIT_BASE, then .culprit.toml
(base = "origin/main"), then HEAD~1. --last forces the latest-commit view.
PR titles and labels use the GitHub CLI when present, or the unauthenticated REST API for public
repos (set GITHUB_TOKEN or GITLAB_TOKEN to raise limits). Deep links cover GitHub, GitLab,
Bitbucket, and Gitea. Blast radius reads imports across JS/TS, Python, Go, Java/Kotlin, Ruby,
C/C++, C#, PHP, Rust, Scala, and Swift.
Contributing
Module map and data shapes: docs/ARCHITECTURE.md. Publishing the MCP
server to the registries: docs/PUBLISHING.md. MIT licensed.
来源:README.md,提交 5f426e5
工具
0版本历史
1- v0.4.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分