Improving And Understanding Platform Builder
Documentation for Plans
title: Improving and Understanding Platform Builder description: Comprehensive analysis of Universe Architect, AI generation services, and integration requirements icon: 🚀 created: January 8, 2026 updated: January 8, 2026 status: active session: 31 sessionID: editor2-31.1
Improving and Understanding Platform Builder
Last Updated: January 8, 2026 | Session 31.1
Status: Critical Analysis Complete
Confidence: 98%
🎯 Executive Summary
Current State: Universe Architect generates navigation skeletons but no real platform content.
Root Cause: Using wrong generation service (VibeCodingOrchestratorService instead of WorkflowStateService).
Impact: Generated "platforms" are empty shells with no entities, actions, or widgets.
Solution: Switch to WorkflowStateService and integrate with vibe-universe-generator workflow.
🔍 Critical Findings
Finding #1: Two AI Generation Services (CRITICAL)
We have TWO completely different AI generation systems:
Service A: VibeCodingOrchestratorService (Currently Used - WRONG)
Location: libs/libs-ai/gograb-ai/src/lib/services/vibe-coding-orchestrator.service.ts
What it does:
- Client-side AI intent analysis (200 tokens → fixed to 4000)
- Creates empty
UniversalModuleshells - Generates structure only (names, types, routes)
- NO entities, NO actions, NO widgets, NO code
- Completes in 2-6 seconds
Output Example:
{
"type": "galaxy",
"name": "Soccer",
"route": "/soccer",
"children": [
{"type": "feature", "name": "Soccer Main", "route": "/soccer/main"},
{"type": "feature", "name": "Soccer Management", "route": "/soccer/manage"}
]
}
Result: Navigation skeleton with NO content.
Service B: WorkflowStateService (Should Use - CORRECT)
Location: libs/libs-ai/gograb-ai/src/lib/services/workflow-state.service.ts
What it does:
- Backend AI workflow (7 phases via SSE)
- Connects to
backend-ai-apiWorkflowController - Generates REAL code files
- Creates entities, actions, widgets, logic
- Progress streaming with events
- Completes in 5-10 minutes
Phases:
- Analyze - Requirements analysis
- Plan - Architecture planning
- Validate - Check feasibility
- Implement - Generate code files
- Integrate - Workspace integration
- Verify - Lint/test/build
- Test-E2E - Playwright tests
Output Example:
{
"type": "galaxy",
"name": "Soccer Players",
"route": "/players",
"entities": [
{
"name": "Player",
"fields": ["name", "position", "number", "team"],
"primaryKey": "id"
}
],
"actions": [
{"name": "createPlayer", "type": "crud", "entity": "Player"},
{"name": "getPlayerStats", "type": "query", "entity": "Player"}
],
"widgets": [
{"name": "PlayerListWidget", "type": "table"},
{"name": "PlayerCardWidget", "type": "card"}
],
"generatedFiles": [
"modules/soccer/src/models/player.model.ts",
"modules/soccer/src/services/player.service.ts",
"modules/soccer/src/components/player-list.component.ts"
]
}
Result: REAL platform with working code.
Finding #2: Architectural Comparison
| Aspect | VibeCodingOrchestrator | WorkflowStateService |
|---|---|---|
| Location | Client (Angular service) | Backend (NestJS API) |
| AI Provider | OpenAI via proxy | Claude/DeepSeek via MCP |
| Generation Time | 2-6 seconds | 5-10 minutes |
| Phases | 1 (intent analysis) | 7 (full workflow) |
| Outputs | JSON structure | TypeScript code files |
| Entities | ❌ None | ✅ Generated |
| Actions | ❌ None | ✅ Generated |
| Widgets | ❌ None | ✅ Generated |
| Code Files | ❌ None | ✅ 20-50 files |
| Progress Events | ❌ None | ✅ SSE stream |
| Persistence | Flash only | MongoDB sessions |
| Used By | Universe Architect | Vibe-Universe-Generator |
Finding #3: Gograb-Modules Team Insights
From: gograb-modules/docs/english/code-review/architectural-review-2026-01-07.md
Yam's System (in gograb-modules):
Architecture:
├── Backend: NestJS AI Gateway
├── LLM: MCP (Model Context Protocol) via stdio
├── Workflow: 7-phase pipeline
│ ├── 1. Analyze → Requirements
│ ├── 2. Plan → Documentation
│ ├── 3. Validate → Architecture check
│ ├── 4. Implement → Code generation
│ ├── 5. Integrate → Workspace integration
│ ├── 6. Verify → Lint/Test/Build
│ └── 7. Test-E2E → Playwright tests
├── Prompts: Markdown files (hot-reload)
├── State: In-memory (needs Redis/PostgreSQL)
└── Git: Branch isolation per generation
Strengths:
- Phase-based workflow (excellent architecture)
- Prompt separation (editable without code changes)
- Git branch isolation (safe experimentation)
- Event-driven progress (RxJS + SSE)
- Debug mode with phase control
Critical Issues (P0):
- In-memory session storage (no persistence)
- No timeouts on phase execution
- Path traversal vulnerability
- No authentication/authorization
- Memory leaks in event streams
- No test coverage
What We've Incorporated:
- ✅ WorkflowStateService connects to their backend
- ✅ 7-phase workflow structure
- ✅ SSE event streaming
- ✅ Progress visualization components
- ❌ NOT using it in Universe Architect (critical mistake)
- ❌ Session persistence not implemented
- ❌ Security validation partially done
🔴 Critical Problems Identified
Problem #1: Using Wrong Service (CERTAIN)
Evidence:
// architect-canvas.component.ts:1691 (Session 29)
const result = await this.vibeCodingOrchestrator.processCommand(prompt);
This service:
- Returns in 2-6 seconds
- Generates structure only
- No real content
Should use:
// vibe-universe-generator.component.ts:442 (CORRECT)
this.workflowState.startWorkflow(request).subscribe({
next: (event) => {
// Real-time generation events
if (event.type === 'file_created') { ... }
if (event.type === 'module_generation_complete') { ... }
}
});
Impact:
- User sees "Soccer" galaxy but it has no players, coaches, matches
- User sees "Management" module but it has no CRUD operations
- Navigation works but pages are empty
- This is unacceptable for a "groundbreaking" platform builder
Problem #2: AI Response Parsing (CERTAIN)
Evidence from Logs (Session 29):
⚠️ AI intent analysis failed, using fallback
⚠️ AI did not provide galaxies! Falling back to intelligent extraction
What's Happening:
// vibe-coding-orchestrator.service.ts:283 (Fixed but still fragile)
const parsed = JSON.parse(response?.text || '{}');
const suggestedGalaxies = command.entities['suggestedGalaxies']; // This is undefined!
Root Cause:
- AI returns galaxies at different key (
galaxiesnotsuggestedGalaxies) - Sometimes wrapped in code blocks
- Sometimes nested in
structureobject
Fallback Creates:
- "Management Management" (duplicate keywords)
- "Players Main" / "Players" / "Players Management" (redundant)
- Multiple modules with same route
/management(breaks navigation)
Solution Implemented (Session 29.6):
- Try multiple keys:
suggestedGalaxies,galaxies,structure.galaxies - Extract from markdown code blocks
- Intelligent fallback from userRoles
- But still NOT using WorkflowStateService which would avoid this entirely
Problem #3: Panel Resize Doesn't Work (CERTAIN)
Current Code:
// architect-side-panel.component.ts
<div class="resize-overlay" (mousemove)="onResize($event)"></div>
Why it Fails:
(mousemove)only fires when hovering that specific div- Resize overlay appears but events don't propagate
- User drags but nothing happens
Correct Pattern (from modular-universe):
onResizeStart(event: MouseEvent): void {
this.resizeListener = this.onResize.bind(this);
document.addEventListener('mousemove', this.resizeListener);
document.addEventListener('mouseup', this.onResizeEnd);
}
Why it Works:
- Global document listeners catch all mouse events
- Works even when cursor leaves panel area
- Standard pattern for drag interactions
Problem #4: Generated Platforms Have No Content (CRITICAL)
From Screenshot Evidence:
Universe Tab Shows:
- Soccer (galaxy)
- Players (galaxy)
- Management (galaxy)
Clicking any module shows:
- "No Widgets" message
- Empty page
- Just navigation structure
Why:
- VibeCodingOrchestratorService doesn't generate widgets
- No entities means no data tables
- No actions means no CRUD operations
- Modules are routing placeholders only
What User Expected:
- Players galaxy → Player list with data table
- Coach dashboard → Coach management interface
- Match schedule → Calendar with matches
What User Got:
- Empty pages with titles
📊 Service Comparison Matrix
| Feature | VibeCodingOrchestrator | WorkflowStateService |
|---|---|---|
| Purpose | Quick structure | Full platform |
| Speed | 2-6 seconds | 5-10 minutes |
| AI Calls | 1 (intent) | 10-20 (all phases) |
| Code Generation | ❌ None | ✅ 20-50 files |
| Entity Models | ❌ None | ✅ TypeScript interfaces |
| CRUD Actions | ❌ None | ✅ Full implementation |
| UI Widgets | ❌ None | ✅ Angular components |
| Services | ❌ None | ✅ State management |
| Tests | ❌ None | ✅ Vitest/Playwright |
| Validation | ❌ None | ✅ Lint/Build checks |
| Progress | ❌ None | ✅ SSE events |
| File Preview | ❌ None | ✅ Real files |
| Used In | Universe Architect | Vibe-Universe-Generator |
| Production Ready | ❌ No | ⚠️ POC (needs hardening) |
🏗️ Gograb-Modules Integration Status
What Gograb-Modules Has (Yam's Work)
AI-Gateway Module Generation System:
Technology Stack:
├── NestJS backend with MCP (Model Context Protocol)
├── LLM providers: Claude, DeepSeek via stdio
├── Prompt system: Markdown files in prompts/ directory
├── Phase executor: Iterative LLM calls with retries
├── Git service: Branch isolation for safe generation
├── Session manager: In-memory (NEEDS: Redis/PostgreSQL)
└── CLI: Debug capabilities with phase control
Workflow:
User Request → ModuleGenerationService → 7 Phases → Generated Module
├── Phase 1: Analyze (requirements)
├── Phase 2: Plan (architecture)
├── Phase 3: Validate (feasibility)
├── Phase 4: Implement (code generation) ← Most important
├── Phase 5: Integrate (workspace)
├── Phase 6: Verify (lint/test)
└── Phase 7: Test-E2E (Playwright)
Key Features:
- Generates real TypeScript code
- Creates entities, services, components, tests
- Uses template-specific prompts (crud, dashboard, integration)
- Git branch per generation
- Checkpoint system for recovery
- CLI with --debug, --phase flags
What Editor2 Has (Our Implementation)
WorkflowStateService (Partial Integration):
Architecture:
├── Angular service wrapping backend API
├── Connects to backend-ai-api /workflow endpoints
├── SSE event streaming
├── Progress signals (phases, progress percentage)
├── Generated manifest signal
└── Used ONLY in vibe-universe-generator
Components Using It:
- ✅
vibe-universe-generator.component.ts- Full integration - ❌
architect-canvas.component.ts- Not using it (uses toy service)
Why WorkflowStateService Exists in editor2:
- We already integrated Yam's backend
- Backend-ai-api has
/workflowendpoints - WorkflowController, WorkflowService already implemented
- SSE streaming works
- Just need to use it in more places!
What We're NOT Using (Critical Gap)
From Yam's System:
- ❌ Git branch isolation - Not needed in frontend
- ❌ Checkpoint system - Backend handles this
- ❌ CLI debug tools - Not applicable
- ⚠️ Session persistence - Backend needs Redis (they use in-memory)
- ⚠️ Auth/security - Backend has it, not fully implemented
- ❌ Cost tracking - Not implemented
- ❌ Observability - No metrics/tracing
What We ARE Using:
- ✅ 7-phase workflow - Via WorkflowStateService
- ✅ SSE event streaming - Via WorkflowStateService
- ✅ Backend integration - Via backend-ai-api
- ✅ Progress visualization - In vibe-universe-generator
- ⚠️ Prompt system - Backend has it, not exposed to frontend
🚨 Architectural Issues Found
Issue #1: Service Confusion (CRITICAL)
The Problem: We have THREE services doing similar things:
1. VibeCodingOrchestratorService (gograb-ai library)
└── Creates empty module structures
└── Used in: Universe Architect ❌
2. WorkflowStateService (gograb-ai library)
└── Connects to backend AI workflow
└── Used in: Vibe-Universe-Generator ✅
3. ModuleGeneratorService (module-generator library)
└── Another AI generation service
└── Used in: AI Panel Component
└── Status: Unknown capabilities
Why This Happened:
- Historical: VibeCodingOrchestrator was first attempt
- Better: WorkflowStateService replaced it
- Problem: Old service never removed, still being used
- Result: Tools use different generation systems
What Should Exist:
Single Generation API:
└── WorkflowStateService (or wrapper)
├── Used by: Universe Architect
├── Used by: Vibe-Universe-Generator
├── Used by: AI Panel
└── Connects to: backend-ai-api /workflow
Issue #2: Tool Fragmentation (HIGH)
Current Tool Landscape:
Universe Architect
├── Purpose: Visual node-based builder
├── Generation: VibeCodingOrchestratorService ❌
├── Output: Empty structures
└── Integration: Standalone
Vibe-Universe-Generator
├── Purpose: AI platform generator
├── Generation: WorkflowStateService ✅
├── Output: Full platforms with code
└── Integration: Standalone
Modular-Universe-Builder
├── Purpose: Grid-based canvas builder
├── Generation: None (manual + AI Panel)
├── Output: Page layouts
└── Integration: With AI Panel
AI Panel (Root Level)
├── Purpose: Chat-based AI assistant
├── Generation: ModuleGeneratorService
├── Output: Modules, widgets
└── Integration: Embedded in main layout
The Problem:
- 4 different tools for building platforms
- Each uses different generation service
- No unified workflow
- User confusion about which tool to use
What Should Exist:
Unified Platform Builder
├── Visual Mode: Universe Architect (node-based)
├── Canvas Mode: Modular-Universe (grid-based)
├── AI Assistant: AI Panel (chat-based)
├── Advanced: Vibe-Universe-Generator (full workflow)
└── ALL use: WorkflowStateService
💡 Gograb-Modules vs Editor2
Similarities
| Feature | gograb-modules | editor2 |
|---|---|---|
| 7-phase workflow | ✅ ModuleGenerationService | ✅ WorkflowStateService |
| MCP integration | ✅ stdio clients | ✅ Via backend proxy |
| SSE streaming | ✅ NestJS | ✅ Angular + backend |
| Prompt system | ✅ Markdown files | ✅ Backend has them |
| Git isolation | ✅ Branch per gen | ❌ Not needed (frontend) |
Key Differences
Architecture Pattern
gograb-modules:
- Backend-heavy (NestJS gateway)
- Direct MCP stdio connection
- Git operations for safety
- In-memory session storage
editor2:
- Frontend orchestration
- Backend API for AI work
- MongoDB for persistence
- Flash state for UI
Generation Philosophy
gograb-modules:
- Generate NX library code
- Write to workspace/libs/modules/
- Commit to git
- Developer-facing
editor2:
- Generate platform structure
- Save to MongoDB
- Render in UI
- User-facing
Session Management
gograb-modules:
// session.manager.ts
private readonly sessions: Map<string, GenerationSession> = new Map();
// ⚠️ In-memory only - Yam's review flagged this as P0 critical
editor2:
// Flash Persistence + MongoDB
createFlashState('architect', defaultState);
universeService.replaceTree(universeId, modules);
// ✅ Persistent, survives refresh
🔧 What Needs to Be Fixed
Fix #1: Replace VibeCodingOrchestrator with WorkflowState (CRITICAL)
File: architect-canvas.component.ts
Current (WRONG):
private readonly vibeCodingOrchestrator = inject(VibeCodingOrchestratorService);
async onVibeGenerate(prompt: string): Promise<void> {
const result = await this.vibeCodingOrchestrator.processCommand(prompt);
// Gets empty structure
}
Should Be:
private readonly workflowState = inject(WorkflowStateService);
async onVibeGenerate(prompt: string): Promise<void> {
const request: StartWorkflowRequest = {
workflowType: 'full-configuration',
request: prompt,
spaceId: this.spaceService.currentSpace()?.id || '',
universeId: this.getCurrentUniverseId()?.id || ''
};
this.workflowState.startWorkflow(request).subscribe({
next: (event) => {
if (event.type === 'file_created') {
this.generatedCodeFiles.update(files => [...files, event.file]);
}
if (event.type === 'module_generation_complete') {
// Real module with entities, actions, widgets
}
if (event.type === 'workflow_complete') {
this.loadUniverseData(); // Reload with real data
this.fitToView();
}
}
});
}
Estimated Time: 2-3 hours
Priority: P0 - System is useless without this
Fix #2: Fix Panel Resize (MEDIUM)
Current (BROKEN):
<div class="resize-overlay" (mousemove)="onResize($event)"></div>
Should Be (from modular-universe):
export class ArchitectSidePanelComponent implements OnDestroy {
private resizeListener?: (e: MouseEvent) => void;
onResizeStart(event: MouseEvent): void {
event.preventDefault();
this.isDragging.set(true);
this.resizeListener = (e: MouseEvent) => {
const newWidth = Math.max(300, Math.min(800, window.innerWidth - e.clientX));
this.width.set(newWidth);
};
document.addEventListener('mousemove', this.resizeListener);
document.addEventListener('mouseup', () => this.onResizeEnd());
}
ngOnDestroy(): void {
if (this.resizeListener) {
document.removeEventListener('mousemove', this.resizeListener);
}
}
}
Estimated Time: 30 minutes
Priority: P1 - UX issue but not blocking
Fix #3: Show Real Generation Progress (MEDIUM)
Current:
- VibeCodingToolbar shows spinner
- No phase information
- No file count
- No progress percentage
Should Be (from vibe-universe-generator):
// Use existing components:
import { GenerationProgressComponent } from '@libs-structural/vibe-universe';
<lib-generation-progress
[phases]="workflowState.phases()"
[currentPhase]="workflowState.currentPhase()"
[progress]="workflowState.progress()"
/>
Estimated Time: 1 hour
Priority: P2 - Nice to have
📋 Action Plan for Next Agent
Phase 1: Critical Fixes (P0) - 3-4 hours
Task 1.1: Replace Generation Service
- Remove
vibeCodingOrchestratorinjection - Add
workflowStateinjection - Replace
processCommand()withstartWorkflow() - Handle SSE events (file_created, phase_complete, etc.)
- Stream files to side panel Code tab
- Update generated structures to include entities/actions/widgets
Task 1.2: Fix Current UniverseId Resolution
- Already fixed (getCurrentUniverseId helper)
- Uses real MongoDB ObjectId, not slug
Task 1.3: Test Full Workflow
- Generate with "create soccer management app"
- Verify backend creates real modules
- Verify files appear in Code tab
- Verify pages have widgets
- Verify navigation works
Phase 2: UX Fixes (P1) - 1-2 hours
Task 2.1: Fix Panel Resize
- Add document event listeners
- Remove broken overlay approach
- Test resize interaction
- Add cleanup in ngOnDestroy
Task 2.2: Improve Generated Names
- Fix AI response parsing to use actual suggestions
- Remove duplicate keyword extraction
- Add route uniqueness validation
- Test with multiple domains
Phase 3: Polish (P2) - 2-3 hours
Task 3.1: Add Generation Progress
- Import GenerationProgressComponent
- Show phase indicators
- Show file count
- Show elapsed time
Task 3.2: Enhanced Module Details
- Parse module config for entities
- Show action list
- Show widget list
- Link to edit in modularity workbench
🎓 Key Learnings
Lesson #1: Verify Service Capabilities Before Using
What I Did Wrong:
- Assumed VibeCodingOrchestratorService would generate platforms
- Didn't check what it actually outputs
- Didn't compare with WorkflowStateService
What I Should Have Done:
- Read both service implementations
- Compare outputs
- Check what vibe-universe-generator uses
- Use the service that generates REAL code
Lesson #2: Don't Assume Integration Patterns
What I Did Wrong:
- Copied panel resize pattern without testing
- Assumed
(mousemove)on div would work - Didn't check modular-universe implementation
What I Should Have Done:
- Find similar component (modular-universe panel)
- Copy exact pattern (document listeners)
- Test interaction before considering complete
Lesson #3: Examine Generated Output
What I Did Wrong:
- Fixed intent detection
- Fixed database persistence
- Celebrated that nodes appeared
- Didn't check if nodes had real content
What I Should Have Done:
- Click generated modules in UI
- Check for widgets, entities, actions
- Verify pages aren't empty
- Test actual platform functionality
📝 Code Smells Detected
Smell #1: Multiple Services Doing "Similar" Things
VibeCodingOrchestratorService
ModuleGeneratorService
WorkflowStateService
AIModuleGeneratorService
Why This Happens:
- Services evolved over time
- New better version created
- Old version not removed
- Different tools use different services
Refactoring Needed:
- Deprecate old services
- Unify on WorkflowStateService
- Update all tools to use same API
Smell #2: "Orchestrator" Anti-Pattern
The Pattern:
class VibeCodingOrchestratorService {
private readonly aiFactory = inject(AIFactoryService);
private readonly moduleGenerator = inject(AIModuleGeneratorService);
private readonly widgetGenerator = inject(UniversalWidgetGeneratorService);
private readonly deployService = inject(DeploymentService);
private readonly collabService = inject(CollaborationService);
// ... 6 more dependencies
async processCommand(input: string) {
// 1500 lines of switching between services
}
}
Why This Is Bad:
- God object anti-pattern
- Too many responsibilities
- Hard to test
- Hard to maintain
- Violates Single Responsibility Principle
Better Pattern:
class WorkflowStateService {
// Single responsibility: Stream workflow events from backend
// Backend handles orchestration
// Frontend handles UI
}
Smell #3: Fallback Logic Everywhere
Pattern Found:
try {
const result = await ai.analyze(input);
const galaxies = result.entities.suggestedGalaxies;
} catch {
// Fallback to keyword matching
const galaxies = this.extractFromKeywords(input);
}
Why This Masks Problems:
- AI parsing fails → silent fallback
- Generates garbage → user sees garbage
- Real issue never surfaces
- User doesn't know AI failed
Better Approach:
- If AI fails → show error to user
- Let user retry or rephrase
- Don't silently generate garbage
- Be honest about failures
🔬 Detailed Service Analysis
VibeCodingOrchestratorService Deep Dive
Purpose (Claimed):
"Complete vibe coding platform with natural language building"
Purpose (Actual):
Quick structure generator for prototyping
Methods:
processCommand(input: string) → VibeResult
├── analyzeIntent(input) → VibeCommand
│ └── Calls AI with 4000 tokens (fixed in Session 29.6)
├── handleCreateUniverse(command) → structure only
├── handleCreateModule(command) → calls AIModuleGeneratorService
├── handleCreateWidget(command) → calls UniversalWidgetGeneratorService
└── handleDeploy(command) → calls DeploymentService
Limitations:
- No code generation capability
- No entity/action/widget generation in universe flow
- Module/widget flows delegate to other services
- Universe flow just creates structure
- No progress events
- No file outputs
- Completes too fast (2-6 seconds) to be generating real code
When to Use:
- Quick prototyping
- Structure-only generation
- Testing navigation flows
- NEVER for production platforms
WorkflowStateService Deep Dive
Purpose:
"Stream AI-driven platform generation with real-time progress"
Architecture:
class WorkflowStateService {
// Connects to backend-ai-api
private apiUrl = `${this.baseUrl}/workflow`;
startWorkflow(request: StartWorkflowRequest): Observable<WorkflowEvent> {
// SSE connection to backend
return this.http.post(apiUrl, request, {
observe: 'events',
responseType: 'text'
}).pipe(
// Parse SSE stream
// Emit workflow events
);
}
// Reactive state
readonly phases = signal<WorkflowPhase[]>([]);
readonly currentPhase = signal<string | null>(null);
readonly progress = signal<number>(0);
readonly generatedManifest = signal<any | null>(null);
}
Events Emitted:
phase_start- Phase beginningphase_complete- Phase finishedcontent_delta- Streaming contenttool_call- LLM tool usagefile_created- Code file generatedmodule_generation_complete- Module readyworkflow_complete- Full generation doneerror- Failure
Backend Integration:
WorkflowStateService (Frontend)
↓ HTTP POST
backend-ai-api/workflow/start
↓
WorkflowController
↓
WorkflowService
↓
ModuleGenerationService (Yam's code)
↓
7-Phase Pipeline with MCP
↓
Real Code Generation
Output:
- 20-50 TypeScript files
- Entities, actions, widgets, services
- Tests (Vitest + Playwright)
- Documentation
- Module manifest
- Full working module
When to Use:
- Production platform generation
- Real modules with content
- Full workflows
- ALWAYS for universe generation
ModuleGeneratorService Mystery
Location: libs/libs-ai/module-generator/
Used By:
- AI Panel Component (
ai-panel.component.ts)
Capabilities: Unknown (needs investigation)
Likely Purpose:
- Single module generation
- Simpler than WorkflowStateService
- Quick module creation from chat
- May use different backend endpoint
Investigation Needed:
- What backend does it call?
- Does it generate real code?
- Should architect use this for single modules?
🎯 Specific Instructions for Next Agent
DO THIS FIRST (Before ANY Code)
Read WorkflowStateService completely
- File:
libs/libs-ai/gograb-ai/src/lib/services/workflow-state.service.ts - Understand all event types
- Note all signals exposed
- Check error handling
- File:
Read Vibe-Universe-Generator integration
- File:
libs/libs-structural/vibe-universe/src/lib/components/vibe-universe-generator/vibe-universe-generator.component.ts - See how it subscribes to workflow events
- See how it handles file_created
- See how it shows progress
- File:
Test Current Workflow Backend
- Generate something in vibe-universe-generator
- Verify backend-ai-api is working
- Check that real files are created
- Confirm entities/actions/widgets are generated
THEN DO THIS (Implementation)
Step 1: Replace architect-canvas generation service
// Remove:
private readonly vibeCodingOrchestrator = inject(VibeCodingOrchestratorService);
// Add:
private readonly workflowState = inject(WorkflowStateService);
Step 2: Rewrite onVibeGenerate() method
- Copy pattern from vibe-universe-generator
- Subscribe to workflow events
- Stream files to side panel
- Show progress phases
- Handle errors properly
Step 3: Fix panel resize
- Copy pattern from modular-universe
- Use document event listeners
- Test drag interaction
Step 4: Verify generated content
- Generate test platform
- Click modules in UI
- Verify widgets exist
- Verify entities/actions are there
🚧 Known Issues to Fix
Issue List
| # | Issue | Severity | Estimated Time |
|---|---|---|---|
| 1 | Wrong generation service | CRITICAL | 2-3 hours |
| 2 | Empty generated platforms | CRITICAL | (Fixed by #1) |
| 3 | Panel resize broken | HIGH | 30 minutes |
| 4 | Duplicate module names | HIGH | 1 hour |
| 5 | Node overlap | MEDIUM | 1 hour |
| 6 | No generation progress | MEDIUM | 1 hour |
| 7 | AI response parsing fragile | LOW | (Wait for #1) |
Total Estimated Time: 6-8 hours for complete fix
📚 Reference Architecture
How Vibe-Universe-Generator Does It (CORRECT)
// 1. Inject WorkflowStateService
readonly workflowState = inject(WorkflowStateService);
// 2. Create workflow request
const request: StartWorkflowRequest = {
workflowType: 'full-configuration',
request: platformDescription,
spaceId: contextSpaceId,
universeId: contextUniverseId,
};
// 3. Start workflow and handle events
this.workflowState.startWorkflow(request).subscribe({
next: (event) => {
// Handle different event types
switch (event.type) {
case 'phase_start':
this.addActivity('thinking', `Starting: ${event.phaseName}`);
break;
case 'phase_complete':
this.addActivity('complete', `✓ ${event.phaseId} completed`);
break;
case 'file_created':
this.handleFileCreated(event.file);
break;
case 'module_generation_complete':
this.handleModuleComplete(event);
break;
case 'workflow_complete':
this.mode.set('complete');
break;
case 'error':
this.mode.set('error');
break;
}
},
error: (err) => {
this.logger.error('Workflow failed', err);
},
});
// 4. Show progress with sub-components
<lib-generation-progress
[phases]="workflowState.phases()"
[progress]="workflowState.progress()"
/>
How Modular-Universe Does Panel Resize (CORRECT)
export class ModularUniverseBuilderComponent implements OnDestroy {
private panelResizeListener?: (e: MouseEvent) => void;
onSidebarResizeStart(event: MouseEvent): void {
event.preventDefault();
this.panelResizeListener = (e: MouseEvent) => {
const newWidth = Math.max(200, Math.min(500, e.clientX - 60));
// Update width
};
document.addEventListener('mousemove', this.panelResizeListener);
document.addEventListener('mouseup', () => this.onResizeEnd());
}
ngOnDestroy(): void {
if (this.panelResizeListener) {
document.removeEventListener('mousemove', this.panelResizeListener);
}
}
}
🎯 Success Criteria
When Next Agent is Done:
Test #1: Generate Soccer Platform
Input: "create a soccer management app for players, coaches and parents"
Expected Output:
✅ Backend workflow starts (7 phases)
✅ Progress shows: Analyzing → Planning → Implementing → Verifying
✅ Files stream to Code tab (player.model.ts, coach.service.ts, etc.)
✅ Entities created: Player, Coach, Team, Match
✅ Actions created: createPlayer, updateMatch, assignCoach
✅ Widgets created: PlayerListWidget, CoachDashboard, MatchCalendar
✅ Pages populated with widgets
✅ Navigation works with real content
✅ Duration: 5-10 minutes (not 6 seconds!)
Test #2: Panel Interaction
✅ Drag resize handle → panel width changes smoothly
✅ Click node in Tree → canvas centers on it
✅ Switch to Code tab → see generated files
✅ Switch to Details → see module metadata
Test #3: Module Editor
✅ Right-click node → Edit
✅ Side panel opens showing full module data
✅ See entities list
✅ See actions list
✅ See widgets list
✅ See routes
💬 Honest Assessment
What Works:
- ✅ Visual ports and connections (Session 29.1)
- ✅ Database persistence with real ObjectIds (Session 29.6)
- ✅ Side panel structure (Session 31.1)
- ✅ Undo/redo functionality
- ✅ Route visualization
What's Broken:
- ❌ Using toy generation service
- ❌ Generated platforms are empty
- ❌ Panel resize doesn't work
- ❌ No real module content
- ❌ No integration with backend workflow
What's Missing:
- Missing: Real code generation (need WorkflowStateService)
- Missing: Generation progress visualization
- Missing: File streaming to Code tab
- Missing: Entity/action/widget data in modules
Confidence: 100% CERTAIN on all points above
🚀 Estimated Work Remaining
To Make It Actually Work:
- P0 fixes: 3-4 hours (replace service, test)
- P1 fixes: 1-2 hours (panel resize, names)
- P2 polish: 2-3 hours (progress, details)
Total: 6-9 hours to complete transformation
Current Progress:
- Infrastructure: 90% ✅
- UX Polish: 70% ✅
- Core Functionality: 30% ❌ (because using wrong service)
🔗 Critical Files Reference
Must Read (Priority Order)
workflow-state.service.ts- The service we SHOULD usevibe-universe-generator.component.ts- How to use it correctlyvibe-coding-orchestrator.service.ts- The service we're using (wrong)modular-universe-builder.component.ts- Panel resize patternarchitectural-review-2026-01-07.md- Yam's critical findings
Backend Files (For Reference)
In backend-ai-api:
workflow/workflow.controller.ts- SSE endpointworkflow/workflow.service.ts- Generation orchestrationworkflow/module-generation.service.ts- 7-phase pipeline
🎯 Final Verdict
Universe Architect Current State:
- Infrastructure: Excellent (ports, persistence, sync)
- UI/UX: Good (side panel, context menu, visualization)
- Core Functionality: Broken (wrong generation service)
It's like building a Ferrari but putting a lawnmower engine in it.
The chassis is perfect, the UI is beautiful, but it doesn't actually do what it's supposed to do because we're using a toy service instead of the real one.
Next agent: Replace the engine (WorkflowStateService), test drive, deliver.
This document provides complete context for Session 31.2 continuation.