| 1 | # ADR 0044: Role split — Avalonia as host (“fuselage”), custom rendering for agent chat (Skia as hypothesis) |
| 2 | |
| 3 | **Status:** Accepted · Implemented |
| 4 | **Date:** 2026-04-13 |
| 5 | **Updated:** 2026-04-13 — iteration order: **model first**, UI and render spike follow. Details — [§ History](#adr0044-history). |
| 6 | |
| 7 | ## Related ADRs |
| 8 | |
| 9 | | ADR | Role | |
| 10 | |-----|------| |
| 11 | | [0031](0031-agent-chat-clarification-batches-and-threading.md) | clarification batches, beyond linear feed | |
| 12 | | [0039](0039-workspace-navigation-affordances.md) | Semantic Map; `ILayoutEngine`, Skia in prospect | |
| 13 | | [0017](0017-multi-window-workspace-and-agent-surfaces.md) | MFD zone, `MfdShellView` | |
| 14 | | [0038](0038-agent-facade-ai-provider-and-tool-orchestration.md) | agent facade | |
| 15 | | [0043](0043-mcp-transport-recovery-human-agent-parity.md) | MCP transport | |
| 16 | |
| 17 | ### Outside ADR |
| 18 | |
| 19 | | Document | Role | |
| 20 | |----------|------| |
| 21 | | [north-star — moving from Cursor](../../design/north-star-cursor-mcp-cascade-workbench-v1.md) | reduce friction | |
| 22 | |
| 23 | --- |
| 24 | ## Context |
| 25 | |
| 26 | The product goal to **stop relying on Cursor for chat** requires agent conversation **inside CascadeIDE** to be **comfortable and scannable** — otherwise migration friction stays high regardless of editor and MCP strength. |
| 27 | |
| 28 | In parallel an architectural frame is discussed: **Avalonia** as a reliable **host** (window, DPI, input, monitors, `TopLevel` lifecycle, shared cockpit frame), not the sole carrier of **all** complex visualization forever. For surfaces like **non-linear** chat (branches, clarification-batch overview, dense structure instead of one feed — see [0031](0031-agent-chat-clarification-batches-and-threading.md)) and related context “maps”, a **separate render layer** is reasonable; **Skia** is a testable candidate (including alignment with [Semantic Map / layout](0039-workspace-navigation-affordances.md)). |
| 29 | |
| 30 | <a id="adr0044-p1"></a> |
| 31 | |
| 32 | ## Solution (direction, no fixed schedule) |
| 33 | |
| 34 | 1. **Explicit role split:** **Avalonia** layer — fuselage: zone placement, standard controls where enough, integration with the rest of the cabin. **Custom render** layer (target candidate — **Skia**) — “instruments” in chat/agent zone and aligned surfaces, **without** promising to rewrite the whole IDE in Skia. |
| 35 | |
| 36 | 2. **Model first, UI not required to start:** first — **canonical model** of dialog flow and session (events, entities, clarification batches, stable IDs, artifact bindings — direction of [0031](0031-agent-chat-clarification-batches-and-threading.md)). It can be designed and verified **without** new UI (tests, serialization, scenarios). With a clean layer split, **sketching presentation on top** is easier than inferring structure from drawn UI. |
| 37 | |
| 38 | 3. **Render spike** (including Skia) — **after** or **in parallel with** model draft, on **synthetic** data or on the model when contours are clear; goal — host/render risks, not guessing domain shape from pixels. |
| 39 | |
| 40 | 4. **Model and pixels are orthogonal:** whether Skia or Avalonia controls in the chat zone, that **does not** cancel model requirements; this ADR fixes **host/render responsibility split**, not a single library. |
| 41 | |
| 42 | <a id="adr0044-p2"></a> |
| 43 | |
| 44 | ## Consequences |
| 45 | |
| 46 | - Possible **two UI styles** (Avalonia and Skia island) — need **boundaries**, shared color/type tokens and discipline so style and bugs do not diverge. |
| 47 | - Scale chat scenario **after** spike conclusions, not before. |
| 48 | - Early **model autotests** (no UI) lower cost of changing presentation. |
| 49 | |
| 50 | ## Rejected alternatives (at this stage) |
| 51 | |
| 52 | - **Treat chat quality as secondary** to the editor — rejected for the goal “live in CIDE without Cursor for conversation”. |
| 53 | - **Rewrite all chat in Skia in one step** — rejected without measurable spike and data model. |
| 54 | - **Start from render layer without model canon** — rejected: risk cementing wrong structure in graphics. |
| 55 | |
| 56 | --- |
| 57 | |
| 58 | ## Change history |
| 59 | |
| 60 | <a id="adr0044-history"></a> |
| 61 | |
| 62 | | Date | Change | |
| 63 | |------|--------| |
| 64 | | 2026-04-13 | iteration order: **model first**, UI and render spike follow. | |
| 65 | |