Architecture / Specification

Deployment Matrix

The Deployment Matrix defines how Nexus MVC layer contracts map to concrete technology stacks, enabling any combination of Controller, Model, View, and Orchestration implementations to be deployed together.

NEXUS-DM-01 v1.0 May 2026 Authority: AS-1

1. Core Principle: Tech-Stack Independence

Nexus components communicate through layer contracts, not direct API calls. A Controller does not know whether its Model is PostgreSQL or Snowflake. A View does not know whether its Controller is a Python FastAPI service or an AWS Lambda function. Each layer implements a contract that defines input/output formats and determinism guarantees.

Why Tech-Stack Independence?

Enterprise clients have existing infrastructure investments. A bank running mainframe COBOL cannot adopt a product that requires Kubernetes. A startup on AWS Serverless will not install on-premises Docker. Tech-stack independence means the same business logic (rulesets, flows, data model, RBAC) deploys to any infrastructure without modification. The NSD describes what to deploy; the Deployment Matrix describes where it can go.

The practical consequence: a Nesto implementation running on AWS Lambda + Snowflake + React uses the same NSD as a Nesto implementation running on Power Platform + SharePoint + PowerApps. The rulesets are identical. The data model is identical. The RBAC is identical. Only the deployment targets change.


2. Layer Contracts

2.1 Controller Contract C-1.0

AspectRequirement
InputJSON payload: { "entity_class": "...", "record": {...}, "ruleset_id": "..." }
OutputJSON payload: { "result": {...}, "rules_applied": [...], "execution_ms": N }
DeterminismSame input + same ruleset = same output. No randomness. No external state dependency.
Formula LanguageMust parse and evaluate the complete Wormwood formula syntax.
BDT ValidationMust validate all fields against their BDT constraints before rule execution.
Error HandlingMust return structured error objects, never crash with unhandled exceptions.

2.2 Model Contract M-1.0

AspectRequirement
InputEntity operations: { "operation": "create|read|update|delete", "entity_class": "...", "data": {...} }
OutputOperation result: { "success": bool, "record": {...}, "version": N }
LifecycleMust enforce lifecycle class restrictions (IMMUTABLE_IDENTITY fields cannot be updated).
RBACMust enforce field-level RBAC: masked fields return ****, hidden fields omitted.
AuditMust record who changed what and when. Append-only audit log.

2.3 View Contract V-1.0

AspectRequirement
InputEntity schema from NSD data_model + style tokens from NSD style section.
OutputRendered form / table / dashboard that the user interacts with.
RBACMust respect field-level RBAC: read-only fields are not editable, hidden fields are not rendered.
StyleMust apply global_tokens and per-flow style overrides.
ValidationMust validate BDT constraints client-side before submission.

2.4 Orchestration Contract O-1.0

AspectRequirement
InputFlow graph definition from NSD flows section + trigger event.
OutputFlow run record: { "run_id": "...", "status": "...", "node_results": [...] }
Graph ExecutionExecute nodes in topological order. Respect ConditionBranch routing.
Human GatesPause flow at ApprovalGate nodes, resume on human decision.
DeterminismSame graph + same input + same gate decisions = same execution path.

Why Contract-Based MVC?

Traditional MVC frameworks bind all three layers to one technology (Rails: Ruby everywhere, Django: Python everywhere). Nexus MVC contracts decouple the layers so that a React View can consume data from a Snowflake Model via a Lambda Controller. The contract is the interface boundary. This is analogous to how HTTP APIs decouple client and server — but applied at the architectural layer level with determinism and RBAC guarantees that HTTP alone does not provide.


3. Deployment Target Matrix

3.1 Controller Implementations

target_stackImplementationFormula EngineConformance
python-fastapiWormwood Python + FastAPINative Python evalCL-3
aws-lambdaWormwood Python on LambdaNative Python evalCL-3
azure-functionsWormwood Python on Azure FunctionsNative Python evalCL-2
snowflake-snowparkWormwood Snowpark UDFsSQL CASE translationCL-2
databricks-pysparkWormwood PySpark pipelinesSpark expression evalCL-2
ms-office-vbaWormwood VBA macro libraryVBA formula transpilerCL-1
power-platformWormwood PowerFx componentPowerFx formula transpilerCL-1
docker-onpremWormwood Docker containerNative Python evalCL-3
bare-metal-onpremWormwood systemd serviceNative Python evalCL-3
mainframe-zosWormwood COBOL copybooksCOBOL evaluation logicCL-1

3.2 Model Implementations

