High Level Design — v1.0 — April 2026

Nexus — System Architecture

This document describes the high-level architecture of the Nexus sovereign process orchestration platform: component boundaries, data flows, RBAC model, multi-tenancy, and deployment topologies.

01 — Four-Scale Architecture

The core UX metaphor is a single canvas navigable at four levels of detail. Each level exposes a different domain of control; keyboard navigation (breadcrumb, Esc to ascend) keeps context visible.

MACRO
Workflow Canvas
Pipeline graph: nodes and edges. Drag-and-drop from node palette. Wire connections. Activate / run pipeline. Real-time node state animations via SSE.
URL: /pipelines/{id}/canvas
MICRO
Class / Schema Editor
Double-click a Form or Store node at MACRO level. Opens entity class definition: fields list, field types (BDTs), RBAC visibility matrix per class. Breadcrumb: Workflow / Node.
URL: /pipelines/{id}/nodes/{node_id}/schema
NANO
Property / Field Editor
Double-click a field row at MICRO level. Opens property editor: type (BDT), default, required per role, enum options per role, tooltip, validation rule references.
URL: /pipelines/{id}/nodes/{node_id}/schema/{class}/{field}
PICO
Rule Editor
Click a validation rule from NANO level. Opens Nexus rule editor: condition expression, message, severity (ERROR/WARN/INFO), rule version history, rule tests.
URL: /rules/{rule_id}

02 — Component Map

Core Services

Engine
Nexus API
FastAPI 0.111. Handles pipeline CRUD, org/team/user management, run scheduling, SSE telemetry, node type registry. SQLAlchemy models on PostgreSQL (prod) or SQLite (dev).
Port: 8010
Admin
Admin Panel
Flask 3. CRUD UI for all entities: orgs, teams, users, pipeline definitions, rule editor, run log viewer. Session auth. Template-rendered.
Port: 8011
Canvas
Nexus Canvas
WORMWOOD_APP.html — 4-level blueprint graph editor (10,022 lines). Delivered: node palette (44 types), drag-and-drop, edge drawing, node property editor with breadcrumb navigation, save/load/new pipeline (all wired to live API), run controls with SSE live animation, run history panel, Classes/Properties/Rules level tabs (wired to live API), 9-step animated Nesto demo + 4 additional scenarios. Open gaps: per-node-type property schemas (GAP-11), USE_CASES hardcoded array (GAP-12), NANO/PICO rule wiring (GAP-13). See NEXUS_COMPONENT_STATUS.html Section 8.1.
Static HTML / React build target

Platform Components

Forms
ChameleonV2
React + TypeScript schema-driven form engine. Pulls class definition from Nexus Form node at runtime. Renders per-RBAC-role field layout. deltaPrism BDT controls. Flow-level CSS token styling.
npm: chameleonv2 v1.2.2 — Repo: chameleonv2/
Data
deltaPrism
Entity graph store + BDT registry. Three modes: Warehouse (graph store + audit), Data Source (ingest/egress), GPU Transform (cuDF execution plan compilation). Proven: 21,327 entities at 21ms/entity.
Port: 15000 — Repo: deltaPrism/
OCR
Atlas OCR
Document field extraction. Called by OCR node in pipeline. Returns structured field map per document type (Passport, Medical, POLO Certificate). Results feed directly into ChameleonV2 Document Reference BDT auto-fill.
Port: TBD — M-NEXUS-BL01

Node Type Registry

Node TypeCategoryInputsOutputsStatus
FormIngestSchema ref, RBAC role config, style refEntity payloadGAP-02 (ChameleonV2)
OCRTransformDocument reference, document typeField mapM-NEXUS-BL01
ValidateTransformEntity payload, rule set refEntity + validation resultNexus engine
AI TransformTransformEntity payload, prompt template, model configTransformed entityM-NEXUS-BL04
StoreEgressEntity payload, class ref, deltaPrism configEntity IDM-NEXUS-E1
ForwardEgressEntity payload, endpoint config, authResponse statusM-NEXUS-E2
Human GateControlEntity payload, role required, form variantDecision + entityM-NEXUS-E3
Trigger (Webhook)IngestHTTP requestRaw payloadM-NEXUS-BL11
Trigger (Schedule)IngestCron expressionTick eventM-NEXUS-BL12
SMS IngestIngestSMS gateway webhookMessage payloadM-NEXUS-BL02
Voice Ingest + TranscribeIngest+TransformAudio file or webhookTranscript textM-NEXUS-BL03
Bank CSV IngestIngestCSV file path or uploadBankEntry entity listM-NEXUS-BL07
PDF GenerateEgressEntity payload, template refPDF fileM-NEXUS-BL08

