{"slug": "affrescoui-clojure-native-apps-you-reprogram-with-ai-while-they-run", "title": "AffrescoUI: Clojure Native Apps You Reprogram With AI While They Run", "summary": "The open-source AffrescoUI project, published by developer RiccardoSottini on GitHub, implements a C++/OpenGL native app engine in which each application is a sandboxed Clojure-dialect Lisp program (or JSON twin) that users or MCP agents can revise in place while it runs, with a version-control module enforcing allow/ask/deny permissions and undo. The project's BENCHMARKS.md claims node-ID JSON Patch revisions average roughly 28 tokens per typical edit and about 27 tokens for a partial re-read after commit, and its CONFORMANCE.md reports 163 of 186 everyday Clojure forms matching standard values. AffrescoUI surfaced on Hacker News on November 28, 2026 under the pitch \"Why stop at Emacs?\", shipping example apps including the Forge IDE, Tempera image editor (where agents may only propose edits for human review), Modello 3D modeller and Flow Kanban.", "body_md": "**AffrescoUI asks: what if native applications were documents agents could patch live — with your approval?** The **[GitHub repository RiccardoSottini/AffrescoUI](https://github.com/RiccardoSottini/AffrescoUI?ref=explainx)** implements a **C++/OpenGL engine** where each app is a **Lisp program** (or **JSON twin**) reconciled **in place** when **users or MCP agents** submit **versioned revisions**.\n\nIt hit **Hacker News November 28, 2026** with the pitch **“Why stop at Emacs?”** — **native performance**, **Clojure familiarity**, **AI reshape while running**.\n\n## TL;DR architecture\n\n| Layer | Role | \n|---|---|\n| **AffrescoUI Lisp** | Sandboxed **Clojure-dialect** programs:`defscreen` ,`defview` ,`defcommand` , … | \n| **Screen format** | JSON schema documents the engine **layout + binds + events** | \n| **Version control (`modules/vcs`)** | **Allow / ask / deny** permissions,**proposals** ,**history** | \n| **Channel + MCP** | Agents connect; **commands become tools** | \n| **Renderer** | **OpenGL** native widgets via**theme kits** | \n\n## Live edits without rebuilds\n\nClassic desktop dev **freezes UI at compile time**. AffrescoUI’s loop:\n\n1. **User or agent** asks in natural language (“add a Blocked column”).\n2. **Agent** proposes a**JSON Patch** -style revision on node IDs.\n3. **VCS** checks**app permissions** — auto-apply or**preview** .\n4. **Format runtime****reconciles** the document**in milliseconds** .\n5. **User keeps or undos** — even after later edits.\n\n**Change sets** export like **portable plugins** — features hop between apps (example: **Sinopia slide sorter** installed into **Orrery planetarium**).\n\nThat is a **different axis** than [Prospero Skeeto imgui harness](https://explainx.ai/blog/prospero-skeeto-native-imgui-ai-coding-harness-public-domain-2026) (**code generation**) or **web v0 clones** (**DOM hot reload**).\n\n## MCP integration for builders\n\nMCP server layer connecting external coding agents to AffrescoUI app commands\n\nThe **`mcp/`** server is the **agent-facing surface**:\n\n- **App commands** register as**MCP tools**\n- Agents execute under **agent authority** , not**user credentials**\n- **Undo** applies to**agent runs** per**VERSION_CONTROL.md**\n\nPair with [OpenGame Nexu MCP templates](https://explainx.ai/blog/opengame-nexu-io-game-agent-25-templates-22-coding-agents-mcp-1681-stars-2026) and [Muxlio durable workflows](https://explainx.ai/blog/muxlio-durable-workflow-coordinator-ai-agents-cli-tools-open-source-guide-2026) when you **orchestrate** multi-step edits.\n\nFor **security**, compare [MCP misbinding](https://explainx.ai/blog/mcp-tool-provider-misbinding-ai-agents-security-2026): AffrescoUI’s **permission table** is **per-app** — miswired tools still need **human review**.\n\n## Clojure familiarity and JSON parity\n\n**LISP.md** and **CONFORMANCE.md** document **163/186 everyday Clojure forms** matching standard values — **deliberate omissions** listed in **differences.md**.\n\nEach **example/** app ships **`lisp/` and `json/`** folders; the **Launcher** settings pick which loads. Tests claim **pixel-identical first frames** and **shared history**.\n\n**Calamaio** text editor is **Lisp-only** — a stress test for **live reprogramming from inside** the app.\n\n## Example applications (not toys)\n\nComponent-based native UI examples AffrescoUI ships in its Launcher catalog\n\nThe README groups **professional** demos:\n\n| App | Category | \n|---|---|\n| **Forge** | IDE with LSP, debugger, terminal | \n| **Tempera** | Image editor — agents **propose only** , human reviews | \n| **Modello** | 3D modeller, **glTF** import | \n| **Haven** | Smart home **automation graph** | \n| **Flow** | **Kanban** with timeline and burndown | \n\n**Tempera**’s **“agents may only propose”** rule is a **product pattern** worth copying in **regulated UIs**.\n\n## Token economics for agent edits\n\n**[BENCHMARKS.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/BENCHMARKS.md?ref=explainx)** argues **node-id patches** shrink prompts:\n\n- **~28 tokens** typical edit\n- **~27 tokens** partial re-read after commit\n\nContrast with **full-file codegen** in [Claude Code sessions](https://explainx.ai/blog/claude-code-token-efficiency-prompt-cache-sessions-guide-2026) — AffrescoUI optimizes for **incremental UI state**, not **greenfield repos**.\n\n## Build and ship today\n\n**Recommended path** (unsigned binaries warn on macOS/Windows):\n\n```\ncmake -S . -B build && cmake --build build && ./build/affrescoui_launcher\n```\n\nRequirements: **CMake 3.25+**, **C++23**.\n\n**WebAssembly** and **VS Code extension** live under **`web/`** and **` editors/`** for alternate hosts.\n\n## What developers are saying on Hacker News\n\nThe **[November 28 thread](https://news.ycombinator.com/item?id=50677861&ref=explainx)** is early but repeats **Emacs comparisons**, **security of live eval**, and **whether Lisp UI scales**.\n\nAffrescoUI’s answer in repo docs: **sandboxed interpreter**, **no direct FS/network**, **explicit host capabilities**.\n\nTreat **HN enthusiasm** as **“try the Launcher”**, not **production sign-off**.\n\n## Module map for contributors\n\nThe README’s **module list** is the integration guide:\n\n| Module | Responsibility | \n|---|---|\n| **modules/core** | Interfaces between render, vcs, channel, services | \n| **modules/lisp** | Reader + interpreter → document tree | \n| **modules/format** | Validation, expressions, in-place reconcile | \n| **modules/vcs** | Permissions, proposals, commits | \n| **modules/channel** | Local sockets, processes, live protocol | \n| **modules/render** | Layout, text shaping, accessibility, GL | \n| **modules/scene3d / imaging** | 3D and tiled images for Tempera/Modello | \n| **mcp/** | MCP server wiring for external agents | \n| **apps/server** | WebSocket document server for shared sessions | \n\nContributors choosing **agent features** should touch **`mcp/` + `modules/vcs` first** — that is where **dangerous actions** get **gated**.\n\n## Security model in plain language\n\n**ARCHITECTURE.md** states **Lisp cannot touch FS, network, or processes**. Side effects flow through **host-granted steps** validated against **who authored the running code**.\n\nImplications:\n\n- **Malicious agent proposals** should fail**permission checks** , not**silently chmod your home directory** .\n- **Features with Lisp code** in change sets run under**feature author authority** — review**change set imports** like**npm dependencies** .\n- **Shared WebSocket server** mode needs**the same session trust** as any**collaborative editor** .\n\nCompare [Claude Cage VM isolation](https://explainx.ai/blog/claude-cage-vm-sandbox-claude-code-network-isolation-2026): AffrescoUI **sandboxes language**, not **entire OS**.\n\n## Launcher catalog and cross-app features\n\nThe **Launcher** is itself a **screen document** with:\n\n- **App grid** and**new app from description**\n- **Catalogue** of installable**features** (reviewed like PRs)\n- **Global AI provider** setting for each app’s assistant corner\n\nInstalling **Sinopia’s slide sorter** into **Orrery** demonstrates **feature contracts** — agents can request **cross-app plugins**, but **humans approve** installs.\n\n## Lisp vs JSON for agent cost\n\nBecause **tests show AI edits Lisp as cheaply as JSON**, teams can pick by **human maintainability**:\n\n- **Lisp** for**symbolic refactors** (`defn` ,`defview` boundaries).\n- **JSON** for**tools that only speak JSON Patch** .\n\n**clj-kondo** config under **`editors/`** helps **CI lint** Lisp programs before agents touch production documents.\n\n## Accessibility and automation hooks\n\n**ACCESSIBILITY.md** and **`modules/automation`** scenarios (scripted input, golden images) mean AffrescoUI targets **real desktop QA**, not only **demo GIFs**.\n\nWire **automation** before you let **unattended agents** drive **Tempera**-class apps — same lesson as [mobile agent testers for Claude Code](https://explainx.ai/blog/mobile-agent-testers-claude-code-github-actions-parallel-qa-november-2026).\n\n## Packaging roadmap\n\n**v2.0.0 binaries** exist but **lack code signing** on macOS/Windows; README recommends **source builds** for daily use.\n\n**Packaging/** and **CMake** targets produce **`affrescoui_launcher`** — plan **internal distribution** via **signed builds** if you ship **customer-facing agents**.\n\n## Walk through Flow Kanban as a developer\n\n**Flow** (`examples/flow/`) is the README’s **Kanban** demo — boards, swimlanes, timeline, burndown. The **Lisp** source shows **small pure functions** over **column state** (for example `cards-of`, `next-order` in `flow.lisp`) bound to **labels and repeaters** in `defscreen`.\n\nA typical **agent edit loop**:\n\n1. Open **Flow** from**Launcher** .\n2. Point the assistant at **“Blocked” column missing** .\n3. Agent proposes a **`defview` + state key** patch.\n4. **Preview** shows new column;**accept** commits to**vcs history** .\n5. Export **change set** to install the same feature in another app.\n\nThat is **product management** velocity without **Electron reload**. Document your **permission table** before you grant **auto-apply** on **production boards**.\n\n## VERSION_CONTROL and change sets\n\n**[VERSION_CONTROL.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/VERSION_CONTROL.md?ref=explainx)** defines **three permission levels**:\n\n- **Allow** — low-risk cosmetic tweaks.\n- **Ask** — structural layout changes.\n- **Deny** — commands agents must never invoke.\n\n**Change sets** bundle commits for **catalogue install**. Treat them like **signed plugins**: read **Lisp included** in the bundle before **approve**.\n\nFeature **Sinopia → Orrery** migration in the README is the **reference story** for **cross-app reuse**.\n\n## WebAssembly and remote documents\n\nThe **`web/`** target compiles a **WASM** build; **` apps/server`** serves **shared persistent documents** over **WebSocket**.\n\nTeams building **multiplayer agent UIs** should compare **latency** of **websocket reconcile** vs **local channel** sockets — AffrescoUI supports **both** through **`modules/net`**.\n\n## Conformance and tooling\n\n**CONFORMANCE.md** tracks **Clojure cross-dialect tests**; **everyday.lisp** runs in CI. **Doxygen** and **clang-format** configs signal **C++ contributors** are expected alongside **Lisp authors**.\n\nIf you already use [benjitaylor skills patterns](https://explainx.ai/blog/benjitaylor-skills-stageshow-faux-product-ui-agent-skill-react-github-trending-guide-2026) or [replica skill cloning](https://explainx.ai/blog/replica-skill-eleven-claude-skills-clone-any-app-recon-entrepreneur-guide-2026), port **skill text** into **AffrescoUI assistant prompts** — but keep **permissions** stricter than **CLI skills**.\n\n## When AffrescoUI is the wrong tool\n\nSkip it if you need:\n\n- **Mobile-first** UI (GL desktop focus).\n- **Maximum web npm ecosystem** (no React tree).\n- **Battle-tested accessibility certification** without reading**ACCESSIBILITY.md** yourself.\n\nChoose it when you want **native GL performance**, **incremental agent diffs**, and **Clojure-shaped** screen code.\n\n## Forge IDE: why a full IDE matters in a UI engine\n\n**Forge** is AffrescoUI’s **stress test** — explorer, tabs, **LSP**, debugger, integrated terminal, SCM, and **command palette** in one **screen document**. It proves the engine is not limited to **toy widgets**.\n\nFor **agent evals**, Forge is the demo where **tool latency** and **multi-pane layout** mirror **real knowledge work**. If your coding agent can **propose a debug panel** through **MCP** and pass **vcs Ask**, you have evidence the **permission model** survives **complex UIs**.\n\n## Learning path for teams\n\n1. **Build Launcher** from source and open**Streak** or**Flow** (smaller surface).\n2. Read **`SCREEN_FORMAT.md`** + one**` examples/*/lisp/index.screen.lisp`** .\n3. Connect **Claude Code or Cursor MCP** to**`mcp/`** with**Ask-only** defaults.\n4. Graduate to **Tempera** or**Forge** once**undo/revert** muscle memory exists.\n\nLink **[AI builder workshops](https://explainx.ai/workshops/ai-builder)** when onboarding **non-Clojure** teammates — they still need **agent governance**, even if **syntax** is new.\n\n## How AffrescoUI compares to other agent UI stacks\n\n| Approach | Strength | Trade-off | \n|---|---|---|\n| **AffrescoUI** | **Native GL** ,**incremental diffs** ,**MCP** | **Young ecosystem** ,**build from source** | \n| **Electron + agent** | Familiar web stack | **Heavy runtime** , full reload habits | \n| **imgui harnesses** | Fast C++ UI for tools | Not **end-user app documents** | \n| **Figma-like v0** | Design polish | Usually **not****on-device native** |", "url": "https://wpnews.pro/news/affrescoui-clojure-native-apps-you-reprogram-with-ai-while-they-run", "canonical_source": "https://explainx.ai/blog/affrescoui-clojure-native-apps-ai-reprogram-live-2026?utm_source=rss&utm_medium=feed&utm_campaign=blog", "published_at": "2026-11-28 00:00:00+00:00", "updated_at": "2026-11-28 16:12:18.552642+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "developer-tools", "ai-tools", "artificial-intelligence"], "entities": ["AffrescoUI", "RiccardoSottini", "Clojure", "OpenGL", "Model Context Protocol", "Hacker News", "Forge", "Tempera"], "also_reported_by": [], "takeaway": "AffrescoUI lets MCP agents submit JSON Patch-style revisions against node IDs that the runtime reconciles in milliseconds, with per-app allow/ask/deny permissions and undo, and its benchmarks put a typical edit at roughly 28 tokens.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/affrescoui-clojure-native-apps-you-reprogram-with-ai-while-they-run", "markdown": "https://wpnews.pro/news/affrescoui-clojure-native-apps-you-reprogram-with-ai-while-they-run.md", "text": "https://wpnews.pro/news/affrescoui-clojure-native-apps-you-reprogram-with-ai-while-they-run.txt", "jsonld": "https://wpnews.pro/news/affrescoui-clojure-native-apps-you-reprogram-with-ai-while-they-run.jsonld"}}