Architecture: What is fundamentally wrong with Vitto's output mode auto-de...
Documentation for Sessions
🏗️ Architecture: What is fundamentally wrong with Vitto's output mode auto-de...
Date: 2026-03-26
Time: 14:19:44 UTC
Session: gspace1-270.3
Agent: architecture
Confidence: 93%
Status: ✅ Documented
📋 Decision Context
Question:
What is fundamentally wrong with Vitto's output mode auto-detection architecture, and what should replace it?
Task: S270: Architecture analysis of Vitto output mode decision system
🎯 Decision Made
Chosen:
Three-part redesign: (1) Replace BOTH with AUTO enum value — BOTH means 'run both paths' not 'decide for me', causing Angular generation when LLM doesn't recommend PE. (2) Deterministic resolver before LLM — use ANALYZE output (entity count, complexity, building blocks) for 80% of decisions without extra LLM round trip. (3) Surface the decision to users — emit format choice in activity feed and allow override via UI toggle.
Options Considered:
- Keep current BOTH overloading (broken by design)
- Add AUTO enum + deterministic resolver + LLM fallback (chosen)
- Remove auto-detection entirely, always require explicit mode (too much UX friction)
- Make BOTH actually run PE generation too (generates 3 outputs, wasteful)
💭 Reasoning
The current design overloads BOTH (which historically means 'generate visual AND code output') as an auto-detect trigger. When auto-detection keeps BOTH unchanged (LLM recommends 'code' or fails), the execute phase runs BOTH visual AND code paths (lines 143+156 of execute.phase.ts), always producing Angular. This is a semantic overload bug — BOTH was never designed to mean 'undecided'. Additionally, the LLM auto-detection is an unnecessary round trip for clear-cut cases: a 3-entity CRUD platform should deterministically get PE without asking an LLM. The LLM should only be consulted for ambiguous cases (e.g., 8 entities with some custom logic). Finally, users have no visibility into or control over the decision — they can't see why Angular was chosen or override it.
📁 Files Involved
APIs/backend-vitto-api/src/app/module-generation/module-generation.types.tsAPIs/backend-vitto-api/src/app/module-generation/phases/module-gen-phase.executor.tsAPIs/backend-vitto-api/src/app/module-generation/phases/execute.phase.ts
🔗 Related
- Decision ID:
dev_1774534783563_v2360k6 - Session: 270
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation