Bugfix: Should the deploy step write generated module files to modul...

Documentation for Sessions

🐛 Bugfix: Should the deploy step write generated module files to modul...

Date: 2026-03-17
Time: 15:25:23 UTC
Session: gspace1-226.17
Agent: backend
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

Should the deploy step write generated module files to modules/{category}/{slug}/ (nested) or modules/{slug}/ (flat)?

Task: Fix Live Preview not rendering generated platform modules


🎯 Decision Made

Chosen:

Flat path: modules/{slug}/ — matching backend-ai-api's /module-files/{slug}/structure endpoint

Options Considered:

  1. Write nested and fix the API reader to also use category (higher blast radius)
  2. Write flat to match existing API reader (chosen)
  3. Write both paths (wasteful duplication)

💭 Reasoning

The deploy step in module-gen-phase.executor.ts was writing files to modules/{category}/{slug}/ (e.g., modules/structural/family-household/). But the VFS loading chain (VfsSyncService → StudioApiService → backend-ai-api /module-files/{slug}/structure) reads from modules/{slug}/ with NO category prefix. This path mismatch meant the backend returned empty file trees, so the VFS had nothing to compile and the preview iframe was blank. GitLab storage uses the {category}/{slug}/ nested structure (correct for repo organization), but the local disk mirror must match what the API endpoint expects. The fix removes the category prefix from the diskPath so both writer and reader agree on modules/{slug}/.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation