How Sentrux Turns AI‑Generated Code into Controlled Architecture Evolution
Sentrux, a Rust‑based real‑time architecture sensor, visualizes a project’s dependency graph as an interactive treemap, scores code health on five metrics, and integrates with AI coding agents via MCP to provide millisecond‑level feedback, enabling continuous quality gating and preventing architectural decay caused by AI‑driven code generation.
Problem
When using AI‑powered IDEs such as Claude Code or Cursor, developers encounter recurring issues:
AI hallucinating functions that do not exist.
Generated code placed in incorrect files or directories.
Introduced bugs in modified files.
Simple new requirements causing regressions in existing features.
Fixing AI‑generated code taking longer than writing code manually.
The underlying cause is not a degradation of the large‑model itself but a loss of project‑level architectural control. Traditional diff‑based review only shows changed lines, making it impossible to maintain a holistic view of the evolving codebase.
Sentrux solution
Sentrux implements an instant architecture sensor that operates on the whole repository rather than on diffs. Its approach consists of three pillars:
1. Visualize
It renders a real‑time interactive treemap that displays file‑level dependencies. Files modified by an AI agent are highlighted, allowing developers to see structural changes directly.
2. Measure
Five core health indicators are evaluated continuously, producing a score from 0 to 10 000:
Modularity – intra‑module cohesion and coupling.
Acyclicity – number of cycles in the dependency graph.
Depth – call‑chain depth and abstraction levels.
Equality – balance of code distribution across modules.
Redundancy – duplicate code and redundant structures.
The scoring runs in milliseconds, as shown by the author’s logs.
3. Govern
A quality gate captures regressions, and a rule engine enforces architectural constraints. When degradation is detected, the system alerts the AI agent and forces a re‑evaluation.
Core features
Visualization : Interactive treemap with real‑time updates.
Measurement : Five‑metric health scoring (0‑10 000) computed in milliseconds.
Governance : Quality gate and rule engine for automated enforcement.
Installation
macOS: brew install sentrux/tap/sentrux Linux:
curl -fsSL https://raw.githubusercontent.com/sentrux/sentrux/main/install.sh | shWindows:
curl -L -o sentrux.exe https://github.com/sentrux/sentrux/releases/latest/download/sentrux-windows-x86_64.exeBasic usage
sentrux # Open GUI with real‑time treemap
sentrux /path/to/project # Scan a specific directory
sentrux check . # Run rule checks (CI‑friendly, exit code 0/1)
sentrux gate --save . # Save a baseline before an AI session
sentrux gate . # Compare against baseline to capture degradationAI agent integration (MCP)
Agents receive architecture health data via the Model Context Protocol (MCP). Example for Claude Code:
/plugin marketplace add sentrux/sentrux
/plugin install sentruxFor other MCP‑compatible agents (Cursor, Windsurf, OpenCode, etc.) add the following configuration:
{
"mcpServers": {
"sentrux": {
"command": "sentrux",
"args": ["--mcp"]
}
}
}Language support
Sentrux leverages the tree‑sitter plugin to support 52 programming languages out of the box. Language packs are downloaded on first launch.
Plugin commands:
sentrux plugin list # List installed plugins
sentrux plugin add <name> # Install a plugin from the registry
sentrux plugin add-standard # Install all 52 language plugins
sentrux plugin init my-lang # Scaffold a new language pluginComparison with traditional tools
Analysis target : Sentrux analyzes code architecture; traditional linters focus on code style; spec‑kit‑type planning tools operate on text documents.
Feedback speed : Sentrux provides millisecond‑level real‑time feedback; linters run on file save; planning tools give post‑hoc feedback.
Closed‑loop capability : Sentrux combines sensor, rules, and executor; linters perform style checks only; planning tools have no feedback loop.
Agent integration : Native MCP support in Sentrux; none in traditional linters and planning tools.
Visualization : Interactive treemap in Sentrux; none in the alternatives.
Language support : 52 languages via plugin architecture in Sentrux; limited language sets in linters; not applicable to planning tools.
Reference resources
GitHub: https://github.com/sentrux/sentruxDisclaimer: Content is provided for learning and exchange only. Use the tool in accordance with platform terms and applicable laws.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
AI Open-Source Efficiency Guide
With years of experience in cloud computing and DevOps, we daily recommend top open-source projects, use tools to boost coding efficiency, and apply AI to transform your programming workflow.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
