Inspiration
When an alert fires at 3 AM, on-call engineers have to answer two questions, one after the other:
- Where is it breaking? Traces answer that.
- Which change caused it? Nothing answers that. You scroll through
git log, deploy history and PRs by hand, under pressure, while production burns.
The two halves live in tools that never talk to each other. We wanted one graph that connects runtime evidence to code history and answers both questions, with evidence for every claim.
So we built a poltergeist hunter for your repo. 👻
What it does
Poltergit is an incident-to-commit investigator, dressed for Halloween.
- 🌫️ Haunting: reads OpenTelemetry traces, finds when the errors started, and separates the origin service from services that only see errors passed along to them.
- 👻 Ghost: ranks the commits most likely to have caused the incident, using deterministic scoring you can explain. Every score component is a number you can check.
- 🧟 Revenant: spots when the ghost brings back a bug that was already fixed: "This bug died on August 13 and came back."
- 📜 Autopsy: a blameless Markdown postmortem, ready to paste. The 🔊 Banshee reads it aloud.
- 🔮 Séance: ask "why did this break?" and get answers from fixed, parameterised graph queries. The LLM never writes Cypher.
- ✝️ Exorcism: drafts a revert patch and PR description. Draft only, never pushed.
- ☠️ Cursed files + CI check: warns when a change touches a file with a history of incidents.
- 🏚️ Haunted House: the service map drawn as rooms that glow by incident history.
- 🧩 Inside Kiro: an MCP server, so you can ask "why did checkout break?" in the IDE and get the same answer, with citations.
Evidence decides, the LLM narrates. The LLM never adds, removes or reorders suspects. A validator rejects any narration that mentions a SHA, file, service or span that isn't in the evidence.
How we built it
Poltergit is a Frankenstein: five technologies that were never meant to meet, stitched into one body.
| Part | Role |
|---|---|
| OpenTelemetry | OTLP traces → services, error spans, CALLS edges, service.version |
| Git history | commits, files, diffs, authors, reverts |
| FalkorDB graph | one schema joining both worlds (plus an in-memory graph for offline replay) |
| Claude | narration only, checked by a validator |
| Kiro + MCP | specs, hooks, steering, and Poltergit's own MCP server |
The bridge. A span is linked to a commit when service.version equals the commit SHA (observed). If that's missing, we fall back to deploy markers and timestamps (inferred), and the UI says which one it is.
Finding the origin. Errors spread upstream, so every caller turns red. For each failing service $s$, we compare its own error rate with the errors it receives from the services it calls:
$$ \text{origin} = \arg\max_{s} \left( e_s - \max_{t \in \text{callees}(s)} e_t \right) $$
The service whose errors start with it, rather than arrive from a callee, is the origin.
Ranking suspects. Every commit $c$ in the window between the last good deploy and the onset gets a weighted score:
$$ S(c) = \sum_{i} w_i \, x_i(c) $$
$$ x(c) = \big[\, \text{touches_origin},\ \text{touches_upstream},\ \text{symbol_match},\ \text{config_or_deps},\ \text{churn},\ \text{cursed_file},\ \text{deployed_before_onset} \,\big] $$
Upstream influence decays with distance $d$ in the call graph, $x_{\text{upstream}} = 1/d$. Churn is log-scaled so a giant refactor doesn't automatically win:
$$ x_{\text{churn}} = \log_{10}!\left(1 + \text{lines}{+} + \text{lines}{-}\right) $$
Revenant detection. A ghost is a revenant if it reverts a fix linked to a past haunting, or if its changed lines look like an old regression on the same file. We use normalised hunk Jaccard similarity:
$$ J(A, B) = \frac{|A \cap B|}{|A \cup B|} \geq \tau $$
Cursed files. Each file gets a curse score from churn, incident history and how few people own it:
$$ \text{curse}(f) = \widehat{\text{churn}}(f) \times \text{incidents}(f) \times \text{owner_concentration}(f) $$
Built with Kiro. Every core feature started as a spec in .kiro/specs/ (requirements → design → tasks) before any code: bridge, graph schema, suspect ranking, haunting UI, autopsy, revenant and MCP. Agent hooks re-ingest git history on save, run tests and lint, and regenerate fixtures. A steering file keeps the architecture rules in front of Kiro in every session. The demo ends with Kiro calling Poltergit's own MCP tools.
The stack is Python and FastAPI on the backend, and React + TypeScript with a hand-drawn SVG timeline on the frontend.
Challenges we ran into
- Linking runtime to code honestly. It's tempting to always claim a link. We made the confidence explicit: observed vs inferred, everywhere.
- Origin vs propagated errors. The service screaming loudest is usually not the one that broke. Following
CALLSedges was what separated cause from symptom. - Keeping the LLM honest. Models will "helpfully" mention a plausible file that isn't in the evidence. The validator rejects those and falls back to a template, so a wrong claim never reaches the screen.
- Decoys. Our fixtures put a decoy commit right next to the real culprit, in a neighbouring service, shipped at the same time. Getting the scoring to separate them took careful weighting.
Accomplishments that we're proud of
- ✅ The right commit ranked first in every test scenario, including the one with the decoy.
- 🔌 The whole demo runs offline from recorded fixtures: no Docker, no network, no API key.
- 🧾 Every claim cites evidence: a commit SHA, a span ID or a score component.
- 🧩 Asking Kiro "why did checkout break?" and getting the same cited answer as the UI.
- 🎃 A spooky costume over a serious tool: readable contrast, keyboard navigable, and
prefers-reduced-motionrespected.
What we learned
- Specs first pays off where correctness matters. Writing the suspect-ranking spec forced us to define "most likely culprit" before writing code, which made the scoring explainable instead of a black box.
- Separate deciding from explaining. Deterministic code picks the suspect; the LLM explains it. LLMs are great at turning evidence into a story, and a validator stops them from inventing evidence.
- Being honest about uncertainty builds trust. Labelling links as observed or inferred made the output more useful, not less.
- MCP brings the tool into the editor. Once Poltergit was an MCP server, the investigation happened where the code lives.
What's next for Poltergit
- Live mode: follow a running OTel Collector so a haunting appears within seconds of a bad deploy.
- Upload any repo: map services to code paths automatically.
- Scale: run FalkorDB on large real-world histories and real incidents.
Built With
- cypher
- falkordb
- fastapi
- git
- kiro
- mcp
- opentelemetry
- otlp
- pygit2
- pytest
- python
- react
- svg
- typescript
- vite