跳到正文
DEV Community· william freund·· 3 小時前AI 評分44

BlastRadius:合併前瞭解哪些地方會出問題

BlastRadius: Know What Breaks Before You Merge

AI 導讀

BlastRadius 可分析 Python 程式碼庫中擬議變更的影響範圍,找出直接及間接呼叫者、相關檔案、測試、依賴鏈和熱點。它以 FalkorDB 儲存程式碼圖譜,透過 Ollama 在本機執行 Gemma,根據圖譜結果撰寫變更摘要及建議執行的測試。單一程式碼庫的本機掃描免費,分析流程不使用託管 API。

正文

william freund

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission 💸

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

What I Built

BlastRadius answers the question every developer dreads: "if I change this function, what breaks?"

You point it at a Python repo. It parses the code into a graph (files, functions, classes; calls, imports, definitions), then runs real graph queries to find the blast radius of any proposed change: every caller, transitively, the files involved, the tests that cover it, the dependency chain, and the hot spots. Then a local open-weight model (Gemma, via Ollama) writes a change summary grounded in those graph results, plus which tests to run.

Who would pay for it: indie developers and small teams who have been burned by "one-line fix, three-hour outage." Local single-repo scans are free; the business is a per-repo / small-team plan for hosted scans and team-wide impact reports.

Demo

Watch the 37-second demo (real run on the bundled sample app): BlastRadius demo video

Or run it yourself: clone the repo, follow the README quickstart, then python -m blastradius demo.

Code

https://github.com/986036734/blastradius

How I Built It

  • FalkorDB (open-source graph database) holds the code graph. All impact analysis is real Cypher: multi-hop reverse CALLS traversal for the blast radius, shortest path for the dependency chain, degree centrality for hot spots.
  • Gemma (Google's open-weight model) via Ollama, running fully locally, writes the change summary. The prompt is grounded in the graph results — callers, files, tests, chain — and the graph results are authoritative: the summary is a draft for the developer to check, not gospel. (In testing, the 1B model occasionally garbles a detail, e.g. inventing a test filename; the 4B model is recommended for better fidelity.)
  • Python stdlib ast for parsing. No embeddings, no hosted APIs in the loop.

Why Does Open Innovation Matter?

Your codebase is your most private asset, and your change history is your team's memory. A closed API would mean shipping both to someone else's server on every query, and paying per token for the privilege.

Running Gemma locally flips that: the graph and the model both live on your machine, your code never leaves the laptop, and the marginal cost of a query is ~$0 — which is exactly what makes a $5/mo-style price point work instead of a per-token meter. Open weights also mean you can swap models (1B on a laptop, 4B on a workstation) without rewriting anything. If Gemma disappeared tomorrow, the graph queries still work; if the graph disappeared, the model would be guessing. The open pieces are what make the product work.

Prize Categories

  • Best Use of Gemma

來源:DEV Community · dev.to