Bugfix: Why did platform generation produce double-nested directorie...
Documentation for Sessions
🐛 Bugfix: Why did platform generation produce double-nested directorie...
Date: 2026-03-10
Time: 21:35:12 UTC
Session: gspace1-200.10
Agent: backend
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
Why did platform generation produce double-nested directories and GitLab 404 errors?
Task: S200.9: Fix platform generation path bugs
🎯 Decision Made
Chosen:
5-part fix: (1) normalizeFilePath strips apps/{slug}/ prefix for app-category files, (2) GitLab commit uses apps/{slug}/ for app files instead of modules/app/{slug}/, (3) addPathMapping accepts spaceSlug param instead of hardcoded 'default', (4) ensureModuleStructuralFiles skips app-category entries, (5) platformSlug fallback chain: systemName → universeSlug → spaceSlug instead of 'generated-platform'
Options Considered:
- Strip apps/ prefix in normalizeFilePath (chosen)
- Change AppShellGeneratorService to not include apps/ prefix in paths
- Add separate path handling for app-category in writeGeneratedFilesToDisk
💭 Reasoning
Root cause: AppShellGeneratorService produces files with paths like apps/{slug}/src/main.ts but normalizeFilePath only stripped modules/{category}/{slug}/ prefixes, leaving the apps/ prefix intact. This caused: (1) local disk double-nesting: platforms/{space}/{slug}/apps/{slug}/src/... (2) GitLab commit paths: modules/app/{slug}/apps/{slug}/src/... — malformed paths that GitLab couldn't resolve, causing cascading 404s for ALL files in the atomic commit. The .gitlab-ci.yml 404 confirmed the entire commit was failing. Additionally, addPathMapping hardcoded 'default' as spaceSlug, and the platform slug fallback to 'generated-platform' was too generic.
📁 Files Involved
APIs/backend-vitto-api/src/app/module-generation/phases/module-gen-phase.executor.tsAPIs/backend-vitto-api/src/app/module-generation/generators/app-shell-generator.service.tsconfig/tsconfig-paths/modules/generated.paths.json
🔗 Related
- Decision ID:
dev_1773178512084_p93ekcu - Session: 200
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation