Current

Tenant Spine: Fortress, Operational Cache and Flow Model

Status: current derived implementation contract
Date: 2026-07-29

Authority: ARCHITECTURE_LOCK.md → IMPLEMENTATION_CONTRACT_v1.1.md → CONSOLIDATED_PRODUCT_PLATFORM_CONTRACT_v1.2.md
Implementation: migrations/035_canonical_spine_schema_fortress.sql → 037_pure_entity_spine_tables.sql → 038_tenant_lifecycle_entity_tables.sql → 039_tenant_network_scope_and_promotion_flow.sql → 040_scope_global_events_provenance_and_evidence.sql → 041_app_category_entity_domain_classification.sql → 042_real_tenant_rls_and_runtime_scope.sql

1. Resolved model

IntegrateWise stores one tenant-level entity model. It does not create a
database schema, table family, or cache partition for a department.

Tenant
→ Tenant Account
→ Spine Network
→ canonical entities, relationships, events and evidence
→ RBAC-scoped Workbench projections

Role, department, industry, team, work objective and active context determine
the projection a user receives. They never determine where canonical truth is
physically stored.

This preserves cross-functional work. A single account, person, task, document,
risk, decision or outcome can be projected in the relevant user views without
copying its truth into a Sales, Finance, Customer Success, Engineering or any
other department database.

The supplied Spine references are applied as follows:

  • Account Intelligence's field-rich tables become typed, tenant-scoped entities
    and relationships; they are not a separate customer-success database.
  • The Workbench IA's tables, views and pages remain three different primitives:
    entities hold truth; views are RBAC lenses; pages/canvases hold narrative and
    may propose governed changes.
  • The Mental Model's evidence chain, connector schema expansion and contextual
    Twin are retained, subject to the frozen Gateway, Pipeline and Governance
    boundaries.
  • The Company Wiki's company, initiative, work-item, decision and knowledge
    lifecycles are modeled as tenant lifecycle events with evidence and exit
    criteria, not merely user activity logs.

2. Two stores, one source of truth

StoreTechnology and ownerContainsDoes not contain
Canonical Spine / FortressNeon Postgres, written only by Pipeline promotion / Governed Spine Writersgoverned entity state, typed relationships, version history, lifecycle events, evidence links, approvals, audit, promotion records and canonical change outboxshort-lived UI state, a browser-owned source of truth, raw provider credentials, or unreviewed AI memory as truth
Operational SpineD1 and KV, managed by Pipeline and Projection Enginebounded entity/projection cache, active context, idempotency, sync receipts, connector health, candidate staging and expiry-bound runtime activityindependent truth, permanent durable memory, authority decisions, or a direct path into canonical tables

The operational store is a cache and staging boundary. It is rebuildable from
Fortress and R2 evidence. If an operational record matters after its expiry, it
must be promoted through the governed path; it must not be retained merely
because it happened to exist in a cache.

Fortress commit
→ canonical change outbox
→ Pipeline / Projection Engine
→ D1/KV operational cache and invalidation
→ Workbench projection

Operational candidate or connector intake
→ evidence + promotion queue
→ policy and required approval
→ Governed Spine Writer
→ Fortress commit

3. Tenant scope and stable identifiers

Every tenant-owned entity, relation, event, evidence link, promotion, cache
entry and log uses this scope envelope.

Scope concernPhysical fieldMeaning
Isolation boundarytenant_idThe tenant that owns the record and policy context. Always required.
Tenant operating accounttenant_account_idReferences spine_tenant_accounts.account_id. This is the tenant's root account identifier.
Tenant Spine Networkspine_network_idReferences the tenant-account-specific spine_networks record. It groups the entity graph, connector bindings, events and projections for that operating network.
Workspace contextworkspace_idOptional active working scope within the tenant; never replaces tenant_id.
Entity identity<entity>_id and canonical_idStable row identity and deduplication/merge identity.
Connector install bindingconnector_binding_idThe authenticated user/tenant/provider-workspace installation binding.
Connector connectionspine_connection_idThe canonical connection for one provider connection. It is lineage for imported data, not the tenant network root.
Traceabilitytrace_id, correlation_id, source_flowThe end-to-end route through a Flow A-D operation.

Every entity additionally carries a provider-neutral classification address:

app_category → business_domain → lifecycle_stage

