Architecture: How to refactor vitto-engine.service.ts (2153 lines) into ma...
Documentation for Sessions
🏗️ Architecture: How to refactor vitto-engine.service.ts (2153 lines) into ma...
Date: 2026-03-01
Time: 19:52:53 UTC
Session: gspace1-158.9
Agent: angular
Confidence: 90%
Status: ✅ Documented
📋 Decision Context
Question:
How to refactor vitto-engine.service.ts (2153 lines) into maintainable plugins and build the Vitto Brain UI?
Task: Session 158: Vitto Intelligence Platform — plugin architecture + brain UI plan
🎯 Decision Made
Chosen:
5-plugin architecture: ContextAssemblyService (~300 lines), ChannelProcessingService (~400 lines), MemoryPersistenceService (~200 lines), SlashCommandService (~350 lines), VittoDebugService (~100 lines). VittoEngineService becomes thin ~200 line orchestrator. Brain UI in gograb-dev (/vitto/brain) with 8 tabs. Mind UI in gograb-ai (/vitto/mind) with 5 user-facing tabs. Three-layer architecture: Core (unchangeable) + Personality (customizable) + Knowledge (grows per user).
Options Considered:
- No alternatives documented
💭 Reasoning
2153-line god object is unmaintainable. Each plugin maps to a distinct responsibility: prompt assembly, channel I/O, memory persistence, slash commands, debug. The refactoring preserves all existing functionality while making each piece independently testable. Brain/Mind split gives devs full debug access while users see only their own data. Core layer ensures Vitto's identity is never accidentally broken by user customization.
📁 Files Involved
APIs/backend-vitto-api/src/app/engine/vitto-engine.service.ts
🔗 Related
- Decision ID:
dev_1772394773250_yhr7h9u - Session: 158
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation