DevMatrixDocumentation
Back to Home
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
119Quality Gates
16Compilation Phases
38,342Auto-Generated Tests
49Technologies

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 and OpenAPI import paths
  • 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
  • 8 validators run on parse output
  • Supports DMX, Markdown, and OpenAPI input formats
  • Produces unified ApplicationIR
ApplicationIR (intermediate representation)
Compiler Wall
03

Cognitive Passes

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

  • 100+ passes organized in 16 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 across 8 output categories
  • Python/FastAPI: models, routes, services, middleware, tests
  • Java/Spring Boot: entities, controllers, repositories, security (WIP)
  • SQL: DDL, migrations (Alembic + Liquibase), seed data
  • Infrastructure: Docker, Compose, Kong, Nginx, Traefik
Python sourceJava source (WIP)SQL migrationsDockerfilesConfig files
05

Quality Gates

119 automated gates validate both the IR and generated code. Three severity levels ensure nothing ships without passing every check.

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

Test Suite Generation

38,000+ tests auto-generated across contract, behavior, security, and validation tiers. Full provenance from spec to code.

  • pytest (Python) and JUnit 5 (Java, WIP) test suites
  • Contract tests, behavior tests, security tests
  • Integration tests with fixtures and seed data
  • Merkle-tree provenance: full traceability from spec → IR → code
Test suitesFixturesProvenance 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, ABAC, MFA)
  • Observability: Prometheus, Jaeger, structured logging
  • Docker Compose for platform-wide orchestration
Production-ready microservice platform

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

119 automated 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 Assurance119 automated gatesNone built-inNone built-inSelf-review (LLM)AutoFix model (errors only)
Test Generation38,000+ auto-generatedNoneManual / suggestedPartial, non-deterministicNone
ProvenanceFull Merkle-tree traceabilityNoneNoneNoneNone
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, Nginx, 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 portableLocked to Supabase + NetlifyLocked to Replit (or export)Any (manual deploy)Locked to Vercel
ReproducibilityByte-identical across runsVaries per promptVaries per promptVaries per runVaries per prompt
Enterprise ComplianceOWASP, SOC 2, HIPAA, PCI DSS, GDPR, ISO 27001NoneNoneNoneNone

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.