I built a merge-conflict predictor that ignores lines and reads the AST instead
Description and use
PRISM’s conflict predictor uses AST parsing with tree‑sitter to detect symbol‑level conflicts that Git’s line‑based system misses, reducing production bugs after clean merges.
Problem
Git’s line‑based conflict detection misses semantic conflicts that break production after a clean merge.
Outcome
The predictor identifies semantic merge conflicts that Git’s line‑based system misses, reducing production bugs caused by silent merges.
Workflow
- Parse merge‑base and branch heads into ASTs using tree‑sitter
- Extract symbols (functions, classes, methods) from each AST
- Detect overlap between symbols on both sides
- If overlap exists, compute a risk score and list of symbols
- Expose result via POST /repos/{id}/predict-conflict and a UI with risk bar and symbol list
Evidence
Git's idea of a merge conflict is narrower than it should be. Two branches change the same lines, you get a conflict. Two branches touch the same function from different files and never collide, git merges cleanly and congratulates you.
Parse the merge-base and both branch heads into ASTs with tree-sitter, extract the symbols (functions, classes, methods), and flag overlap between the two sides.
Tree-sitter grammar packages aren't always installed on the machine. The first version crashed when one was missing, which made it a demo, not a tool.
The predictor doesn't replace tests or review. It answers one narrow question: did these two branches step on the same symbols?
- Record date: 2026-10-04T08:40:46.613Z