DPW architecture

Daimyo Programmers Workshop is an algebraically grounded IDE for an era when most code is written by AI but must still be proven by humans. This page is the architecture map.

In one sentence

DPW is a provider-neutral, deterministic IDE built on its own UI framework (daitai-ui, no React), its own language (daitai-lang) and a verifiable algebra (P01–P23) — with CGF signing compliance like code.

The five layers

┌─────────────────────────────────────────────────────────────┐
│  1. SURFACE         Editor · Kashika · Spreadsheet · UI    │
│                     Editor · AI Co-worker · DaitaiDB       │
├─────────────────────────────────────────────────────────────┤
│  2. FRAMEWORK       daitai-ui (mount / reconciler / reactive) │
│                     SelectionEngine · PubSub · 23 themes   │
├─────────────────────────────────────────────────────────────┤
│  3. CORE            daitai-lang · daitai-algebra (P01–P23) │
│                     CEA (256-D vector index) · CGF         │
├─────────────────────────────────────────────────────────────┤
│  4. AGENT           Executor · Checkpoints · Verify build  │
│                     Typed diagnostics · Approval gates     │
├─────────────────────────────────────────────────────────────┤
│  5. PLATFORM        platformIO → Tauri | Web | Hosted      │
└─────────────────────────────────────────────────────────────┘

Each layer depends only downward. The surface never reaches past the framework into the platform; the core never imports the agent. The boundaries are enforced at the file level, not by convention.

What lives in each layer

1. Surface

User-facing apps that share one framework: the Code Editor, Kashika (presentations), the Spreadsheet, the UI Editor, the AI Co-worker chat and DaitaiDB. Every surface app is a daitai-ui tree over the same Workspace state.

2. Framework — daitai-ui

DPW's own UI framework. No React. A mount/reconciler pair, a reactive system, a SelectionEngine built on the adapter pattern, a PubSub bus with bounded-FIFO queues, and 23 themes. Components are pure functions of state.

3. Core

The deterministic heart. daitai-lang (algebraic OO, Dirac-notation primitives, ADTs), daitai-algebra (the P01–P23 invariants and rewrite system), CEA (a 256-dimensional vector index for symbol / semantic lookup) and CGF (the signed compliance graph).

4. Agent

The "AI in the IDE" layer, but constrained. An Executor runs LLM-proposed steps; a Tracker records them; Checkpoints (git stash refs) make every step reversible; Verify build typechecks before committing; Approval gates stop a step at the algebra boundary if it would violate an invariant.

5. Platform — platformIO

A single interface, three backends: Tauri (native filesystem), Web (localStorage + IndexedDB) and Hosted (cloud-backed persistent storage). Code written once runs in all three.

Three structural moats

| # | Moat | What it means | |---|---|---| | 1 | daitai-algebra (P01–P23) | Verifiable invariants. LLM output can be algebraically validated, not merely executed. | | 2 | CGF — Compliance Graph Format | Draft → Sign → Enforce. A signed .cgfevidence bundle for EU AI Act, GDPR, SOC 2. | | 3 | Provider neutrality | Tauri offline-first. Swap AI providers (Anthropic / Gemini / DeepSeek / OpenAI) without vendor lock-in. |

Workspace modes

  • Desktop — Tauri, native filesystem access, full offline capability.
  • Web — Browser with localStorage + IndexedDB, import / export.
  • Hosted — Cloud-backed persistent storage (coming).

All three speak the same platformIO interface — write once, run anywhere is the literal architectural contract, not a slogan.

Design principles (excerpt)

  • P01 Determinism — same input → same output, always.
  • P02 Immutability — all data unchanged after construction.
  • P03 State → Event → State — every component is an algebraic state machine.
  • P04 PubSub — components are loosely coupled.
  • P05 PAL / IO boundary — pure logic is separated from side effects.
  • P06 Result<T, E> — explicit error handling, no exceptions.
  • (continues through P23 — see The principles.)

Why this matters

A computer-science student in 2026 asks an LLM to generate React slop. DPW is the constructive alternative: an environment where every line has a derivation, every commit a signature, and every algorithm an algebraic law.

The companion Mermaid component diagram is available as dpw-architecture.mmd for rendering in any Mermaid-aware tool.

Reading next