ARCLUX Architecture Deep Dive ποΈ
Understanding ARCLUXβs internal design and how everything connects.Table of Contents
- Core Concepts
- Data Model
- The Pipeline in Detail
- Parser Architecture
- Indexer Algorithm
- Graph Construction
- Detector Pattern
- Performance Considerations
Core Concepts
Repository Model
Everything in ARCLUX is about theRepository object:
The Three Levels of Abstraction
Level 1: FilesData Model
Module
Import
Export
Dependency
The Pipeline in Detail
Step 1: Git Operations
Step 2: Parsing
Step 3: Indexing
Import Resolution Deep Dive
This is the hardest part!Graph Construction
Dependency Graph
Call Graph (Advanced)
Detector Pattern
All 20 detectors follow same pattern:Example: Circular Dependency Detection
Performance Considerations
Why Itβs Fast
- Streaming parsing - Parse files as read
- Parallel processing - Parse multiple files at once
- Lazy evaluation - Only compute whatβs needed
- Caching - Cache results of expensive operations
Bottlenecks
Optimization Strategies
Thread Model
ARCLUX is synchronous by design:- Easy to understand
- No race conditions
- Simple error handling
- Slower than parallel on large projects
- But still fast enough!
Extensibility Hooks
Where you can extend ARCLUX:- Add parser β
PARSER_REGISTRY - Add detector β
DETECTOR_REGISTRY - Add graph type β Call from CLI
- Add rule β
RULES_REGISTRY - Custom analysis β Use programmatic API
Error Handling
Design Principles
- Single Responsibility - Each package does one thing
- Dependency Injection - Pass Repository around
- Immutability - Donβt modify Repository
- Composition - Build complex behavior from simple pieces
- Testability - Everything can be tested in isolation
- Easy to understand
- Easy to extend
- Easy to test
- Easy to maintain
Ready to dive into code? Start with
packages/engine/pipeline.ts! π