interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / docs / ALLEN_CANVAS.md

161 lines · 11449 bytes Raw Blame History Source

Allen's canvas: the model paints the screen

Drake's words: "It all will be on a screen that isn't being processed. It is literally being painted on by the model." Until this branch, the language model behind Allen could only hand back one plain line of text, and the kernel decided everything else. Allen's canvas is the first step past that: the model now decides what is shown, in a small language of its own, and the kernel paints it in Allen's style. This document is the grammar and the reasons for it.

Code: native/kernel/svc/allen_scene.{h,c} (the parser), native/kernel/ui/canvas.{h,c} (the painter), small hooks in native/kernel/ui/allen_ui.c (ck_allen_ui_scene). The prompt the model is given: crates/allen-courier/scene_prompt.txt. Tests: scripts/ck_allen_canvas_test.sh (add --live to ask the real model). Evidence: evidence/allen-canvas/.

1. Why a language, and why this one

The model must not draw pixels. Three reasons, each measured or physical:

  1. Safety. Whatever the model writes, the kernel has to survive it. A small line grammar with fixed limits can be parsed in a few hundred lines of integer C with every byte bounds-checked and fuzzed (300,000 random and mutated replies per test run, under AddressSanitizer and UndefinedBehaviorSanitizer). Pixel commands or a general layout language (HTML, SVG, a display list) cannot be checked that cheaply, and would let one reply clutter or break the screen.
  2. Calm. The design rule is one thing in the centre, the rest at the edge, every change eased in (docs/ALLEN_PRESENCE_RESEARCH.md section 3). If the model chose coordinates and colours it could break that rule on any answer. In this language it can only say what (a number, a list, a person) and *roughly where* (left, right, above); the look, the motion and the palette stay the kernel's.
  3. Reliability of a mid-size model. A model writes keyword lines far more reliably than nested JSON (the inference-server notes record Qwen3 dropping a closing bracket and running on past the end of an array). A line it gets wrong is dropped on its own; the rest of the scene still shows.

The vocabulary is the smallest set that covers what people ask a computer for most of the day: an answer (a number, a note), steps or choices (a list), time (a timer), people (a person and a message), something to look at (a picture, a video, a quote), and the feeling of the room (a mood). The same lines will later carry a friend's message arriving (person from) or a video playing in its place (video) without a single window: the thing the line names is what appears, in the sky beside Allen.

2. The grammar

A scene is plain ASCII, at most 12 lines that count and at most 2048 bytes; anything after is not read.

scene   = { line "\n" }
line    = mood | say | thing | (blank, a code fence, or the model's <think> block: skipped)
mood    = "mood" { tone | water }
tone    = "night" | "dawn" | "deep" | "clear"
water   = "still" | "slow" | "lively"
say     = "say" [":"] text                    (exactly one; Allen speaks it; at most 159 characters)
thing   = kind { word } ":" field { "|" field } (at most 4 things on screen at once)
kind    = "note" | "list" | "number" | "quote" | "person" | "timer" | "picture" | "video"
word    = "left" | "right" | "above"           (where it sits; otherwise the kernel chooses)
        | "warm" | "quiet"                     (lit warm to stand out, or held back)
        | "bloom" | "rise" | "fade"            (how it arrives; bloom is the default)
        | "to" | "from"                        (a person's message: going to them or come from them)

The fields of each kind, with the room each one has (longer text is cut at a word and ends in "..."):

kindfieldsroom (characters)needs
notetitle, text (or just text)48, 2401
listtitle, item, item, ...48, then 64 each (5 items)1
numbervalue, caption16, 64 (value has a digit)1
quotetext, who220, 481
personname, message32, 2002
timerwhen, label24, 641
picturewhat it shows, where from120, 641
videowhat it shows, where from120, 641

A timer's when is a length (25m, 1h 30m, 90 seconds, in 10 minutes, up to 24 hours) and then the ring of light empties as the time runs out; anything else (6:00 pm) is shown as written, in a full ring.

Example (a real reply shape):

mood calm
say Seventeen percent of 240 is 40.8.
number right: 40.8 | 17% of 240
note left quiet: How | 240 x 0.17 = 40.8

What the parser forgives, and what it counts

The kernel never shows a line it does not understand, and never complains on screen. Every reply gets a report (ck_scene_stats): lines read, kept, rejected (an unknown first word, or a thing with nothing in it), tidied (understood after taking off a list mark, numbering, bold stars or a code fence the grammar does not use), cut (a field too long, or bytes outside printable ASCII left out), over (past 12 lines, past 4 things, a second say or mood) and truncated (past 2 KiB). A reply is clean when nothing was rejected, tidied, over or truncated and it has its say line; that is the number reported for the real model. A reply with no scene lines at all is still spoken: its first line becomes the say.

On the courier's one-line wire a scene travels with its newlines written as \n; ck_scene_unwire() turns it back into lines before ck_allen_ui_scene().

3. How it is painted (ui/canvas.c)

Everything is drawn into the same night as Allen, in the palette of ui/allen_ui.c and nothing else: night rgb(6 8 18), text rgb(236 240 252), hint rgb(150 160 196), glow rgb(150 170 255), mist rgb(200 210 255), ink rgb(64 86 196), warm rgb(255 212 150) and rgb(255 222 180). The type is Allen's own stroke face.

4. The prompt

crates/allen-courier/scene_prompt.txt is the system prompt. It names the lines, gives the rules (plain ASCII, at most three things, be honest about what Allen cannot do yet: no weather, clock, internet, messages or media of his own) and three short examples that are not the test questions. allen-scene (crates/allen-courier/src/bin/allen-scene.rs) builds it in with include_str!, so the relay can use the same file the same way. The live test asks the model one question at a time and waits out the server's 503 (busy) answers, waiting as its Retry-After asks (1 to 15 s), for up to thirty minutes per question.

5. Measured

All on the Spark (GB10 host CPU, one core, 3840 x 2160), evidence in evidence/allen-canvas/.

6. What is not done