Inspiration
Coding agents read files. They don't see connections. Before an agent edits round_money, it can't tell what depends on it, which tests would catch a mistake, or who wrote the code. It greps, guesses and hopes. That's exactly the "context, connected" problem: the answers live in the relationships between code, tests, runtime behaviour and history.
What it does
Ripple turns a Python repository into a local Relate graph and lets people (CLI) and coding agents (an MCP server for Claude Code) ask:
- What breaks if I change this function? Every transitive caller, with its distance.
- Which tests should I run? Tests that reach it through the call graph and tests that actually executed it (coverage), each marked static / dynamic.
- Who should review the change? The authors of the function's current lines, from git blame.
- What is dead, untested or tangled? Dead code, untested code and import cycles.
The interesting part is combining sources. In the demo repo, a payment method is dispatched with getattr, so no static analyser sees the call. Coverage does. Ripple stores both as edges (CALLS and EXERCISES) and finds the one test that matters, without reporting the method as dead code.
ripple viz writes an interactive HTML page of the graph: click a function and everything that depends on it lights up.
How we built it
Everything runs locally in one embedded Relate store file (store/ripple.rl), with no server and no API keys.
- Static analysis: the stdlib
astmodule resolves calls through imports, aliases,self/super(), constructors and simple local-variable types. - Dynamic analysis: the repo's pytest suite runs under
coverage.pywith per-test contexts, so every test is linked to the functions it executed. - History:
git logandgit blame --line-porcelain, aggregated per function. - Graph: modules, classes, functions, commits and authors, connected by
CALLS,EXERCISES,IMPORTS,INHERITS,BLAMED_TOand more. Every question is a Cypher query. - Front ends: a CLI, the HTML graph, and an MCP server with 10 read-only tools, including a read-only
cyphertool so an agent can write its own queries.
A deterministic demo repo (shop) was built on purpose, with fixed authors and dates, so every question has a known answer. Tests check the whole pipeline against those answers (130 tests).
Challenges
- Path explosion. A plain variable-length pattern like
-[:CALLS*1..6]->enumerates every path. On a synthetic 3,000-function graph, "which functions are untested?" took 57 seconds. QuantifiedANY SHORTESTpaths do the same job in milliseconds. - Relate specifics. Variable-length bounds can't be query parameters, so the depth is validated and formatted into the query. A
.rlstore allows one writer and no readers at the same time, so the MCP server opens the store per call and closes it right after. - Reproducibility. A git history can't be committed as a nested
.git, so the demo repo's history is stored as plain files and replayed deterministically: the same commit hash on every machine. - Honest static analysis. Dynamic dispatch, parameters and unknown objects give no static edge. We kept the resolver conservative and let coverage fill the gap, rather than guessing.
Accomplishments we're proud of
- The whole demo (
ripple demo) runs from a fresh clone, offline, in about a second. - Claude Code answers "what breaks if I change
round_money?" through the graph instead of grepping: 26 callers, 14 of them tests, up to 4 hops away. - Static and dynamic analysis finding different things, and the graph combining them.
What we learned
Relate makes "a graph inside your application" practical: no service to run, a single file the judges can open. Putting different kinds of evidence (code structure, runtime behaviour, history) into one graph answers questions none of them can answer alone.
What's next
- Run Ripple on larger real repositories (the parser already handles
src/layouts). - Incremental re-indexing on each commit.
- More languages, and richer questions such as "which tests are redundant?".