app_category classifies the entity source, business_domain is the RBAC
classification, and lifecycle_stage is the cross-domain routing key. The
full registry is APP_CATEGORY_ENTITY_DOMAIN_CLASSIFICATION.md.

The distinction matters:

spine_network_id     = the tenant's IW-Spine-Network
spine_connection_id  = one connector/provider connection inside that network

spine_connection_id remains correct for connector-specific lineage. It cannot
substitute for spine_network_id, because a tenant network has many connector
connections and also includes user-created, imported and governed entities.

tenant_account_id is deliberately used on tenant-scoped tables rather than a
generic account_id: spine_accounts.account_id already identifies a business
account/customer entity. The two are different concepts and must not collide.

4. Entity-first lifecycle model

Every durable lifecycle object gets a typed canonical entity table. Generic
spine_entities remains the compatibility graph/identity layer while typed
tables become the canonical materialized home for their entity families.

Lifecycle familyCanonical typed tablesTypical lifecycle events
Tenant identity and authorityspine_organizations, spine_workspaces, spine_users, spine_memberships, spine_roles, spine_permissions, spine_tenant_accounts, spine_networkstenant created, membership granted, role changed, policy changed
People and organizational operating modelspine_persons, spine_teams, spine_processes, spine_objectives, spine_projects, spine_outcomesperson identified, team formed, objective set, project advanced, outcome verified
Work and coordinationspine_tasks, spine_work_items, spine_workflows, spine_approvals, spine_decisions, spine_timeline_eventswork created, assigned, blocked, proposed, approved, completed
Communications and evidencespine_messages, spine_calendar_events, spine_meetings, spine_calls, spine_documents, spine_conversations, spine_activities, spine_evidence_links, spine_provenancemessage ingested, meeting completed, document linked, evidence attached
Continuity and knowledgememory_items, memory_promotion_queue, org_memory_items, knowledge_documents, knowledge_chunks, spine_signalsobservation triaged, memory proposed, promoted, superseded, signal resolved
Customer and commercial lifecyclespine_accounts, spine_leads, spine_opportunities, spine_contracts, spine_subscriptions, spine_invoices, spine_renewals, spine_orders, spine_campaigns, spine_vendorslead qualified, opportunity advanced, contract signed, invoice paid, renewal decided
Product, delivery and operationsspine_products, spine_features, spine_releases, spine_sprints, spine_tickets, spine_incidents, spine_budgets, spine_expenses, spine_assetsrequirement proposed, feature built, release verified, incident resolved, expense approved
Integration and platform controlspine_connector_catalog, integration_connections, spine_connector_installations, integration_provider_schemas, integration_schema_mappings, spine_schema_version_eventsconnector authorized, binding validated, schema discovered, sync completed, scope revoked

The Account Intelligence reference maps cleanly into this tenant model:

Reference entityTenant canonical representation
Account Masterspine_accounts
People Teamspine_persons + tenant-scoped relationships to spine_accounts
Business Contexttyped business-context entity associated to an account through spine_relationships
Strategic Objectivesspine_objectives
Capabilities and API Portfoliospine_assets / capability registry plus typed relationships
Value Streams and Initiativesspine_processes and spine_projects
Health Metrics and Signalsspine_signals, timeline events and entity-specific measurement records
Risk Registertyped risk entity linked to affected entities and mitigation work
Engagement Logspine_activities, linked messages, meetings and calls
Success Plan and Task Managerspine_projects / plans plus spine_tasks and spine_work_items

The typed entity expansion is additive. A future table is added because it owns
a stable business entity and lifecycle—not because a user interface introduces
a new tab.

5. Flow A-D: one routing model, four kinds of material

All flows carry the same scope envelope. Flow classification decides handling
and promotion policy; it never creates a departmental partition.