03 — Multi-Tenancy Model

All resources are scoped to an Organisation. The hierarchy:

LevelModelKeyNotes
1Organisationorg_slugTop-level tenant. All resources scoped here.
2OrgTeamteamHas RBAC roles. Belongs to one Org.
3OrgUseruser → teamTeam membership. One user can be in multiple teams.
3API KeySHA-256 hashPrefixed with org_slug. One-time display on create.
2Pipelinepipeline_idPipeline definition graph JSON. Belongs to Org.
3NodeTypetype registryPer-org or global. 16 built-in types.
3PipelineRunrun historyStatus, telemetry, per-node logs.

Org slugs are validated: lowercase, alphanumeric + hyphen, 3-40 chars. API keys are prefixed with the org slug for routing. Multiple orgs can share a Nexus instance or each run their own (sovereign).

04 — RBAC Model

RoleScopeChameleonV2 Form BehaviourPipeline Access
SubmitterEntity-levelSubmitter variant: personal fields editable, compliance fields read-onlySubmit form only
OperatorTeam-levelOperator variant: all fields visible, can edit non-sensitiveRun pipeline, view run log
ReviewerTeam-levelReviewer variant: decision form, read-only entity view, approve/reject/request-more controlsResolve Human Gate nodes
AdminOrg-levelAdmin variant: all fields, plus config overridesCRUD pipelines, manage users
Compliance OfficerOrg-levelAudit variant: all fields read-only, full audit trail panel visibleView-only all runs
SystemInternalNot renderedAutomated nodes (OCR, Validate, Store, Forward)

RBAC role config is stored per-field at NANO scale and consumed by ChameleonV2 at form render time. The pipeline definition includes a role_map: maps user to role for each pipeline run context. Human Gate nodes require a specific role to resolve; the pipeline run pauses until that role acts.

05 — Key Data Flows

Worker Onboarding Flow (Nesto)

AI Employee Flow (ENDO Irena)

Offer Drafting Flow (ARC)

06 — ChameleonV2 Integration Architecture

Runtime Schema Pull

When ChameleonV2 renders a Form node URL, it calls GET /pipelines/{id}/nodes/{node_id}/schema on the Nexus API. The response includes the class definition (fields, types, RBAC visibility per field) and the BDT control map. ChameleonV2 renders the appropriate form variant for the authenticated user's role.

BDT Control Map

BDT controls are resolved at render-time from the deltaPrism BDT registry (GET /bdt/{type}). Controls: Currency (locale + exchange rate), Document Reference (upload + OCR auto-fill), Entity Link (live graph query picker), GeoPoint (map picker), Classification (live enum list from deltaPrism), Computed (read-only formula expression).

MilestoneDeliverableStatus
M-NEXUS-CV-1ChameleonV2 pulls schema from Nexus Form node at runtimeQueued
M-NEXUS-CV-2RBAC layer: per-role field visibility, editability, required override, enum filtering, layout variantsQueued
M-NEXUS-CV-3deltaPrism BDT controls: Currency, DocumentReference + Atlas OCR auto-fill, EntityLink, GeoPoint, Computed, ClassificationQueued
M-NEXUS-CV-4Flow-level styling: style_ref in pipeline definition drives CSS token override per deploymentQueued

07 — deltaPrism Integration Architecture

Mode 1
Warehouse
Entity graph store with full audit trail. Every write records: entity ID, class, field values, change delta, run ID, timestamp, user ID. Queryable by entity ID, class, run, or time range. Used by: Store nodes, log viewer, ChameleonV2 EntityLink BDT.
Mode 2
Data Source
Ingestion from CSV, JSON, API. Egress to downstream systems. CDC (Change Data Capture) triggers downstream Nexus pipeline nodes on entity mutation. Used by: Bank CSV Ingest node, Gmail ingest, scheduled sync flows.
Mode 3
GPU Transform
Nexus schema + Pico rules compiled to RAPIDS cuDF execution plan. Multi-step transform chains execute on GPU without per-rule round-trips. Proven at 21,327 entities / 21ms per entity. Used by: high-volume bulk transform nodes.

08 — SSE Telemetry & Run Observability

The Nexus API publishes Server-Sent Events on GET /pipelines/{id}/runs/{run_id}/events. The canvas subscribes at run start and updates node visual state in real time.

