Skip to content

Latest commit

 

History

History
378 lines (242 loc) · 19.2 KB

plan-interactive.md

File metadata and controls

378 lines (242 loc) · 19.2 KB

PLAN — Interactive surface (phases 71–80)

Last updated: 2026-11-10 (phases 71–80 done)

Status: This page is the phase record for phases 71–80. Milestone 17 stays in plan-lionsos.md. It removed the postcard guest model (lerux-interface-types, LERUXFS, postcard SerialClient and NetRequest). It did not remove the Ladybird-shaped domains or the postcard servers the browser specs still name. Those stay in desk-browser.md and ../lerux-ladybird/PLAN.md, including that plan's milestone 17 (Forms). New work does not add postcard types. The current browser command is just test-browser-sddf. JavaScript and WebAssembly are approved.

Related: plan.md (roadmap 1–82), plan-qemu.md (phases 61–70, done), plan-arch.md (phases 50–60 + Physical RPi4 lab), plan-au-ts.md (sDDF inspiration), context.md, ADR-009.

Context

Phases 1–70 delivered an Arch-like workflow on QEMU and forbade graphics. This program moves toward two products that need an interactive surface:

  1. A fully-Rust web browser modelled on Ladybird: the same engine shape and process isolation, rewritten in Rust, not a port of the Ladybird, Chromium, or WebKit C++ sources.
  2. A Grok Build clone inspired by xai-org/grok-build — agent loop, tool taxonomy, serial TUI, not the host grok binary.

Same rule as au-ts: steal the idea, not the code. Local reference trees stay outside this repo:

  • Ladybird: /home/julian/repos/github_orgs/LadybirdBrowser/ladybird
  • Grok Build: /home/julian/repos/github_orgs/xai-org/grok-build

Every deliverable is completable on QEMU virt aarch64. No board on the desk, no HDMI, no GENET. RISC-V/x86 display parity is later, not this decade.

What still feels toy for an interactive surface today

Gap Today Why it blocks browser / agent
Pixels Serial only Ladybird WebContent paints a shared bitmap; nothing presents it
HTTP isolation Apps may hold NetClient / TlsClient Ladybird WebContent must not speak TCP; neither should web-content
HTML/CSS http-file-browser emits markup, nobody lays it out Need parse → cascade → layout → paint
Agent loop chat-client is UDP rooms Grok Build is prompt → tool-calls → tools → model
Tools Shell builtins + edit Need Read/Edit/ListDir/Execute/WebFetch as one PD
LLM in CI None Live xAI is non-deterministic; need grok-one like https-one
Joint profile Workstation is serial REPL Prove browser + agent compose without giving untrusted PDs a NIC map

Hard ceiling (ADR-009)

Lifted: QEMU software framebuffer owned by display-server. Apps present via a shared bitmap MR. The desk's VESA framebuffer on the Intel graphics is ADR-013. That path is the firmware option ROM, not a display-engine driver.

Approved:

  • JavaScript and WebAssembly. The script engine follows Ladybird's LibJS stages in lerux-ladybird-js. WebAssembly is ordinary Wasm through wasmi in lerux-wasm (ADR-012), including modules a page runs. See desk-browser.md and ../lerux-ladybird/PLAN.md milestones 13, 14, and 18. The engines are a Rust rewrite of that shape, not a port of Ladybird, Chromium, or WebKit C++.

Still forbidden:

  • Linux/POSIX ABI, musl, fork/exec, unmodified third-party binaries (including grok and the Ladybird C++ tree)
  • Microkit static PD set — one web-content, no extra tabs at runtime
  • wasmtime, the WebAssembly Micro Runtime, SpiderMonkey, and compiling Ladybird's C++ workspace
  • GPU compositor, Wayland, virtio-gpu 3D, libvmm / guest Linux
  • MCP stdio servers, Landlock/Seatbelt, live xAI in CI
  • Vendoring Ladybird, Servo, or grok-build into deps/
  • Treating the RPi4 lab or the Z97 desk page as the metal target being driven. That target is the Acer Swift X. The Physical RPi4 lab and the Z97 desk page stay secondary.

Approach

Work in vertical QEMU slices, each ending in a just test-* (or host CLI) gate. Prefer new postcard types in lerux-interface-types and new PDs over POSIX shims.

