Architecture

Compilation Pipeline

From DMX specification to production-ready platform in 7 deterministic stages. Like LLVM for enterprise software.

100+Cognitive Passes
200+Code Emitters
250+Quality Gates
6Compilation Phases

End-to-End Flow

01

Spec Authoring

Developers write .dmx specifications — either directly (zero LLM) or with LLM-assisted authoring validated by the Critics system.

  • Native DMX authoring (zero LLM cost)
  • LLM-assisted draft generation with critic validation
  • Markdown import
  • Workshop editor with syntax highlighting and auto-completion
.dmx specification file
02

Parsing

The Lark LALR(1) parser transforms .dmx source into a typed, validated ApplicationIR — the compiler's intermediate representation.

  • Lark LALR(1) grammar — deterministic, no ambiguity
  • Validators run on parse output
  • Produces unified ApplicationIR
ApplicationIR (intermediate representation)
Compiler Wall
03

Cognitive Passes

100+ passes across 6 phases enrich, transform, and validate the IR. Pure functional transforms — no side effects, fully deterministic.

  • 100+ passes organized in 6 sequential phases
  • Type resolution, dependency analysis, security policy injection
  • Cross-module reference validation
  • IR enrichment: defaults, computed fields, indexes, constraints
  • Each pass is a pure function: IR in → IR out
Enriched ApplicationIR
04

Code Generation

200+ code emitters transform the enriched IR into target-language source code across Python, Java, SQL, Docker, and configurations.

  • 200+ emitters
  • Python/FastAPI: models, routes, services, middleware, tests
  • Java/Spring Boot: entities, controllers, repositories, security (WIP)
  • SQL: DDL, migrations (Alembic; Liquibase in testing), seed data
  • Infrastructure: Docker, Compose, Kong, Traefik (Nginx planned)
Python sourceJava source (WIP)SQL migrationsDockerfilesConfig files
05

Quality Gates

250+ quality gates validate both the IR and generated code. Three severity levels ensure nothing ships without passing every check.

  • 250+ quality gates across IR validation and code output
  • BLOCK (fatal): compilation halts — must fix
  • WARN (advisory): flagged for review
  • INFO (telemetry): logged for observability
  • OWASP-aligned security checks, performance checks, compliance mapping, architecture checks
Quality reportGate pass/fail status
06

Unified Test System (UTS)

Tests generated and executed for each service across four tiers. A service reaches the evidence pack only after its tiers run.

  • Contracts — OpenAPI conformance and input validation
  • Behavior — business logic, nested CRUD, pagination, aggregation, data integrity, per-field PATCH
  • Security — auth/authz and JWT flow, tenant isolation (IDOR), injection, CSRF, security headers, rate limiting, mass assignment, sensitive-field and error leakage, function-level auth (BFLA)
  • Enterprise — audit trail, PII masking, observability
  • pytest (Python) and JUnit 5 (Java, WIP), with fixtures and seed data
  • Merkle-tree provenance: full traceability from spec → IR → code
Test suitesPer-tier resultsFixturesProvenance artifacts
07

Running Platform

The complete compiled output: API servers, databases, auth, observability, infrastructure — ready to deploy.

  • Fully configured API servers (FastAPI; Spring Boot WIP)
  • Database schemas with migrations and RLS policies
  • Auth middleware (JWT, RBAC, MFA; ABAC planned)
  • Observability: Prometheus, OpenTelemetry tracing, structured logging
  • Docker Compose to run the application
Production-ready application

The Compiler Wall

The Compiler Wall is the architectural boundary between probabilistic AI and deterministic infrastructure. LLM involvement (optional) stops at spec authoring. Everything beyond the wall — parsing, cognitive passes, code generation, quality gates — is 100% deterministic.

Before the Wall

Spec authoring — optionally LLM-assisted with critic validation. Non-deterministic by nature, but validated before crossing.

After the Wall

Parsing → Passes → Emission → Gates → Tests. Same IR in, same code out. No heuristics, no fallbacks. Forever.

Quality Gates

250+ quality gates validate both the intermediate representation and the generated code. Three severity levels ensure nothing ships unchecked.

BLOCK

Fatal — compilation halts immediately. Must fix before proceeding. Security violations, type mismatches, missing references.

WARN

Advisory — compilation continues, flagged for review. Performance hints, deprecated patterns, naming conventions.

INFO

Telemetry — logged for observability and audit trail. Compilation metrics, coverage data, provenance events.

DMX vs. AI App Builders

DevMatrix is not an AI app generator — it is a deterministic compiler. The difference is architectural, not incremental.

DimensionDevMatrixLovableReplit AgentDevinv0
ApproachDeterministic compilerLLM prompt → React appAI agent + cloud IDEAutonomous AI engineerLLM prompt → Next.js app
Determinism100% — same spec, same outputNon-deterministicNon-deterministicNon-deterministicNon-deterministic
Quality Assurance250+ quality gatesNot built inNot built inSelf-review (LLM)AutoFix model (errors only)
Test GenerationAuto-generatedNot built inManual / suggestedPartial, non-deterministicNot built in
ProvenanceFull Merkle-tree traceabilityNot built inNot built inNot built inNot built in
BackendFull — FastAPI + DB + auth + middleware (Spring Boot WIP)BaaS only (Supabase)LLM-generated (variable quality)LLM-generated (variable quality)Minimal (Next.js API routes)
FrontendRoadmap — backend-first compilerReact + TailwindLLM-generated (any framework)LLM-generated (any framework)Next.js + Tailwind + shadcn
InfrastructureDocker, Compose, Kong, Traefik, configsManaged (no control)Managed (Replit hosting)Manual setup requiredManaged (Vercel only)
Code Ownership100% yours — clean architecture, full sourceAccessible via GitHub syncAccessible (export)Accessible (your repo)Accessible via GitHub sync
Deploy AnywhereAny provider — Docker portableHosted workflow or exportHosted workflow or exportAny (manual deploy)Hosted workflow or export
ReproducibilityByte-identical across runsVaries per promptVaries per promptVaries per runVaries per prompt
Compliance evidenceOWASP-aligned checks + control mapping for SOC 2, HIPAA, PCI DSS, GDPRNot built inNot built inNot built inNot built in

Domain Agnostic

DMX compiles any domain that can be specified — healthcare, fintech, insurance, logistics, e-commerce, SaaS platforms. The compiler is domain-agnostic: it reads your specification and produces production-ready code for whatever you describe.