Event TypePayload FieldsCanvas Effect
node_startednode_id, timestampNode border pulses blue
node_waitingnode_id, waiting_forNode amber pulse, waiting badge
node_awaiting_humannode_id, role_required, form_urlNode purple pulse, role badge, form link shown
node_completenode_id, duration_ms, entity_count, output_refNode fill green, data packet animated along outgoing edges
node_failednode_id, error_message, error_codeNode red border, error badge, log panel opens
run_completerun_id, total_duration_ms, entity_countTopbar run indicator shows completion summary

09 — Deployment Topologies

Local Dev
Single Machine
SQLite, no Docker required. python -m uvicorn nexus.main:app --port 8010 + python admin/app.py. deltaPrism and ChameleonV2 run separately on their own ports.
Docker Compose
All-in-One
docker-compose.yml + docker-compose.postgres.yml. PostgreSQL, Nexus API, Admin Panel, deltaPrism, ChameleonV2. Single docker compose up -d. Suitable for demos and staging.
Sovereign Cloud
Private Infra
ECS task definition (scripts/taskdef.json). Can deploy to any container-capable host. PostgreSQL on RDS or self-hosted. nginx reverse proxy. Air-gapped option: no outbound required except to configured Forward node endpoints.

10 — API Surface Summary

RouterBase PathKey EndpointsAuth
Orgs/orgsCRUD orgs, teams, users. POST /orgs/{slug}/api-keys (returns raw key once)Bearer API key
Pipelines/pipelinesCRUD pipelines, node types. POST /pipelines/{id}/run. GET /pipelines/{id}/runs. GET /pipelines/runs/{run_id}Bearer API key
Execution Events/pipelinesGET /pipelines/{id}/runs/{run_id}/events (SSE stream)Bearer API key
Schema/pipelinesGET /pipelines/{id}/nodes/{node_id}/schema. PUT (update class definition)Bearer API key
Rules/rulesCRUD rules, rule versions. POST /rules/{id}/testBearer API key
Health/healthGET /health (live check), GET /health/readyNone

11 — App Catalog & Config Layer (REQ-CFG-001)

Replaces the hardcoded _USECASE_META dict in routes_orgs.py and the hardcoded USE_CASES array in WORMWOOD_APP.html. All app metadata is stored in three new database tables and served via GET /apps/catalog.

New Tables

TablePurposeKey Columns
app_catalogOne row per deployed applicationslug, display_name, domain, status_code, version, tenant_id, config JSONB
app_componentPer-app component versions and connectionsapp_id FK, component_name, component_version, deployment_env, color_hex, connection_config JSONB
app_actionButtons rendered on each app cardapp_id FK, label, action_type (navigate/pipeline/external), target, sort_order

New Endpoint

MethodPathResponseAuth
GET/apps/catalogArray of app objects with components[], actions[], pipeline_countBearer API key
GET/apps/catalog/{slug}Single app objectBearer API key

Card Visual — Jigsaw Composition (REQ-VIS-001)

Each app card in the Orchestrator and Dashboard renders a visual jigsaw panel from components[]:

12 — Multi-Tenancy Architecture (REQ-MT-001)

The current model (Section 03) scopes resources to an Organisation. O6 introduces a Tenant as a top-level isolation boundary above Organisations, enabling multiple independent clients on a single Nexus instance.

Hierarchy

New Table: tenant

ColumnTypeNotes
idINTEGER PK
nameVARCHAR(100)Display name
slugVARCHAR(50) UNIQUEURL-safe identifier
brandingJSONBWhite-label config — logo, colors, app_name (REQ-WL-001)
encryption_key_refVARCHAR(200)External key vault reference (REQ-ENC-001)
subscription_tierVARCHAR(20)free / pro / enterprise (REQ-AFF-001)
affiliate_codeVARCHAR(50)Referral tracking
created_atTIMESTAMPDEFAULT NOW()

app_catalog.tenant_id FK references tenant.id. All queries scoped via tenant_id where multi-tenancy is enforced.

13 — RBAC — O6 Additions (REQ-RBAC-001)

Extends the role model in Section 04 with platform-level and tenant-level scopes, plus Nesto-specific roles.

RoleScopePermissions
platform_adminGlobalAll apps, all tenants, config, publishing
tenant_adminTenantAll apps within tenant, user management
app_adminAppPipeline CRUD, component config, user assignment
app_userAppExecute pipelines, view dashboards
app_viewerAppRead-only
nesto_hr_adminNesto appFull CRUD on worker records, approval authority
nesto_reviewerNesto appReview queue, approve/reject, no create
nesto_auditorNesto appRead-only, full audit trail
nesto_submitterNesto appCreate worker records, no approve

