Skip to content
Arxo Arxo

Architecture Overview

Arxo is a multi-language architecture analysis tool that helps you understand, measure, and enforce architectural patterns in your codebase.

Arxo operates through a multi-stage pipeline:

Source Code → Parsing → Graph Building → Analysis → Metrics → Policy Evaluation → Report

Arxo parses source files in multiple languages:

  • TypeScript/JavaScript - Including React, Vue, Angular
  • Python - Including Django, Flask
  • Rust - Including Cargo workspaces
  • Java - Including Maven, Gradle projects
  • Kotlin - Including Android projects
  • Go - Including Go modules

The parser extracts:

  • Import/dependency relationships
  • Function and method calls
  • Type definitions and usage
  • File and module structure

Arxo builds multiple interconnected graphs:

Import Graph

  • Module-level dependencies
  • Package relationships
  • Directory structure
  • External dependencies

Call Graph

  • Function-to-function calls
  • Method invocations
  • Cross-module calls
  • Dynamic dispatch resolution

Entity Graph

  • File-level relationships
  • Component boundaries
  • Package structure

Arxo computes 50+ architectural metrics across categories:

  • Structural - Cycles, centrality, modularity
  • Coupling - Propagation cost, dependencies
  • Evolution - Change patterns, hotspots
  • Quality - Smells, violations, test coverage
  • AI/LLM - Observability, cost tracking, security
  • Security - Data flow, sensitive information

Define architectural rules in YAML:

policy:
invariants:
- metric: scc.max_cycle_size
op: "=="
value: 0
message: "No circular dependencies allowed"

Arxo evaluates policies and reports violations with context.

Arxo generates reports in multiple formats:

  • Console - Human-readable terminal output
  • JSON - Machine-readable for CI/CD
  • HTML - Interactive web reports
  • SARIF - Integration with code scanning tools
  • MessagePack - Efficient binary format
┌─────────────┐
│ Source Code │
└──────┬──────┘
┌─────────────────┐
│ Parser │ ← Extracts imports, calls, types
└────────┬────────┘
┌─────────────────┐
│ Import Graph │ ← Module dependencies
│ Call Graph │ ← Function calls
│ Entity Graph │ ← File relationships
└────────┬────────┘
┌─────────────────┐
│ Derived Data │ ← SCCs, reachability, centrality
└────────┬────────┘
┌─────────────────┐
│ Metrics │ ← 50+ architectural metrics
└────────┬────────┘
┌─────────────────┐
│ Policy Engine │ ← Evaluate invariants
└────────┬────────┘
┌─────────────────┐
│ Report │ ← JSON/HTML/Console output
└─────────────────┘

The core analysis engine handles:

  • Language parsing and AST extraction
  • Graph construction and indexing
  • Metric computation
  • Performance optimization
  • Caching and incremental analysis

The engine is distributed as a binary library to ensure:

  • Consistent analysis across platforms
  • Optimized performance
  • Protection of proprietary algorithms

Public components you can inspect and extend:

CLI (arxo-cli)

  • Command-line interface
  • Configuration loading
  • Output formatting
  • Progress reporting

MCP (arxo-mcp)MCP docs

  • Model Context Protocol integration
  • AI assistant tools
  • Cursor IDE integration

LSP Server (arxo-lsp)

  • Real-time analysis in editors
  • Code lens indicators
  • Diagnostic messages
  • Quick fixes

Type Definitions (arxo-types)

  • Data structures
  • Configuration schema
  • Plugin interfaces

Arxo analyzes multiple languages in a single codebase:

  • Monorepo support (Nx, Turborepo, Lerna)
  • Cross-language call tracking
  • Unified dependency graphs
  • Language-specific patterns

Arxo caches analysis results:

  • Only re-analyzes changed files
  • Persists graph indices
  • Configurable cache location
  • Cache invalidation on config changes

Metrics are computed in parallel:

  • Multi-threaded graph operations
  • Concurrent metric plugins
  • Memory-efficient streaming
  • Progress tracking

Arxo supports custom configurations:

  • Custom metric selection
  • Configurable thresholds
  • Language-specific filters
  • Output customization
  1. Language-Agnostic Core - Same analysis pipeline for all languages
  2. Graph-Based Analysis - Everything is modeled as relationships
  3. Incremental Computation - Cache and reuse previous results
  4. Policy as Code - Enforce architecture with declarative rules
  5. Multi-Format Output - Integrate with any toolchain

Typical analysis times (on modern hardware):

Project SizeFilesAnalysis Time
Small<1001-3 seconds
Medium100-1,0005-15 seconds
Large1,000-10,00030-90 seconds
Very Large>10,0002-5 minutes

Incremental analysis (only changed files): 1-5 seconds

Arxo operates entirely locally:

  • No data sent to external servers
  • No telemetry or tracking
  • All analysis happens on your machine
  • Source code never leaves your environment

On Linux you can run the engine in a Landlock self-sandbox with --sandbox. The engine restricts itself before any file I/O: the project path is read-only, only the cache directory (e.g. ~/.cache/arxo) is writable, and network access is not allowed when the kernel supports Landlock ABI v4+. If Landlock is unavailable (e.g. kernel < 5.13), the run continues without sandbox. On macOS and Windows, --sandbox is ignored. See CLI analyze: Sandbox for usage.

Run Arxo in a sandboxed container with no network access and read-only filesystem:

Terminal window
docker run --rm --read-only --network=none --cap-drop=ALL \
-v $(pwd):/workspace:ro -v /tmp/arxo-cache:/home/arxouser/.cache:rw \
arxo/arxo analyze --path /workspace

Or use the helper script: ./releases/docker/run-sandboxed.sh analyze --path .. See releases/docker/README.md for details.