02
  • Infrastructure

os-hub

One place to manage many Zion OS instances: create, run, update, and inspect each one in its own local or cloud sandbox.

The hub manages the environment; Zion OS runs the agent and its apps. Lifecycle and deployment changes run as jobs through one provider interface. The console exposes what each provider supports, while Rooms and Networks organize collaboration between instances.

In the ecosystemWhere Zion OS instances are created and looked after. Its Rooms page creates and links Getaroom rooms and retains their receipts. Networks group instances and prepare invitations; the OS client that joins rooms and starts agent work is the next phase.

00
  • Overview

System

One control plane for the fleet. The console and API manage instance jobs, versioned configuration and provider-backed sandboxes, with state in SQLite and stable cloud addresses through the hub proxy. Rooms connects to Getaroom; Networks adds membership, machine identities and invitations.

Stack
Bun · Express · React
State
One SQLite file
Providers
Docker · Modal · Vercel · E2B
Sign-in
WorkOS AuthKit
hub server serves the console too sandboxes one zion os each console os manager instance console monitor files config deploys logs shell tabs follow the provider /api 1 api bun · express jobs background provision · deprovision start · stop · pause restart · deploy health check ≤ 180s select 2 state hub.db sqlite instances · jobs · activity deployments · metrics secret config · encrypted 3 providers one interface platform → docker docker local modal cloud vercel cloud · all tabs e2b cloud capabilities 4 boot zion os127.0.0.1:5301 zion ostunnel zion os*.vercel.run zion os*.e2b.app 5 alice-work.os.zionru.dev stable address proxy host → live endpoint current endpoint 6 collaboration · hub coordinates, Getaroom runs rooms networksmembers · machine identity invitationsapproval · OS acceptance Getaroomseats · context · seal receipt archiveretained in hub.db 7
Fig. 02One hub, many sandboxes
  1. 1ConsoleOS Manager lists every instance. An instance's console shows only the tabs its provider supports. Sign-in goes through WorkOS.03 Console
  2. 2API and jobsLifecycle and deployment operations run as background jobs that the console polls. A start isn't done until the instance passes a health check.01 Lifecycle
  3. 3StateOne SQLite file retains instance records, jobs, deployments, metrics, rooms and networks. Secret values are encrypted separately.08 State
  4. 4ProvidersOne interface for Docker, Modal, Vercel Sandbox and E2B. Platform, the default, hands off to one of them.02 Providers
  5. 5SandboxesOne Zion OS per sandbox. The agent, its apps and their data stay inside it.02 Providers
  6. 6AddressCloud instances keep one address under os.zionru.dev. The hub's proxy follows the sandbox to its current endpoint. Each OS keeps its own sign-in session.05 Access & routing
  7. 7CollaborationRooms manages remote workspaces and keeps receipts. Networks prepares membership, credentials and invitations for the OS client.07 Networks
  8. Not built yetThe OS client. Networks already group instances and link rooms; members stay offline until it connects.
01
  • Runtime

Lifecycle

Lifecycle changes run as jobs, with progress and a final state.

The API answers at once and hands the work to a job: provision, start, stop, pause, restart, deploy or deprovision. The job calls the provider and writes its progress and the result to SQLite, where the console reads them; a job that brings the instance up also waits up to three minutes for it to report healthy. An instance is running, idle after a pause, off after a stop, or failed. On Modal and Vercel, a start brings the sandbox up at a new endpoint; the address under os.zionru.dev stays the same.

Job records are persisted, but lifecycle execution runs inside the hub process. A durable queue and restart recovery remain production work. Deprovision removes the local record even if remote destruction fails, so that result alone does not confirm provider cleanup.

provision pause start deprovision status running idle running job health ≤ 180s endpoint a b address alice-work.os.zionru.dev a start brings a new endpoint; the address stays progress and status land in sqlite; the console polls
Fig. 02.1One Modal instance, four jobs
Jobs
Provision · start · stop · pause · restart · deploy · deprovision
States
Running · idle · off · failed
Health
Waits up to 180s
Address
name.os.zionru.dev
02
  • Sandboxes

