8 releases (stable)
| 1.1.0 | Feb 27, 2026 |
|---|---|
| 1.0.6 | Feb 22, 2026 |
| 0.1.1 | Feb 3, 2026 |
#314 in Testing
Used in forgekit-core
1MB
18K
SLoC
Mirage
Version: 1.1.0
Path-aware code intelligence engine for Rust. Analyzes control-flow graphs to find execution paths, dead code, and impact zones.
Positioning: CFG analysis tool for codebases indexed by Magellan. Answers questions like "what code MUST execute on any path from entry to exit?"
Purpose
Mirage analyzes control-flow graphs from Magellan. Built for:
- Developers — Find dead code, understand execution paths, analyze impact of changes
- AI Assistants — Structured path analysis for code reasoning
- Tooling — Scriptable CFG analysis with precise block-level data
Features
- Path enumeration — Find all execution paths through a function
- Dominance analysis — Compute dominators, post-dominators, dominance frontiers
- Loop detection — Identify natural loops within functions
- Dead code detection — Find unreachable blocks
- Impact analysis — Blast zones, program slicing
- Hotspots — Risk scoring based on path counts and complexity
Quick Start
# Install
cargo install mirage-analyzer
# Requires Magellan database (create first)
magellan watch --root ./src --db code.v3
# Check database status
mirage status
# Show execution paths through a function
mirage paths --function "my_crate::process"
# Find unreachable code
mirage unreachable
# Visualize control flow
mirage cfg --function "my_crate::main" --format dot
Installation
cargo install mirage-analyzer
Or build from source with Native-V3 backend:
# Native-V3 backend (recommended - fastest)
cargo install mirage-analyzer --features backend-native-v3 --no-default-features
Backends
| Feature | Description | File | Best For |
|---|---|---|---|
backend-native-v3 |
High-performance binary backend | .v3 |
Performance-critical |
backend-sqlite (default) |
SQLite backend | .db |
Compatibility |
Both backends provide identical CFG analysis results.
Requirements
- Magellan 2.4.3+ — Required for CFG extraction
- sqlitegraph 2.0.3+ — Included automatically
Documentation
- MANUAL.md — Complete command reference and examples
- CHANGELOG.md — Version history
What Mirage Does NOT Do
- ❌ Search code (use llmgrep)
- ❌ Index code (use Magellan)
- ❌ Type checking or semantic analysis
- ❌ Code editing (use splice)
License
GPL-3.0-or-later. See LICENSE.
Dependencies
~137MB
~3M SLoC