xonecas.io
8447
Co

conveyor / commit 65016c7

Spike 6: the ceiling, from three hard builds; place and project-op fixes

A bottom edge (+ project, animated state machine, project tabs with live
dots), a floating blurred status pane over a TODO/DOING/DONE board, and
paste-an-image-to-ticket: each built first try by Ctrl+click on the desktop.
An attached image reached the agent in its VM.

Fixes found on the way:
- The project op made a git repo of any folder without one; picking the
  home folder in the dialog did that to $HOME (reverted at once). It now only
  initialises a new or empty folder and refuses the rest.
- New kinds were placed before their parent had rendered them, so they
  appeared twice; placement now waits until instances have settled.

Co-Authored-By: Claude Opus 5.5

sacenox2026-11-09 65016c7f54985011f08cc570f42bf3b17b855989 parent 5df81e1

4 files changed

DESIGN.md+8−0
@@ -214,6 +214,13 @@ Four prompts built a project sidebar, a kanban board with an animated activity s
214214 - **Drop targets or rects in handlers**, instead of computing columns from drag distance.
215215 - **Timestamps on tickets, project settings ops (pause), defaults for shared values.**
216216
217+v4 answered those. Agents now see the app: a build ticket carries the app's state, and `preview --state` replays the user's window with the click outlined. The picker resolves to the deepest keyed element. Tickets carry text, times, files and threads. `View::update`/`View::event` exist, with paste and drop. Spike 6 then built the whole target without hitting a widget limit. What it hit instead:
218+
219+- **Actions belong on `Cx`**, not only in handlers: `update` and `event` can't act today.
220+- **Placement is the agent's call**, not a heuristic: guessing placed two widgets twice.
221+- **The preview needs every input the app has** (paste, drop, clipboard), or agents test by simulation.
222+- **Anything that touches the user's disk goes through a guard** in conveyord. The `project` op once ran `git init` in `$HOME`.
223+
217224 ## Stack
218225
219226 **Decision: Rust everywhere, with [Rune](https://github.com/anomalyco/rune) for the app.** GPUI is the fallback. Checked on the real desktop: see [Checks on the real desktop](#checks-on-the-real-desktop).
@@ -322,6 +329,7 @@ Each spike is a throwaway script that answers one question with numbers. They ra
322329 | 3 | Snapshot, restore, resume | done | Restore 1 s, `--resume` redid the work your way. See [Snapshots](#snapshots-and-rewind) |
323330 | 4 | Spike 2 for opencode | done | Same behaviour with DeepSeek v4.1 flash, 45 s |
324331 | 5 | What API does a self-modifying client need? | done | 4/4 builds first try, 3 to 4 min each. Gaps ranked in [The widget builder](#the-widget-builder) |
332+| 6 | Where is the builder's ceiling? | done | 3/3 hard builds first try (blur, vector diagram, paste → ticket). Limits are in the harness. See `spikes/6-ceiling/NOTES.md` |
325333
326334 ### What the spikes taught us
327335
crates/conveyor-app/src/app.rs+5−2
@@ -16,6 +16,9 @@ pub struct State {
1616 /// When widgets last sent conveyord a request: a snapshot asked for before it is stale,
1717 /// and would undo what `set_state` already shows.
1818 sent: Instant,
19+ /// When this process started rendering: new kinds are placed only once every instance has
20+ /// had time to appear, or a kind its parent already renders would be placed twice.
21+ started: Instant,
1922 /// The binary at launch and its mtime. Read once: after cargo replaces it,
2023 /// current_exe() names the deleted file.
2124 exe: Option<PathBuf>,
@@ -61,7 +64,7 @@ pub fn init() -> State {
6164 let base = PathBuf::from(std::env::var("HOME").unwrap_or_default()).join(".local/share/conveyor/app");
6265 let _ = std::fs::create_dir_all(&base);
6366 State { seen: ids(&base, "seen").unwrap_or_default(), placed: ids(&base, "placed").unwrap_or_default(), live: Live::new(base),
64- builds: vec![], connected: false, sent: Instant::now(), inbox: Default::default(), exe: None, built: None, ctrl: false, pointer: (0.0, 0.0),
67+ builds: vec![], connected: false, sent: Instant::now(), started: Instant::now(), inbox: Default::default(), exe: None, built: None, ctrl: false, pointer: (0.0, 0.0),
6568 picked: vec![], element: String::new(), rects: RefCell::new(vec![]), form: None, window: Default::default(), spare: rune::TextEdit::new("") }
6669 }
6770
@@ -89,7 +92,7 @@ pub fn poll(s: &mut State, _t: f64, tx: &mut Tx) -> bool {
8992 }
9093 again = true;
9194 }
92- if !made { place(s); }
95+ if !made && s.started.elapsed() > Duration::from_secs(2) { place(s); } else { tx.wake_after(Duration::from_millis(500)); }
9396 for r in s.live.take_outbox() {
9497 s.sent = Instant::now();
9598 client::send(r);
crates/conveyor/src/server.rs+9−3
@@ -5,7 +5,8 @@
55 //! {"op":"ticket","project":"…","title":"…","body":"…","state":"draft","files":["/abs/path"]}
66 //! state defaults to ready; files are copied in
77 //! {"op":"set","project":"…","id":3,"state":"review"} move a ticket; `running` is conveyor's
8-//! {"op":"project","slug":"…","path":"/abs/dir"} add a project (the folder is made if missing)
8+//! {"op":"project","slug":"…","path":"/abs/dir"} add a project: a git repo, or a new or empty
9+//! folder, which becomes one
910 //! {"op":"project","slug":"…","slots":0} how many tickets run at once; 0 pauses it
1011 use crate::{library, paths, snapshot, store};
1112 use serde_json::{Value, json};
@@ -58,7 +59,7 @@ fn set(project: &str, id: u32, state: &str) -> Result<Value, String> {
5859 Ok(json!({"ok": true}))
5960 }
6061
61-/// Adds a project at `path` (made, with an empty git repo, if missing), or sets its slots.
62+/// Adds a project at `path`: a git repo, or a new or empty folder made into one. Or sets slots.
6263 fn project(slug: &str, r: &Value) -> Result<Value, String> {
6364 if slug.is_empty() || !slug.chars().all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_') {
6465 return Err("a slug is letters, digits, - and _".into());
@@ -69,7 +70,12 @@ fn project(slug: &str, r: &Value) -> Result<Value, String> {
6970 (None, Some(path)) => {
7071 let path = std::path::PathBuf::from(path);
7172 std::fs::create_dir_all(&path).map_err(|e| e.to_string())?;
72- if !path.join(".git").exists() {
73+ // Only a new or empty folder becomes a repo here: never git init someone's files.
74+ let empty = std::fs::read_dir(&path).map_err(|e| e.to_string())?.next().is_none();
75+ if !path.join(".git").exists() && !empty {
76+ return Err(format!("{} has files but isn't a git repository", path.display()));
77+ }
78+ if empty {
7379 crate::agent::git(&path, "", &["init", "-q", "-b", "main"])?;
7480 crate::agent::git(&path, "", &["-c", "user.name=conveyor", "-c", "user.email=conveyor@localhost", "commit", "-q", "--allow-empty", "-m", "Start"])?;
7581 }
spikes/6-ceiling/NOTES.md+82−0
@@ -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.