@@ -0,0 +1,82 @@
1+# Spike 6: the ceiling
2+
3+Goal: find where the builder stops, so we know what API to aim for. Target, from xonecas:
4+
5+> A mostly empty canvas, on the bottom left a discrete `+` button to add a project and an
6+> animated diagram of the agent's state machine. Next to it a single line tall bar at the
7+> bottom with one tab per project and an animated dot if one of its tasks is active. Projects
8+> share the same starting point: a concise task status overview in a movable, floating,
9+> semi-transparent (blurred) pane that sits above all others. Behind it a button to add a new
10+> ticket, and a minimal kanban board with TODO, DOING, DONE, which map to draft, ready and
11+> review. Pasting an image creates a new todo with the image attached.
12+
13+## What xonecas's own tries showed (after spike 5)
14+
15+| Build | What happened | Cause | Fixed in v4 |
16+|---|---|---|---|
17+| #5 new project | Shelled out to `conveyor project`; later wrote `project.json` itself | no project op | `add_project`, `set_slots`, folder dialog on |
18+| #6 new ticket | Worked | — | — |
19+| #7/#8 paste | Ctrl+V never reached the library | Rune gives a field-less paste to the view's first node, and that's the core | the core takes paste and drops and hands them to `View::event` |
20+| #7 image | A host path in the body, which the agent in the VM can't read | no attachments | `new_ticket(.., files)`, delivered to `~/ticket/files` |
21+| #9 | Two workers on one ticket, then a qemu lock error | `set` could move a running ticket back to ready | `set` can't touch running |
22+| all | "Tested in the preview, not the real app" | the agent never saw the user's app | the ticket carries the app's state; `preview --state` replays it, click outlined |
23+| all | element under the pointer: always empty | the picker stopped at widgets | it picks the deepest keyed element |
24+
25+## Builds
26+
27+1. **Bottom edge** (Ctrl+click at the canvas's bottom left). Done in 3 min, first try, 241 lines in
28+ all. `root` became `col(titlebar, canvas, row(add_project, ticket_flow, project_tabs))`. The
29+ diagram draws its review/parked/failed fork with `Shape` lines. The agent rendered the user's
30+ replayed app 7 times (`seen.png`) while it worked.
31+ - `+` opened the desktop's folder dialog through the portal. I picked the wrong folder in it,
32+ the user's home, and the `project` op ran `git init` there. Reverted within a minute: one
33+ empty commit, nothing tracked. **The op now only makes a repo of a new or empty folder,
34+ and refuses anything else.** A building tool that creates things on disk needs the same
35+ care as the agent's sandbox.
36+2. **Per-project view** (selected the conveyor tab, then Ctrl+click on the empty canvas). Done in 3
37+ min, first try: new `board` (TODO/DOING/DONE, with a `+ New ticket` field) and a
38+ `status_pane` (counts per state, what's running, what needs you), with a working
39+ `backdrop_blur`, draggable by its header, its spot saved relative to the canvas's corner. It
40+ decided on its own that DOING shows ready and running, with running cards pulsing and not
41+ draggable, matching conveyord's new rule.
42+ - **Core bug:** after the restart, `place()` ran before the canvas had rendered its own
43+ children, so it mounted `board` and `status_pane` a second time as free canvas children.
44+ "Nothing on screen shows this kind yet" isn't knowable from a few polls; it now waits
45+ 2 s after start. A real fix: the library declares where a kind is shown, or mount
46+ happens only by the agent's explicit choice.
47+ - On the desktop: dragging the pane and dragging #4 TODO → DOING both worked, and the
48+ move showed at once (optimistic `set_state`).
49+3. **Paste an image → TODO** (Ctrl+click on the TODO column; the ticket said element
50+ `col-todo`). Done in 2 min, first try: `board` takes `View::event(Paste)`, writes a draft
51+ with the PNG attached, and cards show a thumbnail of their first image.
52+ - **API gap:** `update` and `event` get no `HostState`, so they can't act. The agent queued
53+ the paste and sent `new_ticket` from a keyed marker element's `on_layout` on the next
54+ frame. Actions belong on `Cx` (`cx.new_ticket(...)`), callable from anywhere.
55+ - **The preview can't paste**, so the agent tested with a simulated event. The preview
56+ needs `--paste FILE` and `--drop FILE`.
57+ - On the desktop, Ctrl+V created a ticket from **whatever image was already on the user's
58+ clipboard** (my test image never got there: no `wl-copy`). I deleted it unopened. A
59+ window-wide paste grab is aggressive: it should confirm, or only act over the board.
60+4. **Attachment reaches the agent.** Ran the sandbox's pasted-image ticket: the agent opened
61+ `~/ticket/files/paste.png` in its VM and described it exactly.
62+
63+The whole UI is 575 lines over 8 widgets. Three builds, three first tries, 2 to 3 min each.
64+
65+## Where the ceiling is now
66+
67+Nothing in the target was out of reach. Vector shapes, backdrop blur, portal dialogs,
68+clipboard images, drag and drop, animation and shared selection all came from Rune or the v4
69+API. The limits that showed are in the harness, not the widgets:
70+
71+| Limit | Seen as | API to aim for |
72+|---|---|---|
73+| Actions only from handlers | the `on_layout` marker hack | `Cx` carries actions: `cx.new_ticket`, `cx.set_state`, `cx.call` |
74+| Placement by guessing | `board` and `status_pane` placed twice | the agent says where a new kind goes (`conveyor place <kind> <instance>`), no heuristic |
75+| Preview input coverage | the paste was tested by a simulated event | `preview --paste FILE --drop FILE`, and scripted clipboard |
76+| Side effects on the user's disk | `git init` in the user's home | conveyord guards every write it makes for a widget; widgets never write outside `cx.dir` |
77+| Window-wide grabs | a stray Ctrl+V became a ticket | events say where the pointer was; widgets take only what's over them |
78+| Rune's `on_modifiers` | the inspector polls Ctrl from pointer events | upstream one-liner |
79+
80+Next ceiling probes, things neither Rune nor the API covers yet: a VM's live desktop (VNC) in
81+a widget, audio and video, a real text editor (syntax, large files), and widgets that run
82+across several windows.