Inspiration

As computer scientists, we all notice that we work faster now and produce more pull requests per month. But, as the CHECK24 team pointed out, we don't know whether that makes the code better or worse. Being able to understand and maintain generated code will become increasingly important, and we wanted a way to measure that instead of guessing. The CHECK24 challenge "Visualise and judge a codebase" gave us the chance to build it.

What it does

Faultline analyses a repository in three stages:

  1. faultline analyze extracts deterministic facts only: entities, the module graph, dependency cycles, deployable units, runtime-role candidates, and component clusters. The output is analysis.json, and it is byte-identical across runs for the same commit.
  2. faultline report builds the report the frontend reads. The ranking is currently a clearly marked mock until the team designs it.
  3. faultline web serves a static interactive page with a module map, a dependency-structure view, a findings list, and a per-repo quality report. Findings link to the cited lines (with GitHub permalinks), and a timeline lets you scrub through snapshots to see architectural drift.

Two dimensions are covered: structural coupling and change risk. Facts never depend on the LLM. When the LLM is used, it writes one-sentence judgments on the top findings and short module briefs, and every citation is checked against the code it refers to.

How we built it

  • Analysis core (Python): tree-sitter parsers for Java and TypeScript, lizard for complexity, and git history for churn. Graph algorithms (strongly connected components, feedback arc set, layering) run on sorted nodes and edges so results are reproducible.
  • Architecture model: the map is the declared structure (deployable units → runtime roles → declared modules), and clustering (Louvain) is a lens that adds "fused / split / misplaced" facts on top rather than replacing the map.
  • LLM layer: Gemini behind a complete(prompt, schema) interface, with validation (citations inside snippets, identifiers exist, numbers match facts). Failed checks drop a judgment rather than fixing it up. Responses are cached by a hash of task, prompt version, model and input.
  • Testing: a mutation harness builds a small Java repo with planted flaws and noise decoys, and checks that the analyzer catches the flaws and ignores the decoys.
  • Frontend: Vite, React 19, Tailwind v4, and shadcn / Aceternity components. The built page is committed.

Challenges we ran into

  • Finding the right approach. The hardest part was deciding how to break the system into components, and which structure to trust as the map. Clustering alone gave unstable answers, so we settled on declared modules as the map and clustering as a lens on top.
  • Determinism versus LLM output. Keeping analysis.json byte-identical meant keeping timestamps, run IDs and anything time-dependent out of it, and anchoring git windows to commit timestamps instead of "now".
  • Import resolution. Static member imports inflated the edge count by about 6 %, so we decided they are not edges. TypeScript resolution reaches 86.6 % because npm packages and some barrel re-exports can't be resolved from the repo.

Accomplishments that we're proud of

  • a lot of different runs on different repos which each produced a solid or good run with the analysis so the robustness criterion holds in practice.
  • All 19 LLM citations in the interim run were verified against their snippets.
  • The report opens with a "fix first" list, and every finding is traceable to the lines behind it.

What we learned

  • Facts before LLM. Deterministic facts make the LLM layer small and checkable, and they are what let us defend the findings.
  • Ranking needs agreed thresholds. Without agreed thresholds, a ranking is just a guess. That is why the current ranking is marked as a mock.

What's next for Faultline

  • Deployment: host the report web app so teams can open a repo's quality report without running the tool locally.

Built With

Share this project:

Updates

Submission history