Skip to content

moca v0.11.0 — sandbox templates, async turns, and lease mode

Latest

Choose a tag to compare

@pdettori pdettori released this 20 Nov 14:32
47b9337

moca v0.11.0 — sandbox templates, async turns, and lease mode

v0.11.0 turns the sandbox service into something you can self-serve and operate: users create, build, tag and retire sandbox templates with provenance and quotas; the control plane gains async turns with per-turn grants and caps, which brings async fan-out back on P6; and the sandbox gains an experimental lease mode that keeps a guest warm between commands. The docs also moved to a site at rossoctl.dev/moca.

Rename: @moca/knative-server is now @moca/server (#804). Anything importing the old package name must update.

Sandbox templates

  • Store and API (#760, #766, #774, #781): the control plane keeps templates with builds, tags, readiness and a read API. Users can create a template (gated by policy and quotas), edit its tags, transfer ownership, and retire a template or one build of it.
  • Provenance (#756, #771, #769): template provenance is recorded in a hash chain that can be verified offline. A manifest hash v2 and a template record check cover the path from an image to a registered template.
  • Builds and placement (#772, #775, #776, #784, #818): a host agent builds queued templates, hosts get a wanted state, workers are placed by host memory, and cold starts are paced per host. A registered build is reused only while a host holds its snapshot.
  • Governance (#762, #786, #819, #943): subjects are enrolled and given the admin role through the API; admins set quotas and can reject a registered build after the fact. Retire and reject are refused while an active Moca Pi session is pinned to the build, and default moves off a retired or rejected build.
  • Sessions on templates (#789, #790): one control plane serves sessions and sandboxes, sessions can be pinned to a template, and a templated session seeds from its build and returns its workspace patch.
  • mocactl (#767, #768, #850): sbx templates create|build|follow|cancel (with --dry-run), sbx quota and sbx policy, --record, and sbx token --renew-every.
  • Egress records (#791, #792, #864): per-sandbox egress records through the API, sbx egress, verify-provenance --egress, and egress refusals that say what they mean.

Async turns and subagents

  • Async turns (#704, #713, #788, #807, #822, #840): submit a turn and read it back as a turn record. Its credential is resolved at dequeue, its model and sandbox tier are pinned, and its grants are minted and refreshed. Turns keep per-turn artifacts, a bounded status read and seven-day retention.
  • Async leaf worker on P6 (#717, #765, #861): a leaf worker consumes the queue on deploy/k8s, which closes the async fan-out gap v0.10.0 listed. /v1/batches was decided against: a fan-out is the caller's loop.
  • Caps and fairness (#856, #933): per-turn token and wall-clock caps, cancel for a running async turn, per-subject fairness, and a cluster-wide bound on an owner's running async leaves.
  • mocactl (#918, #922, #929): get --wait, spawn --max-concurrent, spawn --async, and watch to stream subagent state changes.

Lease mode (experimental, operator opt-in)

Lease mode keeps a warm guest between Execs and can track processes (#706, #763, #802, #808, #814). It is an experimental operator opt-in in this release (#920). Use mocactl sbx mode lease+processes <id> to switch a sandbox.

Sandbox lifetime and workspaces

  • Idle lifetime (#770, #837, #842, #843): a sandbox's lifetime counts idle time. Activity slides the deadline; the CLI has an activity hint and --lifetime, and the installer has SBX_MAX_LIFETIME_DAYS.
  • Workspace idle (#338, #882, #895, #949, #951): SH_WORKSPACE_IDLE for the container worker (default 8h), a turn is told when its session's workspace was reset, and a client releases its workspace at rm.

Fixes

  • Resume and login (#692, #694, #836, #858, #912): mocactl renders another device's newer turn on resume, keeps a prompt a 409 held back, names the control plane and the real error on a failed login, and sbx up uses the logged-in control plane.
  • Command retries (#729, #761): a command refused before it started is retried, then exits 75.
  • Egress (#829, #834, #870): a refusal after an abort writes nothing to the guest, a connection's slot is freed before its tunnel event, and the egress-credential follow-ups landed.
  • Control plane (#832, #827, #833, #941): a sandbox create rolls back if its start record fails, a near-miss identity-provider name refuses to boot, multi-tenant boot refuses unsafe model headers and Vertex ADC, and a build's lastUsedAt is its own.
  • Harness (#715, #835, #896, #898): /v1/runs honors the session sandbox tier, a deadline timer aborts a turn before its lease lapses, and leaked gRPC channels and transports are closed.
  • Sandbox workers (#757, #798, #800, #841, #872, #915): microVM worker and snapshot-build fixes, swept VMMs are waited for, a stopped worker's VMs are ended, a stalled worker can reconnect, and a workspace image larger than the 2 GiB snapshot drive is refused.
  • Deploy (#758, #812, #830, #869, #942, #945, #946, #948): Redis memory limit and image pin, setup refuses to switch an existing Redis 7 namespace to Valkey, sidecar probes use their status port, a read-only Redis ACL user for moca-provisioner, and OIDC and storage-class fixes.
  • Security (#803, #810, #874, #900): hono bump for Trivy CVEs, the test runner and its old esbuild are dropped from the image, outstanding OIDC login starts are bounded per client address, and sbx pull refuses patches for what git runs and reads.
  • Other (#703, #831, #886, #928): sbx claude denies Claude Code's local tools, a refusal burst past the reserve is deferred, and allow-everything egress mode via MOCA_EGRESS_ALLOW=*.
  • Dependency bumps: hono 4.13.18, @bufbuild/protobuf 2.17.0, marked 18.2.0, golang.org/x/sys 0.50.0, CodeQL and GitHub Actions groups.

Also in this release

  • Identity (#701, #851, #888): a generic OIDC identity provider (w3id) behind the login seam, wired into the sandbox installer, plus an installer token for the members API.
  • Operations (#868, #866, #904, #919): a Redis schema-version key with a checked config-bundle format version, configurable relay keepalives, and a host resource sampler.
  • Tooling (#727, #755, #867, #871, #846): sbx, a static Go client for one workspace; --version names its commit from a source checkout; tighter --help; opt-in SH_PROMPT_CACHE and SH_GATEWAY_CACHE switches for benchmarks.
  • Docs (#884, #905, #924, #925, #926, #930): the rossoctl.dev/moca site, a split sandbox user guide with a generated CLI reference, a template guide, an API client guide, and the operate guides moved into Deploy and operate.

Installing

curl -fsSL https://raw.githubusercontent.com/rossoctl/moca/main/scripts/install-mocactl.sh | sh

This installs the latest release (this one). The mocactl-edge prerelease tracks every push to main.

Full Changelog: v0.10.0...v0.11.0

Assisted-By: Claude Code