14 — App Versioning & Publishing (REQ-VER-001)

Lifecycle

DRAFT → REVIEW → STAGING → PUBLISHED → DEPRECATED
StateDescriptionTransition Gate
DRAFTUnder construction — not visible to tenantsCreator decision
REVIEWInternal review — visible to platform_adminCreator submits
STAGINGUAT in progress — visible to tenant_admin of test tenantplatform_admin approves
PUBLISHEDLive — visible to all tenants with subscriptionAll components healthy, tests pass, RBAC configured
DEPRECATEDEnd-of-life — no new tenants, existing tenants warnedplatform_admin sets with migration path

Versioning: semver (MAJOR.MINOR.PATCH) stored in app_catalog.version. Published apps are immutable — a new version creates a new app_catalog row. The status_code column drives visibility rules across all screens.

15 — Data Encryption (REQ-ENC-001)

Affiliate (third-party) app instances require per-tenant data encryption in deltaPrism with external key storage and MFA-gated key release.

LayerComponentDetail
EncryptionAES-256-GCMApplied at deltaPrism data-at-rest layer per tenant
Key storageExternal vaultAWS KMS / Azure Key Vault / HashiCorp Vault — reference stored in tenant.encryption_key_ref
Key release gateMFAVault will not release key without MFA confirmation from tenant_admin
Key rotationAnnual minimumRotation event logged in Liber Cogitatus as a Binding Decision

16 — White Labelling & Affiliate Programme (REQ-WL-001, REQ-AFF-001)

White Labelling

Per-tenant branding stored in tenant.branding JSONB:

KeyTypeEffect
logo_urlstring (URL)Replaces Nexus logo in all screens for this tenant
primary_colorhex stringSets --hub-accent CSS variable
app_namestringReplaces "Nexus" in page titles and headers
favicon_urlstring (URL)Browser tab icon
footer_textstringFooter attribution (default: "Powered by Nexus")
hide_nexus_brandingbooleanEnterprise only — removes all UV/Nexus references

Scope: Dashboard and Workspace screens apply tenant branding. Orchestrator always shows Nexus branding (admin tool). Login screen applies tenant branding when accessed via tenant subdomain.

Affiliate Programme

TierAppsPipelinesWhite-label
Free13No
Pro5UnlimitedNo
EnterpriseUnlimitedUnlimitedYes

Revenue share tracked per tenant.affiliate_code. Affiliate codes issued by platform_admin.

17 — Environment Topology Model (REQ-ENV-002)

Each Nexus org supports multiple named deployment environments. Environments are stored in _tbl_org_environments and exposed via the Environments API. The App Management page (APP_MGMT.html) provides lifecycle controls per environment.

Environment Lifecycle

StatusMeaningAllowed Actions
runningAll components respondingstop, restart, backup, upgrade, downgrade
stoppedIntentionally offlinestart
degradedPartial response — one or more components failingrestart, backup
unknownNo health data yet (default after seed)start, restart

Environment Topology per Org

Navigation Flow: Hub → App Management → Workspace

TriggerFromToURL
Click org cardHub DashboardApp ManagementAPP_MGMT.html?org={slug}&skin={skin}
Open App CTA buttonApp ManagementWorkspaceNEXUS_APP.html?org={slug}&skin={skin}&base={url}
Back to Hub buttonApp ManagementHub DashboardNEXUS_APP.html (session state preserved)
Right-click org cardHub DashboardApp Management (direct)APP_MGMT.html?org={slug}
Click health dotHub DashboardApp Management (env tab)APP_MGMT.html?org={slug}

API Endpoints (Environment Management)

MethodPathPurpose
GET/orgs/{slug}/environmentsList all environments for org
POST/orgs/{slug}/environmentsCreate new environment
GET/orgs/{slug}/environments/{env}Single environment detail
POST/orgs/{slug}/environments/{env}/startStart stopped environment
POST/orgs/{slug}/environments/{env}/stopStop running environment
POST/orgs/{slug}/environments/{env}/restartStop then start
POST/orgs/{slug}/environments/{env}/backupSnapshot data + config
POST/orgs/{slug}/environments/{env}/upgradeDeploy new version
POST/orgs/{slug}/environments/{env}/downgradeRoll back to prior version
GET/orgs/{slug}/environments/{env}/backupsList snapshots