target_stackImplementationLifecycle EnforcementConformance
delta-prism-pythondeltaPrism graph + FastAPINative graph constraintsCL-3
postgresqlPostgreSQL + triggersCHECK constraints + triggersCL-3
snowflakeSnowflake tables + streamsStream policies + UDFsCL-2
databricks-delta-lakeDelta Lake + Unity CatalogColumn constraintsCL-2
azure-cosmos-dbCosmos DB + stored proceduresSP-based enforcementCL-2
aws-neptuneNeptune graph + GremlinProperty constraintsCL-2
sharepoint-listsSharePoint Online listsColumn validation formulasCL-1
ms-accessAccess database + formsInput masks + validation rulesCL-1
excel-worksheetsExcel named tablesData validation + protectionCL-1
db2-mainframeDB2 on z/OSCHECK constraints + triggersCL-1

3.3 View Implementations

target_stackImplementationStyle SupportConformance
chameleonv2-reactChameleonV2 React SPAFull CSS custom propertiesCL-3
chameleonv2-umdChameleonV2 UMD bundleFull CSS custom propertiesCL-3
power-appsPowerApps Canvas AppTheme variablesCL-1
sharepoint-spfxSPFx web partsFluent UI themingCL-2
excel-formsExcel input forms + VBACell formattingCL-1
cli-terminalTerminal / console interfaceANSI colorsCL-1
pdf-staticStatic PDF reports (ReportLab)Typography + colorsCL-1

3.4 Orchestration Implementations

target_stackImplementationGate SupportConformance
nexus-runtime-pythonNexus Python runtimeFull (webhook + polling)CL-3
aws-step-functionsAWS Step Functions ASLCallback tasksCL-3
azure-logic-appsAzure Logic AppsApproval connectorsCL-2
power-automatePower Automate flowsApproval actionsCL-1
airflow-prefectAirflow / Prefect DAGsManual triggersCL-2
databricks-workflowsDatabricks WorkflowsTask dependenciesCL-2
jcl-mainframeJCL job streamsManual step (WTOR)CL-1

4. Mix-and-Match Deployment Examples

Cloud-Native SaaS

For SaaS vendors deploying multi-tenant applications on AWS.

C: aws-lambda M: postgresql V: chameleonv2-react O: aws-step-functions

Microsoft Enterprise

For organisations standardised on Microsoft 365 with Power Platform licensing.

C: power-platform M: sharepoint-lists V: power-apps O: power-automate

Data Lake Analytics

For data engineering teams running compliance scoring on large datasets.

C: snowflake-snowpark M: snowflake V: chameleonv2-react O: airflow-prefect

On-Premises Docker

For security-conscious organisations that require all data on-site.

C: docker-onprem M: postgresql V: chameleonv2-umd O: nexus-runtime-python

Spreadsheet Prototype

For rapid prototyping or small teams without IT infrastructure.

C: ms-office-vba M: excel-worksheets V: excel-forms O: (manual)

Mainframe Integration

For legacy financial institutions running core systems on IBM z/OS.

C: mainframe-zos M: db2-mainframe V: cli-terminal O: jcl-mainframe

Azure Cosmos Graph

For Azure-first organisations with complex entity relationships.

C: azure-functions M: azure-cosmos-db V: sharepoint-spfx O: azure-logic-apps

Databricks Lakehouse

For data teams using Databricks for ETL, ML, and operational analytics.

C: databricks-pyspark M: databricks-delta-lake V: chameleonv2-react O: databricks-workflows

Hybrid Cloud + On-Prem

Controller in the cloud for scalability, data stays on-premises for compliance.

C: aws-lambda M: delta-prism-python V: chameleonv2-react O: nexus-runtime-python

PDF Report Pipeline

Batch processing with static output for audit and compliance reporting.

C: python-fastapi M: postgresql V: pdf-static O: nexus-runtime-python

Why Mix-and-Match?

No single technology stack is optimal for all deployment scenarios. A bank needs mainframe compatibility. A startup needs serverless cost efficiency. A government agency needs on-premises data residency with cloud-based computation. The mix-and-match model means Nexus is not a product that requires adoption of a specific technology — it is a product that adapts to whatever technology the client already has. The NSD carries the business logic; the Deployment Matrix determines where each layer runs.


5. Conformance Testing

Every target stack implementation must pass a suite of conformance tests to validate that it correctly implements the layer contract. Tests are grouped into categories with pass/fail verdicts.

