AltSenior AI: the code reviewer that thinks in trees, remembers the repo, and scores the noise
A deep-dive into the open-source review engine that pairs Tree-sitter parsing, repo-wide retrieval, and severity scoring to act less like a chatbot and more like a senior engineer.
- AltSenior AI treats code review as evidence gathering first and model judgment second, which is how it cuts down on noisy findings.
- Tree-sitter gives the system structural certainty, while RAG gives it repository memory, so the model is not guessing in the dark.
- The severity scorer matters because it turns scattered signals into a review that feels prioritized instead of theatrical.
- The repo’s CLI, NestJS, and Streamlit pieces point to a practical system that is designed to ship, not just demo well.
Most AI code review tools start at the wrong end. They hand a diff to a model, ask for comments, and hope the model somehow infers the rest of the repository. AltSenior AI flips that sequence: it maps the codebase, extracts structure, pulls in context, and only then asks the model to judge what matters.
The real trick is sequencing
The repository’s own pipeline makes the thesis plain. A FileSystemAnalyzer maps what exists. A QualityDetector catches obvious patterns. An ASTAnalyzer turns source into structure with Tree-sitter. Then RAGService retrieves repo-wide context before AIProvider writes findings and SeverityScorer compresses the output into a quality score. That order matters. It pushes the probabilistic part of the system to the end, after the deterministic pieces have already narrowed the search space.
That design gives AltSenior a different personality from the average AI assistant. It is not trying to sound smart first. It is trying to be hard to fool. The repo brief also shows a dual personality architecture, with a TypeScript CLI at the center, a NestJS application context for dependency injection, and a Streamlit sidecar for visualization. That mix suggests a team thinking about adoption, not just model calls.
Why Tree-sitter changes the game
Tree-sitter is the difference between text search and actual syntax awareness. A regex linter can spot a suspicious token sequence, but it cannot reliably tell whether that token lives inside a function body, a nested scope, or a different construct altogether. Tree-sitter gives AltSenior a structural backbone across many languages, which is why the repository can aim at broad language coverage instead of becoming a TypeScript-only toy.
const files = await fileSystemAnalyzer.scan()
const patterns = await qualityDetector.run(files)
const ast = await astAnalyzer.parse(files)
const context = await ragService.retrieve({ files, ast })
const review = await aiProvider.review({ ast, context, patterns })
return severityScorer.score(review)
The other half of the story is retrieval. By pairing AST parsing with repo-wide context, AltSenior can answer a question that a plain chat prompt usually cannot: what does this change mean in the rest of the codebase? That is the senior-reviewer instinct the project is chasing. It does not just inspect a patch. It assembles evidence from nearby files, then lets the model weigh the evidence in context.
What it looks like next to the blunt instruments
| Review style | What it gets right | What it misses | Best use |
|---|---|---|---|
| Prompt-only LLM review | Fast to prototype and easy to understand | Weak memory, more hallucination risk, shallow context | Quick triage or one-off summaries |
| Static linter | Deterministic, cheap, and precise about known rules | Misses cross-file reasoning and design intent | Style, correctness, and basic bug checks |
| CodeQL | Treats code as data and supports semantic queries | Requires specialized queries and security expertise | Security analysis and large codebases |
| AltSenior AI | Combines structure, retrieval, judgment, and scoring | More moving parts than a single prompt | Prioritized AI-assisted code review |
That is the interesting part of the project. It is not trying to replace static analysis, and it is not pretending an LLM can review code from scratch. It is building a smaller, stricter system around the model so the model has less room to be wrong. In practice, that means the output should feel less like chatbot prose and more like a review queue with reasons attached.
The repo’s practical signal
The implementation choices read as deliberate. A NestJS application context lets the CLI use dependency injection without starting a server. A separate web bridge lets the project show results without forcing a heavy frontend stack. A severity score turns a pile of findings into something a developer can act on in a minute, not an afternoon. Even the broad parser support points to the same idea: the system is trying to scale judgment, not just language coverage.