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:

  1. Keep current BOTH overloading (broken by design)
  2. Add AUTO enum + deterministic resolver + LLM fallback (chosen)
  3. Remove auto-detection entirely, always require explicit mode (too much UX friction)
  4. 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


🔗 Related


Auto-generated by MCP Smart Consolidation