CategoryCodeDescription
Rule DeterminismCT-RULESame input + same rules = same output (100 random seeds)
Formula CoverageCT-FORMAll Wormwood formula constructs evaluate correctly
BDT ValidationCT-BDTAll BDT constraint types enforced (min, max, regex, enum)
Lifecycle EnforcementCT-LIFEIMMUTABLE_IDENTITY blocks updates, OPERATIONAL_EVENT blocks deletes
RBAC EnforcementCT-RBACHidden fields not returned, masked fields show ****
Audit TrailCT-AUDITEvery mutation produces an audit record with who/what/when
Flow ExecutionCT-FLOWDAG execution follows topological order, gates pause correctly
Style TokensCT-STYLEView renders with correct colours, fonts, border-radius
Error HandlingCT-ERRInvalid input returns structured error, never crashes
PerformanceCT-PERFRule evaluation completes within SLA for batch sizes

5.1 Conformance Levels

LevelRequirementSuitable For
CL-1CT-RULE + CT-FORM + CT-BDT pass. Core rule evaluation works.Prototyping, internal tools, non-regulated use cases
CL-2CL-1 + CT-LIFE + CT-RBAC + CT-ERR pass. Data integrity and access control guaranteed.Production workloads, departmental apps, moderate compliance
CL-3All 10 test categories pass. Full platform capabilities.Regulated industries, SaaS, multi-tenant, audit-sensitive

Why Tiered Conformance?

Not every deployment needs full audit trails. An Excel prototype for a startup does not need the same conformance guarantees as a bank's production compliance engine. Tiered conformance allows Nexus to be deployed on constrained platforms (Excel, Access, SharePoint) at CL-1, while reserving CL-3 for enterprise production. Clients see exactly what each platform supports and can make informed infrastructure decisions.


6. Component Versioning

Each Nexus component follows SemVer (MAJOR.MINOR.PATCH). Contract versions change only on MAJOR bumps.

ComponentVersionContractStatus
Wormwood Engine0.2.0C-1.0Active
deltaPrism0.1.0M-1.0Active
ChameleonV21.2.2V-1.0Active
Nexus Runtime0.1.0O-1.0Active
Wormwood Admin0.2.0n/aActive
Atlas OCR0.1.0n/aDeclared

7. Compatibility Matrix

Specifies which component versions are compatible with each other. A deployment is valid only if all component versions appear in the same compatibility set.

Compatibility SetWormwooddeltaPrismChameleonV2Runtime
CS-1 (current)0.2.x0.1.x1.2.x0.1.x

8. Batch and Parallel Execution

The Controller contract supports batch mode: submitting an array of records for evaluation in a single request. Target stacks with native parallelism (Snowpark, PySpark, Step Functions) can evaluate records concurrently. Target stacks without parallelism (VBA, Access) evaluate sequentially. The contract guarantees identical results regardless of execution mode.

Why Batch as a Contract Feature?

Enterprise use cases involve thousands or millions of records per run (end-of-month compliance checks, bulk invoice validation). A Controller that only handles one record at a time requires the Orchestration layer to loop — adding latency and complexity. By making batch a first-class contract feature, the Controller implementation can optimise internally (PySpark broadcasts rules across executors, Snowpark runs UDFs in parallel) while the caller always sends the same payload shape.


9. Component Capability Catalogue

Each layer declares its capabilities as a structured set. The NSD references capability codes to determine which features are available on the selected target stack.

9.1 Controller Capabilities (C-CAP)

CodeCapabilityDescription
C-CAP-01Rule ExecutionExecute rulesets against entity records
C-CAP-02Formula EvaluationParse and evaluate Wormwood formulas
C-CAP-03BDT ValidationValidate fields against BDT constraints
C-CAP-04Batch ProcessingProcess arrays of records in one request
C-CAP-05Priority OrderingExecute rules in priority order
C-CAP-06Technology ScopingFilter rules by technology scope tag
C-CAP-07Dependency ChainsExecute dependent rules in correct order
C-CAP-08ScoringGenerate compliance/risk scores
C-CAP-09Hot ReloadReload rulesets without restart
C-CAP-10Rule VersioningTrack rule version per execution
C-CAP-11Explain ModeReturn step-by-step formula evaluation trace
C-CAP-12Dry RunEvaluate rules without writing results
C-CAP-13Parallel EvalEvaluate independent rules concurrently
C-CAP-14EDR ProfilingGenerate entity-driven requirement profiles
C-CAP-15Lua RulesExecute Lua-based enrichment rules
C-CAP-16API Key AuthAuthenticate via API key headers
C-CAP-17Health CheckReport service health and version

