Architecture: How to optimize the platform generation pipeline for speed, ...
Documentation for Sessions
🏗️ Architecture: How to optimize the platform generation pipeline for speed, ...
Date: 2026-03-23
Time: 19:52:04 UTC
Session: gspace1-261.9
Agent: backend
Confidence: 92%
Status: ✅ Documented
📋 Decision Context
Question:
How to optimize the platform generation pipeline for speed, cost, and interactivity?
Task: S257: Platform generation pipeline optimization
🎯 Decision Made
Chosen:
4-change optimization: (1) Switch default outputMode from VISUAL to CODE — activates existing S246 progressive preview code and removes visual from critical path. (2) Defer visual to background Haiku calls. (3) Enable Anthropic prompt caching on EXECUTE system prompts via cache_control content blocks. (4) Partial app shell synthesis with GeneratingComponent placeholder for progressive preview.
Options Considered:
- No alternatives documented
💭 Reasoning
The generation pipeline had three problems: slow (15 min to first preview), expensive (~$2.50/gen), and unresponsive (dead screen). Root cause analysis revealed: default VISUAL mode meant SSE events carried no files (S246 progressive preview was dead code), the implement.prompt.md system prompt was re-sent identically for every module (no caching), and visual path ran in the critical path. Per-phase model routing was already fully wired (S212). Cost savings are modest (~11%) but time-to-first-preview drops from 15 min to ~3 min.
📁 Files Involved
APIs/backend-vitto-api/src/app/module-generation/module-generation.controller.tsAPIs/backend-vitto-api/src/app/module-generation/phases/execute.phase.tsAPIs/backend-vitto-api/src/app/llm/providers/claude.provider.tsAPIs/backend-vitto-api/src/app/llm/llm.types.tslibs/libs-structural/vitto-studio/src/lib/services/studio-vitto-bridge.service.tslibs/libs-structural/platform-preview/src/lib/services/bundler-filesystem.service.ts
🔗 Related
- Decision ID:
dev_1774295524037_85fmisi - Session: 261
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation