Report Current Architecture Feb 26
Documentation for Architecture
GoGrab Platform — Current Architecture Report
Date: February 26, 2026 Session: 148 (gspace1) Research Method: MCP Research Protocol (mcp-research.md) — Phase 1-4 complete Calibrated Confidence: 0.92 (research), 0.54 (architecture decision domain — historical success rate warning)
Executive Summary
The GoGrab AI Platform is a multi-layered, multi-agent system with 10+ deployed components spanning 4 backend APIs, 5 client surfaces (web, Chrome extension, VSCode extension, desktop, mobile), an MCP coordination server, and 238+ NX libraries. The AI orchestration layer (Vitto) is production-grade with a 4-phase engine, A2A protocol compliance, computer use infrastructure, and a learning pyramid tracking 563 patterns.
Critical gap identified: The platform building capabilities — the libraries that generate, edit, and compose modules/pages/flows — remain fragmented with significant dead code and poor integration between generation (vibe-universe) and editing tools (universe-canvas, page-builder, flow-engine, layout-builder, module-editor-lib, etc.). This is documented separately in a follow-up research.
1. Backend Infrastructure
1.1 Four-API Architecture
| API | Port | Role | Key Modules |
|---|---|---|---|
| backend-api | 3000 | Core CRUD | User profiles, auth, spaces, permissions |
| backend-ai-api | 3001 | AI Data Layer | Learning, agents, computer use, MCP gateway, observatory, sessions, workflow |
| backend-docs-api | 3002 | Documentation | Docs service, content management |
| backend-vitto-api | 3003 | AI Orchestrator | Vitto engine (17 modules), A2A protocol, mind, strategy, security, LLM |
1.2 Vitto Engine (backend-vitto-api)
206 TypeScript files across 17 modules:
| Module | Files | Purpose |
|---|---|---|
| engine | 38 | 4-phase orchestrator: ANALYZE → PLAN → EXECUTE → VERIFY |
| mind | 23 | Memory system, anomaly detection, space context, user knowledge |
| module-generation | 26 | Code generation for Angular/NestJS modules |
| strategy | 13 | Cost guards (25 iterations, 100K tokens, 5min max) |
| security | 22 | Vault, injection guards, redaction, audit trails |
| connectivity | 15 | WebSocket/REST bridges to other backends |
| llm | 14 | Provider abstraction (Claude/OpenAI/Gemini/Ollama) |
| proactive | 9 | Daily digest, briefing, monitoring |
| a2a | 10 | Google A2A protocol bridge |
| space-builder | 7 | NL-to-universe conversion, flow generation |
| tools | 10 | 10 core tools (read/write/execute/http/handoff/memory/etc.) |
| connectors | 4 | Integration bridges |
| prompts | 2 | Prompt building system |
| customer | 4 | Intelligence aggregation |
| auth | 1 | Roles/permissions |
| mcp-server | 3 | MCP coordination |
| system | 1 | Health/status |
Key services by size:
vitto-engine.service.ts(1,804 lines) — task submission, queue management, SSE streamsphase-executor.service.ts(1,000+ lines) — 4-phase workflow executionmodule-generation.service.ts(600+ lines) — code generation pipelinemind.service.ts(500+ lines) — memory/context managementa2a.service.ts(200 lines) — A2A protocol translation
Test coverage: 36 spec files including 5 A2A protocol test suites (59 tests).
1.3 Backend AI API (backend-ai-api)
325 TypeScript files across 26 modules:
| Module | Files | Purpose |
|---|---|---|
| infrastructure | 74 | Computer use, sandboxing, observatory, MCP gateway |
| workflow | 62 | Workflow orchestration engine |
| agents | 33 | Agent types, capabilities, evolution tracking |
| learning | 29 | Decision logging, outcome tracking, pattern mining |
| super-intelligence | 16 | Recall, simulation, reflection |
| mcp-gateway | 16 | Tool routing, agent discovery |
| platform-ai | 11 | AI platform abstractions |
| space-agents | 10 | Specialized agents for platform layers |
| sessions | 6 | Session lifecycle management |
| orchestration | 6 | Multi-agent coordination |
| command-center | 6 | CLI-like interface |
| + others | 35+ | Chat, git-safety, dev, module-intelligence |
2. Computer Use Infrastructure
Location: APIs/backend-ai-api/src/app/infrastructure/
Scope: 74 files (30 services + 6 sandbox providers + 30+ skills)
Architecture
SandboxProviderFactory (env-based selection)
├─ SelfHostedProvider (SANDBOX_SERVER_URL → Local Node.js)
├─ E2BCloudProvider (E2B_API_KEY → Firecracker microVMs)
├─ PlaywrightProvider (fallback → Browser automation)
└─ RobotjsProvider (@jitsi/robotjs → Desktop control)
ComputerUseLoopService (1,269 lines)
├─ Observe: Screenshot + OCR
├─ Think: Anthropic Claude (computer_20251124)
├─ Act: Execute via selected sandbox provider
└─ Guards: 25 iterations, 100K tokens, 5min timeout, cost tracking
- E2B Desktop: Firecracker microVMs, Chrome pre-warmed, Firefox killed, 30min idle TTL
- Mid-session reply:
POST /sessions/:id/replyqueues user messages - Service profiles: 9 static (Gmail, Calendar, GitHub, etc.)
- Skills: 30+ implementations (browser, SSH, Docker, Git, desktop)
3. A2A Protocol (Agent-to-Agent)
Location: APIs/backend-vitto-api/src/app/a2a/
Status: Complete with full test coverage (59 tests across 5 suites)
- Bridges Google A2A protocol to internal VittoTask system
- MongoDB persistence with 7-day hot cache
- Status mapping: internal states → A2A standard (working/completed/failed/canceled)
- SSE streaming for real-time task updates
4. MCP Server (Model Context Protocol)
Location: MCP/mcp-gograb-ai/
Scope: 132 TypeScript files, 64+ tool handlers
Tool Categories
- Core workflow: preflight, log_decision, outcome
- Intelligence: recall, simulate, reflect, diagnose, calibrate (21 actions)
- Session management: get_info, set, summary, validate, lifecycle
- Code operations: review, test_gen, validate, analyze
- Agent collaboration: handoff, orchestrate, message, broadcast, rpc, discover
- Research: web_search, docs_search
- Browser/Desktop: navigate, click, fill, screenshot, execute
- Git: SAGP-enforced commit, stash, merge_check, recover
Key Features
- Sentinel reconnect (10 fast retries → 60s intervals indefinitely)
- Offline handoff sync via REST with 2x exponential backoff
- Platform detection: Cursor, Claude Code, Claude Desktop, VSCode
- Notification injection on tool responses (pull-only, 60s check)
- Connects exclusively to backend-ai-api (port 3001)
5. Client Applications
5.1 Web Application (Angular 20)
Location: apps/gograb-ai/
Pages: panel, vitto-chat, dashboard, observatory, home, extension-panel, desktop-auth, desktop-welcome
- AI Panel with streaming chat, drag-drop "Add to Canvas"
- Observatory dashboard (30s auto-refresh, agent monitor + system dashboard tabs)
- EmbeddedAdapterService for iframe bridge support
- Session persistence via MongoDB (not autoFlashState — race conditions confirmed)
5.2 Chrome Extension (Vitto)
Location: apps/vitto-chrome-extension/
Version: 0.2.9 | Manifest V3
- Side panel (Ctrl+Shift+G / Cmd+Shift+G), popup (Alt+G)
- Content script on GoGrab domains
- Bridge adapter (postMessage) for embedded iframe communication
- Auth via URL params in extension context (not postMessage — unreliable)
5.3 VSCode Extension (Vitto Agents)
Location: apps/vitto-vscode-extension/
Version: 0.9.7 | 35 TypeScript files
- 13 commands (status, handoffs, preflight, logDecision, findSimilar, reviewCode, etc.)
- Full MCP connection + tool routing
- Native VSCode notification modals for handoffs
- Webview panels for inline UI
5.4 Desktop App (Tauri)
Location: apps/vitto-desktop/
Build: Tauri (Rust backend + Angular frontend)
- Global hotkey: Cmd+Ctrl+V (macOS)
- CI/CD passing all 4 platforms (macOS arm64/x64, Windows x64, Linux x64)
- Auto-updates via Tauri updater
- Code signing with
~/.tauri/vitto.key
5.5 Mobile App (Capacitor)
Location: apps/vitto-mobile/
App ID: space.gograb.vitto.mobile
- Configured, uses same Angular app via
webDir CapacitorBridgeServicemirrorsTauriBridgeServicepattern- Auth guard covers:
isDesktop || isMobile || isEmbedded - Needs iOS/Android signing pipeline
6. Learning Pyramid
| Metric | Value |
|---|---|
| Validated outcomes | 162 |
| Success | 83 (51.2%) |
| Partial | 55 (34.0%) |
| Failure | 24 (14.8%) |
| Pending | 9 |
| Learned patterns | 563 |
| Core rules | 10 |
| Pattern mining | Every 6h (cron) |
| Anti-patterns tracked | 6 (1 critical, 1 high, 3 medium, 1 low) |
7. Branding & Domain Mapping
| Brand | Scope |
|---|---|
| GoGrab Space | Platform parent brand, gograb.space domains |
| Vitto | AI agent brand (replaced "GoGrab AI" / "Space AI" in Sessions 146-147) |
| Domain | Service |
|---|---|
ai.gograb.space |
Web app (gograb-ai) |
vitto-api.gograb.space |
backend-vitto-api |
vitto-updater.gograb.space |
Desktop auto-updater |
8. Architecture Patterns
- Strategy/Factory pattern — Used consistently for sandbox providers, LLM providers, auth bridges
- 4-phase workflow — ANALYZE → PLAN → EXECUTE → VERIFY (Vitto engine + gmodules1)
- Build UI, Buy Engine — Custom UX components, wrapped external parsers (marked, PrismJS)
- MCP-centric coordination — All agent types coordinate through MCP, not direct API calls
- Offline-first resilience — REST sync, local queuing, sentinel reconnection
9. Risk Assessment
High Priority
- 51.2% architecture decision success rate — Nearly half of decisions result in partial/full failure. Audit the 24 failed outcomes for root causes.
- Platform builder fragmentation — Generation (vibe-universe) and editing tools (universe-canvas, page-builder, flow-engine, etc.) are poorly integrated with significant dead code. (See dedicated follow-up research.)
Medium Priority
- autoFlashState race conditions — Confirmed unresolvable. Always use MongoDB for critical data.
- A2A hot cache 7-day limit — No validation on restart, cold starts lose task state.
- LLM cost alerting absent — Observatory tracks but doesn't alert on threshold breaches.
Low Priority
- Mobile deployment pipeline — Capacitor configured but no signing pipeline.
- Backend trace/pivot detection offline — Intelligence tools partially unavailable when backend disconnected.
10. Port Reference
| Context | Ports |
|---|---|
| gspace1 (testing) | 6200, 6100, 6300, 6400, 6500, 6010 |
| editor2 (coding) | 5200, 5100, 5300, 5400, 5500, 5010 |
| Backend (shared) | 3000 (api), 3001 (ai), 3002 (docs), 3003 (vitto) |
11. Key File Paths
| Component | Path |
|---|---|
| Vitto Engine | APIs/backend-vitto-api/src/app/engine/ |
| Computer Use | APIs/backend-ai-api/src/app/infrastructure/ |
| A2A Protocol | APIs/backend-vitto-api/src/app/a2a/ |
| MCP Server | MCP/mcp-gograb-ai/ |
| Learning System | APIs/backend-ai-api/src/app/learning/ |
| Observatory | APIs/backend-ai-api/src/app/infrastructure/services/observatory* |
| Chrome Extension | apps/vitto-chrome-extension/ |
| VSCode Extension | apps/vitto-vscode-extension/ |
| Desktop App | apps/vitto-desktop/ |
| Mobile App | apps/vitto-mobile/ |
| Web App | apps/gograb-ai/ |
| Session Manifests | sessions/manifests/S{N}.json |
| Session History | sessions/history.json |
Generated via MCP Research Protocol. Outcomes: 162 validated, 563 patterns, 64+ MCP tools operational.