8cb1c776 ยท zzmq.dev@gmail.com/zz
Commit
8cb1c776d4bed9da977a5acf18d4c97c8e0448f6
Backend step 1: define the interface, move today's code behind LocalBackend Step 1 of site/content/remote-backend/index.md's build sequencing: define Backend, move the existing engine behind LocalBackend with zero behavior change, before anything Cloudflare exists to build step 2 (a real Worker + Durable Object) against. engine/backend.ts is the one seam between the protocol (Lane/Ask/Answer, the Ladder, git content) and where it actually lives. Every method takes a repo slug ("owner/repo"), never a resolved local path -- that's exactly the thing only a backend should know, since a future CloudflareBackend has no local filesystem path at all. engine/ localBackend.ts wraps today's real behavior (a local clone, the existing SQLite/git-notes storage) behind it unchanged. This moved the abstraction boundary up into engine/lane.ts itself, not just engine/store.ts: ask()/answer()/proposeLane()/mergeLaneLadder() now take a repo slug and call resolveBackend() internally, rather than taking a resolved stateDir/repoDir that only a local filesystem has. Every caller (agent/tools.ts -- the full live tool surface -- plus engine/workqueue.ts, cli/commands/work.ts, review.ts, ask-post.ts, and the onboarding scripts ladder-build.ts/ladder-replay-commits.ts/ demo/greenfield.ts) now passes a slug instead of a path. Left local-only for now, deliberately: run_in_sandbox (real git worktrees -- there's no general code-execution sandbox in a Worker either, a separate problem from this move), and a few read-only CLI tools (lane-log, the TUI's lane snapshot poller) that still read store.ts directly. None of those are part of the live agent-loop surface a CloudflareBackend needs to serve. Verified live: reset state, ran the real `zz work` loop end to end (claim -> propose -> changeset_review -> submit_changeset -> 3-way merge -> commit -> Ladder write) through the new Backend seam -- identical behavior to every prior run this session, same real commit landing with real Ladder rungs. Next: stand up a Worker + Durable Object against a real Cloudflare account (step 2), prove a real Artifacts clone/read before the Lane/ Ask state or the tool routes.
Troy Howard <thoward37@gmail.com> -- 2026-10-11T10:07:48.000Z