Unclassified

Repository Boundary Audit

Date: 2026-08-01
Governing spec: THREE_REPOSITORY_ARCHITECTURE_SPEC.md, IMPLEMENTATION_CONTRACT_v1.1.md, ARCHITECTURE_LOCK.md


Summary

Both named repositories are significantly over-scoped relative to their canonical channel roles. Neither is ready for integration as a microfrontend zone or a standalone security authority. The integration work must begin with ownership migration, not routing configuration.


iw-spine-network-mcp

What it actually contains

AreaFilesFinding
Auth contextlib/auth-context.tsx, components/core/auth/Own mock session — localStorage-backed, independent of Clerk/Gateway
Workbench shellcomponents/iw/layouts/workspace-shell.tsx, components/iw/views/*Full second Workbench with 12+ domain views (admin, governance, chat, approvals, brainstorming)
Projection/command runtimecomponents/iw/state/runtime-contracts.ts, use-hydrate-projection.ts, use-intent-command.tsCanonical-quality contracts; these are Keep / promote to shared package
Onboardingcomponents/activation/onboarding/*, components/iw/onboarding/*Role-domain onboarding covering 10 roles — Move to Platform activation
L1 domain viewscomponents/l1/* (account-success, bizops, finance, marketing, etc.)Platform Workbench domain views — Move to platform repo
MCP toolingNone foundMissing — the MCP channel itself (19 tools, OAuth resource discovery, MCP transports) is absent
Direct DB/service couplingNone confirmed in surface code; auth context is mockCoupling risk is low, but resolved identity is also mock
Surface contractscomponents/iw/config/surface-backend-contracts.ts, spine-table-map.tsValuable — Keep / promote

Verdict

This is a Workbench prototype, not an MCP channel. It contains the right projection/command runtime types and surface contracts but none of the actual MCP channel code (tool definitions, OAuth protected-resource server, MCP transports, tenant-bound access tokens). It should be treated as a migration source for:

  • Projection runtime types → packages/projection-contracts
  • Surface/table contracts → packages/platform-sdk
  • Domain views → apps/platform/app/(shell)/*
  • Onboarding flow → Platform activation module

The mock auth context and second Workbench shell must be retired after migration. No MCP tooling should be built in this repo until the canonical MCP channel role is properly scoped.

Keep / Move / Retire map

PathDecisionDestination
components/iw/state/runtime-contracts.tsKeep → promotepackages/projection-contracts
components/iw/config/surface-backend-contracts.tsKeep → promotepackages/platform-sdk/contracts
components/iw/config/spine-table-map.tsKeep → promotepackages/platform-sdk/contracts
components/core/hydration/use-hydrate-projection.tsKeep → promotepackages/react-sdk
components/core/hydration/use-intent-command.tsKeep → promotepackages/react-sdk
components/l1/* (all domain views)Moveapps/platform/app/(shell)/
components/activation/onboarding/*MovePlatform activation module
components/iw/onboarding/*MovePlatform activation module
components/iw/views/*Moveapps/platform/app/(shell)/
components/iw/layouts/workspace-shell.tsxMoveapps/platform/components/shell/
lib/auth-context.tsxRetireReplace with Clerk + Gateway identity
components/core/auth/auth-provider.tsxRetireReplace with Clerk provider
components/core/auth/login-page.tsxRetireClerk-hosted or platform auth flow
app/(auth)/login/page.tsxRetireAuth owned by Clerk/Gateway
components/iw/state/role-context.tsxRetireRole resolved by Gateway projection
components/iw/state/workspace-store.tsxRetireWorkspace state from Gateway discovery
components/dialogs/*EvaluateKeep if MCP-specific; move if Workbench
app/(app)/domains/*EvaluateMove if Workbench domain; scope to MCP fallback
MCP tools (absent)BuildAfter role is scoped: exactly 19 tools, OAuth resource server

iw-one-auth-ecosystem

What it actually contains

AreaFilesFinding
Identityapp/auth/login/page.tsx, app/login/page.tsxSupabase email/password + demo cookie — not Clerk, competes with platform identity
Mock authlib/mock-auth.ts (referenced)Demo credential bypass — Retire
Clerk webhooksapp/api/webhooks/clerk/route.tsClerk event receiver — potentially Keep / move to platform
Connector OAuthapp/api/connectors/[provider]/connect/route.ts, callback/, disconnect/Direct provider OAuth execution — Move to Connector Runtime in platform
Connector CRUDapp/api/connectors/route.ts, [id]/route.tsMock in-memory connector list — Retire mock, Move interface to platform
AI/LLMapp/api/ai/chat/route.ts, brainstorm/* routesLLM routing and brainstorm analysis — Move to platform Hermes/AI layer
Cron jobsapp/api/cron/daily-insights/route.ts, hourly-insights/route.tsBackground ingestion — Move to platform reconciliation/ingestion
Provider webhooksapp/api/webhooks/{slack,discord,hubspot,asana,health}Provider event receivers — Move to platform Integration Manager
Spine entities/timelineapp/api/spine/entities/route.ts, timeline/route.tsDirect Spine data access — Move to platform projection API
Twinapp/api/twin/route.tsDigital twin query — Move to platform twin service
Data syncapp/api/data-sync/route.tsIngestion pipeline — Move to platform reconciliation
HubSpot syncapp/api/hubspot/sync/route.tsProvider-specific sync — Move to Connector Runtime
Coda integrationapp/api/integrations/coda/*Provider-specific integration — Move to Connector Runtime
Docs index/readapp/api/docs/*Knowledge indexing — Move to platform knowledge service
Website trackingapp/api/website/track/route.tsAnalytics — Move or Retire
Webhook schedulerapp/api/webhook-scheduler/trigger/route.tsScheduling — Move to platform
Platform proxyapp/api/platform/[...path]/route.tsCatch-all proxy to platform — Retire (routing anti-pattern)
Full Workbench UIapp/app/workbench/*, app/deals, app/clients, app/campaigns, etc.Second full Workbench — Move surfaces to platform or Retire duplicates
One Auth trust flowNot foundMissing — the canonical trust grant / consent / connection reuse flow is absent

Verdict

This is a second standalone platform, not a One Auth trust layer. It contains Supabase identity competing with Clerk, direct provider OAuth execution that belongs in the Connector Runtime, AI/LLM routing that belongs in Hermes, background ingestion that belongs in platform reconciliation, and a full second Workbench. The canonical One Auth-to-Ecosystem functionality (workspace trust grants, delegated provider access, consent lifecycle, connection reuse) is entirely absent.

Migration priority:

  1. Highest — Move now: Clerk webhook receiver, provider OAuth flows, provider webhooks, Spine entity/timeline API access
  2. High — Move after platform APIs exist: AI/brainstorm, cron ingestion, data sync, twin query
  3. Medium — Move with Workbench consolidation: all UI surfaces
  4. Retire immediately: mock auth, demo cookie, Supabase identity, platform proxy catch-all, in-memory connector mock

Keep / Move / Retire map

PathDecisionDestination
app/api/webhooks/clerk/route.tsMoveapps/platform/app/api/webhooks/clerk/
app/api/connectors/[provider]/connect, callback, disconnectMovePlatform Connector Runtime
app/api/webhooks/{slack,discord,hubspot,asana}MovePlatform Integration Manager
app/api/spine/entities, timelineMovePlatform Projection API
app/api/twin/route.tsMovePlatform twin service
app/api/ai/chat/route.tsMovePlatform Hermes/AI layer
app/api/brainstorm/*MovePlatform Hermes/AI layer
app/api/cron/*MovePlatform reconciliation/ingestion
app/api/data-sync/route.tsMovePlatform reconciliation
app/api/hubspot/sync, integrations/coda/*MoveConnector Runtime
app/api/docs/*MovePlatform knowledge service
app/api/webhook-scheduler/triggerMovePlatform scheduler
app/api/connectors/route.ts + [id] (mock)Move interface / Retire mockPlatform Connector Runtime
app/app/workbench/*, all UI pagesMoveapps/platform/app/(shell)/
app/auth/login/page.tsx, app/login/page.tsxRetireClerk-owned auth
lib/mock-auth.tsRetireNo mock auth in production path
app/api/platform/[...path]/route.ts (proxy)RetireAnti-pattern; all calls direct via typed SDK
app/api/website/track/route.tsRetire or moveAnalytics service
One Auth trust/consent (absent)BuildIn apps/platform after Clerk+Gateway foundation

Migration sequence

Immediate (unblock integration)

  1. Extract runtime-contracts.ts and surface-backend-contracts.ts from iw-spine-network-mcp into a new packages/projection-contracts workspace package — these are canonical quality and already used by the platform's gateway client.
  2. Move the Clerk webhook handler from iw-one-auth-ecosystem into the platform — the platform needs Clerk user events to maintain users and memberships in Neon.
  3. Move provider OAuth connect/callback/disconnect routes from iw-one-auth-ecosystem into the platform Connector Runtime — these routes touch provider credentials and must live behind the credential wall.

Before building new features

  1. Remove Supabase identity and mock auth from both repos — Clerk is the only identity authority.
  2. Remove the second Workbench shells — the platform Workbench is canonical.
  3. Scope iw-spine-network-mcp to its MCP channel role only.
  4. Scope iw-one-auth-ecosystem to the canonical One Auth trust/consent flow only, or retire it and build that flow in the platform.

After foundation is stable

  1. Build the 19 canonical MCP tools in the MCP channel repo, backed by the Platform SDK.
  2. Build the One Auth trust/consent/reuse lifecycle in the platform.
  3. Connect the platform Workbench /network route to Gateway workspace discovery and integration projections.

Gate: do not proceed with Phase 2+ until

  • packages/projection-contracts exists and exports ProjectionEvent, WorkbenchCommand, and cursor types
  • Platform has a working GET /api/v1/workspace/discovery endpoint backed by real Neon data
  • Clerk webhook handler is in the platform
  • Provider OAuth flows are in the platform Connector Runtime
  • Neither repo contains competing Supabase or mock auth