Skip to content

Commit 46e38d5

Browse files
feat(sandbox): wire Sandbox entity end-to-end — persistence, orchestration, API, CLI
Implements the Sandbox as a first-class domain entity with full lifecycle: Persistence (vz-stack): - Add sandbox_state and allocator_state SQLite tables with CRUD methods - Add AllocatorSnapshot for crash recovery of ports/IPs/mount offsets - Add 5 sandbox event variants (Creating/Ready/Draining/Terminated/Failed) Orchestration (vz-stack): - ensure_sandbox() creates/reuses Sandbox entity per stack - transition_sandbox_ready() after first successful execution - teardown_sandbox() for graceful Ready→Draining→Terminated - Wire RestartTracker into reconciliation loop - Persist/restore allocator state across restarts API (vz-api): - Replace 501 stubs with real sandbox CRUD handlers - POST /v1/sandboxes (create), GET /v1/sandboxes (list) - GET /v1/sandboxes/{id} (inspect), DELETE /v1/sandboxes/{id} (terminate) - Add server binary, integration tests CLI (vz-cli): - Add `vz sandbox list|inspect|terminate` subcommands - Table and JSON output modes Closes: vz-arp, vz-rhs, vz-f3c, vz-v2n.1.2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c0be386 commit 46e38d5

15 files changed

Lines changed: 1906 additions & 24 deletions

File tree

.beads/issues.jsonl

Lines changed: 42 additions & 12 deletions
Large diffs are not rendered by default.

crates/Cargo.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ console = "0.15"
150150
ratatui = "0.29"
151151
crossterm = "0.28"
152152

153+
# UUID
154+
uuid = { version = "1", features = ["v4"] }
155+
153156
# Testing
154157
tempfile = "3"
155158

crates/vz-api/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,22 @@ license.workspace = true
88
repository.workspace = true
99

1010
[dependencies]
11+
anyhow = { workspace = true }
1112
async-stream = "0.3"
1213
axum = { version = "0.8", features = ["ws"] }
14+
clap = { workspace = true }
1315
serde = { workspace = true }
1416
serde_json = { workspace = true }
15-
tokio = { workspace = true, features = ["time"] }
17+
tokio = { workspace = true, features = ["macros", "net", "rt-multi-thread", "signal", "time"] }
1618
tokio-stream = { workspace = true }
1719
tracing = { workspace = true }
20+
tracing-subscriber = { workspace = true }
21+
uuid = { workspace = true }
1822
vz-runtime-contract = { workspace = true }
1923
vz-stack = { workspace = true }
2024

2125
[dev-dependencies]
26+
reqwest = { workspace = true }
2227
tempfile = { workspace = true }
2328
tower = { workspace = true }
2429
vz-agent-proto = { workspace = true }

0 commit comments

Comments
 (0)