Investigation: What are the root causes of generated platforms failing to c...
Documentation for Sessions
📝 Investigation: What are the root causes of generated platforms failing to c...
Date: 2026-03-16
Time: 19:24:14 UTC
Session: gspace1-226.9
Agent: angular
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
What are the root causes of generated platforms failing to compile, and how systemic are the bugs?
Task: S226.2: Platform Generation v2 architecture design
🎯 Decision Made
Chosen:
5 systematic template bugs, 3 ID generation bugs, 2 data layer bugs, and 1 pluralization bug — all traceable to the template generation engine, not individual component issues. The LLM hallucinates method names because prompt context lacks exact composable API signatures.
Options Considered:
- Fix bugs individually as encountered (reactive)
- Fix all systematically at the template engine level (chosen)
- Rewrite generation pipeline from scratch (too risky)
💭 Reasoning
Analysis of generated output in /Users/fguijarro/developer/repos-gspace/spaces/vitto-uni-test-1 reveals: (1) Route lazy-load imports use wrong file paths — template emits '../../../modules/structural/match-center/src/routes' but actual file is match-center.routes.ts. (2) Templates call crud.onSort() but composable exports onSortChange(). (3) Templates call crud.toggleSelectAll() but composable exports selectAll(). (4) Club members module imports ClubMembersRoutes but actual export is MODULE_ROUTES. (5) Index barrel files reference ./lib/models but path is ./models. (6) Date.now() for IDs at 7 locations in structure-builder.service.ts causes collision with PARALLEL_MODULE_GEN_BATCH > 1. (7) platform-generation.service.ts line 90 uses Date.now()-Math.random(). (8) spaces.service.ts line 881 uses Date.now(). (9) Delete BSON version error from ObjectId construction mismatch. (10) 22+ inline universe_${universeId}_${collection} concatenations risk double-prefix. (11) Two inconsistent pluralize() implementations in template-generator.service.ts (lines 52-56 and 94-98). These are NOT random bugs — they are systematic gaps in the template generation engine that affect EVERY generated platform.
📁 Files Involved
APIs/backend-vitto-api/src/app/module-generation/templates/template-registry.service.tsAPIs/backend-vitto-api/src/app/module-generation/handlers/structure-builder.service.tsAPIs/backend-vitto-api/src/app/module-generation/platform-generation.service.tsAPIs/backend-api/src/app/data/data.controller.tsAPIs/backend-api/src/app/spaces/spaces.service.ts/Users/fguijarro/developer/repos-gspace/spaces/vitto-uni-test-1
🔗 Related
- Decision ID:
dev_1773689054080_rrdcgtm - Session: 226
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation