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 import
- 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
- Validators run on parse output
- Produces unified ApplicationIR
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
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)
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
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
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
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.
| 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 | 250+ quality gates | Not built in | Not built in | Self-review (LLM) | AutoFix model (errors only) |
| Test Generation | Auto-generated | Not built in | Manual / suggested | Partial, non-deterministic | Not built in |
| Provenance | Full Merkle-tree traceability | Not built in | Not built in | Not built in | Not built in |
| 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, 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 | Hosted workflow or export | Hosted workflow or export | Any (manual deploy) | Hosted workflow or export |
| Reproducibility | Byte-identical across runs | Varies per prompt | Varies per prompt | Varies per run | Varies per prompt |
| Compliance evidence | OWASP-aligned checks + control mapping for SOC 2, HIPAA, PCI DSS, GDPR | Not built in | Not built in | Not built in | Not 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.