9.2 Model Capabilities (M-CAP)

CodeCapabilityDescription
M-CAP-01Entity CRUDCreate, read, update, delete entity records
M-CAP-02Lifecycle EnforcementBlock operations violating lifecycle class
M-CAP-03RBAC FilteringApply field-level RBAC on read
M-CAP-04Audit TrailAppend-only mutation log
M-CAP-05Graph RelationshipsStore and traverse entity relationships
M-CAP-06Version HistoryTrack all record versions
M-CAP-07Bulk ImportImport thousands of records in one operation
M-CAP-08Schema MigrationMigrate data model on NSD update
M-CAP-09Encryption at RestEncrypt masked/sensitive fields
M-CAP-10Backup ExportExport all data as NSD-compatible snapshot
M-CAP-11Search IndexFull-text search across entity fields

9.3 View Capabilities (V-CAP)

CodeCapabilityDescription
V-CAP-01Dynamic FormsRender forms from entity class schema
V-CAP-02RBAC RenderingShow/hide/mask fields per role
V-CAP-03Client ValidationValidate BDT constraints before submit
V-CAP-04Style TokensApply global theme from NSD style section
V-CAP-05Table ViewsTabular listing with sort/filter/pagination
V-CAP-06Flow DashboardShow pipeline run status and history
V-CAP-07Gate UIRender approval forms for ApprovalGate nodes
V-CAP-08File UploadUpload documents for OCR/IngestNode processing
V-CAP-09Responsive LayoutAdapts to mobile, tablet, desktop
V-CAP-10AccessibilityWCAG 2.1 AA compliance
V-CAP-11LocalisationMulti-language support via NSD string tables
V-CAP-12Offline ModeQueue submissions when offline, sync on reconnect

9.4 Orchestration Capabilities (O-CAP)

CodeCapabilityDescription
O-CAP-01DAG ExecutionExecute flow graphs in topological order
O-CAP-02Human GatesPause at ApprovalGate, resume on decision
O-CAP-03Conditional RoutingBranch on ConditionBranch node expressions
O-CAP-04Retry LogicAutomatic retry with backoff on node failure
O-CAP-05Timeout ControlPer-node and per-flow timeout limits
O-CAP-06Run HistoryPersistent record of all flow executions
O-CAP-07Webhook TriggersStart flows from external webhook events
O-CAP-08Scheduled TriggersCron-based flow scheduling
O-CAP-09Parallel NodesExecute independent branches concurrently
O-CAP-10Sub-Flow CallsOne flow triggers another as a node

Why a Capability Catalogue?

When the NSD specifies a deployment target, the DevOps Service checks whether the target stack supports all capabilities required by the NSD's flows and data model. If a flow uses OCRNode but the selected Controller does not implement C-CAP-15 (Lua Rules for OCR preprocessing), the deployment plan fails with a clear error: "Target ms-office-vba does not support C-CAP-15 (Lua Rules)." This is a compile-time check for deployments — catching incompatible combinations before they reach production.


Architecture Summary

Design DecisionProblem AddressedMechanism
Layer contractsTechnology lock-inI/O format + determinism contracts, not API bindings
34 target stacksInfrastructure diversity across clients10 Controller + 10 Model + 7 View + 7 Orchestration targets
Mix-and-matchNo single stack fits all clientsAny C + M + V + O combination if contracts match
Conformance levelsConstrained platforms cannot pass all testsCL-1 / CL-2 / CL-3 tiered certification
Capability catalogueUnclear feature support per platformEnumerated capabilities checked at deploy time
SemVer + compat setsVersion incompatibilities in productionCompatibility sets define valid version combinations
Batch as contractSlow one-record-at-a-time processingArray input in contract, parallel eval in implementation
Formula portabilityRules locked to Python runtimeConstrained expression language compilable to any target

11. Versioned Document References

DocumentVersionAuthorityRelationship
System Descriptor (NSD)NSD-1.0Tier 1Parent specification
Rule RegistryRR-1.0Tier 3Rules deployed to targets
Node RegistryNR-1.0Tier 3Executors per target stack
BDT RegistryBDT-1.0Tier 3Type contracts enforced per layer
Component StatusCS-1.0Tier 3Implementation readiness per target
Validation RegistryVR-1.0Tier 3Conformance test bundles
AWS Deployment PlanADP-1.0Tier 3AWS target architecture and sprint plan (NX-S18..S20)
RoadmapRM-1.6Tier 2Target expansion timeline
Use Case RegisterUC-1.0Tier 2Deployments per use case