Skip to content

Storage Reference

GSV uses several storage planes. The Kernel chooses the plane based on whether the data is control-plane state, active process state, byte/object data, or versioned repository content.

Storage Planes

PlaneBacking StoreUsed For
Kernel SQLiteKernel Durable Object SQLUsers, groups, tokens, OAuth accounts, config, devices, routing tables, process registry, packages, adapter links, automation, notifications.
Process SQLiteProcess Durable Object SQLActive messages, pending tool calls, message queue, HIL state, process-local metadata.
AppRunner SQLite/KVAppRunner Durable Object storagePackage runtime SQL, daemon schedules, loaded package runtime props.
R2 STORAGE bucketCloudflare R2Ordinary virtual filesystem files, process media, process archives, package artifacts, CLI download mirrors.
ripgitRIPGIT bindingVersioned home knowledge, package source repositories, mounted source trees.

Virtual Filesystem Mapping

The native fs.* and shell.exec handlers use GsvFs, a Linux-like virtual filesystem with explicit mount routing.

PathBacking StoreNotes
/sys/*, /proc/*, /dev/*Kernel SQLite and live registriesVirtual control-plane files.
/etc/passwd, /etc/shadow, /etc/groupKernel auth tablesOverlaid on top of regular /etc storage.
~/context.d/*ripgit home repo, with R2 fallbackAccount prompt context. Human homes start empty; agent homes seed style and user files. Personal agents also get a one-time boot file.
~/skills.d/*ripgit home repo, with R2 fallbackUser-global reusable process skills.
~/knowledge/*ripgit home repoDurable knowledge databases.
Other home filesR2Stored as ordinary objects with uid/gid/mode metadata.
/src/packages/{packageName}ripgit package source plus R2 overlayVisible installed package source. Writable owned sources stage process-local edits in R2 until explicit commit.
/usr/local/bin/*package mountRead-only package command shims.
Everything elseR2Default object-backed filesystem.

Directory entries in R2 use .dir marker objects. File objects store POSIX-like metadata in custom metadata: uid, gid, mode, and optional dirmarker.

Kernel SQLite

Kernel SQLite is the authoritative control-plane store. Important tables include:

TablePurpose
passwd, shadow, groups, auth_tokensUsers, passwords, groups, and issued auth tokens.
oauth_accounts, oauth_flowsStored generic OAuth account credentials and pending authorization-code + PKCE flows.
mcp_servers, cf_agents_mcp_serversUser-owned MCP server metadata plus the Agent MCP client manager's connection/OAuth state.
config_kvRuntime configuration exposed under /sys/config and /sys/users.
group_capabilitiesCapability grants by group id.
devices, device_accessRegistered devices and group access.
routing_tableIn-flight device-routed syscalls.
processesProcess registry, identity, cwd, mounts, state.
packagesInstalled package manifests, scopes, grants, and artifact hashes.
identity_links, surface_routes, link_challengesAdapter actor links and inbound surface routing.
run_routesRoutes process run signals back to clients or adapter surfaces.
notifications, signal_watches, app_sessions, app_session_clients, app_session_client_keysNotifications, watches, package UI sessions, attached app clients, and per-client launch/session keys.

Process SQLite

Each Process DO owns its own SQLite database. This keeps active agent-loop state close to the durable process.

TablePurpose
messagesCurrent conversation history for the process.
pending_tool_callsSyscalls waiting on Kernel or device responses.
message_queueFIFO queue for messages received while a run is active.
pending_hilHuman-in-the-loop approval state.
process_kvProcess metadata such as identity, profile, current run, and archive id.

On proc.reset or proc.kill, process messages can be archived to R2.

R2 Object Layout

R2 remains the byte store. The current runtime uses these key families:

Key PatternWritten ByPurpose
Any normal filesystem key, for example home/alice/file.txtR2MountBackendDefault virtual filesystem storage.
var/media/{uid}/{pid}/{uuid}.{ext}Process media handlingUploaded or adapter-provided media attached to process messages.
var/sessions/{username}/{pid}/{archiveId}.jsonl.gzProcess reset/kill archiveGzipped JSONL transcript archive.
runtime/package-artifacts/{hash}.jsonPackage install/syncPackage worker artifact loaded by AppRunner.
public/gsv/downloads/cli/{channel}/{asset}sys.bootstrap CLI mirroringDownloadable CLI binaries served through /public/*.
public/gsv/downloads/cli/{channel}/{asset}.sha256sys.bootstrap CLI mirroringCLI checksums served through /public/*.
public/gsv/downloads/cli/default-channel.txtsys.bootstrapDefault CLI release channel.
public/gsv/downloads/cli/install.{sh,ps1}sys.bootstrapStatic CLI install scripts served through /public/*.
public/gsv/assets/tts/**sys.bootstrap Piper asset seedingBrowser-local TTS runtime, WASM, and default voice assets served through /public/*.
process-source-overlays/{pid}/{packageId}/manifest.jsonPackage source mount, pkg sourceManifest of staged package source edits for one process/package.
process-source-overlays/{pid}/{packageId}/files/{path}Package source mount, pkg sourceStaged file content for package source puts.

Process media is deleted by prefix when the process is reset or killed. Package artifacts are content-addressed by hash and referenced from the Kernel packages table.

ripgit Repositories

ripgit stores versioned content. It is used anywhere history, diffs, search, or source snapshots matter.

RepositoryRef HelperMounted AtPurpose
{username}/homehomeKnowledgeRepoRef(username)~/context.d, ~/skills.d, ~/knowledgeHome context, skills, and knowledge databases.
Package source repos, for example root/gsv or {owner}/{repo}package manifest source.repo/src/packages/{packageName}, repo.*Installed package source, review context, and generic repo operations.

The root/gsv repository may contain a top-level skills/ directory. Bootstrap copies those files into user home repos under skills.d/ when they are missing.

Package source mounts are always visible for installed packages the process identity can see. Sources owned by the current user are writable through a process-local R2 overlay; pkg source status, pkg source diff, pkg source commit, and pkg source discard make commit/discard explicit. Other package sources are read-only. Home knowledge repos are writable through the filesystem; generic repository operations use repo.*, and Wiki-specific behavior uses the higher-level knowledge interface.

Package Runtime Storage

Installed package records live in Kernel SQLite. The executable artifact is stored in R2 under runtime/package-artifacts/{hash}.json. AppRunner loads that artifact into the worker loader and provides package code with package-scoped SQL through this.storage.sql.

AppRunner also stores runtime props in Durable Object KV and daemon schedules in its own app_rpc_schedules table.

Practical Rules

  • Use Kernel SQLite for authoritative control-plane state.
  • Use Process SQLite for active conversation and run state.
  • Use R2 for opaque bytes, archives, media, and default filesystem files.
  • Use ripgit for user-editable/versioned documents, knowledge, and package source.
  • Prefer filesystem paths in agent prompts; the mount layer hides the backing store.