Platform                         Browser (Ladybird-shaped)              Agent (Grok-shaped)
────────                         ─────────────────────────              ───────────────────
71 ADR + domain language ✅
72 display + input (QEMU ramfb) ✅
                                 73 request-server PD ✅
                                 74 HTML/DOM (`lerux-html`) ✅
                                 75 CSS + layout + paint ✅
                                 76 browser-ui + one web-content ✅
                                                                    77 agent runtime + grok-one ✅
                                                                    78 serial TUI ✅
                                                                    79 tools (fs / shell / fetch) ✅
80 joint profile: workstation-interactive ✅

Ladybird → lerux PD map

From Ladybird Documentation/ProcessArchitecture.md and Services/:

Ladybird Job lerux 71–80
Browser UI (Qt/AppKit) chrome, input, present pixels browser-ui
WebContent LibWeb + LibJS; paint to shared bitmap web-content (one)
RequestServer HTTP(S)/WS/DNS; WebContent has no NIC request-server in front of tls-proxy / net-server
ImageDecoder decode one image in a fresh process deferred
Compositor GPU/OpenGL present skip; display-server software blit
WasmCompiler / WebWorker approved shape out of 71–80. Scripts and WebAssembly are approved in ../lerux-ladybird/PLAN.md (milestones 13, 14, 18, and 19). The engine is wasmi (ADR-012), rewritten in Rust, not a port of Ladybird, Chromium, or WebKit C++

web-content cannot use the network or filesystem except through request-server. That is ADR-003/007 with a Ladybird name.

Spawn-on-demand (/tmp/session/…/portal/webcontent) does not exist on Microkit.

Grok Build → lerux PD map

From crates/codegen/ (xai-grok-agent, xai-grok-tools, xai-grok-pager, xai-grok-sandbox):

Grok Build Needs on Linux lerux 71–80
Agent loop tokio, files, YAML agents agent PD, postcard AgentRequest
Tools process spawn, reqwest, ripgrep, Landlock IPC to fs-server, shell run, request-server
TUI ratatui, PTY, mouse serial ANSI fullscreen
Sandbox Landlock / Seatbelt (nono) PD isolation is the sandbox
MCP / subagents / LSP stdio children out of 71–80

Core tool kinds: Read, Edit, Write, ListDir, Search, Execute, WebFetch.

Reuse map

Area Paths
DMA / net trust net-topology.md, ADR-003, net-server, tls-proxy
TLS / HTTPS smoke ADR-007, lerux https-one, smoke CA
FS + host inject lerux-fs, fs-server, FsRequest, ADR-008
Serial virt ADR-002, serial-virt
Shell batch Phase 69 run / source
QoS qos.md, ADR-006
Packages / profiles packages.md, support/profiles/
Interactive surface ADR-009 (this program)

Channel numbers come from the profile [[channel]] manifest, not from this document.


Phase 71 — ADR + domain language ✅

Why: plan-arch.md and plan-qemu.md forbade graphics. Starting PDs without an ADR repeats the sdfgen vs in-tree fight (ADR-001).

Steps

  • ADR-009: QEMU software framebuffer; static Ladybird PD topology; Grok-shaped agent as PDs; remaining ceilings.
  • Glossary in context.md (display-server, framebuffer MR, browser-ui, web-content, request-server, agent).
  • Remaining ceilings listed above.

Out of scope

  • Guest code, boards, CI jobs.

Exit

A future agent can implement Phase 72 without re-litigating “are we allowed to have pixels?”. Met.


Phase 72 — Display + input (QEMU) ✅

Why: Ladybird WebContent paints to a shared bitmap; something must present it. The agent TUI can stay serial; the browser cannot.

Steps

  • QEMU ramfb (-device ramfb, configured through fw_cfg DMA). virtio-gpu 2D not needed.
  • display-server PD owns fw_cfg + the ramfb backing MR. Apps never map display MMIO (ADR-003 shape).
  • Shared bitmap MR: producer (display-demo this phase; web-content later) → display-server blit.
  • Postcard DisplayRequest / DisplayResponse (GetMode / Present / PollInput) in lerux-interface-types.
  • Input v1: serial keys as InputEvent via PollInput (not virtio-input).
  • Board qemu_virt_aarch64_display. Smoke just test-display: colour-bar pattern; expect lerux-display: pattern ok. lerux run opens a GTK window when DISPLAY is set (LERUX_QEMU_GRAPHIC=0 forces headless). Host PPM dump is still optional (QEMU screendump).

Out of scope

  • GPU, vsync, cursor sprite, virtio-tablet, RPi4 HDMI.
  • Putting chrome on the framebuffer (serial chrome in Phase 76 is enough).

