TJ's Desk

Draft. This note is unfinished and unlisted. It can change or disappear, so please do not share it yet. All drafts

Rethinking the GRAIN Builder as a Playground

My builder lets an AI pick from a menu of five blocks and calls that building a page. An A2UI playground showed me what it looks like when the model writes the page and you watch it happen.

ai grain builder

I asked my own builder for a lede, three stat cards and a sign-up form. It drew three cards that all said "18 atoms". The page claims an AI builds it, and what it shows is an AI that chose three names from a menu of five while my code filled in the rest. Anyone who looks twice can see that.

The prompt

Atai Barkai posted about the A2UI playground that CopilotKit built. I opened the playground and asked it for Q3 sales by region as a dashboard. It answered in about twelve lines, one component per line, each with an id and its props, copy and numbers included. The code filled in on one side while the page painted on the other. The commenters under the post singled out the same thing I did: watching the code arrive is the part worth learning from.

A2UI is Google's spec underneath it. The agent may place only components the app has registered, the tree streams, and data is declared rather than run. That last stance is GRAIN's own. The rest is what my builder is missing.

Why mine feels weak

There are four reasons, and none of them is the styling. The model is not authoring anything: it names parts. There is nothing to watch: the page appears all at once. The vocabulary of five blocks and three widths cannot say "dashboard", so every ask turns into the same page. And the control rail the human gets reaches further than the three verbs the model gets, which turns the demo inside out.

Under all four sits the model. I measured the in-browser 0.5B on the builder in August and it got zero of eighteen edits right. No redesign that keeps it as the only author fixes the result.

The shape I want

Prompt and samples Code line by line Canvas paints on pass

Three panes: the conversation, the code, the page. Each line in the code pane is checked by the same door GRAIN already uses to refuse a bad edit, so a wrong line is refused alone and does not sink the page. The rail moves under the canvas as an inspector, so the human controls stay. A hosted model writes the tree, the 0.5B keeps the small edits it can manage, and the page says which one wrote what. No fallback gets to claim an AI wrote what code wrote.

The masthead follows the slop check from the other half of this work: headline, byline, rule, no eyebrow. The playground's own heading carries an eyebrow, and GRAIN's catalog will not offer one.

The choice I have not made

GRAIN's contract today is a set of verbs that edit a page that already exists, and it has no verb that adds. To be the thing a model writes, GRAIN needs a catalog of components with typed props, containers that nest, data as records, and a way to create. I can build that as GRAIN's own small compose format, or I can emit A2UI itself and register GRAIN's components as its catalog. The first keeps the format mine. The second gets the renderers and the ecosystem for free. I want one spike of each before I choose.

There are honest open questions too. Should a public portfolio page call a hosted model at all, and who pays? Is the no-add rule retired or kept for the small model? None of the builder above exists yet. It is a plan with a mockup, and the screenshot of three identical cards is still live at /grain/builder.

Sources


The judgment is human. The typing, by design, is not.