Inspiration

Large codebases rot quietly. A linter hands you 5,000 warnings; nobody knows which ten matter, where the architecture is eroding, or what the code should look like. For the CHECK24 challenge (judging the code quality of large repositories) we wanted a tool that opens with what to fix first, lets you click any finding down to the exact lines, and stays stable when you run it twice.

What it does

tnil analyzes a repository end to end and produces an interactive architecture report:

  • Static analysis layer: a lint aggregator over many backends (Java, TypeScript, Python, Dart) and depgraph, which builds the module dependency graph, clusters, layer metrics, rule checks (including the repo's own ArchUnit-style architecture rules), git co-change coupling and combined signals (architectural hotspots, god classes, fat controllers, boundary erosion).
  • arch-agent: an LLM agent that starts from a dossier of pre-combined evidence instead of 20 raw tools, reviews the flagged candidates and records verdicts with file, line, broken rule and fix.
  • arch-reference-agent: a map-reduce swarm (up to 15 subagents, one per module group) that reads the code without metrics and designs the reference architecture: the optimal static structure the codebase should have. Differences between today's code and that target become findings.
  • One ranked list: both finding lists are synthesized and ranked deterministically into a single Fix first list, each item with its action, evidence lines and target structure.
  • Visualizations: the dependency graph, current-vs-reference architecture diagrams (layered, ELK-laid-out), and an animated replay of a full pipeline run that shows every tool call, agent and finding as it happened.

How we built it

TypeScript and Python. depgraph and the viewers in TypeScript (Cytoscape, ELK); agents on the pi agent SDK with every call traced in Phoenix (OpenTelemetry). Jev (TypeSafe) gives cheap typed yes/no judgments, for example whether two co-changing files are really related. LLM calls run through the CHECK24 endpoint; secrets are encrypted in the repo with cylinder. We evaluated on Artemis (a golden set of 19 verified problems) and on public architecture datasets (ArDoCo TEAMMATES, ArchEval ZooKeeper and Spring Framework), with Claude Sonnet as the matching judge.

Challenges we ran into

  • Most file metrics just measure size: lines of code alone separates problem files with AUC 0.90. We had to find signals that add information (outgoing coupling, layer, rule violations) and combine them.
  • Agents with many raw tools mostly read files: a full run made 1,112 read_file calls out of 2,010. Giving them a dossier cut tool calls by about 40% and raised golden-set recall from 16-17 to 19 of 19 on the golden modules.
  • Keeping the reference architecture strictly static and making it comparable with the current code: we had to project the reference back onto every current file so both diagrams share the same units.
  • Ranking: merging two finding lists without diluting the top of the list.

Accomplishments that we're proud of

  • A full Artemis run (lint, depgraph, arch-agent, reference swarm) costs about $1.60.
  • The reference architecture reaches component F1 0.95 on ArDoCo TEAMMATES and 0.71 on Spring Framework.
  • Every finding carries file and line evidence that a tool actually showed the agent; nothing is invented.
  • The animated replay turns an opaque multi-agent run into something you can watch from start to finish.

What we learned

Deterministic analysis should decide where to look and the LLM should decide what it means. Evaluate early: a golden set and public datasets told us quickly when an idea (like aggressive context compaction) quietly lost findings.

What's next for Tnil

More languages and repos, a larger developer-confirmed ground truth, a before/after diff that shows a fix moving the code toward the reference architecture, and one unified design language across all views.

Built With

Share this project:

Updates

Submission history