Visualise and judge a codebase's maintainability. DriftGuard turns a Java or TypeScript repository into an interactive architecture map and a short, ranked maintainability report. Every finding links back to the exact files and lines that support it.
Built at hackaTUM 2026 for the CHECK24 challenge "Visualise and judge a codebase". The question behind it: with AI-assisted pull requests up sharply, is a project getting better or worse, and how would anyone know?
A developer opening an unfamiliar repository should understand its main modules within two minutes and be able to follow any finding to the source that supports it.
- Architecture map: 10–25 named module groups with dependency arrows. You can drill down group → module → package → class, and the layout is precomputed so it looks the same every time.
- Ranked findings, at most 5 on the first screen: dependency cycles, maintenance hotspots, violations of a project's own documented rules, and oversized components that a lot of code depends on. Each finding carries its evidence (node ids, file, line range, pinned commit) and a remedy from the modifiability-tactics catalogue (Bass, Clements & Kazman).
- Deterministic core: parsing, resolution, modelling, analysis and ranking involve no LLM and give byte-identical output across runs, machines and worker counts.
- The LLM sits on top, not underneath: it judges at most 5 findings and writes one summary per repo. It never creates, removes or reorders findings. Every call is cached and listed in the report with its cost.
- Before/after AI (bonus): re-runs the same analysis on the last commit before March 2025 and compares the architecture's drift.
| Repository | Languages | Size (analysed lines) | Resolver coverage |
|---|---|---|---|
| ls1intum/Artemis | Java + Angular | 549k | Java 99.8% · TS 100% |
| keycloak/keycloak | Java + TypeScript | 489k | Java 99.8% · TS 99.9% |
| n8n-io/n8n | TypeScript (pnpm workspace) | 1.97M | TS 99.8% |
Snapshots are pinned in corpus/corpus.yaml. Coverage = resolved / (resolved + ambiguous + unresolved), with external libraries left out. The targets are Java ≥ 95% and TypeScript ≥ 90%. References are never guessed: an ambiguous reference stays ambiguous and an unresolved one is reported.
Repository ─▶ Parse ─▶ Model ─▶ Analyse ─▶ Rank ─▶ LLM judge ─▶ Report + map
git log tree-sitter 4-level detectors D8 evidence in, analysis.json
12 months Java/TS/Vue graph, (cycles, validated JSON references.json
one pass 2-pass roles, hotspots, out → React viewer
resolver layout rules, size)
└──────────────────── deterministic ───────────────────┘
| Stage | What happens |
|---|---|
| Repository | Pinned snapshot plus 12 months of history in a single git log --numstat -M pass. Renames are followed; bot and bulk commits (> 50 files) are reported but left out of activity. |
| Parse | Pass 1 indexes every file in parallel with tree-sitter and caches it by content hash. Pass 2 resolves references: JLS lookup for Java; tsconfig paths/extends, workspace packages, exports, build output → source and barrel files for TypeScript. |
| Model | Modules come from build manifests and feature folders. The graph has four levels (group → module → package → class), and each arrow keeps its distinct source-file count and evidence. Layer roles come from Spring annotations and n8n file naming. The overview layout is integer-based and seed-free. |
| Analyse / rank | Detectors produce findings with evidence. Ranking puts verified rule breaches first, then the average of the change-activity and structural-exposure percentiles. |
| Judge / explain | An LLM interprets the top findings within a fixed budget, from evidence packets only. |
Speed (budget ≤ 3 min per 1M lines cold, ≤ 30 s warm):
| Repo | Cold | Warm |
|---|---|---|
| n8n (1.97M lines) | 13 s | 10 s |
| Artemis (549k lines) | 13 s | 11 s |
Requires uv, git, and Node (LTS, for the viewer).
uv sync --project analyzer # Python 3.15.2 env in analyzer/.venv
cd analyzer
uv run driftguard analyze keycloak # → results/keycloak/<sha>/analysis.json + references.json
uv run driftguard analyze n8n --snapshot pre_ai # last commit before March 2025The first run clones the repository into .cache/repos/ (gitignored). Later runs reuse the clone and the parse cache.
From the repository root, build the viewer data after running the analyzer, then start the viewer:
npm ci --prefix viewer
npm --prefix viewer run data
npm --prefix viewer run dev -- --host 127.0.0.1 --strictPortOpen the viewer. To enable Customize with AI, start the local service in a second terminal:
uv run --project analyzer driftguard onboarding-serveSet LLM_API_KEY in the repository's local .env or in that terminal for the CHECK24 gateway. Choose a pinned repository, review the guidance, and select Run with profile. The guidance is used for AI judgements and the report summary. The analysis, evidence, and ranking use the standard corpus config. Customized reports are stored under results/onboarding/ and served locally. You can open the existing reports directly without starting the service.
| Command | Purpose |
|---|---|
make check-fast |
Lint, type check and tests. Run before every PR. |
make bench REPO=n8n |
Cold and warm timings against the budget |
make determinism REPO=keycloak |
3 runs (empty caches, different worker counts) must hash identically |
make determinism-fixtures |
Same, for every fixture in fixtures/ |
make corpus-run |
Analyse every delivery repository |
make types |
Regenerate the viewer's TypeScript types from the schema |
| Path | Contents |
|---|---|
analyzer/ |
Python package driftguard: git/, parse/, model/, analyse/, judge/, emit/, schema.py (the analysis.json contract) |
viewer/ |
React viewer with repository reports, drift and optional AI onboarding |
corpus/corpus.yaml |
Pinned repositories, excludes and module-group maps |
fixtures/ |
Mini-repos with expected.json for detector and resolver tests |
docs/ |
Plan · decisions · tech stack · design |
results/ |
Generated output (gitignored) |
The analyzer pipeline (git → parse → resolve → model → emit) runs end to end on all three repositories. Detectors and ranking, the viewer, and the LLM judge are in progress. See the plan for the delivery order.
| Name | Area |
|---|---|
| Adarsh | git history, parsing and resolution, graph model, schema.py, performance |
| Iva | detectors, ranking, drift analysis |
| Abdulla | viewer and design |
| Anmol | corpus, fixtures, CI, LLM judge |
Contributor rules (for people and coding agents) are in AGENTS.md. Tool setup is in SETUP.md.