From 78dd497a46ebb1b6e3ab3fbdc87f2554690b5246 Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Sun, 18 Oct 2026 13:34:05 +0700 Subject: [PATCH] docs(t27f): T27F Live research -- generative UI of agent work in our own format (Closes #10259) Survey and design for a live view of agent work: agent events feed a .t27 work graph, .t27 scene/hud/face/motion specs emit a flat display list, and the browser paints it through a loader of at most 40 lines. Covers browser feasibility (what stays plumbing), genUI protocols, real-time visual runtimes and live-avatar vendors with sourced latency and price, the original vector Queen design, and milestones M0-M6 (#10259-#10265). Part of #10266. Co-Authored-By: Claude Opus 5.5 --- docs/nona-02-organism/t27f/genui-research.md | 445 +++++++++++++++++++ 1 file changed, 445 insertions(+) create mode 100644 docs/nona-02-organism/t27f/genui-research.md diff --git a/docs/nona-02-organism/t27f/genui-research.md b/docs/nona-02-organism/t27f/genui-research.md new file mode 100644 index 0000000000..c9108df25d --- /dev/null +++ b/docs/nona-02-organism/t27f/genui-research.md @@ -0,0 +1,445 @@ +# T27F Live: a generative UI for agent work, in our own format + +Research and design proposal, 2026-10-18. Status: proposal, nothing here is built yet. +Epic: gHashTag/t27#10266 (milestones M0-M6 are #10259-#10265). Definition of T27F: `.claude/skills/t27f/SKILL.md`, +section "What T27F is" (gHashTag/trinity#1648, RFC gHashTag/trinity#1649). This document does +not restate it. + +Placement note: the brief asked for `docs/t27f/`. Article DOCS-TREE of +`docs/T27-CONSTITUTION.md` allows new first-party Markdown only under its buckets, so this file +lives in `docs/nona-02-organism/t27f/` (language and organism themes, thematic subfolder). + +## 0. The question, and the short answer + +The owner asked (translated): T27F was planned from the start to become a generative UI of agent +work in our own format, not HTML and not web JS. Is that impossible because the browser does not +support our format? What is the best way to build such an interface with real-time video and +streaming, in the visual style of the reference post, with the Queen Trinity as a face (a +different face, blue eyes), driven by graph relationships? + +Short answer: + +1. **Yes, a browser can run our format.** A browser executes exactly two kinds of program: + JavaScript and WebAssembly. t27 already reaches the browser as WebAssembly: the page + `t27.ai/t27f/graph/` (gHashTag/trinity#1679) runs the T27F exporter and layout, both written + in `.t27`, as a 39 KB wasm module, and the only hand-written JavaScript is 39 lines that move + bytes in and draw what comes back. The same split scales to a live, animated interface: the + scene, layout, animation, state machine and the face are `.t27`; a loader of at most 40 lines + hands a flat list of draw commands to the browser's canvas. That loader is plumbing, like a + sitemap: it is what the browser parses, not what the project says about itself. +2. **The reference post is not a real-time render.** It is a 3-minute music video produced + offline ("Made in 44 hours by 116 agents. 2,423,515,148 tokens, 409 images, 78 clips"; the + author's own reply links it as an "Official Music Video"). What is reproducible live is its + visual grammar: generated footage of a character, overlaid with an agent-state HUD (a status + bar reading TASK COMPLETE / AGENT RUNNING / TASKS n / a clock, task cards such as "TASK 09 + ACTIVE", chart overlays, a window labelled `cloud.mp4`, a log ticker). The HUD is exactly what + T27F can generate from real agent events; the footage is an asset layer. +3. **The best build is client-side and state-driven**: agent events (already published by the + Queen actor feed and the t27-mcp SSE stream) feed a `.t27` work graph (spec -> agent -> + action); a `.t27` scene function turns the graph into a HUD and a vector Queen face; the + browser only paints. Video is an optional slot that plays allowlisted clips; no GPU server + streams pixels. Section 6 gives three options with costs. + +## 1. What already exists (measured, not planned) + +| Piece | Where | Number | +|---|---|---| +| Spec -> graph IR | `specs/t27f/spec_graph.t27`, `spec_graph_export.t27`, `spec_graph_derive.t27` | export p50 0.09 ms, p99 2.1 ms, max 18.8 ms over 2227 specs (Railway lab, 2026-10-18) | +| Graph layout, fold, hit-test | `specs/t27f/spec_graph_view.t27`, `spec_graph_fold.t27` | caps 1024 nodes / 4096 edges, u16 indices | +| Hot reload record | `specs/t27f/hot.t27`; host in gHashTag/t27-mcp `--watch`, `GET /events` (SSE) | save -> SSE event p50 ~25 ms, p90 ~35 ms (lab) | +| Wasm build rule | `specs/t27f/build.t27` | cold rebuild 1.1 s, reuse check 0.2 s, byte-identical output | +| Browser renderer | gHashTag/trinity `apps/website/public/t27f/graph/` | 39 lines JS glue, 39 KB wasm, SVG output | +| UI plan allowlist | `specs/t27f/ui_plan.t27` | 5 trusted widgets, `FORBIDDEN_NAMES` = script, eval, html, iframe, raw_js, function | +| Agent event feed | `specs/queen/actor_events.t27`, `actor_view.t27`, `tasks.t27` | spawn / exit / DOWN / restart / deliver; task states backlog, blocked, running, review, done, dropped, failed | +| Queen art | gHashTag/trinity `apps/website/public/queen/portrait-queen-256.png` and siblings | static 256 px portraits | + +So the hard parts of the chain (our language in the browser, a deterministic exporter, an SSE +stream with a measured latency, a typed allowlist, an agent event feed) are already on master. +What is missing is a scene layer that animates, a work graph that joins agents to specs, and a +face. + +## 2. Can a browser run our own format? The honest map + +Read on 2026-10-18. Support versions come from the webstatus.dev API +(`api.webstatus.dev/v1/features`), MDN and vendor engineering posts. + +### 2.1 What a browser executes, and where our language stops + +A browser runs JavaScript and WebAssembly, and nothing else. WebAssembly is enough for every +piece of logic: the Wasm 3.0 feature set (GC, tail calls, exceptions, 128-bit SIMD, 64-bit +memory) was completed on 2025-09-17 and ships in Chrome, Firefox and Safari +(webassembly.org/news/2025-09-17-wasm-3.0/). t27 needs none of the newer features: it lowers to +`wasm32-freestanding` through Zig, with no garbage collector and no threads, which is already the +page `/t27f/graph/`. + +What wasm cannot do is touch a Web API. WebGPU, Canvas, `fetch`, `EventSource`, WebSocket, +WebCodecs, input events, IME, clipboard and the DOM are all JavaScript interfaces; wasm sees only +the functions its host imports. Even Figma's C++ renderer reaches WebGPU "ultimately" through the +browser's JavaScript API (figma.com/blog/figma-rendering-powered-by-webgpu/), and Dawn's +Emdawnwebgpu ships JS that "must be provided at the final link step" +(dawn.googlesource.com, src/emdawnwebgpu/pkg/README.md). + +So "zero JavaScript" is not reachable for anyone. The accurate claim, and the one T27F Live makes, +is: **zero logic in JavaScript, one shim whose only job is to call the browser.** The measured +spread of that shim across the field: + +| Project | Logic in wasm | Glue | Accessibility | +|---|---|---|---| +| Zig `wasm32-freestanding`, compute only | everything | about 10 lines (0xkiire.com/wasm-with-zig/) | none | +| t27 `/t27f/graph/` (ours) | export + layout, 39 KB wasm | 39 lines | SVG text | +| Rive web runtime | C++ animation runtime | small wrapper; 222-648 KB compressed total (rive.app/docs/runtimes/runtime-sizes) | not documented | +| Makepad (Rust UI) | the whole UI | about 300 KB of unminified hand-written JS (web.js 141,778 chars, web_gl.js 131,716; github.com/makepad/makepad, platform/src/os/web) | not documented | +| Flutter web (skwasm) | Dart via WasmGC + Skia | loader + DOM overlays; engine 1.21 MB brotli | opt-in hidden button, then a DOM mirror of the Semantics tree (docs.flutter.dev/ui/accessibility/web-accessibility) | +| Slint web | Rust | wasm-bindgen glue | "not available" (docs.slint.dev, platforms/web) | +| egui web | Rust | eframe web integration | experimental built-in screen reader only | + +Everything with a full UI pays tens to hundreds of kilobytes of glue, because its wasm calls the +browser in hundreds of places. T27F Live keeps the glue small by design: the wasm returns a flat +display list of about 12 opcodes, so the loader calls about 12 canvas methods and nothing else. + +### 2.2 The layer map + +| Layer | Must stay plumbing (we call it, we cannot replace it) | Is `.t27` | +|---|---|---| +| Loading | instantiate wasm, pass imports, `requestAnimationFrame` | -- | +| Drawing | Canvas2D context (later WebGPU device, swap chain) | the display list, every coordinate, colour token and glyph position | +| Network | `EventSource` (SSE) down, `fetch` POST up | event names, sequence numbers, keyframes, coalescing, resume (`live_stream.t27`) | +| Video | `