Historical v0 Definitive Specification — Superseded
Status: HISTORICAL IMPLEMENTATION HANDOFF
Current frontend authority:docs/frontend-v0/README.md
plus
FRONTEND_PLATFORM_API_AND_DISCOVERY_SPEC.md.Do not implement the domain-first shell, permanent Twin sidebar, direct
service mapping or older environment claims below.
Original Snapshot: IntegrateWise v0 Definitive Specification
Status: Canonical v0 implementation handoff
Date: July 24, 2026
Scope: Complete infrastructure mapping, environment management, service adapters, end-to-end schema, persistent workspace behavior, MCP boundary, and explicit sidebar-to-schema mapping
1. Document Status
This document is the definitive v0 spec for the frontend, Twin, agents, memory, capabilities, continuity, and Spine network. It replaces fragmented drafts.
- Frontend baseline: PR #99 branch
v0/nirmal-it90-cff4a009 - Backend authority: Hermes-aligned platform services and canonical architecture documentation
- Purpose: Align v0 frontend with approved product architecture using existing resources only
2. Canonical Product Law
Twin is the user-facing cognitive orchestrator. Agents are delegated specialists. Capabilities are governed actions. The continuity runtime provides durable execution beneath Twin. Triage controls generated writes. The Spine owns canonical truth.
Ownership chain:
User → Twin → Context Builder → Knowledge + Memory + Search → Agent/Capability Resolver → Governance → Execution → Continuity Runtime → Triage → Approved Spine Mutation → Projection Refresh → Twin Reports Outcome
The user experiences one intelligent actor: Twin. Internal services remain implementation mechanisms beneath Twin.
3. Core Workbench Spine
The Workbench is the persistent user workspace. Everything else—Twin, agents, memory, capabilities, continuity, governance—operates through the Workbench or on behalf of the Workbench.
3.1 Workbench Ownership Law
Workspace
↓
Workbench Shell
↓
Workbench Definition
↓
Role / Department / Industry Projection
↓
Entity / Relationship / Activity / Task / Signal / Evidence / Document / Artifact / Memory / Approval / Continuity
↓
Twin contextual layer
↓
Agent / Capability / Governance / Execution
Rules:
- The Workbench owns user context, role, department, industry, workspace, organization, and active session state.
- The Workbench never exposes raw database tables.
- The Workbench consumes projections from the Spine and backend services only.
- The Workbench never bypasses Governance, Triage, or Pipeline for canonical writes.
- The Workbench is the only durable surface the user returns to after leaving or refreshing.
3.2 Core Workbench Entities
These are the mandatory core entities for v0:
| Entity | Owner | Description |
|---|---|---|
| User | Tenancy | Authenticated person; owns preferences, roles, and personal context |
| Organization | Platform | Top-level tenant boundary; owns billing, policy, and governance scope |
| Workspace | Platform | Operational environment for a user or team; owns domain, department, and active connections |
| Role | Platform | Permission and capability scope; drives projection behavior |
| Department | Platform | Organizational unit; drives routing and data visibility |
| Industry | Platform | Market segment; influences schema, capability policy, and projections |
| Entity | Spine | Canonical operational object: account, contact, deal, ticket, project, knowledge item, decision, policy, capability, signal, memory, conversation |
| Relationship | Spine | Canonical relationship between entities with confidence and validity period |
| Activity | Spine | Operational primitive: task, message, meeting, call, notification, approval |
| Task | Product | Executable unit of work assigned to user, agent, or workflow |
| Note | Spine | User-authored memory or observation |
| Knowledge Document | Knowledge | Explicit reusable document with chunking and embeddings |
| Artifact | Store | Document, image, generated asset, or evidence file stored via Blob/R2 |
| Signal | Signals | Operational condition requiring attention: risk, renewal, anomaly, approval needed, insight |
| Evidence | Spine | Immutable attachment or reference tied to an entity or event |
| Event | Spine | Append-only record of every meaningful mutation with provenance |
| Governance Request | Platform | Approval, rejection, or policy decision tied to a capability or mutation |
| Continuity Session | Continuity | Durable execution context for Twin, agent, workflow, or approval wait |
| Agent Run | Agent Runtime | Delegated execution with bounded context, capability assignment, and outcome |
| Capability Invocation | Capability | Governed business action with policy evaluation, execution target, and evidence |
| Embedding/Vector Record | Knowledge | Server-side embedding for semantic retrieval of entities, memories, documents, and chunks |
3.3 Workbench Projection Contract
The Workbench receives projection responses only. Direct table access is forbidden.
interface WorkbenchProjection {
tenantId: string;
workspaceId: string;
userId: string;
role: string;
department: string;
industry?: string;
activeDomain: string;
activeSection: string;
hydration: {
stage: "instant" | "operational" | "deep" | "complete";
progress: number;
};
overview: {
activeEntities: number;
openWorkItems: number;
overdueWorkItems: number;
pendingApprovals: number;
activeSignals: number;
activeDocuments: number;
activeMemories: number;
activeCapabilities: number;
activeAgents: number;
activeContinuityItems: number;
};
entities: EntityProjection[];
relationships: RelationshipProjection[];
activities: ActivityProjection[];
tasks: TaskProjection[];
signals: SignalProjection[];
documents: DocumentProjection[];
artifacts: ArtifactProjection[];
memories: MemoryProjection[];
approvals: ApprovalProjection[];
continuity: ContinuityProjection[];
evidence: EvidenceProjection[];
events: EventProjection[];
}
3.4 Workbench State Model
Every workbench surface must support:
- Uninitialized
- Loading
- Hydrating
- Ready
- Empty
- Degraded
- Blocked
- Approval Required
- Disconnected
- Stale
- Failed
- Retrying
- Completed
The UI must never collapse these into a generic spinner or generic error.
Example:
Hydrating
The initial Salesforce account structure is ready.
Historical activities are still loading.
Twin can already analyze active opportunities.
3.5 Workbench Routing Law
auth.role + auth.department + tenant.industry + activeDomain
↓
product.workbench_definitions
↓
view_config
↓
WorkbenchShell
↓
Domain / Entity / Task / Signal / Knowledge / Memory / Approval / Continuity surfaces
Routing rules:
- Work view is strictly one chosen domain; no universal default for work.
- Personal domain has default behavior.
- Cross-functional views are explicit and governed by role and department.
- L1/L2/L4/L7 must not appear as user-facing navigation.
3.6 Workbench Shell Layout
┌─────────────────────────────────────────────────────────┐
│ Top Bar: Workspace | Search | Twin | Alerts | User │
├───────────────┬─────────────────────────┬───────────────┤
│ Domain Nav │ Main Workbench │ Twin Sidebar │
│ │ │ │
│ Home │ Projection-driven │ Ask │
│ Accounts │ operational content │ Analyze │
│ Tasks │ │ Recommend │
│ Signals │ │ Delegate │
│ Knowledge │ │ Continue │
│ Memory │ │ Review │
│ Agents │ │ Remember │
│ Capabilities │ │ │
│ Continuity │ │ │
│ Approvals │ │ │
│ Connectors │ │ │
└───────────────┴─────────────────────────┴───────────────┘
3.7 Workbench Data Flow
User intent
↓
AppShell / WorkbenchShell
↓
Context Builder
↓
Gateway / Projection Engine
↓
Spine + Knowledge + Memory + Signals + Tasks + Approvals + Continuity
↓
Governed read model
↓
Workbench surface
↓
Twin contextual layer
↓
Agent / Capability / Governance / Execution
↓
Pipeline/Triage for candidate writes
↓
Approved Spine mutation
↓
Projection refresh
↓
Workbench updates
3.8 Workbench ↔ Twin Mapping
| Workbench Section | Twin Function | Twin Reads | Twin Writes |
|---|---|---|---|
| Home | Orient, recommend | Projection overview, signals, tasks, approvals | None |
| Accounts/Entities | Explain, analyze | Entity 360, relationships, evidence, tasks, signals | Candidate memory, candidate proposal |
| Tasks | Plan, delegate, continue | Task list, continuity state, agent runs | Delegated work, continuity action |
| Signals | Explain, recommend | Active signals, entity context, knowledge | None |
| Knowledge | Explain, recommend | Documents, chunks, embeddings, entity links | None |
| Memory | Remember, review | Personal, work, organization, candidate memory | Memory candidate |
| Agents | Delegate, review | Agent registry, run state, context, evidence | Agent task |
| Capabilities | Act, plan | Capability registry, policy, approval state | Proposed action |
| Continuity | Continue, review | Workflow state, retry state, checkpoint | Continuity action |
| Approvals | Review, act | Governance requests, evidence, capability | Approval decision |
3.9 Workbench ↔ Agent/Memory/Continuity Mapping
| Workbench Event | Agent Action | Memory Action | Continuity Action |
|---|---|---|---|
| Open entity detail | Optional agent read | Read permitted memory | None |
| Twin recommends action | None | None | None |
| User approves proposal | None | None | Schedule execution |
| Twin delegates work | Execute task | Read working memory | Checkpoint/resume |
| Agent returns result | Return result | Write episodic memory | Update execution state |
| Triage review | None | Promote candidate | None |
| Continuity retry | None | None | Retry/backoff |
| Cancel execution | Pause/stop | Archive working memory | Cancel workflow |
4. IW Shared Environment Registry
All IntegrateWise applications share one centrally managed environment and secret stack. Applications do not receive raw provider credentials. They receive IntegrateWise API endpoints and client identifiers only.
4.1 Central Configuration Model
IW Shared Environment
├── Database
├── Object storage
├── Redis/cache
├── Queues
├── Vector storage
├── AI providers
├── Authentication
├── Connector credentials
└── Internal service endpoints
This registry is defined once and consumed by:
- IW Spine Network
- Connector Marketplace
- Work-Bench
- Connector Runtime
- Memory Services
- Twin
- Intelligence Services
- Development Applications
Implementation status: shared environment module scaffolded in packages/config; frontend public env surface stabilized as apps/web/src/lib/shared-env.ts. Full rotation/policy enforcement is pending while backend adapter layer is built.
4.2 Public Application Environment
Frontend and public applications receive only IntegrateWise variables from the shared module:
NEXT_PUBLIC_IW_API_URL=https://gateway.integratewise.ai
NEXT_PUBLIC_IW_AUTH_URL=
NEXT_PUBLIC_IW_CLIENT_ID=
NEXT_PUBLIC_IW_ENVIRONMENT=development
Fallback behavior:
- If
NEXT_PUBLIC_IW_API_URLis missing, the client defaults tohttps://gateway.integratewise.ai. - Seed fallback is disabled unless
NEXT_PUBLIC_IW_SPINE_SEED_FALLBACK=1.
They must not receive:
DATABASE_URLSUPABASE_URLBLOB_READ_WRITE_TOKENUPSTASH_REDIS_REST_URLCLOUDFLARE_ACCOUNT_IDR2_ACCESS_KEY_IDAI_GATEWAY_API_KEYDESCOPE_MANAGEMENT_KEY- Any other raw provider credential
4.3 Server-Side Application Environment
Server-side applications receive IntegrateWise service credentials only:
IW_API_URL=https://api.integratewise.ai
IW_SERVICE_TOKEN=...
IW_ENVIRONMENT=production
They do not receive underlying provider credentials directly. Provider credentials are injected by the central secret manager into the shared runtime.
4.4 Central Secret Manager
Central Secret Manager
↓
Environment profile
↓
Service-specific permitted secrets
Profiles:
developmenttestproduction
Each profile contains:
- Shared infrastructure endpoints
- Shared secret references
- Service-specific permissions
- Versioning and rotation policy
- Health and capability status
4.5 Service Permissions
Each service receives only the secrets it requires:
production
├── spine
├── memory
├── connectors
├── intelligence
├── marketplace
└── workbench
The central registry owns:
- Credential creation and rotation
- Environment profile promotion
- Service permission grants
- Health and capability checks
- Audit of secret access
4.6 Simple Rule
Configure infrastructure once
→ expose IntegrateWise APIs
→ reuse them across every application
The base rule is:
One centrally managed environment and secret stack for all IntegrateWise applications.
4.7 Adapter Contract
Server-side service adapters read from the central registry. They do not read from individual application environment variables.
interface ServiceAdapters {
neon: NeonAdapter;
blob: BlobAdapter;
redis: RedisAdapter;
r2: R2Adapter;
aiGateway: AIGatewayAdapter;
}
All adapters are initialized from centrally managed configuration. Application code never touches raw provider credentials.
5. Infrastructure Tools Mapping
3.1 Cloudflare Data and Edge Infrastructure
| Tool | v0 Role | Constraints | Access Pattern |
|---|---|---|---|
| D1 | Operational cache: active context, idempotency, projection snapshots, runtime state, edge operational indexes | Not canonical business truth; rebuildable from Postgres/Neon | Server-side via Gateway/Workers; browser never writes D1 directly |
| KV | Short-lived hot projections, sessions, connector status, invalidation state | Not canonical; transient and cacheable | Server-side; browser sees only projection freshness |
| R2 | Large artifacts, generated assets, vector/index files, documents, immutable evidence | S3-compatible API until Cloudflare Worker bindings are available | Server-mediated access only; signed retrieval; never expose raw R2 URLs with credentials |
| Vectorize / EmbedGoal | Embedding storage and retrieval for entities, memories, knowledge chunks | Does not own canonical truth | Server-side embedding pipeline; browser sees only search results |
3.2 External Infrastructure
| Tool | v0 Role | Constraints |
|---|---|---|
| Neon / Postgres | Canonical durable Spine, relationships, evidence, events, activities, governance artifacts | Sole authoritative source for operational truth |
| Vercel Blob | User documents and images via private access and signed/server-mediated retrieval | Client never holds write tokens |
| Upstash Redis | Cache, transient Twin context, rate limiting, sessions, live workbench state | Not primary database |
| Vercel AI Gateway | Server-side AI model routing, current model catalog, tool execution, structured responses | All AI calls server-side; keys never exposed to browser |
3.3 Infrastructure Law
- No browser component writes D1, KV, R2, Vectorize, Neon, Redis, or Blob directly.
- All data access is server-side, tenant-scoped, auditable, and provider-neutral.
- D1/KV are operational caches only. Neon/R2 are canonical.
- Failed live projections must not silently become demo seed data.
4. Environment Variable Management
4.1 Required Environment Variables
Add these through v0’s environment-variable manager. Do not place credentials in source or chat.
| Variable | Purpose | Owner |
|---|---|---|
DATABASE_URL | Neon/Postgres connection | Backend/DevOps |
BLOB_READ_WRITE_TOKEN | Vercel Blob access | Backend/DevOps |
UPSTASH_REDIS_REST_URL | Redis REST endpoint | Backend/DevOps |
UPSTASH_REDIS_REST_TOKEN | Redis REST token | Backend/DevOps |
CLOUDFLARE_ACCOUNT_ID | Cloudflare account for R2 | Backend/DevOps |
R2_ACCESS_KEY_ID | R2 access key | Backend/DevOps |
R2_SECRET_ACCESS_KEY | R2 secret key | Backend/DevOps |
R2_BUCKET_NAME | R2 bucket name | Backend/DevOps |
R2_ENDPOINT | R2 S3-compatible endpoint | Backend/DevOps |
AI_GATEWAY_API_KEY | Vercel AI Gateway key | Backend/DevOps |
4.2 Validation and Status Endpoint
Add server-only validation and a capability/status endpoint:
GET /api/v1/capabilities/status
Returns:
{
"neon": { "configured": true, "healthy": true },
"blob": { "configured": true, "healthy": true },
"redis": { "configured": true, "healthy": false, "reason": "timeout" },
"r2": { "configured": true, "healthy": true },
"aiGateway": { "configured": true, "healthy": true }
}
No secrets are exposed. Only presence and health.
4.3 Secrets Policy
- Secrets never reach client bundles or logs.
- Unavailable providers degrade to clear setup/error states.
- Frontend receives only configuration presence and health status.
5. Server-Side Service Adapters
Each provider sits behind an internal interface so existing resources can be replaced without changing workspace features.
5.1 Neon Adapter
Responsibilities:
- Durable Spine entities, relationships, evidence, events, activities
- Department/role projections
- Notes, knowledge records, workbench items
- Audit/activity events
Interface:
interface NeonAdapter {
query<T>(sql: string, params?: unknown[]): Promise<T[]>;
transaction<T>(fn: (client: NeonAdapter) => Promise<T>): Promise<T>;
}
5.2 Blob Adapter
Responsibilities:
- User documents and images
- Private access
- Signed/server-mediated retrieval
Interface:
interface BlobAdapter {
upload(key: string, body: Buffer, contentType: string): Promise<string>;
signedUrl(key: string, expiresInSeconds: number): Promise<string>;
}
5.3 Redis Adapter
Responsibilities:
- Cache
- Transient Twin context
- Rate limiting
- Sessions
- Live workbench state
Interface:
interface RedisAdapter {
get(key: string): Promise<string | null>;
set(key: string, value: string, ttlSeconds?: number): Promise<void>;
del(key: string): Promise<void>;
}
5.4 R2 Adapter
Responsibilities:
- Large artifacts
- Generated assets
- Vector/index files
- Content objects
Interface:
interface R2Adapter {
put(key: string, body: Buffer, contentType: string): Promise<void>;
get(key: string): Promise<Buffer | null>;
signedGetUrl(key: string, expiresInSeconds: number): Promise<string>;
}
5.5 AI Gateway Adapter
Responsibilities:
- Server-side model routing
- Current model catalog
- Tool execution
- Structured responses
Interface:
interface AIGatewayAdapter {
complete(prompt: string, options?: { model?: string; tools?: string[] }): Promise<string>;
stream(prompt: string): Promise<AsyncIterable<string>>;
}
5.6 Adapter Registry
interface ServiceAdapters {
neon: NeonAdapter;
blob: BlobAdapter;
redis: RedisAdapter;
r2: R2Adapter;
aiGateway: AIGatewayAdapter;
}
All adapters are initialized server-side from validated environment variables.
6. Complete End-to-End Schema
6.1 Schema Design Rules
- One source of truth per domain.
- No duplicate tables for the same concept.
- Tenant isolation enforced on every table.
- Immutable provenance on canonical entities.
- Candidate state separated from approved state.
- Embeddings stored server-side; browser never sees raw vector math.
6.2 Canonical Schemas
Use the existing sql-migrations/081_neon_workbench_spine_v1.sql as the primary Neon schema source. It already defines:
platform.tenantsplatform.tenant_configplatform.connector_connectionsplatform.capabilitiesplatform.governance_requestsplatform.outbox_eventsspine.entitiesspine.relationshipsspine.evidencespine.events- Plus knowledge, continuity, and product schemas
Supabase migration supabase/migrations/20260723000001_spine_core.sql is legacy public-schema parity and must not be treated as concurrent source of truth. Frontend migrations must align with the Neon canonical schema above.
6.3 Schema Inventory by Sidebar Section
| Sidebar Section | Primary Tables | Secondary Tables | Schema Owner |
|---|---|---|---|
| Home | spine.entities, spine.events, spine.signals | platform.tenant_config | spine / product |
| My Work | spine.entities, product.work_items, spine.relationships | spine.events | product |
| Inbox | spine.entities, spine.signals, continuity.sessions | platform.outbox_events | spine / continuity |
| Tasks | product.tasks, product.work_items, spine.entities | spine.events, continuity.sessions | product |
| My Queue | product.work_items, platform.outbox_events | continuity.sessions | product / platform |
| Approvals | platform.governance_requests, spine.events | platform.outbox_events | platform |
| Notifications | spine.events, continuity.sessions | platform.connector_connections | spine / continuity |
| Recent Work | spine.events, spine.entities | product.work_items | spine |
| Favorites | spine.entities, spine.relationships | product.work_items | spine |
| Communications | spine.evidence, spine.entities, knowledge.documents | spine.events | spine / knowledge |
| Activity Feed | spine.events, spine.activities | spine.signals | spine |
spine.evidence | spine.relationships | spine | |
| Calendar | spine.entities, spine.events | spine.signals | spine |
| Meetings | spine.entities, spine.events, continuity.sessions | spine.evidence | spine / continuity |
| Chat | spine.evidence, continuity.sessions | spine.entities | spine / continuity |
| Calls | spine.evidence, spine.events | spine.relationships | spine |
| Documents Shared | spine.evidence, knowledge.documents | r2 artifacts | spine / knowledge |
| Personal | spine.entities, spine.memories | continuity.sessions | spine / continuity |
| Notes | spine.memories, spine.evidence | r2 artifacts | spine |
| Knowledge Base | knowledge.documents, knowledge.chunks, knowledge.embeddings | spine.entities | knowledge |
| Brainstorming Sessions | continuity.sessions, spine.memories, spine.events | knowledge.documents | continuity / knowledge |
| Activity | spine.events, spine.activities | spine.signals | spine |
| Finance Manager | spine.entities, spine.signals, spine.events | platform.capabilities | spine |
| Work - Route Based on Role _ Department _ Industry | product.workbench_views, product.view_registry, spine.entities, spine.relationships | platform.tenant_config | product |
| Platform | platform.capabilities, platform.connector_connections, platform.tenant_config | platform.outbox_events | platform |
| Integration Manager | platform.connections, platform.integrations | spine.signals | platform |
| Connector Marketplace | spine_connector_registry, spine_marketplace_apps, spine_app_installs | platform.connector_connections | platform / spine |
| Activation Hub | platform.tenant_config, platform.connections, spine.entities | spine.events | platform |
| Capability Manager | platform.capabilities, platform.governance_requests | platform.outbox_events | platform |
| MCP Pool | platform.mcp_sessions, platform.mcp_tools, platform.mcp_invocations | platform.capabilities | platform |
| AI Models | platform.ai_models, platform.ai_usage | platform.tenant_config | platform |
| Knowledge | knowledge.documents, knowledge.chunks, knowledge.embeddings | spine.entities | knowledge |
| Memory & Continuity | spine.memories, continuity.sessions, spine.events | platform.governance_requests | spine / continuity |
| Automation | platform.capabilities, platform.workflows, continuity.sessions | platform.outbox_events | platform |
| Pipelines | platform.pipelines, platform.pipeline_runs, spine.entities | spine.events | platform |
| Governance | platform.governance_requests, spine.events, platform.outbox_events | platform.capabilities | platform |
| Observability | spine.events, platform.outbox_events, spine.signals | spine.activities | spine / platform |
| Administration | platform.tenants, platform.tenant_config, platform.users, platform.roles, platform.permissions | spine.events | platform |
| Organizations | platform.organizations, platform.tenant_config | spine.entities | platform |
| Users | platform.users, platform.workspace_members | spine.entities | platform |
| Roles | platform.roles, platform.role_scopes | platform.tenant_config | platform |
| Permissions | platform.permissions, platform.role_scopes | platform.capabilities | platform |
| Audit | spine.events, platform.audit_log | spine.evidence | spine / platform |
| Billing | platform.billing_accounts, platform.billing_events | platform.tenant_config | platform |
| Deployments | platform.deployments, platform.environment_config | platform.outbox_events | platform |
| API Keys | platform.api_keys, platform.tenants | platform.outbox_events | platform |
| Security | platform.security_policies, platform.audit_log | spine.events | platform |
6.4 Core Table Definitions
platform.tenants
id TEXT PRIMARY KEY,
canonical_id TEXT NOT NULL UNIQUE,
name TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
status TEXT NOT NULL DEFAULT 'active',
settings JSONB NOT NULL DEFAULT '{}',
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
platform.tenant_config
tenant_id TEXT PRIMARY KEY REFERENCES platform.tenants(id),
role TEXT NOT NULL,
department TEXT NOT NULL,
industry TEXT,
schema_version TEXT NOT NULL DEFAULT 'spine-v1',
active_domains TEXT[] NOT NULL DEFAULT '{}',
depth_matrix JSONB NOT NULL DEFAULT '{}',
capability_policy JSONB NOT NULL DEFAULT '{}',
onboarding_state TEXT NOT NULL DEFAULT 'active',
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
spine.entities
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_id TEXT NOT NULL REFERENCES platform.tenants(id),
canonical_id TEXT NOT NULL,
entity_type TEXT NOT NULL,
version INTEGER NOT NULL CHECK (version > 0),
status TEXT NOT NULL DEFAULT 'active',
name TEXT,
domain TEXT,
industry TEXT,
scope JSONB NOT NULL DEFAULT '{}',
data JSONB NOT NULL DEFAULT '{}',
metadata JSONB NOT NULL DEFAULT '{}',
provenance JSONB NOT NULL DEFAULT '{}',
valid_from TIMESTAMPTZ NOT NULL DEFAULT now(),
valid_until TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
created_by TEXT,
search_document TSVECTOR GENERATED ALWAYS AS (...),
UNIQUE (tenant_id, canonical_id, version)
spine.relationships
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_id TEXT NOT NULL REFERENCES platform.tenants(id),
source_canonical_id TEXT NOT NULL,
source_type TEXT NOT NULL,
target_canonical_id TEXT NOT NULL,
target_type TEXT NOT NULL,
relationship_type TEXT NOT NULL,
confidence NUMERIC(4,3) NOT NULL DEFAULT 1.0,
metadata JSONB NOT NULL DEFAULT '{}',
valid_from TIMESTAMPTZ NOT NULL DEFAULT now(),
valid_until TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
created_by TEXT
spine.evidence
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_id TEXT NOT NULL REFERENCES platform.tenants(id),
canonical_id TEXT,
evidence_type TEXT NOT NULL,
title TEXT NOT NULL,
excerpt TEXT,
source_provider TEXT,
source_reference TEXT,
storage_provider TEXT,
storage_key TEXT,
mime_type TEXT,
content_hash TEXT,
metadata JSONB NOT NULL DEFAULT '{}',
captured_at TIMESTAMPTZ NOT NULL DEFAULT now(),
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
spine.events
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_id TEXT NOT NULL REFERENCES platform.tenants(id),
subject_kind TEXT NOT NULL,
subject_id TEXT NOT NULL,
canonical_id TEXT,
event_type TEXT NOT NULL,
actor_type TEXT NOT NULL,
actor_id TEXT,
correlation_id TEXT,
evidence_ids UUID[] NOT NULL DEFAULT '{}',
payload JSONB NOT NULL DEFAULT '{}',
occurred_at TIMESTAMPTZ NOT NULL DEFAULT now()
platform.governance_requests
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_id TEXT NOT NULL REFERENCES platform.tenants(id),
capability_key TEXT NOT NULL,
subject_kind TEXT NOT NULL,
subject_id TEXT NOT NULL,
requested_by TEXT NOT NULL,
request_payload JSONB NOT NULL DEFAULT '{}',
decision TEXT NOT NULL DEFAULT 'pending',
decided_by TEXT,
decision_reason TEXT,
approval_token TEXT UNIQUE,
expires_at TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
decided_at TIMESTAMPTZ
platform.outbox_events
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_id TEXT NOT NULL REFERENCES platform.tenants(id),
event_type TEXT NOT NULL,
subject_kind TEXT NOT NULL,
subject_id TEXT NOT NULL,
destination_provider TEXT,
capability_key TEXT,
payload JSONB NOT NULL DEFAULT '{}',
governance_request_id UUID REFERENCES platform.governance_requests(id),
status TEXT NOT NULL DEFAULT 'awaiting_approval',
attempts INTEGER NOT NULL DEFAULT 0,
next_attempt_at TIMESTAMPTZ,
delivered_at TIMESTAMPTZ,
last_error TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
knowledge.documents
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_id TEXT NOT NULL REFERENCES platform.tenants(id),
title TEXT NOT NULL,
body TEXT,
metadata JSONB NOT NULL DEFAULT '{}',
status TEXT NOT NULL DEFAULT 'draft',
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
knowledge.chunks
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
document_id UUID NOT NULL REFERENCES knowledge.documents(id),
tenant_id TEXT NOT NULL REFERENCES platform.tenants(id),
content TEXT NOT NULL,
embedding vector(1536),
metadata JSONB NOT NULL DEFAULT '{}',
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
spine.memories
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_id TEXT NOT NULL REFERENCES platform.tenants(id),
scope TEXT NOT NULL DEFAULT 'org',
user_id TEXT,
entity_id TEXT,
kind TEXT NOT NULL DEFAULT 'note',
title TEXT,
content TEXT NOT NULL,
fields JSONB NOT NULL DEFAULT '{}',
embedding vector(1536),
visibility TEXT NOT NULL DEFAULT 'private',
source TEXT NOT NULL DEFAULT 'manual',
provenance JSONB NOT NULL DEFAULT '{}',
created_by TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
continuity.sessions
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_id TEXT NOT NULL REFERENCES platform.tenants(id),
session_type TEXT NOT NULL,
subject_id TEXT,
status TEXT NOT NULL DEFAULT 'active',
context JSONB NOT NULL DEFAULT '{}',
result JSONB NOT NULL DEFAULT '{}',
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
product.workbench_views
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_id TEXT NOT NULL REFERENCES platform.tenants(id),
role TEXT NOT NULL,
department TEXT NOT NULL,
industry TEXT,
view_key TEXT NOT NULL,
view_config JSONB NOT NULL DEFAULT '{}',
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
UNIQUE (tenant_id, role, department, industry, view_key)
7. Workspace Data and Action Layer
7.1 Data Layer
The workspace data layer is tenant-aware and server-side.
Responsibilities:
- Define and evolve schemas for users, roles, departments, workbench views, entities, links, notes, knowledge documents, files, actions, Twin suggestions, and audit records
- Provide route handlers and server actions for real CRUD and workflow operations
- Enforce tenant, role, department, and cross-functional access boundaries on every server operation
- Keep all migrations in
migrations/orsql-migrations/with canonical source in081_neon_workbench_spine_v1.sql
7.2 Action Layer
Server actions and route handlers must:
- Require authenticated tenant context
- Validate tenant and role membership before every operation
- Emit
spine.eventsfor every meaningful mutation - Write canonical state only through governed contracts
- Return projected responses, never raw internal tables
7.3 CRUD Contracts
| Action | Method | Path | Contract |
|---|---|---|---|
| List entities | GET | /api/v1/entities | Projection response |
| Get entity | GET | /api/v1/entities/:id | Entity 360 projection |
| Create entity | POST | /api/v1/entities | Governed creation |
| Update entity | PATCH | /api/v1/entities/:id | Governed mutation |
| List tasks | GET | /api/v1/tasks | Task projection |
| Create task | POST | /api/v1/tasks | Governed creation |
| Update task | PATCH | /api/v1/tasks/:id | Governed mutation |
| List memories | GET | /api/v1/memories | Memory projection |
| Create memory candidate | POST | /api/v1/memory/candidates | Candidate only |
| List knowledge | GET | /api/v1/knowledge | Knowledge projection |
| Upload artifact | POST | /api/v1/artifacts | Signed server-mediated |
| List approvals | GET | /api/v1/approvals | Approval projection |
| Decide approval | POST | /api/v1/approvals/:id/decision | Governed decision |
| Twin interact | POST | /api/v1/twin/interact | Twin contract |
| Agent create task | POST | /api/v1/agents/:id/tasks | Governed delegation |
| Continuity status | GET | /api/v1/continuity | Continuity projection |
8. Connect the UI to Real Workspace Behavior
8.1 Replacement Rules
Replace fixture-only and static-dashboard behavior with persistent flows:
- Notes: CRUD via
/api/v1/memoriesand/api/v1/memory/candidates - Knowledge Base: CRUD via
/api/v1/knowledgewith chunking and embedding pipeline - Files/Content: Upload/download via
/api/v1/artifactsthrough Blob/R2 adapters - Workbench interactions: All routed through projection APIs
- Pipeline/Account/Entity detail: Open working surface with related records, files, meetings, tasks, actions aggregated from connected tools
- Twin: Contextual inside each work surface; proactive, source-linked suggestions; explicit user-controlled execution
8.2 Role-Department-Industry Routing
Work section routing:
logged-in role + department + industry
↓
product.workbench_views lookup
↓
view_config projection
↓
domain/entity task routing
↓
entity detail surface with related records
8.3 Twin Contextual Integration
Twin is not a separate chat sidebar. Twin is contextual inside each work surface:
- Proactive suggestions based on current entity/task/document
- Source-linked evidence
- Explicit user-controlled execution
- Continuity state visible in context
9. MCP Connector Boundary
9.1 Local Implementation
- Implement and test the MCP connector contract locally in the project
- Use the supplied IntegrateWise MCP URL and tenant context only through server-side configuration
- Add provider health checks, capability discovery, tenant envelopes, auditable tool execution, and safe failure states
9.2 Public Contract
The public MCP remains the 19-tool Spine contract only:
get_my_continuityget_active_contextget_my_focusget_contextget_changesget_relatedget_historyget_commitmentsget_decisionsget_permitted_memoryget_relevant_knowledgeask_twinassign_twinget_prepared_workget_available_actionsprepare_actionget_action_planapprove_actionstore_in_spine
9.3 Marketplace Block
Marketplace publication/install remains a separate release step blocked until the Vercel team suspension is resolved or an active team owns the listing. No workaround or replacement account will be created.
10. Sidebar Structure to Schema Mapping
This is the definitive mapping of every sidebar item to backend tables, services, and API contracts.
10.1 Top-Level Navigation
| Sidebar Item | Tables | Backend Services | API Contract |
|---|---|---|---|
| Home | spine.entities, spine.events, spine.signals, platform.tenant_config | gateway, spine, projection-engine, store, signals | SharedWorkbench, /api/v1/projections/workspace |
| My Work | spine.entities, product.work_items, spine.relationships | gateway, spine, projection-engine, task-management | /api/v1/projections/workspace, /api/v1/tasks |
| Inbox | spine.entities, spine.signals, continuity.sessions, platform.outbox_events | gateway, spine, signals, continuity | /api/v1/signals, /api/v1/continuity |
| Tasks | product.tasks, product.work_items, spine.entities, spine.events | gateway, spine, task-management, workflow | /api/v1/tasks, /api/v1/projections/entity/:id |
| My Queue | product.work_items, platform.outbox_events, continuity.sessions | gateway, workflow, task-management, continuity | /api/v1/continuity, /api/v1/tasks |
| Approvals | platform.governance_requests, spine.events, platform.outbox_events | gateway, govern, workflow, task-management | /api/v1/approvals, /api/v1/approvals/:id/decision |
| Notifications | spine.events, continuity.sessions, platform.connector_connections | gateway, spine, continuity, signals | /api/v1/signals, /api/v1/continuity |
| Recent Work | spine.events, spine.entities, product.work_items | gateway, spine, projection-engine | /api/v1/projections/workspace |
| Favorites | spine.entities, spine.relationships, product.work_items | gateway, spine, projection-engine | /api/v1/projections/workspace |
10.2 Communications
| Sidebar Item | Tables | Backend Services | API Contract |
|---|---|---|---|
| Activity Feed | spine.events, spine.activities, spine.signals | gateway, spine, signals, telemetry | /api/v1/signals, /api/v1/events |
spine.evidence, spine.relationships | gateway, spine, projection-engine | /api/v1/projections/entity/:id | |
| Calendar | spine.entities, spine.events, spine.signals | gateway, spine, projection-engine, workflow | /api/v1/projections/entity/:id |
| Meetings | spine.entities, spine.events, continuity.sessions, spine.evidence | gateway, spine, continuity, projection-engine | /api/v1/projections/entity/:id |
| Chat | spine.evidence, continuity.sessions, spine.entities | gateway, spine, continuity | /api/v1/projections/entity/:id |
| Calls | spine.evidence, spine.events, spine.relationships | gateway, spine | /api/v1/projections/entity/:id |
| Documents Shared | spine.evidence, knowledge.documents, r2 artifacts | gateway, spine, knowledge, store | /api/v1/artifacts, /api/v1/projections/entity/:id |
10.3 Personal
| Sidebar Item | Tables | Backend Services | API Contract |
|---|---|---|---|
| Notes | spine.memories, spine.evidence, r2 artifacts | gateway, spine, continuity, store | /api/v1/memories, /api/v1/artifacts |
| Knowledge Base | knowledge.documents, knowledge.chunks, knowledge.embeddings, spine.entities | gateway, spine, knowledge, mcp-connector | /api/v1/knowledge, public MCP get_relevant_knowledge |
| Brainstorming Sessions | continuity.sessions, spine.memories, spine.events, knowledge.documents | gateway, continuity, knowledge, intelligence | /api/v1/twin/interact, /api/v1/memory/candidates |
| Activity | spine.events, spine.activities, spine.signals | gateway, spine, signals | /api/v1/signals, /api/v1/events |
10.4 Finance Manager
| Sidebar Item | Tables | Backend Services | API Contract |
|---|---|---|---|
| Finance Manager | spine.entities, spine.signals, spine.events, platform.capabilities | gateway, spine, projection-engine, govern | /api/v1/projections/workspace, /api/v1/capabilities |
10.5 Work - Route Based on Role _ Department _ Industry
| Sidebar Item | Tables | Backend Services | API Contract |
|---|---|---|---|
| Work (View 1..View N) | product.workbench_views, product.view_registry, spine.entities, spine.relationships, platform.tenant_config | gateway, spine, projection-engine, store | /api/v1/projections/workspace, SharedWorkbench contract |
Routing rule:
auth.role + auth.department + tenant.industry
↓
product.workbench_views
↓
view_config
↓
domain projection
10.6 Platform
| Sidebar Item | Tables | Backend Services | API Contract |
|---|---|---|---|
| Integration Manager | platform.connections, platform.integrations, spine.signals | gateway, connector, integration-management-mcp, provider-management-mcp | /api/v1/connections, /api/v1/integrations |
| Connector Marketplace | spine_connector_registry, spine_marketplace_apps, spine_app_installs, platform.connector_connections | gateway, integration-management-mcp, mcp-pool | /api/v1/marketplace/apps, /api/v1/connections |
| Activation Hub | platform.tenant_config, platform.connections, spine.entities, spine.events | gateway, tenants, pipeline, spine | /api/v1/activation/complete-onboarding |
| Capability Manager | platform.capabilities, platform.governance_requests, platform.outbox_events | gateway, mcp-pool, integration-management-mcp, govern | /api/v1/capabilities, /api/v1/approvals |
| MCP Pool | platform.mcp_sessions, platform.mcp_tools, platform.mcp_invocations, platform.capabilities | gateway, mcp-connector, mcp-pool | Internal /api/v1/mcp/* only; admin observability only |
| AI Models | platform.ai_models, platform.ai_usage, platform.tenant_config | gateway, intelligence, hermes, iw-agent-runtime | /api/v1/models, /api/v1/ai/usage |
10.7 Knowledge
| Sidebar Item | Tables | Backend Services | API Contract |
|---|---|---|---|
| Knowledge | knowledge.documents, knowledge.chunks, knowledge.embeddings, spine.entities | gateway, spine, knowledge, mcp-connector | /api/v1/knowledge, public MCP get_relevant_knowledge |
10.8 Memory & Continuity
| Sidebar Item | Tables | Backend Services | API Contract |
|---|---|---|---|
| Memory & Continuity | spine.memories, continuity.sessions, spine.events, platform.governance_requests | gateway, spine, continuity, knowledge, govern | /api/v1/memory, /api/v1/memory/candidates, /api/v1/continuity |
10.9 Automation
| Sidebar Item | Tables | Backend Services | API Contract |
|---|---|---|---|
| Automation | platform.capabilities, platform.workflows, continuity.sessions, platform.outbox_events | gateway, mcp-pool, integration-management-mcp, govern, hermes, workflow | /api/v1/capabilities, /api/v1/continuity |
10.10 Pipelines
| Sidebar Item | Tables | Backend Services | API Contract |
|---|---|---|---|
| Pipelines | platform.pipelines, platform.pipeline_runs, spine.entities, spine.events | gateway, pipeline, connector, normalizer | /api/v1/pipelines, /api/v1/projections/entity/:id |
10.11 Governance
| Sidebar Item | Tables | Backend Services | API Contract |
|---|---|---|---|
| Governance | platform.governance_requests, spine.events, platform.outbox_events, platform.capabilities | gateway, govern, workflow, task-management | /api/v1/approvals, /api/v1/approvals/:id/decision |
10.12 Observability
| Sidebar Item | Tables | Backend Services | API Contract |
|---|---|---|---|
| Observability | spine.events, platform.outbox_events, spine.signals, spine.activities | gateway, spine, signals, telemetry, workflow | /api/v1/signals, /api/v1/events |
10.13 Administration
| Sidebar Item | Tables | Backend Services | API Contract |
|---|---|---|---|
| Organizations | platform.organizations, platform.tenant_config, spine.entities | gateway, admin, tenants | /api/v1/admin/organizations |
| Users | platform.users, platform.workspace_members, spine.entities | gateway, admin, tenants | /api/v1/admin/users |
| Roles | platform.roles, platform.role_scopes, platform.tenant_config | gateway, admin, tenants | /api/v1/admin/roles |
| Permissions | platform.permissions, platform.role_scopes, platform.capabilities | gateway, admin, tenants | /api/v1/admin/permissions |
| Audit | spine.events, platform.audit_log, spine.evidence | gateway, spine, admin, govern | /api/v1/audit/events |
| Billing | platform.billing_accounts, platform.billing_events, platform.tenant_config | gateway, billing, tenants | /api/v1/admin/billing |
| Deployments | platform.deployments, platform.environment_config, platform.outbox_events | gateway, admin, telemetry | /api/v1/admin/deployments |
| API Keys | platform.api_keys, platform.tenants, platform.outbox_events | gateway, admin, tenants | /api/v1/admin/api-keys |
| Security | platform.security_policies, platform.audit_log, spine.events | gateway, admin, govern | /api/v1/admin/security |
11. Twin Mapping by Sidebar
Twin is available across all operational routes. Twin actions, memory use, capability resolution, and continuity state are mapped per section in Section 10.
Canonical Twin actions:
- Ask: reads context, memory, knowledge; no writes
- Analyze: reads projections and evidence; optional agent read
- Recommend: resolves capabilities; policy preview only
- Plan: resolves capabilities and agents; draft only, no write
- Delegate: creates agent task; assigns context and capabilities; continuity checkpoint
- Act: invokes governed capability; requires approval when policy demands
- Continue: resumes continuity workflow; reconciles state
- Review: inspects governance, execution, memory, evidence
- Remember: creates memory candidate; requires triage approval
12. Agent Mapping by Sidebar
Agent activation occurs only through Twin or governed workflow.
| Sidebar Section | Agent Responsibility | Backend Service |
|---|---|---|
| Agents surface | Agent selection, task creation, capability assignment, monitoring | agent-registry, iw-agent-runtime |
| Delegated work | Execution monitoring, outcome summary, learned outcomes | task-management, workflow, continuity |
| Twin handoff | Agent results returned to Twin for summarization and triage | intelligence, hermes |
| Twin sidebar | Agent status within Twin context | iw-agent-runtime, continuity |
Agent invariants:
- Agents do not read canonical Spine directly.
- Agents do not write canonical state.
- Agents do not promote their own memory.
- Agents do not approve their own actions.
- Agents may not bypass Twin, Governance, or Triage.
13. Memory Mapping by Sidebar
| Sidebar Section | Memory Scope | Backend Table | Promotion Path |
|---|---|---|---|
| Notes | Personal Memory, User Work Memory | spine.memories | Candidate → Triage → Governance → Approved |
| Knowledge Base | Organization Memory | knowledge.documents, knowledge.chunks | Candidate → Triage → Pipeline → Spine |
| Brainstorming Sessions | Candidate Memory | continuity.sessions, spine.memories | Candidate → Triage |
| Memory & Continuity | All scopes | spine.memories, continuity.sessions | Candidate → Triage → Governance |
| Twin sidebar | Relevant memory refs | spine.memories | Read-only projection |
14. Continuity Mapping by Sidebar
| Sidebar Section | Continuity State | Backend Table | User-Facing Language |
|---|---|---|---|
| My Queue | queued, waiting-approval | product.work_items, platform.outbox_events | Twin is continuing this work |
| Approvals | waiting-approval | platform.governance_requests | Twin needs your decision |
| Continuity | scheduled, running, retrying, paused, completed, failed | continuity.sessions, workflow | Twin is working / waiting / retrying / completed |
| Notifications | continuity updates | spine.events, continuity.sessions | Twin completed the delegated work |
| Twin sidebar | active continuity IDs | continuity.sessions | Twin will resume after dependency completes |
15. Capability Mapping by Sidebar
| Sidebar Section | Capability Responsibility | Backend Table | Backend Service |
|---|---|---|---|
| Platform / Capability Manager | Discovery, enablement, policy | platform.capabilities | mcp-pool, integration-management-mcp |
| Twin sidebar | Resolve, invoke, monitor, summarize | platform.capabilities | mcp-pool, govern, hermes |
| Automation | Workflow and capability orchestration | platform.workflows, platform.capabilities | workflow, mcp-pool, govern |
| Governance | Approval-required capabilities | platform.governance_requests | govern, workflow |
Capability Registry hidden fields:
- Execution target
- Risk classification
- Approval requirements
- Audit requirements
16. Spine Network Mapping by Sidebar
| Sidebar Section | Spine Network Responsibility | Backend Tables | Backend Services |
|---|---|---|---|
| Home | Governed read models, Entity 360, timeline, tasks, signals | spine.entities, spine.relationships, spine.signals, spine.events | spine, projection-engine, store, gateway |
| Work | Entity and relationship projections | spine.entities, spine.relationships, spine.events | spine, projection-engine |
| Knowledge | Knowledge entities and chunks | knowledge.documents, knowledge.chunks, spine.entities | knowledge, spine |
| Memory & Continuity | Memory and session projections | spine.memories, continuity.sessions, spine.events | spine, continuity |
| Administration | Tenant config, schema config, connection config | platform.tenants, platform.tenant_config, platform.connector_connections | tenants, pipeline, spine |
Spine invariants:
- No browser component writes Neon directly.
- Pipeline promotion is the sole canonical Spine writer.
- D1/KV are operational caches only.
- Failed live projections must not silently become demo seed data.
17. Duplicate Removal and Canonical Source Rules
- Use
sql-migrations/081_neon_workbench_spine_v1.sqlas the canonical Neon schema. - Supabase public schema migration is legacy parity only.
- Do not create second Spine tables in frontend-owned server routes.
- Do not duplicate tenant/organization/user schemas across apps.
- Do not introduce new top-level architecture categories outside the documented 60-core inventory.
18. Verification and Rollout
18.1 Verification Checklist
- Type checks/build pass
- Migration validation against
081_neon_workbench_spine_v1.sql - Adapter health checks for Neon, Blob, Redis, R2, AI Gateway
- CRUD tests for entities, tasks, memories, knowledge, artifacts
- Tenant isolation tests for all schemas
- AI tool-call tests through AI Gateway adapter
- Browser tests for:
- Notes
- Knowledge Base
- File upload
- Pipeline/entity detail
- Contextual Twin suggestions
- Role-based workbench routing
- Confirm secrets never reach client bundles or logs
- Confirm unavailable providers degrade to clear setup/error states
18.2 Rollout Sequence
- Merge backend adapters and validation endpoint
- Apply canonical migrations
- Wire frontend to real APIs by sidebar section
- Enable Twin contextual surfaces
- Enable memory, triage, agent, continuity, and capability surfaces
- Remove provisional frontend-owned provisioning APIs
- Validate marketplace publication prerequisites without publishing
18.3 Post-Vercel Restoration
After Vercel access is restored:
- Sync environment variables
- Deploy and verify production bindings
- Complete Marketplace publication flow
19. Constraints
- Existing resources are connected by credentials; no new provider account is created automatically.
- Cloudflare Workers/bindings cannot be provisioned from this project without Cloudflare account authorization; this phase uses R2 through its S3-compatible server API. Worker deployment follows once Cloudflare access is available.
- Vercel Marketplace installation and MCP listing publication cannot complete while the owning Vercel team is suspended.
- All data access is server-side, tenant-scoped, auditable, and provider-neutral.
- L1/L2/L4/L7 must not appear as user-facing product navigation.
- Legacy runtime aliases must not be introduced as new canonical frontend dependencies.
20. Acceptance Criteria
20.1 Frontend Ownership
- No provider SDK imported in frontend
- No direct provider API calls
- No direct canonical database reads
- No service-role credentials in frontend runtime
- No direct Spine writes
- No direct memory promotion
- No direct agent capability invocation outside platform contracts
20.2 Twin
- Twin is available across all operational Workbench routes
- Twin receives active context
- Twin responses include evidence
- Twin can propose actions
- Twin can delegate to agents
- Twin displays continuity state
- Twin submits candidates to Triage
20.3 Agents
- Agent activation occurs only through Twin or governed workflow
- Agent receives bounded context
- Agent receives explicit capabilities
- Agent execution is auditable
- Agent cannot write canonical state
- Agent result returns to Twin
20.4 Memory
- All memory is scoped
- Candidate memory is distinguishable from approved memory
- Promotion requires Triage
- Organisation memory requires governance
- Agent memory is isolated by run and policy
20.5 Capabilities
- Capabilities are business-oriented
- Every capability declares risk
- Every write capability passes policy
- Destructive capability requires approval
- Execution results produce evidence
20.6 Continuity
- Long-running work survives a user session
- Approval waits are durable
- Retry state is visible
- Agent pause/resume is supported
- Completion returns to Twin
20.7 Spine
- Canonical writes pass through governed mutation contracts
- Every write includes provenance
- Projections refresh after approved changes
- Twin and agents only read projections