Version: 2.0
Date: December 6, 2025
Status: Unified Package Architecture
ElixirScope is a comprehensive AST-based debugging and code intelligence platform for Elixir applications. This documentation reflects the unified package architecture where all 8 layers are contained within a single elixir_scope package, with Foundation as an external hex dependency.
elixir_scope/ # Unified package
├── Foundation (external dependency) # Infrastructure services
├── AST Layer # Static code analysis
├── Graph Layer # Mathematical algorithms
├── CPG Layer # Code Property Graph
├── Analysis Layer # Pattern detection
├── Capture Layer # Runtime instrumentation
├── Query Layer # Query engine
├── Intelligence Layer # AI/ML integration
└── Debugger Layer # Debugging interface
claudeCodeArchPlan.md- Complete architecture plan and implementation strategyCLEANUP.md- Documentation cleanup strategy (completed)
implementation/AST_IMPLEMENTATION_GUIDE.md- AST Layer implementation (Core)implementation/GRAPH_IMPLEMENTATION_GUIDE.md- Graph Layer hybrid libgraph approach (Start Here)- Additional layer guides to be created as needed
reference_implementation/- Complete working implementation from original monolithast/- AST layer reference code (70 files, 16k LOC)graph/- Graph algorithms reference (11 files, 506 LOC) - NOTE: Using libgraph + custom extensions insteadcpg/- CPG construction reference (80 files, 14k LOC)capture/- Runtime capture reference (50 files, 10.7k LOC)intelligence/- AI integration reference (22 files, 5.4k LOC)analysis/- Analysis patterns reference (38 files, 3.6k LOC)query/- Query engine reference (13 files, 1.8k LOC)debugger/- Debugger interface reference (18 files, 1.6k LOC)
ast/- AST Layer PRDs and technical specs (legacy - needs update)diags/- Diagnostic and analysis documentsmodule_docs/- API documentation
archive/- Historical documentation organized by purposefoundation_extraction/- Foundation layer extraction historylegacy_monolith/- Original monolith architecture docsdated_docs/- Time-stamped development documentationdevelopment_history/- Development notes and evolution
Foundation layer is extracted to external hex dependency foundation ~> 0.1.0
Start here - Using libgraph + custom extensions for faster implementation
# Implementation target
lib/elixir_scope/graph/
# libgraph integration + custom code analysis algorithms
# 70% faster implementation vs. building from scratch
# Reference: docs/implementation/GRAPH_IMPLEMENTATION_GUIDE.mdCore functionality - Central data hub for all other layers
# Implementation target
lib/elixir_scope/ast/
# Reference code
docs/reference_implementation/ast/Build incrementally: CPG → Analysis → [Capture, Query] → Intelligence → Debugger
- Single dependency:
{:elixir_scope, "~> 0.1.0"} - Atomic deployments: All layers versioned together
- Direct integration: Function calls vs. message passing
- Shared memory: Efficient ETS table and cache sharing
- Simplified testing: No external dependency coordination
- Reusable infrastructure: Available to other Elixir projects
- Stable base: Infrastructure changes rarely
- Clear separation: Domain logic vs. infrastructure concerns
- Production ready: 168 tests, comprehensive OTP compliance
| Layer | Files | LOC | Complexity | Priority |
|---|---|---|---|---|
| AST | 70 | 16,383 | HIGHEST | Core (Phase 3) |
| CPG | 80 | 14,430 | HIGHEST | Phase 4 |
| Capture | 50 | 10,727 | HIGH | Phase 4 |
| Intelligence | 22 | 5,396 | MEDIUM-HIGH | Phase 4 |
| Analysis | 38 | 3,638 | MEDIUM | Phase 4 |
| Query | 13 | 1,800 | MEDIUM | Phase 4 |
| Debugger | 18 | 1,589 | MEDIUM | Phase 4 |
| Graph | 11 | 506 | LOW | Start (Phase 2) |
- ✅ Foundation layer complete and extracted
- ✅ Architecture plan finalized
- ✅ Documentation organized
- ✅ Reference implementation preserved
- 🚧 Ready to begin Graph layer implementation
- Graph Layer (1 week) - Prove architecture, minimal complexity
- AST Layer (2 weeks) - Core functionality, highest value
- Iterative builds - Add layers incrementally with validation
- Integration testing - Validate cross-layer communication
- Performance optimization - Memory management, query performance
# Setup (from main README)
mix deps.get && mix compile
# Testing
mix test.smoke # Foundation integration
mix test.unit # Layer-specific tests
mix test.integration # Cross-layer tests
# Quality checks
mix dev.check # Format, Credo, compile, smoke tests- Architecture Plan:
claudeCodeArchPlan.md- Complete strategy - Reference Code:
reference_implementation/- Working implementation - Foundation API:
README_FOUNDATION.md- Foundation layer usage
- Layer Guides: Step-by-step implementation instructions
- Test Patterns: Testing strategies for each layer
- Integration Examples: Cross-layer communication patterns
- Performance Targets: Benchmarks and optimization guidelines
This documentation structure provides comprehensive support for implementing the unified ElixirScope package while preserving historical context and providing clear implementation guidance.