# Resource Evaluation: MDMA (MobileReality) **URL (trigger)**: https://github.com/MobileReality/mdma **Primary Sources**: MDMA GitHub repository (README, docs, evals), local audit of the source tree at `/Users/florianbruniaux/Sites/divers-test/mdma` **Type**: Open-source library / DSL for agent-generated interactive UI **Evaluated**: 2026-07-07 **Score**: 3/5 (MODERATE, integrate when time available) --- ## Executive Summary MDMA is an open-source project that defines a Markdown-with-embedded-YAML dialect for interactive UI (forms, buttons, tables, approval gates), designed to be produced reliably by small or fine-tuned LLMs and validated deterministically before rendering. Three independent audit agents examined the source tree and reached a consistent picture: the core engineering (parser, validator, fixer pipeline, eval methodology) is genuinely solid, but several marketing claims don't survive contact with the code, and there's a real functional bug in the shipped form component. **Why 3/5**: The validator/fixer architecture and the honest eval framing are worth documenting as a reference pattern for anyone building a similar small-model-output-reliability pipeline. But the gap between claimed and actual behavior (a form component whose "required" fields aren't enforced, "runs anywhere" that doesn't apply to rendering, non-cryptographic hashes marketed alongside "audit-log"/"pii" keywords) means this isn't a "go build on this in production" recommendation without independently fixing the validation gap first. --- ## Content Analysis ### Key Facts (Verified) 1. **Deterministic validator/fixer pipeline**: single pass, no additional LLM call, regex-based extraction tolerant of malformed markdown, 22 rule files under `/Users/florianbruniaux/Sites/divers-test/mdma/packages/validator/src/rules` (19 documented in the README, 22 counted in the source at audit time), ordered fixers for field-type inference, YAML key typo correction, and binding repair. 2. **Standard parsing**: built on remark/unified as a proper plugin, with explicit handling of streaming state (distinguishes a block still generating from one that's genuinely malformed). 3. **Eval methodology**: uses promptfoo with custom assertions, documented with a "not 100%, observations not conclusions" framing in `/Users/florianbruniaux/Sites/divers-test/mdma/evals/own-model/README.md`. Measured result: 41% success with a bare prompt versus 90.5% with the DSL and validator combined, on their own fine-tuned model served via Modal/Hugging Face. 4. **"Runs anywhere" for core packages**: `spec`, `parser`, `validator`, and `runtime` packages contain zero Node-specific imports (`fs`, `path`, `crypto`), confirmed by grep across all four package source trees. 5. **CI hygiene**: GitHub Actions pinned by commit SHA in `.github/workflows/ci.yml` and `release.yml` (e.g. `actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6`), changesets-based per-package versioning, a `turbo run test` test suite spanning all packages. 6. **Package structure**: 10 packages (`spec`, `parser`, `validator`, `runtime`, `attachables-core`, `renderer-react`, `cli`, `mcp`, `agui`, `prompt-pack`), each independently versioned and published under the `@mobile-reality` npm org. ### Fact-Check: Claims vs. Code | Claim | Status | Evidence | |-------|--------|----------| | "Guarantees valid UI" | ❌ Overstated | 90.5% measured, not 100% (`evals/own-model/README.md`) | | Own eval results file shows 100% | ⚠️ Internal contradiction | `evals/own-model/results.json`: 95/95 pass (100%) dated 2026-06-30, unreconciled with the README's 90.5% figure for the same eval track | | "Runs anywhere" | ⚠️ Partially true | True for `spec`/`parser`/`validator`/`runtime` (zero Node imports, verified). False for rendering: exactly one renderer exists, `@mobile-reality/mdma-renderer-react`, 100% React | | Chart component renders charts | ❌ Misleading | `ChartRenderer.tsx` parses CSV and renders an HTML ``; code comment admits "Renders chart data as a simple HTML table" (`packages/renderer-react/src/components/ChartRenderer.tsx`) | | Webhook component executes webhooks | ❌ Misleading | `WebhookRenderer.tsx` dispatches a UI event (`INTEGRATION_CALLED`) the host app must wire up; no HTTP call happens inside MDMA (`packages/renderer-react/src/components/WebhookRenderer.tsx`, line 29). To the project's credit, this gap is listed in their own roadmap as not-yet-built | | "On-device / mobile models" | ⚠️ Misleading framing | Refers to the size of the generator LLM (hosted on Modal, distributed via Hugging Face), unrelated to rendering. The renderer CSS has zero `@media` queries, confirmed across all `.css` files in `packages/renderer-react` | | "Accessible by design" (demo page) | ❌ Unsupported | Native labels/buttons and one `role="alert"` exist (`CalloutRenderer.tsx`), but no `aria-invalid`/`aria-live` anywhere, and the PII-masking table cell is a clickable `` with no `role="button"`/`tabIndex` (`packages/renderer-react/src/components/TableRenderer.tsx`, lines 4-15) | | Form validation (required/pattern/min/max) is enforced | ❌ False, functional bug | See dedicated section below | | Audit-log integrity is tamper-evident | ❌ Not cryptographically | FNV-1a hash, code comment says "non-cryptographic" (`packages/runtime/src/core/event-log-integrity.ts`, line 10) | | PII redaction hash is secure | ❌ Not cryptographically | djb2-style rolling hash, comment says "non-cryptographic, for logging only" (`packages/runtime/src/redaction/hash.ts`) | --- ## The Form Validation Bug (Independently Found by Two Audit Agents) This is the most consequential finding, because it contradicts the project's own documentation rather than a marketing tagline. - `FormRenderer.tsx` wraps every field in a plain `
`, not a `
` element (`/Users/florianbruniaux/Sites/divers-test/mdma/packages/renderer-react/src/components/FormRenderer.tsx`, line 152). - The submit control is `