Exit

QEMU window shows a non-serial pixel buffer produced by a PD (just run with a display). CI checks the log line. Met.


Phase 73 — Request-server PD ✅

Why: Ladybird’s load-bearing isolation: WebContent never speaks TCP. lerux already has tls-proxy + net-server; untrusted browser/agent PDs still must not own that path.

Steps

  • request-server is the only HTTP client of tls-proxy / net-server on the new boards.
  • HttpRequest / HttpResponse in lerux-interface-types (method, URL, headers, chunked body; reuse MAX_NET_TCP_PAYLOAD chunking).
  • Smoke client request-client calls request-server; it does not get NetClient / TlsClient channels (web-content / agent later).
  • Smoke just test-request: GET https://host:8443/fixture.html from lerux https-one; expect lerux-http: fixture ok.

Out of scope

  • Cookies, HTTP cache, WebSocket, HTTP/2, public Web in CI.
  • Replacing fetch-client on existing workstation boards (it may keep TlsClient until a later cutover).

Exit

An untrusted PD can GET https://host/… without mapping NIC DMA or linking rustls. Met.


Phase 74 — HTML + DOM (lerux-html) ✅

Why: LibWeb’s pipeline starts at tokenize → tree builder. We need a no_std+alloc library, not html5ever/std, and not Ladybird’s libweb_html_tokenizer (cbindgen + AK/Rust).

Steps

  • Shared crate lerux-html: tokenizer + tree builder for a subset (html, head, body, title, p, h1–h3, a, div, span, ul/ol/li, pre, code, strong, em, img stub, style as text).
  • Host unit tests on committed fixtures under support/browser/.
  • PD dump: just test-html logs lerux-html: nodes=8 for the baked-in smoke fixture (include_str, not /host).

Out of scope

  • document.write, SVG, MathML, innerHTML script injection, spec-complete parser.
  • Importing Ladybird or Servo parser crates.

Exit

A fixture parses to a walkable DOM in a PD. Met.


Phase 75 — CSS subset + layout + paint ✅

Why: Ladybird’s “loading to painting” after parse is CSS → cascade → layout → paint into a bitmap.

Steps

  • CSS subset: color, background-color, font-size, display: block|inline, margin, padding, width. Author <style> + a tiny UA sheet.
  • Block-flow layout only (no flex, grid, floats, positioning).
  • Paint RGB888 into the shared bitmap MR (lerux-web crate, paint-demo PD).
  • Host: fixture → PPM (Bitmap::encode_ppm) + signature pixels. Guest: just test-paint expect lerux-web: paint ok.

Out of scope

  • JS-driven style, webfonts, images beyond a solid-color img placeholder, GPU.

Exit

display-server presents pixels that correspond to the HTML+CSS fixture (human-checkable in QEMU; CI checks the log line + host signature/PPM). Met.


Phase 76 — browser-ui + one web-content ✅

Why: Ladybird’s Browser process owns chrome and input; WebContent owns the engine. Keep that split even with one tab.

Steps

  • browser-ui: URL line (serial open <url> v1), owns the channel to web-content, forwards present to display-server.
  • web-content: parse/layout/paint; only HttpRequest to request-server + bitmap MR. No FS, no NIC.
  • Navigate https://host:8443/paint.html via request-server (smoke CA). First load is implicit; serial open <url> remains available.
  • Profile browser / board qemu_virt_aarch64_browser. just test-browser.

Out of scope

  • Tabs, history, bookmarks, chrome painted on the framebuffer (serial chrome is enough).
  • JS.

Exit

just test-browser loads the fixture through request-server and paints it. Met.


Phase 77 — Agent runtime + grok-one stub ✅

Why: Grok Build’s host is xai-grok-agent: tools + system prompt + model config. CI cannot hit live xAI (same reason https-one exists).

Steps

  • Host lerux grok-one: HTTP server that returns scripted tool-calls / final text for a tiny prompt set.
  • agent PD: AgentRequest::Prompt / AgentResponse::{Text, ToolCall, Done, Error}. Completions via request-server → grok-one.
  • Smoke CA path only. Reserve secret.grok.* in the config schema; unused in CI.
  • just test-agent-runtime: prompt “read /hello.txt” → stub emits Read → agent returns file body (baked-in /hello.txt until Phase 79 FS tools).

Out of scope

  • Streaming tokens as a product, compaction, subagents, real xAI in CI, browser OAuth.

Exit

One tool-loop round-trip in QEMU against a stub. Met.


