Architecture: Why does Vitto always generate Angular/rspack output instead...

Documentation for Sessions

🏗️ Architecture: Why does Vitto always generate Angular/rspack output instead...

Date: 2026-03-26
Time: 14:19:22 UTC
Session: gspace1-270.2
Agent: backend
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

Why does Vitto always generate Angular/rspack output instead of Platform Elements, even after S269 added the dual pipeline?

Task: S270: Fix Platform Elements generation pipeline not triggering


🎯 Decision Made

Chosen:

Root cause: 5 cascading defaults all hardcoded to 'code' or 'BOTH', preventing auto-detection from ever triggering. Fixed by: (1) changing frontend default from 'code' to 'both' in studio-vitto-bridge.service.ts, (2) changing 4 backend controller defaults from CODE to BOTH, (3) adding 'platform-elements' to validation @IsIn decorator, (4) adding outputMode to SSE forwarding in module-gen.plugin.ts tool, (5) lowering auto-detection confidence threshold from 0.7 to 0.5

Options Considered:

  1. Fix only frontend default (insufficient - backend still defaults to CODE)
  2. Fix only backend defaults (insufficient - frontend still sends 'code')
  3. Fix all 5 layers simultaneously (chosen - addresses root cause chain)
  4. Remove auto-detection entirely and require explicit mode (too disruptive)

💭 Reasoning

The S269 auto-detection logic (module-gen-phase.executor.ts:241) only runs when outputMode is undefined or BOTH. But every entry point defaulted to CODE: studio-vitto-bridge.service.ts defaulted to 'code', all 4 module-generation.controller.ts endpoints defaulted to ModuleGenOutputMode.CODE, and the tool enum didn't include 'platform-elements'. Even when auto-detection ran and recommended PE, the module-gen.plugin.ts SSE forwarding didn't include outputMode in the forwarded data, so the frontend's handleModuleGenerated couldn't route PE HTML to the blob URL preview. The @IsIn validation decorator also rejected 'platform-elements' as an invalid value. This was a systemic issue where 5 independent defaults all conspired to prevent PE generation.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation