# AffrescoUI: Clojure Native Apps You Reprogram With AI While They Run

> Source: <https://explainx.ai/blog/affrescoui-clojure-native-apps-ai-reprogram-live-2026?utm_source=rss&utm_medium=feed&utm_campaign=blog>
> Published: 2026-11-28 00:00:00+00:00

**Key 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.

**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**.

It hit **Hacker News November 28, 2026** with the pitch **“Why stop at Emacs?”** — **native performance**, **Clojure familiarity**, **AI reshape while running**.

## TL;DR architecture

| Layer | Role | 
|---|---|
| **AffrescoUI Lisp** | Sandboxed **Clojure-dialect** programs:`defscreen` ,`defview` ,`defcommand` , … | 
| **Screen format** | JSON schema documents the engine **layout + binds + events** | 
| **Version control (`modules/vcs`)** | **Allow / ask / deny** permissions,**proposals** ,**history** | 
| **Channel + MCP** | Agents connect; **commands become tools** | 
| **Renderer** | **OpenGL** native widgets via**theme kits** | 

## Live edits without rebuilds

Classic desktop dev **freezes UI at compile time**. AffrescoUI’s loop:

1. **User or agent** asks in natural language (“add a Blocked column”).
2. **Agent** proposes a**JSON Patch** -style revision on node IDs.
3. **VCS** checks**app permissions** — auto-apply or**preview** .
4. **Format runtime****reconciles** the document**in milliseconds** .
5. **User keeps or undos** — even after later edits.

**Change sets** export like **portable plugins** — features hop between apps (example: **Sinopia slide sorter** installed into **Orrery planetarium**).

That 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**).

## MCP integration for builders

MCP server layer connecting external coding agents to AffrescoUI app commands

The **`mcp/`** server is the **agent-facing surface**:

- **App commands** register as**MCP tools**
- Agents execute under **agent authority** , not**user credentials**
- **Undo** applies to**agent runs** per**VERSION_CONTROL.md**

Pair 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.

For **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**.

## Clojure familiarity and JSON parity

**LISP.md** and **CONFORMANCE.md** document **163/186 everyday Clojure forms** matching standard values — **deliberate omissions** listed in **differences.md**.

Each **example/** app ships **`lisp/` and `json/`** folders; the **Launcher** settings pick which loads. Tests claim **pixel-identical first frames** and **shared history**.

**Calamaio** text editor is **Lisp-only** — a stress test for **live reprogramming from inside** the app.

## Example applications (not toys)

Component-based native UI examples AffrescoUI ships in its Launcher catalog

The README groups **professional** demos:

| App | Category | 
|---|---|
| **Forge** | IDE with LSP, debugger, terminal | 
| **Tempera** | Image editor — agents **propose only** , human reviews | 
| **Modello** | 3D modeller, **glTF** import | 
| **Haven** | Smart home **automation graph** | 
| **Flow** | **Kanban** with timeline and burndown | 

**Tempera**’s **“agents may only propose”** rule is a **product pattern** worth copying in **regulated UIs**.

## Token economics for agent edits

**[BENCHMARKS.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/BENCHMARKS.md?ref=explainx)** argues **node-id patches** shrink prompts:

- **~28 tokens** typical edit
- **~27 tokens** partial re-read after commit

Contrast 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**.

## Build and ship today

**Recommended path** (unsigned binaries warn on macOS/Windows):

```
cmake -S . -B build && cmake --build build && ./build/affrescoui_launcher
```

Requirements: **CMake 3.25+**, **C++23**.

**WebAssembly** and **VS Code extension** live under **`web/`** and **` editors/`** for alternate hosts.

## What developers are saying on Hacker News

The **[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**.

AffrescoUI’s answer in repo docs: **sandboxed interpreter**, **no direct FS/network**, **explicit host capabilities**.

Treat **HN enthusiasm** as **“try the Launcher”**, not **production sign-off**.

## Module map for contributors

The README’s **module list** is the integration guide:

| Module | Responsibility | 
|---|---|
| **modules/core** | Interfaces between render, vcs, channel, services | 
| **modules/lisp** | Reader + interpreter → document tree | 
| **modules/format** | Validation, expressions, in-place reconcile | 
| **modules/vcs** | Permissions, proposals, commits | 
| **modules/channel** | Local sockets, processes, live protocol | 
| **modules/render** | Layout, text shaping, accessibility, GL | 
| **modules/scene3d / imaging** | 3D and tiled images for Tempera/Modello | 
| **mcp/** | MCP server wiring for external agents | 
| **apps/server** | WebSocket document server for shared sessions | 

Contributors choosing **agent features** should touch **`mcp/` + `modules/vcs` first** — that is where **dangerous actions** get **gated**.

## Security model in plain language

**ARCHITECTURE.md** states **Lisp cannot touch FS, network, or processes**. Side effects flow through **host-granted steps** validated against **who authored the running code**.

Implications:

- **Malicious agent proposals** should fail**permission checks** , not**silently chmod your home directory** .
- **Features with Lisp code** in change sets run under**feature author authority** — review**change set imports** like**npm dependencies** .
- **Shared WebSocket server** mode needs**the same session trust** as any**collaborative editor** .

Compare [Claude Cage VM isolation](https://explainx.ai/blog/claude-cage-vm-sandbox-claude-code-network-isolation-2026): AffrescoUI **sandboxes language**, not **entire OS**.

## Launcher catalog and cross-app features

The **Launcher** is itself a **screen document** with:

- **App grid** and**new app from description**
- **Catalogue** of installable**features** (reviewed like PRs)
- **Global AI provider** setting for each app’s assistant corner

Installing **Sinopia’s slide sorter** into **Orrery** demonstrates **feature contracts** — agents can request **cross-app plugins**, but **humans approve** installs.

## Lisp vs JSON for agent cost

Because **tests show AI edits Lisp as cheaply as JSON**, teams can pick by **human maintainability**:

- **Lisp** for**symbolic refactors** (`defn` ,`defview` boundaries).
- **JSON** for**tools that only speak JSON Patch** .

**clj-kondo** config under **`editors/`** helps **CI lint** Lisp programs before agents touch production documents.

## Accessibility and automation hooks

**ACCESSIBILITY.md** and **`modules/automation`** scenarios (scripted input, golden images) mean AffrescoUI targets **real desktop QA**, not only **demo GIFs**.

Wire **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).

## Packaging roadmap

**v2.0.0 binaries** exist but **lack code signing** on macOS/Windows; README recommends **source builds** for daily use.

**Packaging/** and **CMake** targets produce **`affrescoui_launcher`** — plan **internal distribution** via **signed builds** if you ship **customer-facing agents**.

## Walk through Flow Kanban as a developer

**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`.

A typical **agent edit loop**:

1. Open **Flow** from**Launcher** .
2. Point the assistant at **“Blocked” column missing** .
3. Agent proposes a **`defview` + state key** patch.
4. **Preview** shows new column;**accept** commits to**vcs history** .
5. Export **change set** to install the same feature in another app.

That is **product management** velocity without **Electron reload**. Document your **permission table** before you grant **auto-apply** on **production boards**.

## VERSION_CONTROL and change sets

**[VERSION_CONTROL.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/VERSION_CONTROL.md?ref=explainx)** defines **three permission levels**:

- **Allow** — low-risk cosmetic tweaks.
- **Ask** — structural layout changes.
- **Deny** — commands agents must never invoke.

**Change sets** bundle commits for **catalogue install**. Treat them like **signed plugins**: read **Lisp included** in the bundle before **approve**.

Feature **Sinopia → Orrery** migration in the README is the **reference story** for **cross-app reuse**.

## WebAssembly and remote documents

The **`web/`** target compiles a **WASM** build; **` apps/server`** serves **shared persistent documents** over **WebSocket**.

Teams building **multiplayer agent UIs** should compare **latency** of **websocket reconcile** vs **local channel** sockets — AffrescoUI supports **both** through **`modules/net`**.

## Conformance and tooling

**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**.

If 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**.

## When AffrescoUI is the wrong tool

Skip it if you need:

- **Mobile-first** UI (GL desktop focus).
- **Maximum web npm ecosystem** (no React tree).
- **Battle-tested accessibility certification** without reading**ACCESSIBILITY.md** yourself.

Choose it when you want **native GL performance**, **incremental agent diffs**, and **Clojure-shaped** screen code.

## Forge IDE: why a full IDE matters in a UI engine

**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**.

For **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**.

## Learning path for teams

1. **Build Launcher** from source and open**Streak** or**Flow** (smaller surface).
2. Read **`SCREEN_FORMAT.md`** + one**` examples/*/lisp/index.screen.lisp`** .
3. Connect **Claude Code or Cursor MCP** to**`mcp/`** with**Ask-only** defaults.
4. Graduate to **Tempera** or**Forge** once**undo/revert** muscle memory exists.

Link **[AI builder workshops](https://explainx.ai/workshops/ai-builder)** when onboarding **non-Clojure** teammates — they still need **agent governance**, even if **syntax** is new.

## How AffrescoUI compares to other agent UI stacks

| Approach | Strength | Trade-off | 
|---|---|---|
| **AffrescoUI** | **Native GL** ,**incremental diffs** ,**MCP** | **Young ecosystem** ,**build from source** | 
| **Electron + agent** | Familiar web stack | **Heavy runtime** , full reload habits | 
| **imgui harnesses** | Fast C++ UI for tools | Not **end-user app documents** | 
| **Figma-like v0** | Design polish | Usually **not****on-device native** |
