Commit 46e38d5
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
- crates
- vz-api
- src
- tests
- vz-cli/src
- commands
- vz-stack/src
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | | - | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
0 commit comments