xonecas.io
8447
Co

conveyor / commit a08bae5

Faster ticket setup: the library ignores target/, the bake warms ~/work

Every ticket spent ~70 s before its agent did anything:
- push, 32 s: cp -r of the template carried target/ into the library's
  first commit, 713 MB pushed into every VM. Now 0.5 s.
- first preview build, 38 s: the image's cargo cache was warmed in
  /tmp/library (cargo fingerprints workspace crates by path) and before
  rune-kit, so rune and preview rebuilt each time. Now 12 s.

The template gets a .gitignore (conveyor's, in OWNED); the bake leaves
target/ out and builds where agents do.

Co-Authored-By: Claude Opus 5.5

sacenox2026-11-09 a08bae55dc77d17d336e9e4e047ae5fbf94ee19c parent 4ea51c5

5 files changed

DESIGN.md+2−1
@@ -212,7 +212,8 @@ Ctrl+click ─► conveyord: widgets ticket (kind, instance chain, tree, shared,
212212 - **A starter kit ships in the template**, every widget made with the builder: the title bar's Widgets dropdown (each placeable widget with its description), `board` (kanban by state, drag to move, quick-add), `ticket` (edit, conversation, actions by state, a review's `git diff --stat`), `editor`, `library`, a canvas per project and a taskbar of projects. A first run is an empty canvas: pick from the dropdown, or Ctrl+click to make your own.
213213 - **`api.rs` is conveyor's contract**, copied into the library on every start along with `gen.rs`, `CLAUDE.md` and the preview. The preview is the app's own host (`api::Live`) with sample data, so the agent checks exactly what the app runs.
214214 - The app restarts (on a conveyor change) with `exec` on the path it read at launch, and conveyord copies itself into VMs from `/proc/self/exe`: after cargo replaces a binary, `current_exe()` names the deleted file.
215-- The base image carries the pinned toolchain and a warm `~/.cache/conveyor-target`, so the agent's first preview build is incremental.
215+- The base image carries the pinned toolchain and a warm `~/.cache/conveyor-target`, so the agent's first preview build is incremental. The bake builds in `~/work`, where agents build: cargo fingerprints workspace crates by path, and a cache warmed elsewhere rebuilt rune and the preview in every ticket (38 s, against 1.2 s). Rebake when the template's dependencies change.
216+- The library ignores `target/`. Without it, `target/` landed in the first commit and every ticket pushed 713 MB into its VM (32 s, against 0.5 s).
216217
217218 #### What spike 5 showed (`spikes/5-builder/NOTES.md`)
218219
crates/conveyor/src/library.rs+1−1
@@ -12,7 +12,7 @@ pub const BASE: &str = "trial:main";
1212 static BUILD: Mutex<()> = Mutex::new(());
1313
1414 /// Conveyor's side of the library: kept in step with the template on every start.
15-const OWNED: [&str; 9] = ["api.rs", "gen.rs", "CLAUDE.md", "Cargo.toml", "Cargo.lock", "rust-toolchain.toml",
15+const OWNED: [&str; 10] = [".gitignore", "api.rs", "gen.rs", "CLAUDE.md", "Cargo.toml", "Cargo.lock", "rust-toolchain.toml",
1616 "preview/Cargo.toml", "preview/build.rs", "preview/src/main.rs"];
1717 const COMMIT: [&str; 4] = ["-c", "user.name=conveyor", "-c", "user.email=conveyor@localhost"];
1818
templates/library/.gitignore+1−0
@@ -0,0 +1 @@
1+target/
templates/library/CLAUDE.md+1−1
@@ -17,7 +17,7 @@ Read the words against that. "Make this purple" means the clicked kind. "Put a l
1717
1818 ## What's yours to change
1919
20-Only `widgets/`. Everything else is conveyor's (`api.rs`, `gen.rs`, `preview/`, `Cargo.*`, this file), and a branch that changes it is rejected.
20+Only `widgets/`. Everything else is conveyor's (`api.rs`, `gen.rs`, `preview/`, `Cargo.*`, `.gitignore`, this file), and a branch that changes it is rejected.
2121
2222 A file in `widgets/` with `pub const WIDGET` is a widget kind. One without it is a helper module the widgets share (`use super::highlight;`): put code two widgets need, or a big piece of one, there instead of growing a widget file.
2323
tools/bake.py+6−4
@@ -297,11 +297,13 @@ def bake():
297297 log("verify:", (r.stdout or "").strip().replace("\n", " | "))
298298 # Rust and a warm cargo cache, so a widget ticket builds in seconds, not minutes.
299299 log("pre-building the widget library")
300- tar = subprocess.run(["tar", "-C", str(REPO / "templates"), "-cf", "-", "library"], capture_output=True, check=True).stdout
300+ # In ~/work, where agents build: cargo fingerprints workspace crates by path.
301+ tar = subprocess.run(["tar", "-C", str(REPO / "templates"), "--exclude=library/target", "-cf", "-", "library"],
302+ capture_output=True, check=True).stdout
301303 subprocess.run(["ssh", "-i", str(KEY), "-p", str(ssh_port("bake")), "-o", "BatchMode=yes", "-o", "StrictHostKeyChecking=no",
302- "-o", "UserKnownHostsFile=/dev/null", "-o", "LogLevel=ERROR", f"{USER}@127.0.0.1", "tar -xf - -C /tmp"], input=tar, check=True)
303- r = ssh("bake", "rustup default 1.99.1 >/dev/null 2>&1 && cd /tmp/library && CARGO_TARGET_DIR=$HOME/.cache/conveyor-target "
304- "cargo build --release -p preview 2>&1 | tail -1 && rm -rf /tmp/library", check=False)
304+ "-o", "UserKnownHostsFile=/dev/null", "-o", "LogLevel=ERROR", f"{USER}@127.0.0.1", "tar -xf - -C /tmp && mv /tmp/library ~/work"], input=tar, check=True)
305+ r = ssh("bake", "rustup default 1.99.1 >/dev/null 2>&1 && cd ~/work && CARGO_TARGET_DIR=$HOME/.cache/conveyor-target "
306+ "cargo build --release -p preview 2>&1 | tail -1; cd && rm -rf ~/work", check=False)
305307 log("library:", (r.stdout or r.stderr or "").strip())
306308 # Reset what must be unique per overlay, then shut down clean.
307309 ssh("bake", f"echo {PASS} | sudo -S sh -c 'rm -f /etc/ssh/ssh_host_* && : > /etc/machine-id && fstrim -a'", check=False)