Inspired by exoharness/exo's sandbox system — the one piece of its architecture we clearly lack.
Design sketch:
src/sandbox.zig: vtable seam with two roles — a backend (acquire a sandbox, acquire-from-snapshot) and a handle (exec, start process, snapshot). Mirrors the ManagedSandboxBackend/ManagedSandboxHandle split.
- First backend: Docker via CLI only (no SDK): snapshot =
docker commit -p <ctr> graff-snap-<id> + docker save to a tar blob; restore = docker load + docker run with the image swapped in; evict any warm container for the key first. AppleContainer (container CLI) is the same wire with a different binary.
- Snapshots persist under
.graff/sessions/<id>/snapshots/<snap>/{manifest.json,payload.bin}; the conversation log stays canonical and is never rewound with the sandbox — filesystem state only, processes relaunch.
- REPL:
/snapshot and /rewind <id>.
- Teleport = restore a DockerImageTar snapshot on a different backend (e.g. Daytona), which we already use by hand for Windows verification.
Why we want it: the bot sandbox runner (zigrepper#136 phase 2), DGM trial isolation beyond git worktrees, and try-risky-thing-then-rewind workflows.
Known exo limitations to avoid repeating: whole payload held in memory during capture/restore; no snapshot GC.
Inspired by exoharness/exo's sandbox system — the one piece of its architecture we clearly lack.
Design sketch:
src/sandbox.zig: vtable seam with two roles — a backend (acquire a sandbox, acquire-from-snapshot) and a handle (exec, start process, snapshot). Mirrors the ManagedSandboxBackend/ManagedSandboxHandle split.docker commit -p <ctr> graff-snap-<id>+docker saveto a tar blob; restore =docker load+docker runwith the image swapped in; evict any warm container for the key first. AppleContainer (containerCLI) is the same wire with a different binary..graff/sessions/<id>/snapshots/<snap>/{manifest.json,payload.bin}; the conversation log stays canonical and is never rewound with the sandbox — filesystem state only, processes relaunch./snapshotand/rewind <id>.Why we want it: the bot sandbox runner (zigrepper#136 phase 2), DGM trial isolation beyond git worktrees, and try-risky-thing-then-rewind workflows.
Known exo limitations to avoid repeating: whole payload held in memory during capture/restore; no snapshot GC.