Compilation Pipeline
From DMX specification to production-ready platform in 7 deterministic stages. Like LLVM for enterprise software.
End-to-End Flow
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
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
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
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
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
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
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
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.
| Dimension | DevMatrix | Lovable | Replit Agent | Devin | v0 |
|---|---|---|---|---|---|
| Approach | Deterministic compiler | LLM prompt → React app | AI agent + cloud IDE | Autonomous AI engineer | LLM prompt → Next.js app |
| Determinism | 100% — same spec, same output | Non-deterministic | Non-deterministic | Non-deterministic | Non-deterministic |
| Quality Assurance | 119 automated gates | None built-in | None built-in | Self-review (LLM) | AutoFix model (errors only) |
| Test Generation | 38,000+ auto-generated | None | Manual / suggested | Partial, non-deterministic | None |
| Provenance | Full Merkle-tree traceability | None | None | None | None |
| Backend | Full — FastAPI + DB + auth + middleware (Spring Boot WIP) | BaaS only (Supabase) | LLM-generated (variable quality) | LLM-generated (variable quality) | Minimal (Next.js API routes) |
| Frontend | Roadmap — backend-first compiler | React + Tailwind | LLM-generated (any framework) | LLM-generated (any framework) | Next.js + Tailwind + shadcn |
| Infrastructure | Docker, Compose, Kong, Nginx, Traefik, configs | Managed (no control) | Managed (Replit hosting) | Manual setup required | Managed (Vercel only) |
| Code Ownership | 100% yours — clean architecture, full source | Accessible via GitHub sync | Accessible (export) | Accessible (your repo) | Accessible via GitHub sync |
| Deploy Anywhere | Any provider — Docker portable | Locked to Supabase + Netlify | Locked to Replit (or export) | Any (manual deploy) | Locked to Vercel |
| Reproducibility | Byte-identical across runs | Varies per prompt | Varies per prompt | Varies per run | Varies per prompt |
| Enterprise Compliance | OWASP, SOC 2, HIPAA, PCI DSS, GDPR, ISO 27001 | None | None | None | None |
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.