FlowMaterialOperational handlingCanonical promotionCanonical output
A — structured operational dataProvider records, tuples, state changes, metrics and lifecycle updatesConnector intake, idempotency, schema validation and a bounded normalized candidateDeterministic normalization creates a candidate. The promotion queue and policy decide whether it can be system-promoted or requires review.Typed entity/version/relationship/event rows with external identity, provenance and connector lineage.
B — documents and communicationsEmails, messages, meetings, calls, transcripts, documents, attachments and raw provider artifactsPreserve raw evidence in R2; cache only retrieval metadata and extracted candidate links in D1/KVTriage and policy promote only validated entity links, extracted actions, decisions, signals or knowledge.Evidence record, source link, permitted structured entity changes and searchable knowledge references.
C — AI and cognitive contextTwin sessions, plans, reasoning outputs, agent tool results, brainstorming and memory candidatesStore bounded session/context and proposal staging. No Flow C component writes canonical business truth.Always through Triage → promotion record → the required human approval → Governed Spine Writer.Approved memory, knowledge, decision, task, signal or other explicitly typed entity with cited evidence.
D — platform binding and controlAuthenticated identity, tenant/account/network resolution, RBAC, consent, connector bindings, schema compatibility, policy, entitlement and runtime configurationVerify and cache only short-lived resolved context; record operational health and idempotency stateGoverned platform write for binding/control records. Flow D validates the authority envelope for A/B/C; it does not partition business truth.Connector and schema binding records, consent, policy/audit and resolved scope for every other flow.

Flow event record

Every material event is represented in spine_flow_events with:

tenant_id + tenant_account_id + spine_network_id
+ flow (A | B | C | D)
+ phase (received | normalized | triaged | queued | approved | promoted |
         projected | reconciled | rejected | expired)
+ subject entity/event + connector/binding lineage + trace/correlation IDs

This is the requested operational record for system, connector, agent and
human activity. It is broader than a user action log and supports a complete
trace from external source to Workbench projection and back to a verified
outcome.

6. Promotion and sync rules

Operational to Fortress

  1. A connector, user action, page/canvas proposal, or agent produces an
    operational candidate.
  2. The candidate includes the scope envelope, evidence references, affected
    entity IDs, source flow, trace/correlation IDs and proposed operation.
  3. It is recorded in spine_promotion_queue; raw content remains in R2 or its
    bounded operational reference, never copied blindly into a truth table.
  4. The policy determines the appropriate route:
    • deterministic, low-risk Flow A data may be promoted by the governed
      system route once schema and provenance are valid;
    • Flow B derived meaning, Flow C cognitive material, material record merges,
      decisions, memory and consequential changes require the applicable human
      approval;
    • a rejected or expired candidate never becomes canonical.
  5. Only the Governed Spine Writer commits canonical entities, versions,
    relationships, evidence links and audit records atomically.

No browser, page/canvas, Twin, connector runtime, MCP tool or operational D1
worker writes a Fortress entity table directly.

Fortress to operational

  1. A canonical commit creates spine_canonical_change_outbox record and a
    spine_flow_events entry.
  2. Pipeline and the Projection Engine consume the outbox, invalidate affected
    D1/KV keys and build fresh, RBAC-safe cache entries.
  3. A cache receipt records the canonical entity version applied.
  4. The Workbench requests the projected shape through Gateway; it never reads
    Fortress or a connector/provider model directly.

An operational cache miss is a partial-evidence/read-rebuild condition. It is
never permission to substitute seed data or to fabricate a new truth record.

7. Evidence, audit and lifecycle accountability

NeedCanonical record
What happened and where in the routespine_flow_events, spine_timeline_events
What durable entity changedtyped entity row + spine_entity_versions
Why it changedspine_provenance, spine_evidence_links, source/evidence reference
Who/system made or requested itactor_type, actor_id, connector and binding lineage in the flow event
Who authorized itspine_decisions, spine_approvals, spine_audit_log
How an operational candidate became truthspine_promotion_queue linked to decision/approval and target entity
How truth became a current viewspine_canonical_change_outbox plus operational sync receipt/cache version

The required line of evidence is therefore:

source artifact or user/system action
→ Flow A/B/C/D event
→ candidate and evidence
→ promotion decision / approval where required
→ canonical entity version
→ outbox
→ operational projection cache
→ RBAC-safe Workbench view

8. Projection and RBAC

The Workbench receives a projection, never a raw table or a department schema.
The Projection Engine applies:

  1. resolved tenant, tenant account and Spine Network;
  2. authenticated user membership and permissions;
  3. workspace, object, relationship and context scope;
  4. entity visibility, field visibility and capability policy;
  5. role/department/industry only as view-composition inputs.

This makes cross-projections safe: the same canonical account can appear as a
renewal risk, an invoice context, a project dependency, a support incident
relationship or an executive outcome only when the reader's RBAC policy allows
it.

9. Implementation and enforcement sequence

