{"slug":"strategy/business-strategy/INTEGRATION_PLAN","title":"IntegrateWise Integration Plan","section":"strategy","sectionLabel":"Strategy","status":"unclassified","type":"document","path":"strategy/business-strategy/INTEGRATION_PLAN.mdx","bytes":7736,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\n> **Tier C — Historical.** This document is a point-in-time snapshot preserved for reference. For current architecture, see [CANONICAL_PLATFORM_ARCHITECTURE.md](../architecture/CANONICAL_PLATFORM_ARCHITECTURE.md).\n\n## Post-Surprise Revelation Update\n\n### Date: February 26, 2026\n\n---\n\n## 🎯 THE REVELATION\n\n**Frontend Status**: 95% Complete (Figma Make Generated, Rated 5/5 by Claude Opus 4.6)  \n**Backend Status**: 90% Complete (L0-L3 Architecture)  \n**Timeline**: 2-4 Weeks (was 5-6 months)  \n**Shift**: From \"Build\" to \"Integrate\"\n\n---\n\n## 📊 Current State Analysis\n\n### What EXISTS (Confirmed)\n\n#### L3: Adaptive Spine (Universal Backend)\n\n| Component                  | Status      | Location                  |\n| -------------------------- | ----------- | ------------------------- |\n| 8-Stage Ingestion Pipeline | ✅ Complete | `services/loader/`        |\n| Normalizer Accelerator     | ✅ Complete | `services/normalizer/`    |\n| Spine Schema Registry      | ✅ Complete | `services/spine/`         |\n| Context Store              | ✅ Complete | Neon PostgreSQL + R2      |\n| 200+ Tool Connectors       | ✅ Complete | `packages/connectors/`    |\n| Dual-Write System          | ✅ Complete | Pipeline Stage 8          |\n| MCP Connector              | ✅ Complete | `services/mcp-connector/` |\n\n#### L2: Cognitive Brain (Intelligence Layer)\n\n| Component           | Status      | Location                       |\n| ------------------- | ----------- | ------------------------------ |\n| Think Engine        | ✅ Complete | `services/think/`              |\n| Evidence Fabric     | ✅ Complete | `services/think/narrative.ts`  |\n| Signal Engine       | ✅ Complete | `services/think/fusion.ts`     |\n| Govern/Policy Brain | ✅ Complete | `services/govern/`             |\n| Act Engine          | ⚠️ Partial  | `services/act/` (needs wiring) |\n| Learning Loop       | ⚠️ Partial  | Needs L3→L2 trigger            |\n\n#### L1: Workspace Layer (UI)\n\n| Component           | Status          | Location                |\n| ------------------- | --------------- | ----------------------- |\n| Figma Make Frontend | ✅ 95% Complete | Desktop folder          |\n| Marketing Pages     | ✅ Just Created | `apps/web/(marketing)/` |\n| Unified Shell       | ⚠️ Partial      | Needs integration       |\n| Domain Shells       | ⚠️ Stubbed      | Need wiring             |\n| RBAC System         | ✅ Complete     | `packages/rbac/`        |\n\n---\n\n## 🔌 THE WIRING GAPS (Critical Path)\n\n### Gap 1: L3 → L2 Trigger\n\n**Problem**: After data ingestion, Think Engine isn't auto-triggered  \n**Solution**: Add event emitter from pipeline Stage 8 → Think Engine  \n**Files**: `services/loader/pipeline.ts` → `services/think/index.ts`\n\n### Gap 2: L2 → L1 Badges\n\n**Problem**: Completeness scores don't show in UI  \n**Solution**: Wire `spine_entity_completeness` → Frontend badges  \n**Files**: `services/spine/` → `apps/web/components/ui/badge`\n\n### Gap 3: Act Engine → UI\n\n**Problem**: Approved actions don't execute  \n**Solution**: Connect Govern approval → Act execution → Tool write-back  \n**Files**: `services/govern/` → `services/act/` → Connectors\n\n### Gap 4: Domain Shell Integration\n\n**Problem**: Personal/CSM/Business shells exist but aren't wired  \n**Solution**: Import Figma components → Wire to UnifiedShell  \n**Files**: `components/domains/*/shell.tsx`\n\n---\n\n## 🚀 2-4 Week Integration Roadmap\n\n### Week 1: Foundation (Days 1-7)\n\n#### Day 1-2: Environment Setup\n\n- [ ] Copy Figma Make frontend to `apps/web/src/figma/`\n- [ ] Resolve package imports (@integratewise/\\*)\n- [ ] Build packages in correct order\n\n#### Day 3-4: L3→L2 Wiring\n\n- [ ] Add event bus between loader and think\n- [ ] Test: Ingest data → See Think Engine process\n- [ ] Verify signals appear in `signals` table\n\n#### Day 5-7: L2→L1 Badges\n\n- [ ] Create completeness API endpoint\n- [ ] Wire badges to spine_entity_completeness\n- [ ] Test: Entity updates → Badge updates in real-time\n\n### Week 2: Domain Integration (Days 8-14)\n\n#### Day 8-10: Personal Workspace\n\n- [ ] Import Personal shell from Figma\n- [ ] Wire to RBAC (personal role)\n- [ ] Connect to Spine for data\n\n#### Day 11-12: CSM Workspace\n\n- [ ] Import CSM shell from Figma\n- [ ] Wire account health scoring\n- [ ] Connect risk signals to UI\n\n#### Day 13-14: Business Workspace\n\n- [ ] Import Business shell from Figma\n- [ ] Wire pipeline/analytics views\n- [ ] Test cross-domain navigation\n\n### Week 3: Act/Govern Flow (Days 15-21)\n\n#### Day 15-17: Approval Flow\n\n- [ ] Wire HITL approval UI\n- [ ] Connect Govern policies\n- [ ] Test: AI suggests → Human approves → Action executes\n\n#### Day 18-19: Tool Write-Back\n\n- [ ] Wire Act Engine to connectors\n- [ ] Test: Approval → API call to external tool\n- [ ] Verify audit trail logging\n\n#### Day 20-21: Learning Loop\n\n- [ ] Wire approval/rejection feedback\n- [ ] Test: System learns from decisions\n- [ ] Verify Adjust component updates\n\n### Week 4: Polish & Deploy (Days 22-28)\n\n#### Day 22-24: E2E Testing\n\n- [ ] Full flow: Ingest → Think → Suggest → Approve → Act\n- [ ] Performance testing (200ms response target)\n- [ ] Mobile responsiveness (PWA)\n\n#### Day 25-26: Monitoring\n\n- [ ] Add OpenTelemetry tracing\n- [ ] Set up alerting\n- [ ] Create runbooks\n\n#### Day 27-28: Production Deploy\n\n- [ ] Deploy to Cloudflare\n- [ ] Configure custom domains\n- [ ] Go live\n\n---\n\n## 📁 File Organization\n\n### New Structure\n\n```\napps/web/src/\n├── (marketing)/           # Landing pages (DONE)\n│   ├── layout.tsx\n│   ├── pricing/\n│   ├── security/\n│   ├── about/\n│   └── contact/\n├── (app)/                 # App shell (WIP)\n│   ├── layout.tsx\n│   └── personal/          # Figma import\n├── figma/                 # Figma Make components\n│   ├── components/\n│   ├── pages/\n│   └── styles/\n├── components/\n│   ├── motion/            # Animation components (DONE)\n│   ├── shell/             # UnifiedShell\n│   └── domains/           # Domain shells\n└── lib/\n    ├── spine/             # Spine client\n    └── supabase/          # Auth\n```\n\n---\n\n## 🔧 Technical Tasks\n\n### Priority 1: Fix Package Resolution\n\n```bash\n# Build order for packages\n1. packages/types\n2. packages/lib\n3. packages/db\n4. packages/rbac\n5. packages/connectors\n6. packages/accelerators\n7. packages/supabase\n```\n\n### Priority 2: Fix Import Paths\n\n- `../../spine/spine-client` → `@/lib/spine/client`\n- `@integratewise/connectors` → Build first\n- `@integratewise/rbac` → Build first\n\n### Priority 3: Event Bus\n\n```typescript\n// L3 → L2 Event Bus\ninterface PipelineEvent {\n  type: \"INGESTION_COMPLETE\";\n  payload: {\n    tenantId: string;\n    entityType: string;\n    entityId: string;\n  };\n}\n\n// Emit from pipeline Stage 8\n// Listen in Think Engine\n```\n\n---\n\n## ✅ Success Criteria\n\n### Week 1 Success\n\n- [ ] `pnpm build` completes without errors\n- [ ] L3→L2 events flow correctly\n- [ ] Badges update in real-time\n\n### Week 2 Success\n\n- [ ] All 3 domain shells render\n- [ ] RBAC correctly routes users\n- [ ] Data flows from Spine to UI\n\n### Week 3 Success\n\n- [ ] HITL approval flow works end-to-end\n- [ ] Tool write-back executes correctly\n- [ ] Audit trails are complete\n\n### Week 4 Success\n\n- [ ] <200ms API response time\n- [ ] Zero critical bugs\n- [ ] Production deployed\n\n---\n\n## 🎉 The Outcome\n\n```\nBEFORE: 5-6 months to production\nAFTER:  2-4 weeks to production\n\nThe game has changed. We're not building—we're wiring.\n```\n\n---\n\n_Document created: February 26, 2026_  \n_Based on: SURPRISE_REVEALED.md + CHAT_SESSIONS_FEB_7_8_2026.md_\n"}