Providers

One interface for every sandbox, with the extras made explicit.

Every provider can provision, start, stop, pause, restart, destroy and tail logs. Files, metrics, deploys and a shell are optional: a provider opts in by implementing them, and the hub offers the matching console tabs only where it has. A pause keeps something different on each: the container on Docker, the volume on Modal, a snapshot on Vercel, memory on E2B. Platform, the default, hands off to a driver, Docker unless configured; a hosted installation can choose a cloud driver instead.

Integrations connects each user’s cloud provider account. Credentials are encrypted in the hub and resolved server-side when acting on that user’s instances. Platform continues to use its configured driver; the sandbox and its durable data follow that driver’s lifecycle semantics.

logstail filesbrowse monitorusage deploysconfig shellexec dockerlocal modalcloud vercelcloud e2bcloud platformdefault follows its driver always opted in not offered
Fig. 02.2What each provider offers
Interface
Provision · start · stop · pause · restart · destroy · logs
Optional
Files · metrics · telemetry · deploy · exec
Default
Platform, Docker unless configured
Pause keeps
Container · volume · snapshot · memory
03
  • Operations
  • Monitoring

Console

Inspect the environment and operate the instance from one console.

Logs is always available. Monitor, Files, Config, Deploys and Shell follow the provider’s declared capabilities, with command execution also controlled by a hub setting. The same capability checks govern the API, so the console reflects the operations the backend can actually perform.

For providers with metrics, a background sampler records CPU, memory, disk, data size and file count, then folds headline values into the fleet view. The monitor adds history and provider telemetry such as session expiry. Bastion derives sandbox posture from the hub’s observed facts and marks unobserved layers as unassessed.

instance console provider capabilities select the available tabs inspect metrics · telemetry logs · posture operate files · command exec config · deployments metric history SQLite → charts provider APIs ownership checked metrics default: 30s interval · 500 retained samples
Fig. 02.3 One console, explicit provider capabilities
Inspection
Logs · metrics · telemetry · posture
Operations
Files · config · deploy · exec
Sampling
30 seconds by default
History
500 samples per instance by default
04
  • Configuration
  • Revisions

Config & deploy

Track what is saved, what is deployed, and what passed health checks.

Each instance has a versioned environment configuration. Secret values are encrypted at rest and masked in the console. Editing advances the saved version; the deployed version records the configuration the sandbox successfully started with. A mismatch appears as pending configuration drift.

A deployment selects an image or git revision through a capable provider. The hub records the requested revision, job progress and bounded build log, then records the resolved digest or commit when supplied. Successful health checks mark the deployment and configuration as applied. A failed deployment remains visible in history.

saved config version · encrypted secret values masked requested revision image or git provider defaults deployment job provider deploy → wait for healthy deployment record revision facts · build log · applied config version saved version ≠ deployed version: configuration drift
Fig. 02.4 Configuration becomes applied only after health
Inputs
Versioned environment · image or git revision
Secrets
Encrypted at rest · masked in the UI
Result
Revision facts · bounded log · status
Applied
Deployed version after successful health checks
05
  • Identity
  • Ingress

Access & routing

A stable address reaches the current sandbox; each OS owns its session.

Human management uses the hub’s server-side WorkOS sign-in and sealed session. The external identity maps to a local user ID, and instance operations check that owner. Launch checks that the instance is running, then opens its own AuthKit login entry point when WorkOS is configured. The OS establishes its own session through the shared identity environment.

Cloud URLs stay under os.zionru.dev while the underlying provider endpoint can change. The hub proxy looks up the hostname, checks the running state and forwards to the current endpoint in sandbox metadata. Unknown, stopped or unreachable instances return explicit errors. Docker uses a loopback host port.