Phase 78 — Agent serial TUI ✅

Why: Grok Build’s pager is the product surface. lerux already owns serial virt; start there, not on the framebuffer.

Steps

  • Fullscreen ANSI: transcript, status, prompt. Inspired by grok-pager layout, not a ratatui port.
  • Shell grok PPC to agent (same pattern as edit / chat).
  • Scripted serial smoke: expect chrome + a stub reply (lerux-agent: chrome ok then runtime ok).

Out of scope

  • Mouse, PTY multiplexer, theming engine, ACP.
  • Headless JSON as a product (a log line is enough for CI).

Exit

A human can type a prompt on the workstation serial and see the stub’s reply in a TUI. Met on qemu_virt_aarch64_agent_runtime (agent owns serial chrome; shell grok is wired for Phase 80 composition).


Phase 79 — Agent tools ✅

Why: Grok Build’s useful core is tools, not the TUI. Map taxonomy onto existing IPC.

Steps

  • Read / Write / Edit / ListDir / Search (linear scan; not ripgrep) via FsRequest.
  • Execute: on-disk batch of echo lines inside the agent PD (same idea as shell run; no fork/exec). The agent cannot PPC the shell (shell is priority 1; ADR-006).
  • WebFetch via request-server (not NetClient).
  • Workspace = LERUXFS2 /work (seeded hello.txt). File cap remains 256 KiB; tools chunk.
  • just test-agent: stub drives Read + Edit + WebFetch; expect lerux-agent: tools ok.

Out of scope

  • MCP, LSP, image/video gen, scheduler, bash pipelines, Landlock.
  • Adding agent / tls-proxy / request-server to the full workstation (Phase 80).

Exit

The agent can change a file and fetch a URL in a QEMU smoke without a POSIX process. Met on qemu_virt_aarch64_agent.


Phase 80 — Joint workstation-interactive ✅

Why: The two products share request-server + display. Prove they compose, then stop.

Steps

  • Profile workstation-interactive: workstation + display-server + request-server + web-content + browser-ui + agent.
  • Agent tool browse: ask web-content to load a URL; return extracted text (and optionally “paint ok”).
  • Trust map in security.md: web-content and agent are untrusted; request-server / display-server / fs / net stay trusted.
  • just test-interactive. QoS: new PDs in the bulk band; PPC callees outrank callers (ADR-006). HTTP stack is raised (log 7 > net 6 > tls 5 > request 4 > web-content 3 > agent 2) so Browse can PPC.
  • Update packages.md / boards.md when boards exist.

Out of scope

  • Making this the default workstation.
  • RPi4 HDMI; multi-arch display.

Exit

One QEMU profile where the agent fetches a local page that the browser also paints. Met on qemu_virt_aarch64_interactive.


Completion bar (interactive-surface program)

Treat 71–80 as done when a developer with no hardware can:

  1. Boot a QEMU board that owns a software framebuffer (display-server).
  2. Load a committed HTML+CSS fixture through request-server into web-content and see pixels.
  3. Run a serial agent TUI whose stub LLM drives Read/Edit/WebFetch on guest FS + HTTPS.
  4. Use a joint profile where the agent’s browse / WebFetch path does not give web-content a NIC mapping.
  5. Point at ADR-009 and context.md for why this is not a POSIX desktop and not Ladybird / Servo / grok ports.

Hardware truth remains Physical RPi4 lab.


Near-term priority

This program is done. The build order was 72 (display), then 73 (request-server), then 74–80 (HTML, paint, browser, agent, joint profile).

Further work on this list waits on a new ADR. JS, GPU, and extra tabs stay off the list. Phase 81 and Phase 82 landed after this program. On-device work that is still open is the Physical RPi4 lab.


Verification (program-level)

Gate Command / artifact
Host lint just check
PD lint just check-pd (once PDs exist)
Display just test-display (lerux-display: pattern ok)
Request-server just test-request (lerux-http: fixture ok)
HTML just test-html (lerux-html: nodes=8)
Paint just test-paint (lerux-web: paint ok)
Browser just test-browser (lerux-browser: paint ok)
Agent runtime just test-agent-runtime (lerux-agent: chrome ok, runtime ok)
Agent tools just test-agent (lerux-agent: tools ok)
Joint just test-interactive (lerux-agent: interactive ok, lerux-web: paint ok)
Isolation residual existing just test-isolation still green

Smokes stay on the smoke CA + https-one / grok-one. Do not add a CI job that hits the public Web or live xAI.