Dev.to AI 🤖 Ai 👁 0 📖 1 min read

Vibelens: 2.8 MB Rust CLI that maps git diffs to a 3-hop blast-radius graph

Reviewing 900-line AI-generated PRs in raw git diff is mostly guesswork. You see twenty changed files, you skim past a three-line helper tweak, and that tweak quietly breaks an auth route two modules upstream — or hides

Vibelens: 2.8 MB Rust CLI that maps git diffs to a 3-hop blast-radius graph

Reviewing 900-line AI-generated PRs in raw git diff is mostly guesswork. You see twenty changed files, you skim past a three-line helper tweak, and that tweak quietly breaks an auth route two modules upstream — or hides an except: pass, todo!(), verify=False, or weakened test assertion.

I built vibelens https://github.com/an1zy/vibelens to fix that locally: a single ~2.8 MB pure-Rust binary with zero cloud calls and zero C build dependencies.

What it actually does

  1. Extracts the diff (git.rs): reads working tree, --staged, untracked files, or any range like main..HEAD (auto-detects merge-base when your tree is clean).

  2. Indexes symbols in parallel (lang.rs): uses ignore + rayon with a fast brace/indent pass instead of bundling tree-sitter C toolchains. Covers Rust, TypeScript/JavaScript, Python, Go, C#, Java, and C/C++.

  3. Traces 3-hop blast radius (graph.rs): maps diff hunks onto modified functions/types/routes/tests, walks reverse callers up to depth 3, and sorts files by real downstream impact so you read the riskiest changes first.

  4. Static slop & security audit (slop.rs): flags swallowed exceptions (except: pass, catch {}), stubs (todo!(), NotImplementedError, TODO: implement), assertionless or weakened tests, verify=False / shell=True / unsafe, 4-line copy-paste blocks, .unwrap() in non-test Rust, and hardcoded key literals.

Output modes

  • vibelens — monochrome terminal triage report
  • vibelens --open — standalone frosted-glass HTML graph + diff viewer
  • vibelens --tui — ratatui terminal UI
  • vibelens --svg card.svg --md — PR summary card and Markdown table
  • vibelens --fail-above 45 — CI gate (exits with code 2)

Trade-off: call tracing uses identifier matching rather than full type resolution, so heavy macro magic or dynamic dispatch won't be resolved. Prebuilt binaries for Windows, Linux, and macOS (ARM64 + x64) are up in https://github.com/an1zy/vibelens/releases — MIT licensed.

Repo: https://github.com/an1zy/vibelens

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.