human management hub sign-in session instance traffic stable hostname owned instance launch running OS open its AuthKit login hub proxy host lookup current endpoint OS session sealed by the OS live sandbox provider URL can move instance traffic currently depends on the hub proxy
Fig. 02.5 Identity and routing follow separate paths
Human identity
WorkOS · local owner ID
Session
Separate hub and OS sealed sessions
Cloud ingress
Stable hostname → current endpoint
Local ingress
Docker loopback port
06
  • Getaroom
  • Receipts

Rooms

Manage collaboration spaces and keep the result after they close.

The Rooms page creates or links owned Getaroom rooms, shows seats and shared context, edits supported permission rules and issues participant keys. Getaroom owns the room sandbox and runtime enforcement. The hub owns its room link, operation records, cached snapshots and retained receipts.

Create and close intent is persisted before the remote request. Ambiguous creation goes to review unless the remote service guarantees idempotent creation. Closing seals the room; receipt archival retries separately if retrieval fails. Live events refresh the detail view, while snapshots restore its current state after reconnecting.

Background room work uses the owner’s verified access token in memory. After restart or expiry it waits for the user to reopen Rooms or Networks; unattended service authorization is a later step.

hub room intent link · request key operation record Getaroom sandbox · seats context · rules known room snapshot · live events seal on close uncertain create needs review link an owned room retained receipt archive survives the remote room sandbox
Fig. 02.6 Remote room lifecycle, local retained evidence
Hub owns
Links · operations · snapshots · receipts
Getaroom owns
Sandbox · seats · context · enforcement
Close
Seal room · archive receipt
Recovery
Reconcile uncertain creates
07
  • Membership
  • Invitations

Networks

Group your instances, discover peers, and prepare access to shared rooms.

A network groups OS instances owned by one hub user and links Getaroom rooms. Enrollment stages a separate machine credential in encrypted instance configuration; the authentication record stores its hash. Rotation or revocation invalidates that identity. Membership enables scoped discovery, while availability comes from client heartbeats rather than sandbox running status.

Invitations carry instructions and an optional coordinator. Peer requests require owner approval by default, and every recipient independently accepts. The hub then prepares a room credential for that instance, tracks join reports and revokes access when the invitation ends. The coordinator label describes the task; it grants no extra room privileges.

The Hub side is implemented. Until the OS client connects, members await their first connection and invitations await acceptance. Creating an invitation does not start an agent; uncertain seat creation requires reconciliation.

network membership owned instances · linked rooms machine identity · heartbeat availability hub invitation API approval → invitation → accept → room credential OS client · next phase poll · accept · connect · report Getaroom room · agent work
Fig. 02.7 Hub contract ready; OS client is the next phase
Scope
One owner · instances in multiple networks
Machine identity
Hashed credential · encrypted deployable copy
Presence
Offline after 90s without a heartbeat
Next phase
OS room client · agent task execution
08
  • Persistence
  • Operations

State

Keep the fleet’s control records separate from each OS’s working data.

One SQLite database holds users, provider accounts, instances, jobs, deployments, metrics and activity, plus room links, receipts, networks, machine identities and invitations. Agent sessions, app data and runtime memory belong inside each Zion OS sandbox, with persistence determined by its provider.

The hub currently runs as one process: lifecycle jobs, monitoring, room reconciliation and invitation cleanup execute alongside the API. Lifecycle progress is stored, but the executing job is not a durable queue. Room and invitation intent supports more explicit recovery, including review states for uncertain remote effects.

Keep the encryption key with a recoverable database backup. The storage abstraction, organization/team model and production scaling topology are documented plans; they are not implemented guarantees.

hub.db · SQLite control records · encrypted secret values instance operations jobs · revisions metrics · activity provider accounts collaboration records room links · receipts networks · identities invitations OS working data stays in its sandbox sessions · apps · memory · provider persistence production target: durable jobs · portable storage
Fig. 02.8 Hub control records and OS working data
Current topology
One process · one SQLite file
Workers
Lifecycle · monitoring · rooms · invitations
Secret recovery
Database plus preserved encryption key
Planned
Durable queue · storage abstraction · separate ingress