TESTING GUIDE

Documentation for Sessions

Session 16.1 Testing Guide

Complete Platform Building Flow Test

This guide walks through testing the complete platform building process from start to finish.


Prerequisites

  1. Servers Running:

    # Terminal 1: Frontend
    yarn dev:gograb
    
    # Terminal 2: Backend AI API
    yarn serve:backend-ai
    
  2. Space Context: Have a space created (e.g., chrome-space-1)


Test 1: Routing - Space-Aware Navigation

1.1 Direct Navigation to Vibe

URL: http://localhost:5200/space/chrome-space-1/vibe

Expected:

1.2 Universe-Scoped Vibe

URL: http://localhost:5200/space/chrome-space-1/universe/test-universe/vibe

Expected:

1.3 Workbench Navigation

URL: http://localhost:5200/space/chrome-space-1/modularity/workbench/test-module

Expected:


Test 2: Intelligent Suggestions

2.1 Restaurant Platform

Steps:

  1. Navigate to Vibe: /space/chrome-space-1/vibe
  2. Start typing: "I want a restaurant"
  3. Wait 300ms (debounce)

Expected:

2.2 Retail Platform

Steps:

  1. Clear input
  2. Type: "retail store with inventory"

Expected:

2.3 Keyboard Navigation

Steps:

  1. Type "fitness gym"
  2. Press ↓ (down arrow)
  3. Press ↑ (up arrow)
  4. Press Enter

Expected:

2.4 Escape to Close

Steps:

  1. Type "healthcare"
  2. Press Esc

Expected:


Test 3: Complete Tool Integration Flow

3.1 Vibe → Universe Canvas

Steps:

  1. Navigate to /space/chrome-space-1/vibe
  2. Type platform description or select suggestion
  3. Click "Generate Platform"
  4. Wait for generation to complete
  5. Click "Deploy to Universe"

Expected:

Console Checks:

[ModularityIntegration] Module generated
[ModularityIntegration] Proceeding to universe canvas
[PlatformEvent] TOOL_SWITCHED from ai-platform-generator to modular-universe

3.2 Universe Canvas → Workbench

Steps:

  1. In Universe Canvas, right-click a module
  2. Select "Edit Module" or "Refine in Workbench"

Expected:

Console Checks:

[ModularityIntegration] Opening module in workbench for refinement
[ModuleWorkbench] Return context detected: { tool: 'modular-universe', universeId: '...' }

3.3 Workbench → Universe Canvas (Return)

Steps:

  1. In Module Workbench, click "Return" or "Back to Universe"

Expected:

Console Checks:

[ModuleWorkbench] Returning to previous tool: { tool: 'modular-universe', universeId: '...' }
[ToolNavigation] Navigating to tool: modular-universe

Test 4: MongoDB Sync

4.1 Platform State Sync

Steps:

  1. Generate a platform in Vibe
  2. Open browser DevTools → Application → IndexedDB
  3. Check flash-persistence database
  4. Look for unified-current-platform key

Expected:

4.2 MongoDB Sync (if backend connected)

Steps:

  1. In PlatformStateService, call syncToMongoDB()
  2. Check MongoDB for universe document

Expected:


Test 5: Backend Suggestions API

5.1 API Endpoint Test

Request:

curl -X POST http://localhost:3000/workflow/suggest \
  -H "Content-Type: application/json" \
  -d '{"input": "restaurant management system"}'

Expected Response:

{
  "industries": ["restaurant"],
  "modules": [
    {
      "id": "menu-management",
      "name": "Menu Management",
      "description": "Manage menu items, categories, pricing, and availability",
      "entities": ["MenuItem", "MenuCategory", "MenuSection"],
      "actions": ["createMenuItem", "updateMenuItem", "deleteMenuItem", "listMenuItems"],
      "priority": 10
    },
    // ... more modules
  ],
  "entities": [
    {
      "name": "MenuItem",
      "description": "A menu item with pricing and details",
      "fields": [...],
      "relationships": ["MenuCategory", "Order"]
    }
  ],
  "confidence": 0.85
}

Troubleshooting

Issue: NG04002 Routing Error

Symptom: Cannot match any routes. URL Segment: 'space/chrome-space-1/workbench/...'

Fix: Ensure all services use space-aware routing:

Issue: Suggestions Not Appearing

Symptom: Type in input but no suggestions show

Checks:

  1. Input length > 3 characters?
  2. Wait 300ms for debounce?
  3. Check console for errors
  4. Verify ModuleSuggestionsService is injected

Issue: Context Lost Between Tools

Symptom: Navigate to Workbench, return to Universe, context lost

Checks:

  1. Verify returnTo query param is set
  2. Check ModuleWorkbench.returnContext signal
  3. Verify UniverseContextService has spaceId and universeId

Issue: MongoDB Sync Fails

Symptom: syncToMongoDB() throws error

Checks:

  1. Backend running and accessible?
  2. RealtimeSyncService connected?
  3. Space context available in UniverseContextService?

Performance Benchmarks

Operation Target Actual
Suggestion debounce 300ms ✅
Suggestion generation < 100ms ✅
Route navigation < 200ms ✅
MongoDB sync < 500ms ⏳

Browser Console Commands

// Check universe context
window['ng'].getComponent(document.querySelector('lib-vibe-universe-generator')).universeContext.context()

// Check platform state
window['ng'].getComponent(document.querySelector('lib-vibe-universe-generator')).integration.currentGeneration()

// Check suggestions
window['ng'].getComponent(document.querySelector('lib-intelligent-input')).activeSuggestions()

Success Criteria Summary

✅ All routing paths work without errors
✅ Intelligent suggestions appear and are selectable
✅ Context flows seamlessly between all three tools
✅ MongoDB sync operational
✅ Backend API responds correctly
✅ No duplicate interfaces created
✅ All existing infrastructure reused properly

Status: All core functionality implemented and ready for testing