S244 Platform Generation Quality V3
Documentation for Sessions
S244: Platform Generation Quality v3
Date: 2026-03-19 to 2026-03-20 Session: 244 Status: In Progress (core infrastructure complete, refinement ongoing)
What This Session Achieved (Plain Language)
This session transformed the platform generation pipeline from producing blank, non-functional previews to rendering real working platforms with live data from the database.
Before S244
When a user asked Vitto to generate a platform:
- The code was generated correctly and saved to GitLab
- But the Live Preview showed only navigation tabs with blank content underneath
- The Generations tab always said "No generations yet"
- Generated code didn't use most of the available building blocks (workflows, filters, entity lookups)
- No seed data was created, so even when code worked, lists showed empty
- Other Studio tabs (Entities, Data, API, Docs) showed nothing useful
After S244
- Live Preview renders real CRUD interfaces — tables with data, forms with fields, detail views
- Generated code uses the full SDK (composables, shell components, proper typing)
- The preview system correctly detects modules regardless of directory structure depth
- 13 UI component stubs ensure all generated components render in the preview
- The Generations tab loads generation history on open
- The generation pipeline is enriched to teach the LLM about workflows, filters, entity lookups, module registration, and seed data (pending backend restart for full activation)
Timeline of Changes
Phase 1: Research & Design (2026-03-19)
What happened: Deep analysis of both monorepos (gspace1 and gmodules1) to understand the quality gap.
Key finding: gspace1 already had 21 core libraries covering every building block pattern gmodules1 uses. The gap wasn't infrastructure — it was that the LLM generation prompt (implement.prompt.md) only taught ~30% of the available SDK. The LLM can only generate what it's told exists.
Deliverables:
- Design spec:
docs/superpowers/specs/2026-03-19-platform-generation-quality-v3-design.md - Implementation plan:
docs/superpowers/plans/2026-03-19-platform-generation-quality-v3.md
Phase 2: Pipeline Enrichment (2026-03-19)
7 tasks executed to enrich the generation pipeline:
| # | What Changed | Why It Matters |
|---|---|---|
| 1 | Added @libs-core/workflow-engine to platform template |
Generated code can now import workflow components |
| 2 | Added BuildingBlockSpec, SchemaSpec, SeedDataSpec types |
Pipeline can carry workflow/filter/seed metadata |
| 3 | Enriched ANALYZE prompt with building block detection | LLM now identifies which entities need workflows, filters, etc. |
| 4 | Added 5 building block patterns to EXECUTE prompt | LLM generates workflow definitions, filter panels, entity lookups, module registration, seed data |
| 5 | Wired ANALYZE→EXECUTE metadata flow | Building block decisions propagate to code generation |
| 6 | Added seed data seeding in INTEGRATE phase | Generated platforms have data on first load |
| 7 | Fixed Generations tab initialization | Tab loads generation history instead of showing empty state |
Phase 3: Preview System Fixes (2026-03-20)
3 critical infrastructure bugs found and fixed:
Bug 1: Module Detection Regex (THE reason preview was blank)
- Root cause: Preview's
detectModulesInVfs()used regexmodules/([^/]+)/src/which only matches ONE directory level. Generated modules live atmodules/structural/{slug}/src/— TWO levels. - Impact: Zero modules detected → empty routes → blank
<router-outlet> - Fix: Updated regex to support both 1-level and 2-level paths
- File:
preview.service.ts
Bug 2: Missing SDK Component Stubs (caused ɵmod TypeError)
- Root cause: The preview replaces SDK libraries with lightweight stubs. Only 2 UI components were stubbed (
GgsCrudListShellComponent,GgsEntityLookupComponent). Generated code imports 11+ more (form shells, detail shells, badges, buttons, filters, inputs, selects, etc.) which resolved toundefinedat runtime. - Impact: Angular JIT encounters
undefinedin componentimportsarray →TypeError: Cannot read properties of undefined (reading 'ɵmod')→ entire route fails to render - Fix: Expanded stubs from 2 to 13 UI components with functional templates
- File:
sdk-preview-stubs.ts
Bug 3: Missing formatDate in useCrudDetail stub
- Root cause: Generated detail components call
crud.formatDate()which the real composable provides, but the stub didn't - Fix: Added
formatDate()andformatDateTime()to the stub - File:
sdk-preview-stubs.ts
Phase 4: Prompt Hardening (2026-03-20)
- Added ban on external CDN URLs (LLM was generating references to
cdn.gograbspace.comwhich doesn't exist) - Added schema field type rules (lowercase types,
validation.enuminstead oftype: 'enum')
Files Modified (Complete List)
Generation Pipeline (backend-vitto-api)
| File | Change |
|---|---|
APIs/backend-vitto-api/src/prompts/module-gen/implement.prompt.md |
+226 lines: 5 building block patterns, schemas/seedData output, CDN URL ban |
APIs/backend-vitto-api/src/prompts/module-gen/system-analyze.prompt.md |
+19 lines: buildingBlocks detection rules per entity |
APIs/backend-vitto-api/src/app/module-generation/module-generation.types.ts |
New types: BuildingBlockSpec, SchemaSpec, SeedDataSpec; updated EntitySpec, ModuleGenExecuteResult, normalizeAnalyzeResult() |
APIs/backend-vitto-api/src/app/module-generation/phases/execute.phase.ts |
Enriches specs with buildingBlocks; extracts schemas/seedData from LLM output |
APIs/backend-vitto-api/src/app/module-generation/phases/integrate.phase.ts |
Seeds data to backend-api after validation |
Preview System (platform-preview)
| File | Change |
|---|---|
libs/libs-structural/platform-preview/src/lib/config/sdk-preview-stubs.ts |
Expanded from 2 to 13 UI component stubs; added formatDate/formatDateTime |
Studio UI (vitto-studio)
| File | Change |
|---|---|
libs/libs-structural/vitto-studio/src/lib/services/preview.service.ts |
Fixed module detection regex for 2-level directory paths |
libs/libs-structural/vitto-studio/src/lib/services/studio-generation-listener.service.ts |
Calls loadGenerations() on completion so Generations tab populates |
libs/libs-structural/vitto-studio/src/lib/panels/generations-panel.component.ts |
Added effect() to auto-load generations/drafts on panel init |
Platform Template
| File | Change |
|---|---|
repo-templates/platform-base-template/tsconfig.base.json |
Added @libs-core/workflow-engine path mapping |
repo-templates/platform-base-template/libs/core/workflow-engine/ |
Copied workflow-engine library |
What's Working Now
- Live Preview renders generated platforms with real CRUD data from backend-api:3000
- Module detection works for both flat and categorized directory structures
- 13 UI components are stubbed for preview rendering (shells, badges, buttons, filters, inputs, selects, etc.)
- LLM prompt teaches workflows, filters, entity lookups, module registration, seed data
- ANALYZE phase detects building block requirements per entity
- Generations tab loads history on open
- All TypeScript compiles cleanly across all modified projects
What Still Needs Work
Pending Activation (requires backend-vitto-api restart)
- Building block generation — The TypeScript changes to execute.phase.ts, integrate.phase.ts, and types need a restart to be live. The prompts are hot-reloaded, but the metadata wiring and seed data seeding need compiled code.
- Seed data — Once the INTEGRATE phase changes are live, generated platforms will have 3-5 records per entity on first load.
Known Remaining Issues
- Preview UI/UX needs theme integration — The stub components render with minimal CSS. They should inherit the theme-system's CSS variables for a polished look.
- Tab switching feels jumpy — Each module route lazy-loads and triggers a re-render. Consider preloading adjacent routes or adding transition animations.
- Slow reload — The rspack WASM compilation takes ~500ms cold. For subsequent reloads, the bundler should use incremental/patch compilation (infrastructure exists but may not be triggering correctly).
- Generations tab shows only the active draft. Previous generations and the main branch reference are not displayed (may need backend endpoint or data model investigation).
- Duplicate component naming — The LLM sometimes generates both
child-profile-list/andchildprofile-list/directories. The prompt should enforce consistent hyphenated naming.
Future Improvements
- SDK stubs with theme-system CSS variables — Make preview look production-ready
- Incremental compilation — Only recompile changed files on tab switch
- Seed data with stable
_ids — Ensure idempotent re-seeding - Schema registration validation — Verify schemas match generated entity interfaces
- Cross-module entity lookup — Generated lookups reference entities from other modules correctly
Decisions Logged (MCP Intelligence)
| Decision ID | Topic | Confidence |
|---|---|---|
dev_1774027803329_1giur1w |
Module detection regex fix (blank preview) | 0.97 |
dev_1774027825040_zmbluyz |
SDK preview stubs expansion (ɵmod TypeError) | 0.98 |
dev_1774027858330_t40mkst |
Pipeline enrichment with building blocks | 0.93 |
Conventions Added
| Convention | Rule |
|---|---|
platform-generation |
When adding UI component to implement.prompt.md, add corresponding stub to sdk-preview-stubs.ts |
platform-generation |
Module paths support both 1-level and 2-level directory structures |
For Non-Developers: What Does This Mean?
Before this session: When Vitto generated a platform, you saw navigation tabs but the actual pages were blank. It felt broken even though the code was being created correctly behind the scenes.
After this session: Generated platforms now show real, functional pages — lists with data, editable forms, detail views. The system pulls real data from the database. When you click "Edit" on a badge or reward, you see a proper form with fields, labels, and validation.
What's next: The visual polish needs improvement (matching the GoGrab theme), the performance can be smoother (less jumping between tabs), and the system needs to generate even richer features automatically (workflow status transitions, filter panels, entity relationship lookups). These improvements are designed and coded — they just need a backend restart to activate fully.
Bottom line: We went from "preview shows nothing" to "preview shows working CRUD apps with real data" in one session. The foundation is now solid for iterative quality improvements.