039_tenant_network_scope_and_promotion_flow.sql establishes the root account
and network tables, the universal entity scope map, promotion queue, canonical
outbox and all-flow log. It also adds tenant_account_id and
spine_network_id to existing tenant-scoped rows without rewriting legacy
data. 040_scope_global_events_provenance_and_evidence.sql applies the same
envelope to the generic event, provenance and evidence logs that predate the
tenant-scoped model.

041_app_category_entity_domain_classification.sql adds the versioned
classification registries and entity classification record. It gives the
Projection Engine a domain filter and lifecycle routing key without turning
department into storage.

The companion D1 migration creates only rebuildable cache/staging/receipt
tables. It carries the same scope envelope but cannot become a source of
truth.

The safe cutover is:

  1. create and backfill tenant account/network records;
  2. attach scope rows to existing canonical entities and active connector
    bindings;
  3. make Gateway/Pipeline require the complete scope envelope on new writes;
  4. backfill/repair legacy rows conservatively;
  5. add validated NOT NULL/foreign-key enforcement only after the migration
    report has no unresolved active records;
  6. switch operational cache readers and writers to the new scoped cache tables;
  7. prove isolation with cross-tenant, cross-account, cross-network,
    cross-connector and RBAC projection tests.

No department migration is part of this sequence.

10. Closed four-flow lifecycle

The four flows operate through one closed lifecycle in Development, Customer
Zero and Customer Production. Flow D is the authority envelope for every Flow
A, B or C event; it is not a fourth business-data partition.

External source / Workbench / AI or MCP consumer
→ Gateway and Flow D authority binding
→ raw evidence preservation + immutable scoped event
→ Flow A deterministic normalization
  or Flow B deterministic extraction/link preparation
  or Flow C adaptive Triage
→ Operational Spine candidate/cache
→ promotion policy + required human approval
→ Governed Spine Writer
→ Neon Fortress
→ canonical change outbox
→ Operational Spine/search/projection rehydration
→ RBAC-scoped Workbench
→ contextual Silent Twin
→ Capability → Governance → approval token → Hermes
→ provider outcome
→ re-ingestion → verification → reconciliation
→ Governed Spine Writer → Neon Fortress

This sequence resolves several wording traps:

  • Customer Zero is an operating tenant and isolated environment, not a
    separate product, database model or control-surface application.
  • Twin is the AI Co-worker behavior. “Co-worker” is positioning for the
    Twin when it accepts delegated work; it is not another runtime beside Twin.
  • Triage prepares and routes candidates. It does not approve its own
    candidate and does not commit canonical truth.
  • A Projection is not a copy of truth. D1/KV projection state may be stale
    or rebuilt; the versioned Neon entity remains authoritative.
  • Aging never causes truth promotion. Promotion is caused by evidence,
    schema/provenance validity, policy and required authority.

11. OODA, search and context organization

The Four Buttons remain the exact user-facing OODA grammar:

OODAUser controlRuntime responsibility
ObserveStore in SpineCapture an observation through Gateway, evidence preservation and the governed write path.
OrientAsk Your TwinAssemble permitted context and retrieve/rank relevant entity, relationship, timeline, document, memory and evidence state.
DecideAssign Your TwinCreate a bounded assignment, draft, proposal or immutable action plan. No external mutation occurs.
ActApprove Twin's ActionGovernance validates authority and issues the token used by Hermes for execution.

Normalizer and Triage prepare material that can later be searched, but they are
not the whole search runtime:

Flow D tenant/RBAC binding
→ relational + relationship + timeline + full-text + vector retrieval
→ evidence/freshness/authority filtering
→ relevance and work-priority ranking
→ bounded Active Context
→ Projection Engine or Twin

Tenant and permission filtering occurs before ranking. Search indexes and
embeddings are derived structures; they never own truth. A material click may
refresh or reuse Active Context, but it does not automatically start expensive
model reasoning or open a permanent Twin panel.

Triage participates in context organization by classifying, linking,
deduplicating and prioritizing incoming unstructured/cognitive candidates.
Projection-time search participates by cumulatively retrieving the already
permitted material needed for the active work. These are complementary
responsibilities, not one combined authority.

12. Retention, aging and historical evidence

Retention is policy by material class and tenant. The values below are safe
defaults to validate, not a replacement for tenant, contractual, regulatory,
deletion or legal-hold policy.

