Unclassified

Canonical Entity Constitution

Status: SUPERSEDED / ABSORBED — historical subsystem constitution. Current authority: INTEGRATEWISE_ARCHITECTURE.md v2.2.
Scope: Stable entity shapes, relationships, state machines, and field contracts for the Adaptive Spine.
Canonical Owner: IntegrateWise Platform
Last Verified: 2026-07-20


1. Purpose

This document defines the canonical entity layer. All projections, capabilities, connectors, and Twin behavior depend on these contracts.

Change this document only through platform amendment.


2. Entity Registry

export type EntityType =
  | "account"
  | "contact"
  | "opportunity"
  | "deal"
  | "lead"
  | "renewal"
  | "risk"
  | "task"
  | "meeting"
  | "ticket"
  | "incident"
  | "bug"
  | "sprint"
  | "release"
  | "deployment"
  | "invoice"
  | "expense"
  | "payment"
  | "campaign"
  | "attribution"
  | "content"
  | "form"
  | "ad"
  | "feature"
  | "epic"
  | "story"
  | "feedback"
  | "pull_request"
  | "commit"
  | "knowledge_article"
  | "document"
  | "note"
  | "goal"
  | "project"
  | "initiative"
  | "workflow"
  | "process"
  | "vendor"
  | "contract"
  | "purchase_order"
  | "spend_analysis"
  | "system"
  | "vulnerability"
  | "employee"
  | "student"
  | "course"
  | "assignment"
  | "generated_insight"
  | "timeline_entry"
  | "action_proposal"
  | "action_run"
  | "approval_token";

3. Canonical Field Contracts

3.1 Account

FieldTypeRequiredDescription
idstringyesSpine entity id
tenant_idstringyesTenant partition
namestringyesAccount name
industrystringnoIndustry vertical
health_scorenumberno0-100
arrnumbernoAnnual recurring revenue
mrrnumbernoMonthly recurring revenue
renewal_datestringnoISO date
riskstringnoRisk level
statusstringyesEntity status
sourcestringnoAuthoritative source connector
created_atstringyesSpine timestamp
updated_atstringyesSpine timestamp

3.2 Opportunity / Deal

FieldTypeRequiredDescription
idstringyesSpine entity id
account_idstringyesLinked account
stagestringyesPipeline stage
amountnumbernoDeal value
probabilitynumberno0-100
close_datestringnoISO date
ownerstringnoAssigned owner
next_stepstringnoNext action
sourcestringnoAuthoritative source connector

3.3 Task

FieldTypeRequiredDescription
idstringyesSpine entity id
subjectstringyesTask title
statusstringyesTask status
prioritystringnoTask priority
assigneestringnoAssigned user
due_datestringnoISO date
entity_typestringnoLinked entity type
entity_idstringnoLinked entity id
sourcestringnoAuthoritative source connector

3.4 Ticket

FieldTypeRequiredDescription
idstringyesSpine entity id
account_idstringyesLinked account
statusstringyesTicket status
prioritystringyesTicket priority
assigneestringnoAssigned agent
sla_statusstringnoSLA state
sourcestringnoAuthoritative source connector

4. Relationship Contracts

RelationshipFromToCardinalityDescription
account.contactsaccountcontact1:NAccount contacts
account.opportunitiesaccountopportunity1:NAccount opportunities
account.renewalsaccountrenewal1:NAccount renewals
account.risksaccountrisk1:NAccount risks
account.ticketsaccountticket1:NAccount tickets
deal.contactsdealcontact1:NDeal contacts
task.accounttaskaccountN:1Task account link
ticket.accountticketaccountN:1Ticket account link
sprint.taskssprinttask1:NSprint tasks
feature.epicfeatureepicN:1Feature epic link

5. State Machines

5.1 Opportunity / Deal

new → qualified → proposal → negotiation → won
                                 → lost

5.2 Task

open → in_progress → blocked → done
                         → cancelled

5.3 Ticket

new → open → pending → solved → closed
       → escalated

5.4 Sprint

planned → active → completed → archived
                → cancelled

6. Invariants

  1. Every entity has tenant_id, source, created_at, updated_at.
  2. The Spine never overwrites authoritative external data without a traceable sync mutation.
  3. Entity ids are immutable.
  4. Relationships are resolved through Spine ids, not external system ids alone.
  5. State transitions emit a timeline entry.