{"slug":"documentation/MERGE_SUMMARY","title":"IntegrateWise — 4-Way Merge Summary (by App & Department)","section":"documentation","sectionLabel":"Documentation","status":"unclassified","type":"document","path":"documentation/MERGE_SUMMARY.mdx","bytes":12183,"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**Date:** 2026-07-05  \n**Sources:** `app_real.zip` | `v0-core` | `web.old.zip` | `pull-from-main 2.zip`\n\n---\n\n## What Was Done\n\nAll 4 source zips were extracted and merged into the live monorepo at `/Users/nirmal/Documents/kimi/workspace/integratewise/`, organized by **app** and **department route groups**.\n\n### Merge Results\n\n| Source             | Files | Action                                | Destination                                 |\n| ------------------ | ----- | ------------------------------------- | ------------------------------------------- |\n| **app_real**       | 271   | 102 merged, 149 preserved, 20 skipped | `apps/workspace/src/app/`, `components/`    |\n| **v0-core**        | 179   | 90 written (76 new + 14 overwrite)    | `apps/workspace/`, `migrations/v0-core/`    |\n| **web.old**        | 690   | 353 copied + 1 overwrite              | `apps/workspace/`, `public/`, `styles/`     |\n| **pull-from-main** | 2,132 | 179 new + 17 overwrite                | `packages/`, `services/`, `apps/workspace/` |\n| **Cleanup**        | —     | 3,376 archive files removed           | `_archive/__MACOSX/` deleted                |\n\n**Total files staged for commit: 4,643**\n\n---\n\n## Department Organization\n\n### Route Groups (9)\n\n```\napps/workspace/src/app/\n├── (app)/          → Dashboard, chat, command-center\n├── (auth)/         → Login, signup, error\n├── (business)/     → Deals, leads, clients, sales\n├── (chat)/         → AI workspace, twin\n├── (cs)/           → Accounts, meetings, TAM\n├── (docs)/         → Content, knowledge\n├── (ops)/          → Admin, governance, data-flow\n├── (personal)/     → Profile, billing, settings\n└── (workspace)/    → Home, work, intelligence\n```\n\n### Component Folders (18)\n\n```\napps/workspace/src/components/\n├── app/           → 122 files  (shells, navigation, command-palette)\n├── auth/          → 8 files   (login, signup, protected-route)\n├── business/      → 91 files  (sales, CRM, pipeline, deals)\n├── chat/          → 1 file    (twin workbench)\n├── cs/            → 87 files  (account-success, service desk)\n├── docs/          → 12 files  (knowledge, governance)\n├── ops/           → 55 files  (admin, IT, product-engineering)\n├── personal/      → 21 files  (profile, goal-framework)\n├── workspace/     → 121 files (spine, twin-ui, connectors)\n├── ai-workspace/  → AI chat shell\n├── dialogs/       → Shared dialogs\n├── integrations/  → Integration selection, memory insights\n├── media/         → Cloudinary images\n├── onboarding/    → Onboarding wizard, template selector\n├── shells/        → Layout shells\n├── ui/            → shadcn/ui primitives\n├── views/         → Page-level view components\n└── widgets/       → Reusable widgets\n```\n\n### API Routes (80+ directories)\n\n```\napps/workspace/src/app/api/\n├── ai/chat              → AI streaming\n├── billing/*            → Subscriptions, invoices, webhooks\n├── brainstorm/*         → Analyze, daily-insights, execute\n├── connectors/[provider]→ OAuth connect/callback/disconnect\n├── cron/*               → Daily insights, sync scheduler\n├── cs/health-score      → CS health scoring\n├── data-sync            → Data synchronization\n├── goals/progress       → Goal tracking\n├── hubspot/sync         → HubSpot integration\n├── insights/patterns    → Pattern detection\n├── loader/*             → Template pipeline (stage1, stage2, etc.)\n├── neutron/*            → Data normalization\n├── search               → Search API\n├── spend/*              → Spend analytics\n├── stripe/webhook       → Stripe billing webhooks\n├── sync/schedule        → Sync scheduling\n├── webhooks/*           → Slack, Discord, Asana, HubSpot, etc.\n└── workspace/bootstrap  → Workspace initialization\n```\n\n### New Packages (from pull-from-main)\n\n```\npackages/\n├── accelerators/        → Performance accelerators\n├── adk/                 → Agent Development Kit\n├── analytics/           → Analytics pipeline\n├── auth/                → NEW: Authentication service\n├── bootstrap/           → Bootstrap utilities\n├── config/              → Shared configuration\n├── connector-contracts/ → Connector contracts\n├── connector-utils/     → Connector utilities\n├── connectors/          → 30+ connector implementations\n├── continuity/          → Continuity engine\n├── db/                  → Database layer\n├── design-system/       → Extracted UI primitives\n├── domain-shells/       → Domain shells\n├── entity360/           → Entity 360 view\n├── gateway-sdk/         → Gateway SDK\n├── governance/          → Governance engine\n├── handoff-adapters/    → Handoff adapters\n├── hermes-spine-memory/ → Spine memory\n├── identity/            → Identity platform\n├── integratewise-mcp-tool-connector/ → MCP connector\n├── intelligence/        → Intelligence layer\n├── knowledge/           → Knowledge system\n├── knowledge-bank-ui/   → Knowledge bank UI\n├── lib/                 → Shared library\n├── normalizer/          → Data normalizer\n├── notifications/       → Notification system\n├── rbac/                → Role-based access\n├── sdk/                 → Public SDK\n├── search/              → Search engine\n├── shared/              → Shared utilities\n├── spine/               → Operational spine\n├── tenancy/             → Multi-tenancy\n├── types/               → Shared types\n├── ui/                  → UI components\n├── webhooks/            → Webhook system\n└── workbench/           → Workbench runtime\n```\n\n### New Services (from pull-from-main)\n\n```\nservices/\n├── act/                 → Action executor\n├── admin/               → Admin service\n├── agent-registry/      → Agent registry\n├── api/                 → API gateway\n├── billing/             → Billing service\n├── connector/           → Connector service\n├── connector-sync/      → Connector sync\n├── continuity/          → Continuity service\n├── folder-watcher/      → Folder watcher\n├── gateway/             → Main gateway (existing, preserved)\n├── govern/              → Governance service\n├── hermes/              → Message bus\n├── intelligence/        → Intelligence service\n├── iw-agent-runtime/    → Agent runtime\n├── knowledge/           → Knowledge service\n├── l2/                  → L2 processing\n├── loader/              → Data loader\n├── mcp-connector/       → MCP connector\n├── normalizer/          → Data normalizer\n├── pipeline/            → Processing pipeline\n├── signals/             → Signal processing\n├── store/               → Data store\n├── telemetry/           → Telemetry\n├── tenants/             → Tenant service\n├── think/               → Thinking/LLM service\n├── twin-orchestrator/   → Twin orchestration\n├── webhook-ingress/     → Webhook ingress\n└── workflow/            → Workflow engine\n```\n\n---\n\n## What Was Preserved\n\n| Location                                      | Status                                      |\n| --------------------------------------------- | ------------------------------------------- |\n| `apps/web/`                                   | ✅ Untouched — still the working deployment |\n| `packages/api/src/` (auth, entities, metrics) | ✅ Untouched — Hono backend preserved       |\n| `services/gateway/`                           | ✅ Untouched — gateway routing preserved    |\n| `apps/workspace/next.config.ts`               | ✅ Untouched — build config preserved       |\n| `apps/workspace/package.json`                 | ✅ Untouched — dependencies preserved       |\n\n---\n\n## Known Issues / Next Steps\n\n1. **Duplicate components** — Some components exist in both `components/views/` and `components/<dept>/`. The department-organized versions should be canonical; views/ can be cleaned up.\n2. **`app/layout.tsx` overwritten** — The root layout was replaced by v0-core's version. Verify providers (ThemeProvider, AuthProvider) are still correct.\n3. **API route bloat** — 80+ API routes in `apps/workspace/src/app/api/`. These should gradually move to the Hono backend (`packages/api/src/`).\n4. **Migration numbering** — v0-core migrations (001–028) may conflict with existing migrations (032–034). Renumbering needed.\n5. **Build verification needed** — Run `pnpm build` in `apps/workspace/` to verify the merged code compiles.\n6. **Import paths** — Some components may reference `@/components/ui/` instead of `@integratewise/design-system`. Update as needed.\n7. **TypeScript errors** — Expect ~40–50 TS errors from the merged code. Most are from missing types or stub implementations.\n\n---\n\n## Architecture: One App, One Backend, One Design System\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                    apps/workspace/                          │\n│  ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐           │\n│  │ (app)   │ │ (cs)    │ │ (business)│ │ (workspace)│       │\n│  │ Dashboard│ │ Accounts│ │ Deals   │ │ Home     │         │\n│  │ Chat    │ │ Meetings│ │ Leads   │ │ Work     │         │\n│  │ Command │ │ TAM     │ │ Sales   │ │ Intelligence│       │\n│  └─────────┘ └─────────┘ └─────────┘ └─────────┘           │\n│  ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐           │\n│  │ (auth)  │ │ (personal)│ │ (ops)  │ │ (docs)   │          │\n│  │ Login   │ │ Profile │ │ Admin   │ │ Content  │          │\n│  │ Signup  │ │ Billing │ │ Governance│ │ Knowledge│         │\n│  └─────────┘ └─────────┘ └─────────┘ └─────────┘           │\n├─────────────────────────────────────────────────────────────┤\n│  components/<dept>/  lib/  hooks/  public/  styles/        │\n├─────────────────────────────────────────────────────────────┤\n│                    packages/                                │\n│  api/  design-system/  connectors/  types/  ui/  ...       │\n├─────────────────────────────────────────────────────────────┤\n│                    services/                                │\n│  gateway/  workflow/  intelligence/  knowledge/  ...        │\n└─────────────────────────────────────────────────────────────┘\n```\n"}