Data classAuthoritative storeDefault operational postureAging effect
Sessions, temporary signals and transient contextD1/KVMinutes to 7 daysExpire; reconstruct where possible. Never promote because of age.
Active operational projection/cache stateD1/KVUp to 30 days by classRebuild from Fortress/outbox or expire when no longer active.
Candidate memory, knowledge, decisions and proposalsOperational staging + evidence referenceUntil reviewed, rejected or policy-expiredPromotion requires the applicable policy and human authority.
Canonical entities, relationships, outcomes and auditNeon FortressTenant/record-class retention policyVersion, supersede, export or delete only through governed retention operations.
Raw artifacts and immutable evidence bytesR2Evidence policy, lifecycle and legal holdTransition storage class, retain or delete through explicit R2 policy; Spine retains governed metadata and lineage.
Embeddings and search indexesVector/search servicesSame or shorter lifetime than their permitted sourceDelete/rebuild when the source is deleted, revoked, reclassified or re-embedded.

The long-horizon tier is a Historical Evidence/Analytics tier, not a second
canonical Spine. R2 lifecycle policies may transition evidence to lower-cost
storage classes, while bucket locks may enforce minimum retention. Neon remains
the authoritative metadata, policy, lineage and entity record. Tenant export,
right-to-delete, legal hold and residency requirements must be resolved before
any fixed production retention schedule is enabled.

13. Development, Customer Zero and Customer Production

All three environments run the same logical contracts and four flows. They do
not share data, credentials, queue state, cache state, evidence or deployment
authority.

EnvironmentData and purposeCanonical truthOperational stateRelease rule
DevelopmentSynthetic fixtures, approved redacted reproductions and test providersDisposable Development Neon branch/database when persistence tests require itDedicated Development D1/KV/R2/queues/searchCode/configuration may be promoted after tests. Development data rows never promote.
Customer ZeroIntegrateWise's real internal operationsDedicated Customer Zero Neon database/branch and credential boundaryDedicated Customer Zero D1/KV/R2/queues/search and auditProves production behavior. Only reviewed code/configuration/policy may move toward Customer Production; internal memory/data never does.
Customer ProductionExternal tenant data and customer-authorized providersProduction Neon with enforced tenant scope/RLS, or a dedicated customer cell where requiredProduction tenant-scoped D1/KV/R2/queues/search; dedicated resources for contractual isolationReceives versioned releases only. No customer data flows into Customer Zero or another tenant.

There is no per-department D1, Neon schema, Worker or Spine. Department,
industry and role remain projection dimensions. A dedicated tenant cell may be
selected for contractual isolation, residency, scale or regulatory reasons;
that is a deployment policy, not a different logical schema.

The default compute plane is the shared, stateless Cloudflare Platform services
with trusted tenant resolution at Gateway and tenant-aware bindings underneath.
Durable Objects may coordinate strongly consistent per-tenant or per-workspace
runtime state. Workers for Platforms is optional and is used only when
IntegrateWise must deploy and isolate customer-supplied or agent-generated code,
such as a governed coding-agent or extension runtime. Ordinary multi-tenant
Gateway, Pipeline, Projection, Governance and Hermes execution does not require
one Worker script per tenant.

Cloudflare Workers may connect to the Neon Fortress directly with the approved
driver or through Hyperdrive. This does not change storage authority: D1 remains
bounded operational state and Neon remains the Fortress.

Current Cloudflare implementation references:

14. Cross-environment release and replay

Only release artifacts cross environment boundaries automatically:

Development proof
→ reviewed code/schema/configuration/policy artifact
→ Customer Zero validation
→ reviewed production release
→ Customer Production

Data movement follows stricter rules:

  • Customer Zero data and memory never seed Customer Production.
  • Customer Production tenant data never enters Customer Zero or another
    customer tenant.
  • A production incident may become a Development reproduction only after
    authorization, redaction and synthetic reconstruction. It is a new
    Development ingestion event, not a cross-environment Spine promotion.
  • Aggregated product telemetry may enter an internal observability scope only
    under an explicit telemetry/privacy contract. It is not tenant continuity or
    business truth.
  • Every replay is scoped, idempotent, auditable and prevented from performing
    provider side effects unless its governed replay policy explicitly permits
    them.

No dev=true, cz=true or prod=true row marker is an isolation boundary.
Isolation is enforced by environment-specific resources plus the complete
tenant/account/network authority envelope.