Architecture: S185: How to wire Studio entity creation to actual code gene...

Documentation for Sessions

🏗️ Architecture: S185: How to wire Studio entity creation to actual code gene...

Date: 2026-03-06
Time: 22:50:15 UTC
Session: gspace1-185.2
Agent: angular
Confidence: 90%
Status: ✅ Documented


📋 Decision Context

Question:

S185: How to wire Studio entity creation to actual code generation pipeline?

Task: S185: Finish Studio — wire entity-to-CRUD pipeline, fix API mismatches, add SSE listener


🎯 Decision Made

Chosen:

Two-step flow: (1) Create module record via StudioApiService.createModule() → UniversalModulesController, (2) Trigger code gen via StudioVittoBridgeService.generateModule() → 6-phase pipeline SSE. New StudioGenerationListenerService routes SSE events to AiFileWriterService for VFS population. Fixed module-files API mismatch (was /module-files, actual is /modules/:slug/structure).

Options Considered:

  1. Keep sendTask() to /engine/tasks and add handler there
  2. Call generateModule() directly without creating module record first
  3. Use HTTP POST instead of SSE for code generation

💭 Reasoning

The original plan conflated 'create module' with 'generate code' — these are two distinct operations targeting different backends (backend-api for CRUD records, backend-vitto-api for code gen). The sendTask() → /engine/tasks endpoint had no handler for entity creation. The correct approach separates concerns: record creation (fast, synchronous) from code generation (slow, SSE-streamed). Session 184 already fixed context bridge and PanelContext gaps, so we focused on the actual pipeline wiring.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation