Monolithic architecture with significant tech debt. main.tsx serves as entry point AND orchestration — CLI parsing, init, feature flags, MCP config, session management, tool orchestration, command handlers. 187 imports in the first 210 lines. 61 feature() calls.
profileCheckpoint(), startMdmRawRead(), startKeychainPrefetch() execute during module evaluation. Makes module untestable, creates hidden dependencies.bootstrap/state.ts: 150+ fields in a global singleton. No clear ownership. Mutable state scattered across modules.feature() calls in main.tsx alone. No centralized management. Code paths difficult to trace.| Principle | Status | Evidence |
|---|---|---|
| Single Responsibility | ❌ | main.tsx has 6+ responsibilities |
| Open/Closed | ❌ | God object knows everything |
| Dependency Inversion | ❌ | 187 concrete imports |
| Separation of Concerns | ❌ | CLI + logic + infra + UI mixed |
| Testability | ❌ | Side effects block unit tests |
| Modularity | ⚠️ | Good tool system, poor boundaries |