TheDocumentation Index
Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
Use this file to discover all available pages before exploring further.
Workspace is the shared kernel inside Mirage’s Arm.
It is the concrete Python object that holds the resources shared across
mounts, commands, and sessions.
Technically, Workspace owns the global coordination layer of Mirage:
mounts, cache, command registry, job tracking, execution history, and session
lifecycle.
Unix Analogy
| Unix kernel | Mirage Workspace |
|---|---|
| VFS mount table | MountRegistry |
| Page cache | File cache and index cache |
| Process table | Job table |
| System call dispatch | Command registry |
| Shell host | Session manager plus executor |
Workspace
is shared across all sessions. Multiple sessions read from the same mounts,
share the same cache, and have their jobs recorded in the same job table.
What Workspace Owns
- Mount registry - prefix-based routing of virtual paths to resources
- Cache - shared file and index cache used across commands and sessions
- Command registry - command and op lookup through mounted resources
- Job table - background job tracking
- Execution history - recorded command runs and I/O metadata
- Observer stream - read-only session traces exposed at
/.sessions - Session manager - creation, lookup, and closing of sessions
What Workspace Coordinates
execute()parses a shell command, runs it against the right mounts, and returns anIOResultdispatch()routes low-level ops to the right mounted resourcesync()flushes dirty data back to resources when the sync policy requires itclose()shuts down FUSE state, background tasks, and cache state
Session Lifecycle Through Workspace
create_session()creates a new session with its own cwd and envget_session()retrieves a session by idlist_sessions()lists all active sessionsclose_session()closes one sessionclose_all_sessions()closes every non-default session
What Workspace Does Not Own
- Per-session mutable state - cwd, env, functions, and last exit code live on
Session - Mount semantics - prefix binding and access policy belong to Mounts
- Shell syntax - parsing, expansion, and control flow belong to the Shell
Common Shape
/, read-only remote data
at named prefixes.
execute()
execute() is the main entrypoint into the kernel. It parses the command,
looks up the target session, resolves mounts, runs the shell executor, applies
I/O side effects, and records history.
Persistence: save, load, copy
AWorkspace can be serialized to a tar archive and reloaded later, or
copied in-process for speculative execution / parallel agent forks:
resources=... at load time. The same machinery powers OpenAI Agents
sandbox checkpoints (persist_workspace / hydrate_workspace).
See Snapshot for the format, override rules,
copy-vs-save divergence, and OpenAI Agents integration.