Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

id

ID is Drew’s identity and graph platform. It started as a peer-to-peer file sharing tool and is now a local-first, federated, capability-based application platform built on the Iroh networking stack. The parts of the system are:

  • Content-addressed objects. A file is stored under the hash of its bytes in an Iroh blob store. A human-readable name points at the hash, so the same content is the same object on every node that holds it.
  • P2P file sharing over Iroh. Nodes store, retrieve, and send files by name or by hash, locally or against a remote node named by its 64-hex node ID. Peer discovery runs over gossip, mDNS, and an optional DHT lookup.
  • Worlds with Roc guests. A world is a multiplayer program written in Roc, compiled to an import-free Wasm module, and run by a host under the Plaza ABI v1. Guests have no direct access to the filesystem, the network, the clock, or randomness; every effect goes through the capability protocol.
  • Capabilities. World access is granted as capabilities: an invite minted by a host’s admin, a per-world ceiling that bounds what any program in the world may request, and provider grants enforced on the host side. Reaching a node grants no authority on that node.
  • The directory. A home-server directory holds accounts, groups, invites, and keysets, recorded in an append-only journal and replayed through the same code path as live changes.
  • The hosted edition. A per-user edition of the same system runs as a Cloudflare Worker with one Durable Object per user. In the source tree today it is a local-only scaffold: it is not a deployed service, and this book says so wherever it describes it.

The code lives in pkgs/id/ in the developing-today/code repository: a Rust workspace of 17 packages — the root id crate (the facade) plus 16 crates under pkgs/id/crates/ — surveyed at commit 1ccb4a19457 on 2026-11-23.

Why ID exists

Before ID, each of Drew’s tools kept its own store in its own shape, and each program that needed identity, files, or shared state built its own version of them. ID replaces those separate stores with one platform:

  • One object store for files and records. Files, documents, signed events, and world state all live in content-addressed or signed, journalled stores with one set of rules for naming, tagging, and sync, instead of one ad-hoc store per application.
  • Identity and authority in one place. Accounts, groups, delegation, key custody, and recovery are directory functions. World access is a capability issued against that identity, not a password per program.
  • Local-first, hostable by anyone. A node runs entirely on one machine from a data directory. Hosting is an explicit act — id serve — and remote commands are clients only: they connect out to a host and never host a world themselves. The hosted edition is a per-user backstop built from the same stores, not a requirement.
  • Programs that cannot exceed their grant. A Roc guest is a pure function over its model plus a list of capability requests. The host answers each request only if the world’s ceiling and the participant’s grant allow it; a known but ungranted request returns a refusal, never silent execution.

Who it serves

  • Drew, at the command line. The id binary is the owner’s tool: file commands (put, get, find, list, cat, show, peek), the tag family, serve, the world client commands, group, doc, claim, key, and keyset. Running id with no subcommand starts the interactive REPL. The second binary, id-native-shell, is the Bevy desktop shell.
  • Agents in worlds. An agent joins a world with a capability and acts through the world session protocol. The MCP bridge in the id-caps crate translates MCP tool calls into world session frames under a policy point that checks a capability ceiling, charges quota before execution, and writes one signed audit event per action. The bridge is a library translator: there is no standalone MCP server binary in pkgs/id. See Agents in worlds: the MCP bridge and policy and The MCP bridge.
  • Hosted per-user edition users. A bound hosted user gets one Durable Object holding that user’s key-value data, blob references, and a signed-object bridge store that acts as a sync peer. The binding ceremony is native code (pkgs/id/src/hosted_binding.rs); the Worker consumes the resolved binding and jurisdiction headers. This edition is a scaffold in the tree, gated on issues #2285 and #3403 for any real deployment. See The hosted edition and The hosted Worker API.

The surface map

ID is one platform with several surfaces. The map below is the whole system on one page; The shape of the system explains how the pieces fit together.

SurfaceWhat it isWhere it is covered
The crates17 packages: the id facade plus id-core, id-caps, id-store, id-events, id-groups, id-sync, id-directory, id-worlds, id-web, id-cli, id-config, id-currency-registry, id-render, id-import-notion, id-native-shell, and id-hw-shellThe crates, The id facade crate
The id binaryThe CLI: 32 top-level commands and 113 leaf commands (surveyed 2026-11-23), including serve, the only command that hosts files, a world, or the web UIThe id command line
The id-native-shell binaryA Bevy desktop client for the world shell contract; a workspace member but not a default member, so a normal id build never builds itid-native-shell
The REPLThe interactive shell started by id repl or by bare id, with its own parser, its own command set, and shell features (command substitution, the `>` pipe-in operator, here-strings, and heredocs)
The web UIThe id-web crate served by id serve --web (bind default 127.0.0.1, port default 3000): file browser, collaborative editor, world pages, program gallery, and the HTTP and WebSocket APIs — 54 distinct paths and 58 method bindings in the main router (surveyed 2026-11-23)The web UI: pages and HTTP API, WebSocket protocols
The hosted Worker scaffoldpkgs/id/hosted-worker: a Cloudflare Worker front door forwarding to one UserDO Durable Object per bound user, with 15 method routes; local-only, not deployedThe hosted Worker API
The MCP bridgeid_caps::mcp_bridge and id_caps::mcp_policy: a library-level translator from 8 pinned MCP v1 tools to world session frames, plus the host-side policy point; no server binary and no transport of its ownThe MCP bridge

How to read this book

  • First run: Installation and provisioning, then Quickstart. You will have a built id binary, a verified version string, and one complete store, fetch, tag, and find run.
  • Understanding the system: The shape of the system, then Architecture, then the concept chapter for the part you are working in — the file core, worlds, capabilities, identity and the directory, sync, events, residency, the hosted edition, shells, agents, and currency.
  • Looking up an exact surface: the reference part gives, for every command, page, endpoint, and protocol, its invocation shape, its flags with their literal defaults, its behaviour, and its failure shapes.
  • Building on the library: the library part covers the crates as a Rust API, starting from the facade; the tutorials walk through complete tasks end to end.
  • Design work: the design part is explicitly design. Those chapters describe the recorded design programme — 408 ID design records in the repository’s doc/ archive (counted 2026-11-23) — and each one states what exists today before it describes what is designed.

Conventions used in this book

  • Defaults are stated literally. When a flag, parameter, or setting has a default, the default is given as the value itself — for example “web port (default 3000)”, “world name (default lobby)”, “checkpoint interval (default 1000)”.
  • Source wins over help. Where a binary’s help text, a README, or a package document disagrees with the source, this book states the source behaviour and names the disagreement. The surveys behind this book recorded 56 numbered disagreements across the CLI, library, web and configuration, and design-record surfaces (surveyed 2026-11-23); the chapters note the ones that affect their surface instead of silently picking a side.
  • Secrets are named, never valued. This book gives secret names, token file paths, flag names such as --web-token and --world-admin-token, and environment variable names such as ID_WEB_TOKEN and ID_WORLD_ADMIN_TOKEN. It never prints a secret value. Passphrases for id key and id keyset are hidden prompts in the tools themselves, never flags.
  • Design is marked as design. A chapter in the design part, and any designed-but-unshipped behaviour mentioned elsewhere, is labelled as a design with its tracking issues named. Designed behaviour is never written as if it works today.
  • Numbers are dated. Command, flag, route, crate, and record counts carry their survey date (2026-11-23, at commit 1ccb4a19457). A number without a date in this book is a constant of the code — a default, a limit, a version — not a measurement.
  • Chapters are self-contained. Each chapter defines its terms where it first uses them and cross-links instead of assuming you have read the chapters before it.

Installation and provisioning

ID builds from the developing-today/code repository, in pkgs/id/. This chapter covers the two build routes the package README documents — Nix with just, and Cargo directly — the feature split that decides what a given build contains, the data directory a node creates, and the version check that proves the binary you built is the binary you are running.

All commands below run inside pkgs/id/.

Enter the development shell (Nix route)

nix develop

The dev shell provides the full tool set the README lists: Rust 1.99.1, clippy, rustfmt, cargo-llvm-cov, cargo-audit, cargo-machete, just, Bun, TypeScript, Chromium, and Firefox. The Cargo route below needs only Rust for the library build, and Rust plus Bun for the web build.

Build with just

# Library build (no web UI, no Bun required)
just build-lib

# Full build with the web UI (requires Bun)
just build

just build-lib runs the lib variant of scripts/build.sh; just build runs the web variant, which builds the TypeScript frontend in pkgs/id/web/ first and embeds the result in the binary. The matching serve recipes are just serve-lib (which runs cargo run -- serve) and just serve (which runs cargo run --features web -- serve --web).

The two Nix packages in pkgs/id/flake.nix install the same single id binary under two feature sets:

Nix packageFeaturesWeb UIWorld SSH serving
id-web (the default package)web, sandbox, ssh, worldyesyes
id-libsandbox, world (built with default features off)nono

Build them with just build-nix (the web variant) and just build-nix-lib (which runs nix build .#id-lib).

Build with Cargo

# Default build: sandbox and world, no web UI
cargo build

# Web UI build: build the frontend assets first, then enable the feature
cd web && bun install && bun run build && cd ..
cargo build --features web

The root package’s feature table is the authority:

  • default = [sandbox, world]. A plain cargo build therefore includes the wasmtime world sandbox (sandbox, which itself implies world) and every world command, and excludes the web UI and world SSH serving.
  • web is a separate opt-in feature. It is not part of the default set.
  • ssh = [world, …] adds world serving over SSH.
  • dht adds mainline DHT address lookup. It is off in the default build.
  • currency-poc-tb adds the TigerBeetle client for the currency proof of concept. It adds no CLI surface.

The --no-default-features trap (disagreement CLI-2)

The README’s Cargo quick start presents this command as the library-only build:

cargo build --no-default-features

The source disagrees with that framing, and this book follows the source. Because default = [sandbox, world], --no-default-features removes sandbox and world as well as leaving web off. The concrete losses in a --no-default-features build are:

  • id match-audit and the four sandbox world commands — id world dev, id world measure, id world replay, id world verify — do not exist in the parser at all. Clap reports them as unrecognized subcommands.
  • Every other id world … command still parses and still prints its full --help tree, but fails at runtime with the error this build has no world support.
  • id serve --web fails at startup with an error stating the binary was built without the web feature.
  • id serve --server-config <FILE> fails at startup with an error stating the binary was built without the world feature.

What a --no-default-features build keeps: the file commands, tag, group, delegate, revoke, doc, claim, writer-sets, walk, gallery, key, keyset, peers, and the REPL. id walk is not feature-gated anywhere and works in every build.

The Nix id-lib package is the build the README command intends: it is built with default features off and then re-adds exactly the two features the README command leaves out — buildNoDefaultFeatures = true with buildFeatures = [sandbox, world]. If you want the id-lib feature set from Cargo directly, the equivalent is:

cargo build --no-default-features --features sandbox,world

Provision a data directory

An id node keeps all of its state in one data directory. The default data directory is the current working directory. Two global flags, given before the subcommand, change it:

  • -d, --data-dir <DIR> — use <DIR> as the base directory. It is created if missing. The process changes directory into it at startup.
  • --new [<NAME>] — create a fresh instance directory at .iroh/<NAME>/ under the current directory and use it. The name is optional: a bare --new generates a random 8-hex name. The command fails if the directory already exists, and the name must not contain /, \, or ... --new conflicts with --data-dir.

Inside the data directory, the layout is:

PathWhat it is
.iroh-store/The Iroh blob store (redb plus data files), with the Iroh docs store under .iroh-store/docs/. The constant is STORE_PATH = ".iroh-store" in id-store.
.iroh-keyThe node’s own key file. The client key file is .iroh-key-client.
.iroh-serve.lockThe lock file a running id serve holds. Its presence is how the REPL and other commands detect the local serve and proxy operations to it. The constant is SERVE_LOCK = ".iroh-serve.lock" in id-core.
.iroh-meta/The tag-store registry directory; the registry file inside it is .iroh-meta/registry.json.
.id-worlds/<NAME>/Per-world files for a hosted world, where <NAME> is the world name (default lobby).
events/The event store directory used by doc, claim, and writer-sets. This is the runtime default of the global --event-store <DIR> flag; a relative value is relative to the data directory.
groups.jsonlThe group log used by group, delegate, and revoke. This is the runtime default of the global --groups-log <FILE> flag; a relative value is relative to the data directory.

One disagreement is worth knowing before you go looking for the lock: the module documentation in crates/id-cli/src/commands/serve.rs draws the lock file as .id-serve-lock. That spelling is wrong (disagreement CLI-5). The constant, the --data-dir help text, and the code all use .iroh-serve.lock.

id serve --ephemeral skips provisioning entirely: it uses in-memory stores, and all content is lost when the process exits.

Identity provisioning is separate from the data directory. A node creates its key on first use of the store. The id key and id keyset command families export, import, enrol, and recover keys; passphrases are always hidden prompts, never flags. Those commands are covered in Groups, documents, claims and keys.

Verify the install

id --version

A correct build prints two lines:

id 0.1.0
defaults: file sha256=<hash> mode=append

The first line is the version, 0.1.0. The second line is the embedded-defaults provenance, installed by pkgs/id/src/main.rs: it states which defaults source is in force for peer discovery — the embedded defaults.json file (with its SHA-256 and its mode, append in the shipped file) or the built-in equivalent. A one-line version output means the binary in front of you is an older build whose surface also differs from the source in other ways (disagreement CLI-4): older Nix store builds accept a serve --replace-defaults flag the current parser rejects, spell the defaults file defaults.conf, and have no walk command.

Check which id you are running before trusting the output. The name collides with the GNU coreutils id program by design — the platform even has an id id command that prints the node’s identity — and a system id on the PATH prints user and group IDs instead of the two lines above. If id --version does not print both lines, the binary on your PATH is not the one this chapter built.

Next: Quickstart runs one complete store, fetch, tag, and find pass against a fresh data directory.

Quickstart

This chapter runs one complete first pass with the id binary built in Installation and provisioning: store a file, list it, fetch it back, tag it, and find it again by search. It ends with a one-command world smoke test that runs entirely offline. No server is started and no network is used; every command below operates on the local store in the current directory.

All examples use toy data. Create the file first:

mkdir demo-node && cd demo-node
printf 'hello from the quickstart\n' > hello.txt

Running the commands inside an empty directory keeps the node’s data — .iroh-store/, .iroh-key, and .iroh-meta/, as laid out in Installation and provisioning — in one place you can delete afterwards.

1. Store the file

id put hello.txt

put stores the file’s bytes in the blob store under the hash of the content and records the name hello.txt pointing at that hash. The command’s aliases are in, add, store, and import. A store under a different name uses the path:name form:

id put hello.txt:greeting.txt

2. List what the node holds

id list

list prints the stored files with their names and hashes. The list you see contains hello.txt (and greeting.txt if you ran the rename form above). There is no ls alias for this command in the parser (disagreement CLI-1): id ls fails with an unrecognized-subcommand error. The ls spelling exists only inside the REPL and as an alias of id tag list.

3. Fetch the file back

id get hello.txt:copy.txt

get takes source:output pairs: the command above resolves the name hello.txt to its hash, reads the blob, and writes it to copy.txt in the current directory. Two shorter forms do related work:

id cat hello.txt        # write the content to stdout
id get-hash <HASH> out.txt

cat (aliases output, out) is get forced to stdout. get-hash fetches by the 64-hex content hash directly and requires an explicit output path; the output path - means stdout.

Fetching a name the node does not hold is an error, not an empty result: the command prints Error: file not found (or not found: <name>) and exits with code 1.

4. Tag the file

Tags are key-value metadata attached to a stored file, held in the tag store rather than in the blob. Set one, then read it back:

id tag set hello.txt topic greeting
id tag list hello.txt

tag has the aliases label and link, and tag set has the alias add. A tag key can hold multiple values, and a tag with no value is a key-only tag. Remove the tag again with:

id tag del hello.txt topic greeting

tag del deletes every value for the key plus the key-only tag when no value is given. Tagging is covered in full in The tag family.

5. Find the file again

Two different searches exist, and they search different things.

Search by file name with search, which lists matches and retrieves nothing:

id search hello

Queries are case-insensitive. Match quality is ordered exact, then prefix, then contains, over the file name and the hash. There is no glob matching (disagreement CLI-8): the README example id find "*.rs" does not match every .rs file, because the query is a substring query, not a pattern. The literal query *.rs matches only a name or hash containing that character sequence.

Retrieve the best match in one step with find, which writes the best matching file to a file of its own name by default:

id find hello

Search the tags instead with tag search, whose terms are ANDed together:

id tag set hello.txt topic greeting
id tag search topic:greeting

The structured term forms are key: (the key exists), :value (the value exists), key:value (the pair), a quoted "literal", and a bare term, which matches case-insensitively across subject, key, and value.

A search with no matches in the find, search, or show commands is an error: Error: no matches found for: <queries>, exit code 1.

6. One-command world smoke test

id world doctor

world doctor takes no node argument and contacts no host. It checks the local world toolchain — the Roc compiler (flag --roc-bin, environment variable ID_ROC_BIN, falling back to roc on the PATH) and the Roc platform (flag --platform, environment variable ID_ROC_PLATFORM, falling back to ./examples/roc-world) — and prints a report. Add --json for the machine-readable form. The exit rule is exact: the command exits non-zero only when a check fails; warnings do not fail it.

This is a toolchain check, not a world session. Hosting a world requires id serve --world with a world admin token, and joining one requires a capability minted by that host’s admin; no command in this chapter claims a live world service exists. The full path — scaffold a world with id world new <DIR>, run the offline scratch-world loop with id world dev <DIR> (which prints one JSON report and needs no host), host with serve, and join with id world join <NODE> — is covered in World commands: joining and playing and the tutorial Tutorial: join a world and run a guest app.

What you have after this chapter

One node directory containing a blob store with one stored file under two names, one metadata tag, and the node’s own key file — plus the five commands (put, list, get, tag, find/search) that every other file workflow in this book is built from. The reference for the whole family is File commands: put, get, find and kin.

The shape of the system

This chapter is the whole system on one page: the crates, the surfaces, how a file moves, how a world runs, and where data lives. Every other part of this book expands one section of this page.

The workspace: a facade plus 16 crates

pkgs/id/ is a Rust workspace of 17 packages: the root package id version 0.1.0 (the facade) and 16 crates under pkgs/id/crates/. Default members are 15 packages: the root plus 14 crates. The two shell crates, id-native-shell and id-hw-shell, are workspace members but not default members, so a plain cargo build in pkgs/id/ never acquires the Bevy desktop or hardware-shell dependencies. Two vendored crates, vendor/p2panda-sync and vendor/p2panda-encryption, are excluded from the workspace.

The facade is not a re-export shim. pkgs/id/src/ holds 26 modules of first-party code (among them backup, currency, fileops, grant_service, hosted_binding, hosted_export, hosted_ingest, and structured_logging) alongside the re-exports that make the split crates reachable as id::<name>. The shipped id binary is itself an embedding consumer of that surface: pkgs/id/src/main.rs imports the CLI types and command functions through id::….

Dependency direction runs one way, from leaves to surfaces:

LayerCratesWhat each owns
Foundationid-coreThe leaf modules everything depends on (10 production dependents): content IDs, the graph record model, signed envelopes, discovery, the port contract vocabulary, and the constants KEY_FILE = ".iroh-key", CLIENT_KEY_FILE = ".iroh-key-client", SERVE_LOCK = ".iroh-serve.lock"
Dataid-store, id-eventsid-store: the blob store, tags, documents, search, and the signed event-header chain. id-events: the event store, the group projection, writer sets, and sync gating
Platform servicesid-caps, id-groups, id-sync, id-directoryid-caps: the capability catalog, execution limits, and the world manifest. id-groups: group policy and enforcement, the blob gate, group encryption. id-sync: log sync, the meta protocol, FileOps, envelopes, and artifacts. id-directory: the home-server directory, invites, keysets, recovery, and seitan admission
Worlds and webid-worlds, id-webid-worlds: the world runtime, sessions, the wasmtime sandbox, and cross-world authority (75 .rs files, the largest crate). id-web: the HTTP and WebSocket server, routes, templates, and markdown
Applicationid-cliArgument parsing, command implementations, the REPL, and the server-config loader
Standaloneid-config, id-currency-registry, id-render, id-import-notionid-config: the versioned configuration contract (no production dependents; the facade names it only in dev-dependencies). id-currency-registry: the currency control-plane registry (facade only). id-render: the rendering pipeline compiler core (no dependents). id-import-notion: the Notion importer inventory primitives (no dependents)
Shellsid-native-shell, id-hw-shellThe Bevy native reference shell and the ESP32-class hardware shell spike. Both consume the facade with default-features = false, features = ["world"]

The split is recorded history, not a plan: the code was one crate and was divided in numbered steps of umbrella issue #3447 — id-core in Phase 1, then id-caps, id-store, id-events, id-sync, id-groups, id-worlds, id-directory, id-web, and id-cli in steps 1 to 7b.

The surfaces

Two binaries exist in the workspace, both by Cargo’s implicit src/main.rs rule; no [[bin]] section exists in any workspace Cargo.toml.

  • The CLI (id, from the root package). 32 top-level commands and 113 leaf commands with 188 distinct long flags (surveyed 2026-11-23). id serve is the only command that hosts: blobs, optionally a world, and optionally the web UI. Every other command is a client or a local operation. Running id with no subcommand starts the REPL.
  • The REPL (id repl, alias id shell, or bare id). The REPL has its own parser — a line is whitespace-split and matched against literal patterns — so clap flags and defaults do not exist inside it except where a hand parser re-implements them. It adds commands the CLI does not have (delete, rename, copy) and lacks the CLI’s serve, world, group, doc, claim, key, and keyset families. Its modes are Local (direct store), local-serve (operations proxied to a running local serve, detected by .iroh-serve.lock), and RemoteNode (started as id repl <NODE>).
  • The web UI (id-web, behind the root crate’s web feature). Served by id serve --web with bind default 127.0.0.1 and port default 3000. The main router holds 54 distinct paths and 58 method bindings (surveyed 2026-11-23): file pages, a ProseMirror collaborative editor, the world bridge surface, the program gallery, and three WebSocket protocols (collaborative editing, tag changes, and the world session bridge). A second, program-only router holds 10 paths and is what a publication mount serves.
  • The hosted Worker scaffold (pkgs/id/hosted-worker). A Cloudflare Worker front door forwards already-authenticated requests to one UserDO Durable Object per bound user; the object exposes 15 method routes over key-value data, blob references, usage, export, and the signed-object bridge. It is a local-only scaffold: its wrangler.toml authorizes no account-level deployment, and under local workerd it fails closed with 503 jurisdiction_unavailable for every fully valid request, by design. A second package, pkgs/id/worker-poc, is a proof of concept that runs one example world in a Worker isolate; it is not a production path.
  • The native shell (id-native-shell, Bevy). A desktop client for the F13.1 shell contract in pkgs/id/contract/shell-contract.v1.json (contract id-shell, version 1, revision 15). It connects to a world host, renders the host’s view frames, and adds no frame kinds. Its argument parser is hand-rolled: it has no --help or --version, and an unknown flag is an error with exit code 2.
  • The hardware shell (id-hw-shell). A library crate, not a binary: the shell contract reduced to presence, journal-head state, and confirm/act form answers, for ESP32-class devices. It is transport-free by design and builds exactly two client frame kinds, join and form_result.

Agents reach worlds through one more surface, the MCP bridge: a library translator in id-caps (8 pinned MCP v1 tools) plus its policy point. There is no MCP server binary; see The MCP bridge.

How a file moves

  1. Store. id put hello.txt hands the bytes to FileOps (id-sync), the single put/rename/copy/delete implementation used by the CLI, the REPL, the meta protocol, and the web UI. The bytes land in the Iroh blob store as an immutable blob named by its hash. A name in the tag store points at the hash, and FileOps stamps the identity tag keys name, file, and path, plus the origin key at first write.
  2. Rename and replace. Renaming a name does not move bytes; it moves the name and archives the displaced name as {name}.archive.{unix-ts}. That archive name form is a reserved namespace: FileOps refuses it as a user file name.
  3. Fetch. id get hello.txt resolves name to hash through the tag store and reads the blob. With a 64-hex node ID as the first positional argument, the same commands operate on a remote node instead: the request travels over the meta protocol (ALPN /iroh-meta/3) to that node’s store.
  4. Serve and sync. id serve holds the store open for peers, announces through gossip discovery (topic id-peer-discovery-v1), mDNS local discovery (on by default), and DHT lookup (off by default; serve --dht enables it). id send copies a file from one server to another with no bytes passing through the client. Signed events — documents, claims, group operations — move through the event store and log sync, not through the blob path.

How a world runs

  1. Author. A world program is Roc source against the shared platform package in pkgs/id/examples/roc-world/. id world new <DIR> scaffolds main.roc, build.sh, and README.md. The guest provides eight functions: init, update, view, layout, records, wants, snapshot, and restore.
  2. Compile. The program compiles to an import-free Wasm module under Plaza ABI v1: the module exports memory plus 14 plaza_* exports and imports nothing — no WASI, no filesystem, no network, no clock, no randomness. Nine Roc guest apps ship in the tree (surveyed 2026-11-23), including the packaged two-player tic-tac-toe in pkgs/id/apps/tic-tac-toe/.
  3. Host. Only id serve --world hosts a world. Hosting requires --world-admin-token; the world name defaults to lobby and its files live in .id-worlds/<NAME>/. The host runs the guest in the id-worlds wasmtime sandbox under literal limits: fuel default 10000000, guest memory default 16 MiB, message size default 1024 KiB, total world memory default 64 MiB, open worlds default 256, sessions default 1024, checkpoint interval default 1000 events.
  4. Effects by capability. The guest returns its effect requests from wants as a JSON document of subscriptions and capability requests (time.now, chat.say, records.read, kv.get, and the rest of the catalog in id_caps::world_caps). The host answers each request with a participant-0 update event, journalled so replay feeds the same events back. Grants and ceilings are enforced on the host: the default capability policy is deny, and an ungranted request returns a refusal event with a stable error code such as cap_denied.
  5. Join. Every id world … subcommand is a client. A participant joins with a capability from id world invite, which requires the admin token and a display name; roles run from spectator to builder and moderator, invite expiry defaults to 7 days, and the maximum expiry is 30 days. Shells — terminal, browser, native, hardware — speak the same session protocol to the host over Iroh, WebSocket, or SSH.

Where data lives

DataStoreLocation
File bytesIroh blobs FsStore (redb plus data files).iroh-store/ in the data directory; in-memory under serve --ephemeral
File names and metadata tagsTag store over Iroh docs namespace pairs (global, node-private, custom)Under .iroh-store/docs/; namespace registry at .iroh-meta/registry.json, registry version 1
Signed events (documents, claims, groups, writer sets)Event store, redb file events.redb, format marker id.events.store.v9The events/ directory in the data directory (the --event-store default)
Group logAppend-only JSONLgroups.jsonl in the data directory (the --groups-log default)
Directory accounts, groups, invitesDirectory journal, one JSON entry per line, 17 entry kindsdirectory.jsonl beside the server config that provisions it
World statePer-world journal plus content-addressed Wasm modules.id-worlds/<NAME>/ in the data directory
Node and client keysKey files.iroh-key and .iroh-key-client in the data directory; keysets in .id-keyset.jsonl and .id-keyset-client.jsonl
Hosted user dataOne UserDO Durable Object per bound user (SQLite schema version 3) plus an R2 bucket for blob bytesIn the hosted Worker scaffold only; no deployment exists

The full inventory is Data stores and schemas.

Shipped and design: the discipline of this book

ID has two records, and this book keeps them separate. The shipped record is the source tree: the surveys behind this book read the parser, the crates, the routers, and the Worker at commit 1ccb4a19457 on 2026-11-23, and the getting-started, concepts, reference, and library parts describe only what that tree does. The design record is the archive: 408 ID design records among the 2,917 paths under the repository’s doc/ directory (counted 2026-11-23), plus the open issues they name. The design part of this book describes that record as design.

The two records disagree in named places, and the disagreements are data, not embarrassments to smooth over. The surveys recorded 56 of them: the README gives list an ls alias the parser does not have (CLI-1); the README’s Cargo quick start misdescribes --no-default-features (CLI-2); the hosted Worker README’s route list describes a first slice the code has passed (WEB-9); the MCP v1 tool list contains presence.set, a tool the bridge refuses on every call (WEB-13); README.original.md is not an original README at all but the earliest ID concept sketch, with an access model the capability system replaced (DES-8). Where a chapter meets one, it states the source behaviour, names the disagreement by its survey number, and moves on. A claim this book could not pin against the source is marked unverified in the chapter where it appears; a claim with no such mark is one the surveys verified.

Architecture

Source: this chapter rests on the library survey (survey/library.md, the crate map and re-export surface at checkout 1ccb4a19457), the CLI survey (survey/cli.md, the command and feature-gate surface), and the web and configuration survey (survey/web-config.md, the web, Worker and MCP surfaces). The design-record survey (survey/design-records.md) is the source for which parts of the older documents are stale.

One workspace, one public surface

The system lives in pkgs/id/ in the developing-today/code repository. The root Cargo.toml is two things at once: the package id at version 0.1.0 (edition 2024, rust-version 1.96) and the workspace root. The workspace has 17 members: the root package plus 16 crates under pkgs/id/crates/. Default members are 15: the root plus 14 crates. id-native-shell and id-hw-shell are members but not default members, so a plain cargo build in pkgs/id/ never acquires the Bevy desktop dependencies or the hardware-shell code.

Library consumers use one public surface: the root crate, imported as id::. The split crates are internal. A consumer who names a split crate directly uses an internal path, with two recorded exceptions: id-config, id-currency-registry, id-render and id-import-notion are not exposed at id:: at all, so a consumer who wants them names those crates directly (library survey §2).

The facade is not a re-export shim. pkgs/id/src/ owns 26 modules of first-party code, including backup, conversion, currency, device_bridge, didit, encryption, fileops, grant_service, grants, groups, hosted_binding, hosted_export, hosted_ingest, references and serve_proxy. Several facade modules sit at historical paths over code that now lives in a split crate: src/groups/mod.rs re-exports from id-events, id-groups and id-worlds; src/fileops.rs, src/store_traits.rs, src/envelope_net.rs, src/envelope_outbox.rs, src/blob_gate.rs and src/pull_policy.rs do the same over id-store, id-sync, id-groups, id-events and id-worlds. The facade header in src/lib.rs also carries the family-wide signing contract from design #6487: sign only what receipt would accept, with four decidability classes (a) intrinsic, (b) signer-relative, (c) seam-extended, (d) receiver-state.

The split history is recorded in the crate doc headers. The code was one crate and was split under umbrella #3447: Phase 1 id-core (#3447), step 1 id-caps (#4403), steps 2a/2b id-store and id-events (#4405), step 3 id-sync (#4406), step 4 id-groups (#4407), step 5 id-worlds (#4408), steps 6b/6c id-directory and id-web (#4409), step 7b id-cli (#4411). Four crates are not split products: id-config (slice 9111-01, #10178), id-currency-registry (F1/F2 of #2062, #2317/#2318), id-render (#7918) and id-import-notion (slice 1, #8419), plus the two shells.

The crate map

Dependency direction is one-way. id-core depends on nothing in the workspace and everything depends on it. The full production edge list, from the library survey §0:

CrateOwnsDepends on
id-coreFoundation leaves: hashes, frames, tuple encoding, canonical CBOR, discovery, membership, signed envelopes, the graph record modelnothing
id-capsCapability catalog, execution limits, the declarative world manifestid-core
id-storeBlob store, the signed event-header chain, documents, tags, tag claims, searchid-core
id-eventsEvent store, group projection and fold, writer sets, sync gatingid-core, id-store
id-groupsGroup policy and enforcement remainder: blob gate, group encryption, group actions and logid-core, id-events, id-store
id-syncLog sync, the meta protocol wire half, file operations, envelopes, signed artifacts, transfer, federationid-core, id-events, id-store
id-directoryHome-server directory, views, auth, mail, invites, seitan admission, keysets and recoveryid-caps, id-core, id-events, id-sync
id-worldsWorld runtime, sessions, the wasmtime sandbox, the shell contract, program bundles and galleryid-caps, id-core, id-directory, id-events, id-groups, id-store, id-sync
id-webHTTP and WebSocket server, routes, templates, markdown, collaborative editingid-caps, id-core, id-directory, id-events, id-groups, id-store, id-sync, id-worlds
id-cliThe application layer: argument parsing, subcommand implementations, the REPL, server configid-caps, id-core, id-directory, id-events, id-groups, id-store, id-sync, id-worlds, optional id-web
id (facade)The public surface, the id binary entry point, and the 26 facade-owned modulesid-caps, id-cli, id-core, id-currency-registry, id-directory, id-events, id-groups, id-store, id-sync, id-worlds, optional id-web
id-configThe versioned configuration contract: the V2 ConfigDocument, hard invariants, the deterministic resolvernothing; no production crate depends on it
id-currency-registryCurrency control-plane registry: the ledger-u32 allocator, currency and account recordsnothing
id-renderRendering pipeline compiler core: parse, validate, compose, lower, emitnothing; no dependents
id-import-notionNotion importer manifest and inventory primitivesnothing; no dependents
id-native-shellBevy native reference shell for the shell contractthe facade, with features ["world"]
id-hw-shellESP32-class hardware shell spike: presence, journal head, confirm/actthe facade, with features ["world"]

Three boundary facts follow from the map. First, the group model lives in id-events, not in id-groups: model, fold, policy, friendship and writer-set vocabulary are id-events property, and id-groups is the enforcement remainder over it (library survey §1.9). Second, id-directory never depends on id-worlds; the edge runs the other way, because WorldCore in id-worlds holds a directory::Directory as persisted state (library survey §1.7). Third, id-config has no production dependent: the facade names it only under [dev-dependencies], for its invariant tests. The configuration contract is a test-enforced contract, not a runtime dependency. The design history of the split is carried in Design: foundations — objects, graph and the file core.

Feature gates cut across the map. The facade default is default = ["sandbox", "world"]. The web feature adds the optional id-web dependency. The ssh feature forwards to id-worlds/ssh and id-cli/ssh. The dht feature forwards to id-sync/dht and id-cli/dht. The Nix packages are id-web (features web, sandbox, ssh, world) and id-lib (features sandbox, world; no web, no ssh). The per-command consequences are in The id command line.

The surfaces

The CLI is the primary surface. Two binaries ship: id (root package, pkgs/id/src/main.rs, parser in id-cli) and id-native-shell (its own crate, hand-rolled argument parser, no clap). The id parser defines 32 top-level commands and 113 leaf commands. Running id with no subcommand starts the REPL. Full detail is in The id command line.

The REPL is a second parser, not a skin over clap. A line is whitespace-split and matched against literal patterns in crates/id-cli/src/repl/runner.rs. It has commands the CLI does not have (delete, rename, copy, gethash as one word) and it lacks serve, world, group, doc, claim, key and keyset. Its input language adds heredocs, here-strings, the |> pipe-in operator and $(…) command substitution. See The interactive REPL.

The web surface is the id-web crate: an Axum server with embedded assets, ProseMirror collaborative editing over WebSockets, a world session bridge at /ws/world, a program gallery surface and a script-free directory explorer at /explore. The main router has 54 distinct paths and 58 method bindings; the program-only router has 10 paths. Every router passes through one security layer: loopback bind by default (--bind default 127.0.0.1), a Host allow-list on loopback binds, a same-origin check on requests carrying Origin, and an optional gate token from --web-token or ID_WEB_TOKEN. See The web UI: pages and HTTP API.

The hosted Worker is a scaffold, not a deployed service. pkgs/id/hosted-worker/ carries a wrangler.toml whose header states it is local only, with no account-level deployment authorized, gated on #2285 and #3403. Locally, the app worker fails closed with 503 jurisdiction_unavailable for every fully valid request, by design, because local workerd does not implement jurisdiction restrictions. pkgs/id/worker-poc/ is a proof of concept for #2271: one example world running unmodified in a Worker isolate, with journal equality against the native wasmtime host as its acceptance test. Neither package is a production path. The design for a deployed edition is in Design: hosted and serverless editions, and the scaffold’s routes are in The hosted Worker API.

The shells are clients of one contract. The shell contract of record is pkgs/id/contract/shell-contract.v1.json: contract id-shell, version 1, revision 15, ALPN /id-world/1. Four shells are named in its conformance suite: terminal, browser, native and hardware. The native shell is the Bevy crate id-native-shell; the hardware shell is the single-file crate id-hw-shell (996 lines, no submodules). Both consume the facade as library consumers, with default-features = false, features = ["world"]. See Shells: terminal, web, native and hardware and Worlds and the Roc guest runtime.

The MCP bridge is a library surface, not a server. No standalone MCP server binary, no stdio or HTTP MCP transport and no JSON-RPC tools/list implementation exists in pkgs/id. id_caps::mcp_bridge translates one MCP tool call into a shell-contract client frame, and id_caps::mcp_policy is the host-side policy point. See Agents in worlds: the MCP bridge and policy.

Data flow of a file

A file enters through FileOps, the single put/rename/copy/delete implementation in id-sync that the CLI, the REPL, the meta protocol and the web layer all call (web-config survey §5.4). FileOps writes the bytes into the blob store: iroh-blobs FsStore in .iroh-store/, or an in-memory store under id serve --ephemeral. The blob is immutable and content-addressed; its hash is its identity. FileOps then binds a name to the hash. A name is an iroh-blobs tag pointing at the hash, and metadata tags for the name live in the tag store. The model is stated in The file core: content addressing, names and tags.

Reads run local or remote through one chooser. MetaClient in id-cli (an enum at crates/id-cli/src/meta_client.rs:31) picks between a running serve process and the in-process local node. The serve lock file .iroh-serve.lock in the data directory is the signal that a local serve is running. On the wire, the meta protocol ALPN is /iroh-meta/3 (META_ALPN = b"/iroh-meta/3" in id-sync). For remote file commands, a first positional argument of 64 hex characters is consumed as the remote node ID and the rest of the command operates on that node. Server-to-server copy (id send) moves no bytes through the client: the source server pushes with its own identity. Replication and transfer rules are in Sync, replication and FileOps.

Data flow of a world

A world exists only on a host. id serve --world is the only hosting command; every id world subcommand is a client (the F13.8 boundary, stated in the serve long help and the world command docs). The host loads a guest program: a precompiled Wasm module from --world-module, a Roc source install, or a module installed by a client with the admin token. Guests are import-free Wasm modules. The host runner is id_worlds::sandbox::{Sandbox, WorldInstance} on wasmtime: Sandbox::compile(wasm, SandboxLimits), then Sandbox::instantiate(seed).

Inside the host, the flow is a loop over a journal. A client shell sends an input frame under the shell contract. The host appends the input to the world journal and calls the guest update. The guest returns its new model plus a wants document naming capability requests. The host resolves each request against the capability catalog, the world’s grants and the server ceiling, and answers with a participant-0 event fed back through update. Host events are journaled, so replay feeds the same events back and reaches the same state. The host renders view and sends view frames to every connected shell. Checkpoints come from the guest snapshot function; id serve --world-checkpoint-every defaults to 1000, and 0 never trims. The runtime contract is in Worlds and the Roc guest runtime; the enforcement point for capability requests is in Capabilities, ceilings and providers.

Where the older documents disagree

Two disagreements matter for a reader of this chapter. LIB-13 and DES-1: the root Cargo.toml description, the src/lib.rs title and the README lead all describe a peer-to-peer file sharing CLI. The compiled surface also includes the world runtime, the directory, group encryption, the currency registry and the rendering compiler. The file-sharing description covers the file core and none of the platform layers. LIB-3: the facade’s own doc header still presents the pre-split single-crate module list and shows no worlds, sync, events, directory or currency layer. The crate map in this chapter follows the code at 1ccb4a19457, not either document.

The file core: content addressing, names and tags

Content addressing

The file core has two halves: immutable bytes and mutable names. Bytes are stored once, in the blob store, and addressed by hash. A name points at a hash. Changing a file writes new bytes under a new hash and moves the name; the old bytes stay in the store until garbage collection.

The store is iroh-blobs. On disk it is an FsStore (redb plus data files) in .iroh-store/, with the iroh-docs store under .iroh-store/docs/. id serve --ephemeral uses the in-memory variant and loses content on exit. STORE_PATH = ".iroh-store" and open_store / StoreType (Persistent(FsStore) or Ephemeral(MemStore)) are the library entry points in id-store.

A hash is the only content identity the CLI exposes. Commands that take a hash take 64 hex characters: id get-hash takes a hash and an output path, id put-hash stores a single source hash-only, and the gallery commands reject a hash that is not 64 hex characters with invalid hash: expected 64 hex characters. Storing the same bytes twice produces the same hash and one stored blob. Two store modes exist for names: id put stores bytes and binds a name; id put --hash-only and id put-hash <SOURCE> store bytes with no named tag. In the second mode the hash is the only handle the caller holds.

One hash fact is pinned in the surveys and one is not. The signed event chain in id-store computes an operation ID as BLAKE3 over the received event bytes (web-config survey §5.2). The surveys do not name the blob hash algorithm for the iroh-blobs store itself. This chapter therefore states the blob hash as the iroh-blobs hash, printed as 64 hex characters, and marks the algorithm name unverified against the survey sources.

Names

A file, in the FileOps definition, is a name bound to an immutable blob hash, plus tag-store metadata for that name (web-config survey §5.4). The name binding is an iroh-blobs tag. id put notes.txt stores the file notes.txt under the name notes.txt; id put notes.txt:archive-copy stores the same bytes under the name archive-copy, because the put syntax is path:name. Retrieval resolves the name to its current hash: id get archive-copy writes the current bytes for that name.

FileOps is the single implementation behind every surface: CLI, REPL, meta protocol and web all call the code in crates/id-sync/src/fileops.rs (facade path src/fileops.rs). Rename, copy and delete are FileOps operations, and FileOps maintains three identity metadata keys on every rename and copy: name, file and path. An origin key is stamped at first write and records the origin node (#4973).

The CLI has no top-level delete, rename or copy command. Those operations exist in the REPL (delete, rename, copy/cp), in the web API (/api/rename, /api/copy, /api/delete) and in FileOps itself. The command surface is in File commands: put, get, find and kin.

Two tag systems with one word

The word tag names two distinct systems, and this book keeps them apart.

The first system is metadata tags, run by id tag. A metadata tag is a key/value pair attached to a file name. The store is the tag store in id-store, backed by iroh-docs namespace pairs: a global namespace, a node-private namespace, and custom paired or single namespaces. Tag values are arbitrary bytes. On the web wire, a binary value travels as value_b64.

The second system is tag claims, run by id claim. A claim is a signed statement in the event store that a subject carries a name, with a scope of shared or local. Claims live in id-store (tag_claims) and the event log, they replicate with the log, and they carry authorship. Metadata tags carry no signature and no author. The claim commands are in Groups, documents, claims and keys; the identity and group model behind claims is in Identity, the directory and groups. The design record that models claims as atomic-triple projections (decision of 2026-11-06) and the tag-scope design (#1793) are carried in Design: capabilities and providers.

Metadata tags: set, delete, list

id tag set <FILE> <KEY> [VALUE] sets one value. Multiple values per key are allowed: setting the same key twice with two values leaves both values on the file. With no value, the command sets a key-only tag. Two binary-safe input forms exist. --value-hex <HEX> takes the value as hex, and --value-file <PATH> reads the value from a file, with - meaning stdin. The two flags conflict with each other and with the positional value.

id tag del <FILE> <KEY> [VALUE] deletes one value, or, with --value-hex <HEX>, the value named in hex. With no value at all, it deletes every value for the key plus the key-only tag.

id tag list [FILE] lists tags for one file, or for all files when the file argument is omitted. Display is lossy by default: a value that is not valid UTF-8 prints as <binary N bytes>, and values truncate at 256 bytes. --no-truncate prints full values, --hex prints values in hex, and --binary selects the binary display. The REPL forms of the tag commands have none of the --value-hex, --value-file, --hex, --binary or --no-truncate flags; those are clap-only (CLI survey §2.1).

Tag changes broadcast on the web surface as TagEvent JSON frames on /ws/tags: set, del, del_all and transfer, each carrying ns, subject, key and an optional value; transfer carries from, to and count. The frame format is in WebSocket protocols.

id tag search <QUERY>... takes structured terms, and all terms must match (logical AND). The term forms are:

  • key: — the file has the key, with any value.
  • :value — the file has the value, under any key.
  • key:value — the file has that key with that value.
  • "literal" — a quoted literal term.
  • A bare term — matched case-insensitively across subject, key and value.

Quoted key and value positions are supported inside the key:value forms. The same syntax runs in the REPL (tag search, alias tag find) and in the web API at GET /api/tags/search, which takes q and ns parameters. The full tag command family is in The tag family.

File search is a different matcher. id find and id search match queries against names and hashes with quality ordered exact, then prefix, then contains, case-insensitively. There is no glob or wildcard matching anywhere in commands/find.rs. Disagreement CLI-8: the README example id find "*.rs" presents the query as a pattern; the literal query *.rs matches only a name or hash containing that character run, and in practice matches nothing.

The tag registry

Namespaces are recorded in a registry file: .iroh-meta/registry.json, with REGISTRY_VERSION = 1 (crates/id-store/src/tags.rs). The registry records the namespaces in use and the completion of the one-time migration described below. The registry is local node state. It is not a replicated document, and no command in the CLI survey reads or writes it directly; the tag commands operate on namespaces the registry tracks.

Auto-tags and id migrate-tags

Three keys are maintained by the system, not typed by the user: name, file and path (the identity keys FileOps refreshes on rename and copy), plus the origin key stamped at first write. Files stored before the auto-tag rules existed can lack them.

id migrate-tags (alias migrate) repairs that state. It adds the name and file auto-tags where they are missing. It never overwrites an existing value. The REPL has the same command as migrate-tags / migrate. The command is idempotent in effect: a second run finds the tags present and adds nothing.

Archives and the archive naming rule

Rename and replace do not destroy the previous binding. FileOps archives it. The archive name is {name}.archive.{unix-ts}: the live name, the literal segment .archive., and the Unix timestamp in seconds. If that name is taken in the same second, the suffix is bumped ({ts+1}, then higher) until a free name is found, claimed under an in-process lock (#1612/#2462).

Archives carry metadata. The live name records archive.rename and archive.replace keys naming the archives it owns. Each archive records an archive.owner key naming its owner. Archives are dropped only with their owner. There is no per-archive delete operation.

The archive namespace is reserved at the writer, and the reservation test is exact. A candidate user file name whose final segment matches {stem}.archive.{digits} is refused with ReservedArchiveName when two conditions both hold: the characters after .archive. are all digits, and those digits parse as a u64. A name such as field-notes.archive.draft stays valid, because draft is not digits. A digit string too large for u64 fails the second condition and is not an archive name under the rule. This digit-plus-u64-fit test is the finding recorded against #13291 and #4767: classification of an existing name as an archive turns on the suffix parsing as a u64, not on the .archive. segment alone. The web layer builds its soft-delete and restore pair on top of the same FileOps archive machinery; FileOps::delete itself is a hard delete of name, metadata and owned archives, while blob bytes survive until garbage collection. The delete, copy and transfer rules in full are in Sync, replication and FileOps.

Worlds and the Roc guest runtime

What a world is

A world is a hosted, multiplayer program instance. One guest program, one journal of inputs, one current state, and any number of connected participants, each identified inside the program by a participant ID. Participant 0 is reserved: it is the host itself, and host events enter the program under participant ID 0.

A world has a name. The default world name is lobby. World names use the character set a-z 0-9 - _. A hosted world’s files live in .id-worlds/<NAME>/ under the serve data directory. A single serve process hosts many worlds under operator limits set at startup: --world-max-open defaults to 256, --world-max-sessions defaults to 1024, and --world-idle-secs defaults to 600, with 0 keeping worlds open.

The shipped guest programs show the range of the model. The packaged app is tic-tac-toe (pkgs/id/apps/tic-tac-toe/, app.toml declaring [program] kind = "roc-world", guest in program/main.roc): two players, digit inputs 0 to 8 as moves, ply parity picking X or O, and a records projection publishing {"board","plays","winner"}. The examples add a chat client, a counter, a 4×3 grid demo, a screen demo and a territory game for up to 8 seated players on a 16×8 grid whose seats persist across leave, rejoin and restart. Nine Roc guest apps ship as examples or packages, plus the shared platform package and a Rust twin SDK (library survey §5.1).

The guest program shape

Every guest provides eight functions. The platform requires block in examples/roc-world/platform.roc fixes the signatures:

  • init : U64 -> model — build the initial model from the host seed.
  • update : model, U64, Str -> model — apply one event. The second argument is the participant ID; 0 means a host event.
  • view : model -> Str — render: legacy text, or a portable screen document.
  • layout : model, U64, U64 -> Str — viewport-sized rendering.
  • records : model -> Str — a JSON object projection of the model, mirrored by the host.
  • wants : model -> Str — subscriptions and one-shot capability requests, as JSON.
  • snapshot : model -> Str — the state as text, for journal checkpoints.
  • restore : Str -> model — the inverse of snapshot.

update and view are pure. The platform requires no Task. An app provides all eight; an app that does not use a function provides it as a stub. The platform exposes six pure-Roc modules to apps: Screen, Key, RocJson, RocGrid, RocCap and RocText.

Plaza ABI v1: the host/guest boundary

Guests compile to WebAssembly, and the contract between host and guest is Plaza ABI v1, documented in examples/roc-world/ABI.md. The module exports memory plus 14 plaza_* exports:

plaza_abi_version, plaza_alloc, plaza_free, plaza_init, plaza_update, plaza_view, plaza_layout, plaza_records, plaza_wants, plaza_snapshot, plaza_restore, plaza_out_len, plaza_error_ptr, plaza_error_len.

Required exports are memory, plaza_alloc, plaza_free, plaza_init, plaza_update, plaza_view and plaza_out_len. plaza_abi_version takes no arguments and returns 1; it is optional for backward compatibility. plaza_layout, plaza_records and plaza_wants are optional. plaza_snapshot and plaza_restore are both present or both absent. plaza_error_ptr and plaza_error_len are optional diagnostics, capped at 4096 bytes. Output passes through one shared slot whose length plaza_out_len reports. The Rust twin SDK in examples/rust-world/ emits the same 14 exports from a plaza_sdk::World trait and a plaza_guest! macro.

There are no Wasm host functions. Guests are import-free Wasm modules: no WASI, and no filesystem, network, clock or randomness imports. Every effect a guest needs goes through the capability protocol below. The host runner is id_worlds::sandbox::{Sandbox, WorldInstance} on wasmtime: Sandbox::compile(wasm, SandboxLimits) compiles a module, Sandbox::instantiate(seed) creates an instance, and the instance exposes update, view, layout_at, records, wants, snapshot and restore. Disagreement LIB-7: ABI.md and the Rust example READMEs locate this runner at src/sandbox.rs; that file does not exist. The runner is crates/id-worlds/src/sandbox.rs, surfaced as id::sandbox.

Execution limits are literal serve settings, flattened into serve as WorldRuntimeArgs: --world-fuel defaults to 10000000, --world-memory-mib to 16, --world-message-kib to 1024, and --world-total-memory-mib to 64. The native (ELF) tier has its own limits: --world-native-memory-mib defaults to 256, --world-native-cpu-secs to 10 and --world-native-deadline-ms to 10000. Per-world profiles persist through id world profile; the profile flags and their aliases are in World commands: administering and verifying.

The wants capability protocol

plaza_wants returns a JSON document: {"v":1, "subscribe":[…], "requests":[{"id":"r1","cap":"time.now","args":{…}}]}. The document is capped at 64 KiB, with at most 64 subscriptions, at most 64 requests and at most 4 distinct tick intervals.

The host answers each request with a participant-0 update event: {"cap":"result","id":…, "ok":true, "value":…} on success. On failure the event carries "ok":false and one stable error code: cap_denied, unknown_cap, bad_args, failed, actor_denied, outside_ceiling or result_too_large. A request for a known capability the world does not hold returns a refusal event. The host never executes an ungranted request silently. Grants and ceilings are enforced host-side; the model is in Capabilities, ceilings and providers.

RocCap is the guest-side client library for this protocol. It keeps a session with request IDs r0, r1, … and provides issue, attach, requests and route, plus request builders: chat_request (chat.say), now_request (time.now), players_request (players.list), world_request (world.info), history_request (chat.history), records_request (records.read), schedule_at_request and schedule_cancel_request.

Because host answers enter as journaled events, replay is deterministic: the journal records the host event, and replay feeds that recorded event back through update instead of asking the provider again. A guest that asked for the time receives, on replay, the time the host recorded.

Hosting and clients: the F13.8 boundary

id serve is the only command that hosts a world. Its long help states the boundary directly: this is the only command that hosts or serves a world. Hosting requires --world and --world-admin-token. A module is supplied by --world-module <FILE> (a precompiled Wasm module in the Roc ABI), by Roc source installs (restricted to source-only under --world-source-only, from env ID_WORLD_SOURCE_ONLY), or by later client installs. Serving a world over SSH takes --world-ssh-port, bound to --bind, and exists only in builds with the ssh feature.

Every id world subcommand is a client. join, records, caps, install, compile, mirror, download, replica and the rest connect to a host; none of them hosts. Two commands state the distinction in their own docs. id world mirror runs a local replica endpoint that accepts sync connections; it is not a world host. id world dev runs a fully offline scratch-world loop on the local machine, with no host and no network. The client commands are in World commands: joining and playing and World commands: administering and verifying.

The shell contract

Shells do not speak the guest ABI. A shell speaks the shell contract to a host, and no shell frame depends on the guest ABI. The contract of record is the machine-readable file pkgs/id/contract/shell-contract.v1.json: contract id-shell, version 1, revision 15. It defines the /id-world/1 ALPN protocol over three transports: an iroh QUIC stream, WebSocket at /ws/world, and SSH exec id-world/1. The maximum frame is 1 MiB. Session phases are opening, query, install and joined. Frame classes are six: event, ephemeral, query, control, admin and delegation. The WebSocket binding of the same protocol carries 43 client frame kinds and 35 server frame kinds (web-config survey §1.3). The conformance suite shell-suite.v1.json names four shells — terminal, browser, native, hardware — with each shell’s presented and sent frame sets. Only the native shell declares a client provider: client.file.read.

Three admin toggles travel as contract frames and as id world commands: isolation (id world isolation <NODE> <isolated|unisolated>), cross-world writes (id world cross-world-write <NODE> <on|off>, plus force-cross-world-write for force-on only) and file scope (id world file-scope <NODE> <confined|unrestricted>, with --write-override <on|off>). All three require the admin token.

Journal, checkpointing and replay

The host keeps a journal per world (world_store::{FileJournal, ModuleDir} in id-worlds). Inputs and host events append to the journal in order. A checkpoint writes the guest snapshot text into the journal, and later replay can start from the checkpoint instead of from the seed. id serve --world-checkpoint-every defaults to 1000; 0 never trims. After startup, a boot window refuses replay: --world-boot-window-secs defaults to 600, and 0 disables the window.

Four offline commands work on journals and modules without a host, all gated on the sandbox feature. id world journal check <DIR> validates a journal directory and exits non-zero when the journal is invalid or written in a newer format than the binary reads. id world journal backup <DIR> <OUT> writes a backup; the output must not already exist, and the journal must pass check first. id world replay --module <FILE> --fixture <FILE> --seed <N> replays a recorded fixture and prints its verdict line first, then exits non-zero on a record mismatch. id world verify has the same shape and runs a double-replay determinism check, exiting non-zero at the first divergence. Session recording to replayable fixtures is the input side of the same mechanism.

Designs that go past this shipped core — hot-world sharding, native-spill write leases, journal replication to signed read replicas as a network service, and recurring cross-world schedules — are design records, not shipped behaviour. They are carried in Design: worlds and the guest runtime and Design: sync, replication and FileOps.

Capabilities, ceilings and providers

The model in one paragraph

A guest program holds no ambient authority. Every effect it can cause is a named capability, resolved by a provider on the host side (or, for client. capabilities, on the client side), and allowed only when three tests pass: the capability exists in the catalog, the world holds a grant for it, and the grant fits inside the ceilings that bind the world. A request that fails any test returns a refusal event to the guest. The guest learns of the refusal through the same update path as a success; see Worlds and the Roc guest runtime.

The catalog, limits and manifest live in the crate id-caps (capability catalog, execution limits and world manifest, split step 1, #4403). Its 18 public modules include world_caps (the catalog), world_limits, world_manifest, world_scopes, cap_baseline, cap_class, cap_diff, used_caps, declaration, agent_delegation, the four Roc library gate modules (library_manifest, library_resolution, library_gate, library_attach) and the MCP pair (mcp_bridge, mcp_policy). Disagreement LIB-14: the id-caps lib.rs doc still describes only the original three moved modules. The module list in this chapter follows the code.

The catalog

id_caps::world_caps registers the provider catalog. The entries named in the library survey are: time.now, time.tick, random.u64, players, players.list, chat.say, chat.history, records.read, kv.get, kv.set, kv.delete, blob.put, blob.get, blob.delete, http.fetch, notify, schedule.at, schedule.cancel, world.info, device.info, form.present, form.result, form.cancel, loc.position and loc.watch. The survey’s enumeration ends with an ellipsis, so this list is the attested subset, not a proven-complete catalog; the full argument schemas and bounds are in world_caps itself.

Two namespaces exist. Host providers carry bare names such as time.now. Client providers carry the prefix in CLIENT_PROVIDER_NAMESPACE = "client." (world_caps.rs:312): a capability such as client.file.read is executed by the connected shell, not by the host. The shell contract’s conformance suite records the native shell declaring exactly one client provider, client.file.read. The rollout record for that provider is design record F13.7, carried with the rest of the client-provider design in Design: capabilities and providers.

Subscriptions are capabilities too. A guest subscribes through its wants document: players subscribes to the participant list, and time.tick:<ms> subscribes to a tick at that interval, with at most 4 distinct tick intervals per document.

Grants and revokes

Grants are set in two places.

At host startup, id serve takes --world-cap <NAME>, repeatable, naming capabilities for the default world’s program. The value * grants the whole catalog.

At runtime, id world caps <NODE> reads and changes a world’s grants. Reading needs only a guest capability. Any change needs the admin token (--admin-token or env ID_WORLD_ADMIN_TOKEN). The change flags are --grant <CAP>, repeatable, with * meaning the catalog; --revoke <CAP>, repeatable; and --ceiling <CAPS>, comma-separated and repeatable, naming known capabilities only, with no * allowed.

Revocation is per capability name. The surveys do not describe a grant expiry or a grant object format for world caps; the grant state is the world’s current grant set as reported and changed by id world caps. That absence is stated here as a survey limit, not as a design claim: the grant record format is unverified against the survey sources.

Ceilings

A ceiling is a set of capability names that bounds what a world may hold. Two ceilings apply to a hosted world.

The server-wide ceiling is set by id serve --world-allowed-caps <NAMES>, a comma-separated list. The value * is refused on this flag: a server ceiling must name its capabilities. A grant outside the server ceiling does not take effect; a guest request that passes its grant but falls outside the applicable ceiling is answered with the error code outside_ceiling.

The per-world ceiling is set by id world caps --ceiling. It narrows the world further, inside the server ceiling.

The configuration contract in id-config states the general rule for ceilings in this system: ceilings only narrow. A scoped override that widens a ceiling is rejected with CeilingWidened, never clamped (web-config survey §4.1). The id-config ceilings are operation ceilings (max_hops, max_bytes, max_time_ms, max_fan_out), distinct from capability ceilings, but the narrowing rule is the same doctrine in both places.

Cap policy: deny and grant-on-use

id serve --world-cap-policy <POLICY> decides what happens when a guest requests a capability it has not been granted. The default is deny. Under deny, the request returns a refusal event with code cap_denied. The other documented value is grant-on-use: the first use of a requestable capability grants it to the world, and the request proceeds. grant-on-use does not lift a ceiling: a capability outside the server-wide or per-world ceiling stays refused under either policy, with code outside_ceiling. The remaining refusal codes on the capability path are unknown_cap (no such catalog entry), bad_args, failed, actor_denied and result_too_large (full list in Worlds and the Roc guest runtime).

Attenuation and delegation of world access

World access itself is a capability string. A participant joins with --capability <C> (or env ID_WORLD_CAPABILITY), and the session protocol carries an attenuate client frame: a holder can pass on a narrower access than the one it holds. The library side of delegation for agents is id_caps::agent_delegation, with types AgentId, Role, RoleBinding, Delegation, JoinGrant and DelegationRefusal, and the function verify_join. World invite roles are a separate, coarser ladder — spectator, observer, player, guest, delegator, builder, moderator, with invite default guest — covered in Identity, the directory and groups. The attenuated-capabilities design record of 2026-10-09 is carried in Design: capabilities and providers.

The Roc library import gate

Capabilities bind at compile time as well as at run time. A Roc library that uses a capability declares it, and the import pipeline in id-caps checks the declaration before the host loads the program: library_manifest states the requirement, library_resolution resolves it, library_gate admits or refuses the import, and library_attach attaches an admitted library. The worked example is examples/roc-cap-demo/: a library lib/Greeter.roc over records.read, plus two compile-must-fail negative tests — a missing capability against platform-no-caps.roc, and a wrong RocCap signature. The integration test crates/id-caps/tests/roc_import_policy.rs runs the same pipeline against examples/roc-import-policy/fixtures.json.

Policy enforcement next to the session: PolicySession

The MCP bridge holds the clearest shipped statement of the enforcement order, in id_caps::mcp_policy. A PolicySession wraps a BridgeSession and applies, per tool call: (1) a capability-ceiling check against the session’s CapabilityCeiling (sets of tools, worlds, object classes and a program allowlist; anything unnamed is outside the ceiling); (2) a quota charge taken before execution, on three axes — frames, tool_calls, program_invocations; (3) exactly one audit event per action, refusals included, hash-chained and signed with the journal key. It also enforces a stale-decision rule (a call’s screen_revision must name the latest observed revision) and per-tool sliding-window rate limits. Quota exhaustion parks the agent with the world event agent parked, quota exhausted. world.leave is never refused by ceiling or quota and is charged nothing, but it is audited. The bridge itself is covered in Agents in worlds: the MCP bridge and policy and The MCP bridge.

The same pattern — ceiling first, charge before execution, audit every outcome — is the enforcement shape the world host applies to guest capability requests, with the grant set and ceilings of the world in place of the agent’s RoleGrant. The surveys name the host-side pieces (catalog, grants, ceilings, refusal codes) and the bridge-side PolicySession in full; a single named host-side policy type equivalent to PolicySession is unverified against the survey sources.

What is design, not shipped

The surveys attest the catalog, grants, ceilings, the two cap policies, the import gate and the bridge policy point as shipped code. The following are design records only, and are carried in Design: capabilities and providers: the capability taxonomy across web, ESP32/MQTT and text/audio interfaces; speech.* conversational audio capabilities (a feature record dated 2026-11-20; the shipped catalog enumeration in the library survey does not list a speech.* entry, so its presence in the shipped catalog is unverified); the MQTT device bridge id.device.v1; capability certification and its exception policy; and the used-capability derivation tooling that scans a program’s call graph to produce its used set (#5998). The id-caps modules used_caps, cap_diff and cap_baseline ship as library code; the derivation tool as a user-facing surface is the design record’s subject.

Identity, the directory and groups

Two identities per node

Every node holds two identities: a server identity and a client identity. id id prints the server identity; id id --client prints the client identity. Each identity is an Ed25519 keypair in its own key file. The file names are constants from id-core: KEY_FILE = ".iroh-key" for the server key and CLIENT_KEY_FILE = ".iroh-key-client" for the client key, both relative to the data directory. The node ID that other commands take as a remote target is the 64-hex form of the identity key; parsers reject a value that is not 64 hex characters with invalid node ID: must be 64 hex characters.

Almost every identity command takes --client to act on the client identity instead of the server identity. The one recorded exception is id keyset recovery status, which takes no --client flag (CLI survey §1.8).

Keys: export, import, seed phrases

id key manages the raw key files. Passphrases are always hidden prompts, never flags. The commands are:

  • id key export <OUTPUT> — write the key to a file; --client selects the client key.
  • id key import <INPUT> — read a key from a file; --client selects the client key, --replace permits overwriting an existing key.
  • id key export-seed — print a 24-word seed phrase once; it writes no file.
  • id key import-seed — restore a key from a seed phrase; --client and --replace apply.

The failure shapes are exact: a short passphrase fails with passphrase must be at least {MIN_PASSPHRASE_BYTES} bytes (the placeholder is shown here in backticks because the value is substituted at run time), mismatched passphrases fail with passphrases do not match, and a file that is not a 32-byte key fails with the message that the path is not a 32-byte key file. The seed phrase mechanism is the seed_phrase module in id-core. The local key envelope — the identity key wrapped under a passphrase — is key_envelope in id-core, with a design record dated 2026-11-04.

Keysets and guardians

A keyset turns one identity into a set of device keys under an authorization log. Keyset records live in JSONL files: .id-keyset.jsonl for the server identity and .id-keyset-client.jsonl for the client identity. Every id keyset subcommand takes --client except recovery status. The commands are show, enrol <DEVICE_KEY_FILE> --label <NAME> (the label is required), revoke <DEVICE_KEY> with --reason <TEXT> defaulting to revoked, rotate <NEW_ADMIN_KEY_FILE>, guardians <GUARDIANS>... --threshold <N> (the threshold is required), and checkpoint.

First keyset use migrates a single-key account through a genesis record. The identity ID does not change in the migration.

Guardians are the recovery path. A guardian set with a threshold is recorded by id keyset guardians. Recovery then runs as a six-step exchange over a relay file; --relay <FILE> is required on all six subcommands:

  • id keyset recovery publish --relay <FILE> — publish the recovery material.
  • id keyset recovery request <IDENTITY> --relay <FILE> — open a request; --reason <TEXT> defaults to lost every key.
  • id keyset recovery approve <REQUEST> --relay <FILE> — a guardian approves.
  • id keyset recovery cancel <REQUEST> --relay <FILE> — cancel the request.
  • id keyset recovery status <REQUEST> --relay <FILE> — read the request state.
  • id keyset recovery complete <REQUEST> --relay <FILE> — finish the recovery.

The library code is in id-directory: keyset, keyset_file, recovery, recovery_flow, recovery_relay, recovery_view and restored_key. The fuller ceremony designs — guardian social recovery record formats and successor-key authority (#2382), the keyset authorization log ADR (#2380), and the delegation and cross-signing ceremony — are design records carried in Design: identity, directory, groups and delegation.

The directory

The directory is the home-server account layer, in the crate id-directory (split step 6b, #4409). Its core type is Directory, with methods new, open, replay, replay_read_only, append, sign_up, sign_up_keyed, add_key, remove_key, confirm_email, account_for and verify_account, among others named in the library survey.

The directory persists as a journal: directory.jsonl, one JSON DirectoryEntry per line, in the server-config directory. Replay runs entries through the same apply path as live changes. The journal has 17 entry kinds: account_signed_up, account_keyed, account_verified, account_key_added, account_key_removed, account_email_confirmed, account_email_removed, group_created, group_updated, group_visibility, group_deleted, member_set, tier_set, friend_requested, friend_accepted, friend_removed and friend_removal_noted.

Supporting types are fixed. A directory Member is one of two kinds, tagged account or group. Access levels are Level: access, read, write, manage, moderator, admin. Account tiers are Tier: anonymous, registered, verified. Account secrets enter the directory only as SHA-256 digests, and the account key domain is id-account-v1. Directory groups are the directory’s own group records (group_created and its sibling entries); they are distinct from the event-log groups in the next section.

Admission to a directory runs through seitan, in id-directory (modules seitan with accept, admit, derive, freshness and token parts). The seitan V2 admission protocol derives invites with HMAC-SHA512 and a scrypt stretch. Invite records carry the magic IDINV (V2). The web surface exposes the same flow at POST /api/seitan/invite and POST /api/seitan/admit. World invites are a separate minting path with their own shape: id world invite <NODE> --name <NAME> requires the participant display name, takes --role from spectator, observer, player, guest, delegator, builder, moderator (documented default guest), --expires-in (documented default 7 days, maximum 30 days) and --uses <N> (at least 1; omitted means unlimited).

Operator provisioning writes directory state at serve startup. The --server-config TOML names [[users]] entries (a key name, a 64-hex Ed25519 public key as id, an optional alias) and [[groups]] entries (key, name, a creator user key who becomes Admin, optional alias, and [[groups.members]] rows with roles from pull, read, write, manage, admin). Provisioning is idempotent. The full key list is in Configuration and environment.

Event-log groups

The second group system lives in the signed event log. The model — group record, deterministic fold projection, friendship, policy, wire forms — is owned by id-events (groups with delegation, event, fold, friendship, policy and wire parts). id-groups is the enforcement remainder over that model: group actions, the group log, local warnings, the blob gate and group encryption. Group encryption runs on p2panda-encryption’s DataScheme, with causal ordering, history modes and welcome chunking bounded by id_core::frames::MAX_FRAME_BYTES.

The CLI writes group actions to a log file: the global flag --groups-log <FILE>, with runtime default groups.jsonl in the data directory. id group --json prints one JSON object per action, and an array for list. A refused action exits non-zero, and its event stays in the log.

Group creation takes a template. id group create --template <normal|friendship> defaults to normal. A friendship group requires --with <ACCOUNT>, has exactly two members, and rejects --max: the error is a friendship has two members, so it takes no --max. A normal group takes --max <N> and --admins-on-create.

Membership commands are id group add <GROUP> <MEMBER> with --role defaulting to read, id group role <GROUP> <MEMBER> <ROLE>, id group remove <GROUP> <MEMBER>, id group policy <GROUP> and id group list. Removal takes --mode from server-default, revoke, transfer, keep-prior, reassign-to-group; the successor flags --successor-kind and --successor <ACCOUNT> require --mode transfer.

One command is a stub, and the book states it plainly. id group join <INVITE> parses the invitation ticket, then always fails: group join is unavailable: invitation parsing works, but admission and network acceptance are not implemented yet; no group membership was recorded. No group membership is recorded by that command. Disagreement CLI-9: the top-level help text lists join among the group verbs, while the verb’s own help and handler record it as unavailable. The handler is the correct side.

Delegation and revocation

Delegation is two top-level commands over the group log. id delegate <GROUP> <GRANTEE> grants a role: --scope <ROLE> defaults to read, --redelegate permits the grantee to delegate further, and --mode takes keep_prior, cascade or transfer. The command prints the delegation’s event ID. id revoke <GROUP> <GRANT> revokes, where the grant argument is the event ID that delegate printed. Both commands accept --json.

The same delegation vocabulary is present in the event store’s group projection (id_events::groups::delegation) and in the world layer’s agent delegation (id_caps::agent_delegation, with Delegation, JoinGrant and verify_join). The generic invite-delegation design — encoding, depth, leakage and group live-set semantics — is a design record, carried in Design: identity, directory, groups and delegation.

Writer sets

A writer set names the set of authors whose events count for an object. The types are in id-events: idset::{WriterSet, Entry, Excludes}, with the view projection idset::view::expand_set. Writer sets are also a sync gate: id-events owns writer sets and sync gating together, so the set decides whose writes a node accepts during ingest.

The CLI surface is id writer-sets, with --event-store as its store (runtime default events in the data directory) and three subcommands: show <EVENT>, expand <EVENT> (with --resolution <HEX> and --retro), and discover (with --scope <SCOPE> and --resolution <HEX>; no scope means all sets). The writer-set v2 design — view-as-object, set algebra, federation and discovery v2 — is a design record carried in Design: sync, replication and FileOps. The shipped surface is the v1 projection and discovery above.

Sync, replication and FileOps

Discovery: gossip, mDNS, DHT, bootstrap

A node finds peers four ways, and each way has a literal switch on id serve.

Gossip is the default wide-area mechanism. Peers announce on a gossip topic and hear announcements from others. The topic fallback constant is id-peer-discovery-v1 and the topic-secret fallback constant is id-public-discovery-v1. The operative defaults normally come from the embedded defaults.json (shipped content: mode append, topic id-peer-discovery-v1, topic secret id-public-discovery-v1, plus optional bootstrap and web binding entries), and --no-default-topic makes serve fall back to the hardcoded constants. --topic and --topic-secret override. --no-gossip turns gossip discovery and announce off; --gossip forces it on, and the two flags conflict. Disagreement CLI-6: the --topic help text presents the constant as “the default”; the constant is the fallback, and defaults.json is the operative source on a stock serve.

mDNS is local discovery, on by default. --no-mdns disables it on both serve and the remote file commands.

The DHT is mainline DHT address lookup and publishing. It is off by default. id serve --dht enables it, and the lookup code lives in id-sync behind the dht cargo feature; the flag exists in the parser regardless of the feature. Disagreement DES-6: the older documents name three different discovery mechanisms (ARCHITECTURE.md says mDNS plus Iroh’s DHT; the 2026-03-22 peer-discovery record says iroh-gossip plus a distributed topic tracker; the README says only local discovery). The shipped flags above are the code’s answer: gossip, mDNS and opt-in DHT coexist.

Bootstrap nodes seed the first contacts: --bootstrap <IDS> takes comma-separated node IDs and is repeatable, and --no-default-bootstrap ignores bootstrap IDs from defaults.json. Relays carry traffic when direct connections fail; --no-relay on serve and on the remote commands means direct connections only.

id peers reads the result. Its default mode is RPC-then-gossip against a running serve; --gossip restricts it to gossip and --rpc to RPC. Defaults: --depth is 1, --max-peers is 1000, --timeout is 30 seconds.

The meta protocol and log sync

Commands reach a store through the meta protocol. The ALPN is /iroh-meta/3 (META_ALPN = b"/iroh-meta/3" in id-sync). The wire half — MetaRequest and MetaResponse — lives in id-sync::protocol. The facade-facing surface (MetaProtocol, MetaClient, FindMatch, TaggedMatch, MatchKind) lives in id-cli. MetaClient chooses between a running serve (detected by the .iroh-serve.lock file in the data directory) and the in-process local node, which is why the same id get command works with or without a serve running.

Event replication runs on log sync, in id-sync::log_sync: p2panda log-sync sessions with a range-sync bridge, exposed as SyncProtocol. Ingest of a replicated event ends in one of five outcomes, the same five the hosted bridge records: accepted, duplicate, fork, waiting or refused. Writer sets gate ingest: an event from an author outside the object’s writer set is not accepted into that object’s projection (see Identity, the directory and groups).

Friend traffic runs on envelopes. The envelope ALPN is /id-envelope/1. The outbox is an append-only journal (envelope_outbox::Outbox in id-sync), replayed on open, so an undelivered envelope survives a restart. Signed artifacts travel the same layer: four kinds, friend_remove, home_declared, document and tag, each a signed body with author, sequence, previous hash, kind and body. Signed announcements (announcement::{Announcement, SignedAnnouncement}) carry peer announcements with signature verification.

Federation is a module family inside id-sync: federation with record join, record store and exchange networking, plus slices covering key lifecycle and revocation, replay guard, signature suites, signer binding, rejection events, conflict reports, sync scope, anti-entropy, peer priority, fanout budget, query grants and privacy, signed receipts, request identity, result dedup, loop inform, routing state, topology probe, takeover response, peer classes and the ingest gate. The federated query fan-out and peer trust class designs that extend this family are design records, carried in Design: sync, replication and FileOps. One design/code distinction matters here: the design records describe a single /id-sync/1 handshake for sync traffic. The shipped ALPNs in the code surveys are /iroh-meta/3 for the meta protocol, /id-envelope/1 for envelopes and /id-program-registry/1 for the program registry. The /id-sync/1 split is design material, not a shipped wire name.

FileOps: one implementation, three rules that decide outcomes

FileOps (crates/id-sync/src/fileops.rs) is the single implementation of put, rename, copy, delete and transfer for the CLI, the REPL, the meta protocol and the web layer. A file is a name bound to an immutable blob hash, plus tag-store metadata (see The file core: content addressing, names and tags). Three rules decide the outcomes users see:

Rule 1 — archives belong to their owner, and only the owner takes them away. A rename or replace archives the previous binding as {name}.archive.{unix-ts} (collision-bumped, claimed under an in-process lock). The archive records archive.owner; the live name records archive.rename or archive.replace. There is no per-archive delete. Deleting the owner deletes its archives with it.

Rule 2 — delete is a hard delete of the name, and blob bytes outlive it. FileOps::delete removes the name, its metadata and its owned archives in one operation. The blob bytes stay in the store until garbage collection, because another name or a hash-only holder can still reference the same hash. The web layer’s delete is a different operation built on top: a soft delete with a matching restore (POST /api/delete, POST /api/restore, POST /api/hard-delete for the permanent form).

Rule 3 — transfer moves bytes server to server, never through the client. id send <SOURCE_NODE> <NAME> --to <DEST_NODE> instructs the source server to push the file to the destination with the source server’s own identity; no bytes pass through the client process. The web form is POST /api/files/send (#5346), and the library form is id_sync::transfer (server-to-server file transfer, #5345), re-exported at id::transfer. --as <NAME> names the file at the destination, and --replace archives the old destination file first, under Rule 1.

A note on numbering: the three rules above are stated in the order this chapter presents the FileOps survey material (archive ownership, delete semantics, transfer path). The surveys attest each rule’s substance — archive ownership and the absence of per-archive delete, hard delete with blob survival, and the server-to-server push — in web-config survey §5.4 and CLI survey §1.4. A numbered Rule 1–3 list inside fileops.rs itself is unverified against the survey sources; the laptop checkout was unreachable during drafting, so the in-source numbering could not be checked.

Copy and rename complete the operation set. Both refresh the identity metadata keys name, file and path on the destination. Rename archives the source binding under Rule 1 when the destination already holds a file; the exact archive-on-rename trigger is recorded in the web-config survey as the rename handler’s optional archive of the original or replaced file (POST /api/rename).

Replica and mirror

Two commands keep a second copy of a world without hosting it.

id world mirror <NODE> --capability <C> runs a local replica endpoint that accepts sync connections. It is not a world host (the F13.8 boundary in Worlds and the Roc guest runtime). -f/--follow keeps it syncing; --dir <PATH> makes the replica persistent; --timeout-secs <N> defaults to 30, with range 0..=86400.

id world replica <NODE> --dir <DIR> --admin-token <T> is the operator form. --dir is required. --once runs a single pass and conflicts with --follow; --source <HEX> pins a source; --lease <FILE> takes a lease file. Its --world <NAME> flag is the only world-command flag with a clap default: lobby.

World journal replication as a network service — read replicas over a signed stream (F12.13, #806) — is a design record, carried in Design: sync, replication and FileOps. The shipped replication surface is the mirror and replica commands above, plus the log sync of the event store.

The walk skeleton: the sync model in miniature

id walk is the walking skeleton for #9106, the extensible-primitives and federation programme. It is a complete, small sync system: signed records, heads, conflicts and peer sync, with demo keys. It is not feature-gated; it works in a --no-default-features build (CLI survey §3). Every command takes the node directory first, and one process holds a node directory at a time.

  • id walk init <DIR> --name <NAME> — create a node directory. --name is required. Re-initialising keeps the records, and the recorded name must match.
  • id walk write <DIR> --as <alice|bob> --text <TEXT> — write a record. --as and --text are required. Writers are demo keys derived from the name. --parent <HEX> is repeatable; omitted, the write parents on the current heads; two or more parents resolve a conflict. The command prints an id://… address for the record.
  • id walk read <DIR> <ADDRESS> — read a record by its address. Reading a record the node does not hold is an error, not a fetch: the walk never retrieves on read.
  • id walk reports <DIR> — print heads and conflict reports.
  • id walk serve <DIR> — run until interrupted; prints a peer token of the form <endpoint-id>@<socket-address> (shown in backticks; the token is the two parts joined by @).
  • id walk sync <DIR> --peer <TOKEN> — sync with the peer named by the token. --peer is required.

The walk is the proof of the sync model because it isolates the model’s moving parts at demo scale. Two node directories diverge by writing under different demo keys, converge by walk sync, and surface their divergence as heads and conflict reports rather than hiding it. Records move only during sync, never during read — the same rule the full system states as ingest outcomes and writer-set gating, reduced to six commands. The full command reference is in Gallery, match-audit and walk.

Events and the signed audit chain

Almost everything durable in ID is an event. Files have names and blobs, worlds have journals, and groups have membership, but the record that ties them together — who did what, in what order, under whose authority — is the signed event store. This chapter describes the store as it ships: its on-disk format, its wire format, the vocabulary of event kinds, and the surfaces built on top of it. The neighbouring chapters cover the file core and sync; this one covers the log itself.

The store on disk

The event store lives in a single redb file named events.redb in the store directory (a temporary sibling, events.redb.tmp, is used during writes). Its format marker, recorded in the meta table, is id.events.store.v9. The previous marker, id.events.store.v8, is also accepted: a v9 store differs from a v8 store only in that it may carry a bodies table.

The v9 store has 17 tables: events, hashes, chains, forks, groups (a multimap), proof_ids, proof_headers, waiting, waiting_by_dep (a multimap), meta, blocks, writer_set_bodies, actions, device_ops, applied, bodies, and tag_fold. Keys are big-endian, so one author’s events sort in sequence order inside the tables. A chain row is a fixed 41-byte encoding: the next sequence number as a big-endian u64, the 32-byte head hash, and a frozen flag byte (0 or 1).

The implementation sits in id-events (crates/id-events/src/event_store/), behind the Storage / FileStorage seam. The event store’s own vocabulary types — the op vocabularies the signed header embeds, such as chat, notes, note links, session checkpoints, issuer rotation and policy — live one layer down in id-store, with the header type that carries them. The operator block list is stored in the event store’s blocks table; it is data, not configuration.

The wire format: canonical-CBOR v1 headers

Every event on the wire is a p2panda-core header, Header<ChainExt>, encoded in canonical CBOR. The domain tag is id.events.v1. The operation ID of an event is the BLAKE3 hash of the received bytes. Signatures are checked with verify_strict: an event whose signature does not verify is not admitted.

The extension carried in each header, ChainExt, has three fields: kind, group, and after. The kind is 1 to 64 bytes and is normalized to NFC. The after field names up to 32 prior hashes (MAX_AFTER = 32); it is the dependency list that lets a receiver order an event against the events it builds on, and hold it in the waiting pool when a dependency has not arrived yet.

Ingest has five outcomes, and the same five outcomes appear in the hosted bridge described in The hosted edition: accepted, duplicate, fork, waiting, and refused. A fork is evidence, not an error to be hidden: the forks table keeps it, and a forked chain is how double-signing by one author becomes visible to everyone who syncs the log.

The event-kind vocabulary

Event kinds are string constants. The reference inventory names 23 of them across id-store, id-events and id-core, plus the group-operation kinds carried by id_events::groups. The named set includes:

  • Chat and documents: chat.message.v1, chat.anchor.v1, document.put, document.remove, media.put, media.remove.
  • Notes: note.create, note.revise, note.link.
  • Tags: tag.set, tag.clear.
  • Sessions: session.checkpoint.
  • Identity and devices: identity (the documents/identity kind), issuer.rotation, device.add, device.revoke.
  • Attestation: attestation.genesis, attestation.claim, attestation.witness_decision, attestation.objection.
  • Writer sets: idset.writer, idset.rescind.
  • Chained messages carried by id-sync: chained.message.

Group operations — group create, member and role changes — are carried by the group kinds owned by id_events::groups and validated during ingest and resolution in the event store. The exact spelling of every group-operation kind was not enumerated in the surveys and is unverified in this chapter; the reference chapter on data stores carries the full table.

Documents, claims and writer sets

Three surfaces sit directly on the event store.

Documents are events of kind document.put and document.remove, addressed through DocumentRef in id-store, with DOCUMENT_KIND naming the document kind. A document is therefore not a separate database: it is a projection of the event log, rebuilt by folding the log.

Claims are the local-claims surface in id-events (local_claims), with the tag-claims hash domain id.local-claim.v1 in id-store. A claim is a signed statement by one author about a subject; the fold decides what a given reader’s view shows.

Writer sets decide whose events count for a given view. The types live in id-events as idset::{WriterSet, Entry, Excludes}, with the view expansion in idset::view::expand_set and the set bodies stored in the event store’s writer_set_bodies table. Events by authors outside the writer set are still stored and synced; the writer set governs projection, not admission. That distinction — accept-all ingest, writer-set views — is the trust model of the whole system.

Journals and checkpoints

Two other logs reuse the same ideas at smaller scale.

The directory keeps an append-only JSONL journal, directory.jsonl, holding one DirectoryEntry per line across 17 entry kinds (account sign-up, key add and remove, group create and update, member and tier changes, friend requests and removals, and the rest). The journal is replayed through the same apply path as live changes, so a replayed directory and a live directory reach the same state by construction.

Worlds keep their own journals. A world host checkpoints its journal on a fixed cadence: id serve takes --world-checkpoint-every, default 1000, where 0 means never trim. Note editing has its own checkpoint kind, session.checkpoint, and the collaborative editor can publish a durable note-session checkpoint (collab tag 10), answered by tag 11 carrying the hex of the new note head revision; filename sessions refuse that frame. Session checkpoints began as a proof of concept (#2241) and a design for a session header plus segment checkpoint event kind (#2240); the shipped kind constant is session.checkpoint.

The audit chain

The audit chain is the event chain itself, read as evidence. Each author’s events form a hash chain: every header commits to its position by sequence and by the after dependencies, the chain row in the store records the head hash and next sequence, and each header is signed by its author. To audit is to re-verify: recompute the BLAKE3 operation IDs, check every signature with verify_strict, confirm the sequence has no gaps, and confirm that no fork exists for the range in question — or, if one does, that it is recorded in forks and attributed to the author who double-signed.

The same pattern recurs wherever ID needs a tamper-evident record. The MCP policy point, described in Agents in worlds: the MCP bridge and policy, writes exactly one hash-chained, journal-key-signed audit event per agent action, refusals included. The hosted bridge store mirrors the native tables under bridge_ names (bridge_events, bridge_chains, bridge_forks, bridge_proof_ids, bridge_proof_headers, bridge_waiting, bridge_waiting_by_dep, bridge_meta), so a hosted peer holds the same evidence in the same shape.

One honesty note on scope: the surveys establish the store format, the wire format and the kind vocabulary from the code at the surveyed commit. They do not publish a worked example of a full chain verification, and this chapter does not invent one. A toy illustration, with invented data only: author key aa… (a placeholder name, not a real key) signs event sequence 0 with kind note.create; sequence 1 names sequence 0’s hash in after; a verifier who receives sequence 1 first holds it as waiting until sequence 0 arrives, then accepts both in order.

Next: Residency, jurisdiction and boundaries covers where events are allowed to live; The hosted edition covers the peer that holds them for hosted users.

Residency, jurisdiction and boundaries

Residency answers a question the rest of ID mostly ignores: where is this data allowed to be? A native node keeps its stores on its own disk, under its operator’s control. A hosted user, a relay, or a federated peer may be in a different legal jurisdiction, and some data — a hosted user’s store, a world’s blobs, a bridge peer’s copy of the event log — must stay inside a named jurisdiction or not move at all. This chapter describes the residency model as it ships, the boundary machinery around it, and, plainly, the one part that does not ship yet: the fenced jurisdiction migration control plane.

The model

The residency vocabulary lives in id-core: the modules residency, residency_inventory, boundary, boundary_surfaces, sanctions and sanctions_store. The facade re-exports residency at id::residency. Routing and synchronisation for residency live one layer up, in id-events, as residency_routes and residency_sync.

On the operator side, residency is declared in the id serve server configuration. The server-config TOML has two optional tables owned by crates/id-cli/src/server_config/boundaries.rs (#8851): a [residency] table and a list of [[boundaries]] tables. Both tables are optional; a server config with neither is valid, as is an entirely empty server-config file. The exact field list inside [residency] and [[boundaries]] was not enumerated in the surveys and is unverified in this chapter; the reference chapter on configuration carries it.

Two signed domains name the boundary artefacts. A boundary evidence record is produced under the domain id.boundary.evidence.v1. A boundary declaration is hashed under the domain id.boundary.declaration.v1. Declarations state the rule; evidence is what an enforcement point checks. The design behind the shipped inputs — declaration residence, evidence sources and the verifier — is the #8851 record, and the fuller framework of declarations, evidence and enforcement is design work described below.

In id-cli, two modules work the boundary at runtime: boundary_evidence and boundary_gate. In id-directory, the BoundaryGate trait is the seam the directory consults. The names state the split: evidence is gathered and checked as data; the gate is the point that admits or refuses.

Jurisdiction fences in the hosted edition

The one place jurisdiction is enforced end to end today is the hosted worker, and it fails closed. The front door consumes resolved context headers set by an authenticated internal caller — X-Binding-Id and X-Jurisdiction, plus X-Iroh-Id — strips every client-supplied internal header, and re-sets them internally as x-hosted-binding-id, x-hosted-jurisdiction, x-hosted-routed: restricted and x-hosted-iroh-id. Requests reach the per-user Durable Object only through the jurisdiction-restricted namespace; src/routing.ts is the only module that touches the raw USERS namespace, and there is no unrestricted fallback.

Inside the Durable Object, every route runs a common guard before it does any work: the routing context must be present, the runtime jurisdiction must match, and the persisted (binding_id, jurisdiction) pair — bound immutably by the first routed request — must match. The object’s own state route, GET /v1/state, reports binding_id, jurisdiction, schema version and object name, so the fence is inspectable.

Local development shows the fence at its strictest. Local workerd does not implement jurisdiction restrictions, so the worker returns 503 with the error jurisdiction_unavailable for every fully valid request when run locally, by design. That behaviour is the subject of The hosted edition; the point here is that the failure is closed, not open: when jurisdiction cannot be established, nothing is served.

The migration control plane: status

Moving a hosted store from one jurisdiction to another is the job of the migration control plane in the issue chain #3399 → #3400–#3404. Its status must be stated plainly:

The #3404 migration control plane core has landed; the hosted wiring has not. The migration_control slice — a fenced jurisdiction migration control plane, 1,202 lines with 17 tests in crates/id-core/src/migration_control.rs, plus its wiring edits — landed on main on 2026-11-23 (PR #13347), after a flag hold on the landing was cleared by Drew’s approval naming #3404. The core is library code in the shipped tree, but no command in this book’s CLI reference invokes it and no hosted surface calls it yet: #3404 remains open for the hosted wiring (#3399/#3400/#3402), and no operator can run a jurisdiction migration today.

The forward design — how a fenced migration is proposed, evidenced, approved and executed without ever holding a user’s store in two jurisdictions or in none — is carried by the design chapter residency, jurisdiction and boundaries, not by this chapter. This chapter describes shipped behaviour only, and shipped behaviour today is: stores are bound to a jurisdiction at first routed request, the binding is immutable inside the object, and there is no shipped migration path between jurisdictions.

Boundaries beyond jurisdiction

Not every boundary is a jurisdiction fence. The surveys record boundary machinery in three other places, and a reader should not merge them:

  • The sanctions boundary: id-core carries sanctions and sanctions_store, and the design record for the sanctions boundary data model is #5878. The federation layer carries key suspension records in crates/id-sync/src/federation/slices/b02_key_revocation.rs — operator maintenance suspension, bounded or indefinite. Suspension is a boundary on keys, not on places.
  • The provider declaration lifecycle: a provider declaration moves Filed → Admitted → Live → Suspended / Superseded / Stale → Tombstoned. Suspension there is registry state; the provider’s contents are unchanged. That lifecycle is covered in Currency, tokens and metering where the registry family is discussed, because the same declaration machinery serves the program gallery.
  • The payload boundary: a decision record (#5908) sets the procedure for decomposing a payload versus attaching it. That is a boundary on representation, not on residency.

What the design records add

The design archive holds 11 records for this theme — the smallest concept theme in the book, kept as its own chapter because it has its own blocker chain (#3399 → #3400–#3404). They include the Durable Object jurisdiction pinning investigation, the jurisdiction-aware per-user hosted store designs (#2283 and the loose record 2026-11-01_jurisdiction_aware_user_store_design.md), jurisdiction-partitioned hosted worlds and world blobs (#3397), residency boundaries for the native bridge, federation and relays (#3398), the shared-world residency investigation, the residency and boundaries framework (#5683), the residency evidence model (#5876), the sanctions boundary (#5878), boundary audit and appeals, and the boundary enforcement inputs record (#8851) behind the shipped server-config tables.

Where any of those records describes behaviour beyond the shipped fence, the hosted guard and the server-config tables named above, it is design, not current behaviour, and the design chapter says so record by record.

The hosted edition

ID is local-first: a native node holds its own stores and keys. The hosted edition is the same system offered as a service — a user’s store and sync peer run in a Cloudflare Durable Object, bound to that user by a native binding ceremony, so a user without a running node still has a home for their signed objects. This chapter describes the hosted edition exactly as it stands, and the standing is the first fact:

The hosted edition is not deployed. The hosted-worker package in pkgs/id/hosted-worker is a local-only scaffold. Its wrangler.toml header states that the config is for wrangler dev and tests, that no account-level deployment, production binding or billable resource is authorized by the package, and that deployment and the real-account jurisdiction canary are gated on #2285 and #3403. Nothing in this chapter describes a running service. There is no production hosted URL, no production account, and no live user on this code.

The binding ceremony is native

The worker does not authenticate users itself. Binding a hosted identity to an ID key happens natively, in the facade crate at pkgs/id/src/hosted_binding.rs, with companion facade modules hosted_export and hosted_ingest. The worker’s front door consumes the result: an already-authenticated resolved context carried in the headers X-Binding-Id and X-Jurisdiction, plus X-Iroh-Id.

The front door (src/worker.ts, 73 lines) strips every client-supplied internal header, re-sets the context internally (x-hosted-binding-id, x-hosted-jurisdiction, x-hosted-routed: restricted, x-hosted-iroh-id), enforces the front-door body limit, and forwards to the per-user Durable Object through the jurisdiction-restricted namespace only. Objects are named by binding_id — 32 lowercase hex characters — never by email or provider subject. src/routing.ts is the only module that touches the raw USERS namespace, and there is no unrestricted fallback. The jurisdiction side of this fence is covered in Residency, jurisdiction and boundaries.

Bindings

The worker’s wrangler.toml (compatibility date 2025-06-01, name id-hosted-worker) declares:

  • USERS — a Durable Object namespace bound to the UserDO class, migration tag v1, with SQLite-backed classes (new_sqlite_classes = ["UserDO"]).
  • BLOBS — an R2 bucket named id-hosted-blobs, holding content-addressed blob bytes (#3811 slice A, #9954). Local emulation only.
  • USER_CEILING_BYTES — an optional string variable: the per-user storage ceiling. Absent or empty means no ceiling; a malformed value fails writes closed. The front door also reads it for the body limit; MAX_BODY_BYTES caps a request body at 100 MiB.
  • BRIDGE_WAITING_PER_AUTHOR, BRIDGE_WAITING_TOTAL, BRIDGE_WAITING_MAX_AGE_MS — optional string variables bounding the bridge waiting pool. Absent means the native defaults in bridge-store.ts; malformed values fail bridge writes closed.

A separate test harness config (wrangler.test.toml, name id-hosted-worker-test) binds TEST_USERS to the same UserDO class, a bucket id-hosted-blobs-test, and USER_CEILING_BYTES = "1073741824". It is test-only and is never an application entry point.

Locally, the worker fails closed on jurisdiction: local workerd does not implement jurisdiction restrictions, so every fully valid request receives 503 jurisdiction_unavailable, by design.

What UserDO implements

The per-user object is UserDO in src/user-do.ts. Its schema version is 3, stored in SQLite tables meta, kv and blobs, plus the bridge schema (bridge_events, bridge_chains, bridge_forks, bridge_proof_ids, bridge_proof_headers, bridge_waiting, bridge_waiting_by_dep, bridge_meta) — the same table family as the native event store in Events and the signed audit chain, under bridge_ names.

Every route first runs the common guard: routing context present, runtime jurisdiction matches, and the persisted (binding_id, jurisdiction) pair — bound immutably by the first routed request — matches. The object exposes 15 method routes over 13 paths:

Method and pathPurpose
GET /v1/usageUsage, ceiling, and whether the user is at cap (at_cap)
GET /v1/exportFull KV and blob index export; stays available at cap, by design
GET /v1/statebinding_id, jurisdiction, schema_version, object name
GET /v1/bridge/challengeIssue a single-use ID-key proof nonce (bridge, #3818)
GET /v1/bridge/headsBridge chain heads; a fresh ID-key proof is required per call
POST /v1/bridge/pushIngest a batch of signed events; outcomes are accepted, duplicate, fork, waiting, refused
POST /v1/bridge/pullPull events beyond per-author positions; binary batch, with x-bridge-more and x-bridge-heads headers
GET /v1/bridge/exportExport sets for the native build_export (#13157); 502 naming the hash if R2 cannot produce a cited blob
WS /v1/bridge/wsBridge session; in-band CHALLENGE/AUTH, binary frames only
PUT /v1/blobsStore a content-addressed blob, keyed by SHA-256 hex; deduplicated across users, with a per-user reference row
GET /v1/blobs/{64-hex}Fetch a referenced blob
DELETE /v1/blobs/{64-hex}Drop this user’s reference only; the R2 bytes are deliberately not deleted (garbage collection is the #9935 family)
PUT /v1/kv/{key}Per-user KV write; the key must match [A-Za-z0-9._-]{1,128}
GET /v1/kv/{key}KV read
DELETE /v1/kv/{key}KV delete; available at cap

Any other path or method returns 404 with {"error":"not_found"}. Bridge routes additionally fail closed when the binding record names no ID (Iroh root) key.

Read the table as a data plane, because that is what it is. The hosted object holds one bound user’s KV, blob references, and a signed-object bridge store. As a sync peer it holds signed objects and fork evidence; it assigns no order, re-signs nothing, and serves no authoritative snapshot. Ordering and authority stay with the authors’ chains, exactly as on a native node.

Also in the package, but not routed by worker.ts, are src/provisioning.ts and provisioning-surface.ts (a provisioning surface), src/account-directory.ts, src/admission-gate.ts, src/export.ts, and a currency gateway proof of concept under src/currency/ (gateway, ledger, relay, crypto; #2298). The currency proof of concept is explicitly not the permanent currency service: it is an in-process ledger stub modelled on TigerBeetle, with gateway-signed balance snapshots and a UserDO relay reconciling by request-ID lookup. Currency, tokens and metering covers it in place.

What it does not yet do

The list of absences is part of the specification of the current state:

  • No deployment exists. The gates are #2285 and #3403; until they clear, the package runs only under wrangler dev and its test harness.
  • No jurisdiction canary has run against a real account, so the jurisdiction-restricted namespace behaviour is verified locally only in its fail-closed form (503 jurisdiction_unavailable).
  • Blob garbage collection does not exist; deleting a blob drops one user’s reference and leaves the R2 bytes in place (#9935 family).
  • The hosted-worker README’s own route list is stale: it describes the first slice (GET /v1/state and KV PUT/GET, with blobs, metering and caps as later steps) and was never revised. The code implements blobs, usage and metering, export, KV DELETE and the full bridge. This is survey disagreement WEB-9; the code, not the README, is the source for the table above.

worker-poc: a completed proof, not a service

pkgs/id/worker-poc is a separate, finished proof of concept for #2271: run one example world unmodified in a Worker isolate and prove journal equality against the native wasmtime host. All of its acceptance boxes are checked (2026-11-01). Nothing in it is a production path.

Its worker (src/worker.ts) exposes a WorldObject Durable Object (binding WORLD, migration v1-sqlite, a CompiledWasm rule for the prebuilt guest) with three routes: POST /step taking {participant, event}, POST /cold-start, and GET /state. A SQLite journal table is the source of truth. The hosted loader (src/manifest.ts) refuses portability=native manifests and manifests declaring more than 64 MB of memory, up front.

A subfolder, d1-journal-poc/, is a second, local-only fit probe for D1: GET /health, POST /append, GET /snapshot, GET /tail, with journal header version 1 entries created and caps_granted, a placeholder database ID, and always --local. Its own note records that a D1 bookmark is not a stream cursor.

Where the rest lives

The design for a deployed hosted edition — provisioning and SSO binding, per-user stores, storage contracts, self-hosted tier adapters and the media plane — is carried by the design chapter hosted and serverless editions (30 records in the survey’s mapping). The shipped scaffold above is the ground that design stands on, and this chapter’s claim is only the scaffold’s: implemented locally, gated, and not running anywhere.

Shells: terminal, web, native and hardware

A shell is a client surface for ID: it presents a node’s files and worlds to a person and turns that person’s actions back into protocol frames. ID has four shells, and they share one contract. The machine-readable form of that contract is pkgs/id/contract/shell-contract.v1.json — contract name id-shell, version 1, revision 15 — defining the /id-world/1 ALPN protocol: three transports (an Iroh QUIC stream, WebSocket at /ws/world, and SSH exec id-world/1), a 1 MiB maximum frame, session phases (opening, query, install, joined), six frame classes (event, ephemeral, query, control, admin, delegation), and the full client and server frame vocabulary. A companion conformance suite, shell-suite.v1.json, names the four shells — terminal, browser, native, hardware — with each shell’s presented and sent frame sets, and golden session transcripts (sessions/terminal.jsonl, 5 frames; sessions/native.jsonl, 7 frames) that shells are checked against. Host-side, the contract is owned by id_worlds::shell_contract.

The four shells differ in what they can present. The rule that keeps them one system is the fallback rule: a shell without a renderer for a surface uses that surface’s text projection. No shell invents frame kinds; the native and hardware shells below both state that explicitly in their own terms.

The terminal shell: CLI and REPL

The terminal shell is the id binary itself: 2 binaries in the workspace produce the command surface (the id binary and the id-native-shell binary below), with 32 top-level commands and 113 leaf commands in the surveyed CLI. The command chapters of the reference section cover that surface; the concept is that the terminal is a full shell, not a debug tool — it joins worlds, administers them, and speaks the same session protocol as every other shell.

Running id with no subcommand starts the REPL (in src/main.rs, the no-command case calls run_repl). The REPL is also reachable as id repl [NODE], with the hidden alias id shell. It has its own parser, in crates/id-cli/src/repl/ — dispatch in runner.rs, line preprocessing in input.rs, context in crates/id-cli/src/commands/repl.rs — and 20 command groups in the surveyed surface. Its modes are auto-detected and printed in the banner as id repl (<mode>): a local mode against the node’s own store, and RemoteNode mode when started as id repl <NODE_ID> against a running serve.

REPL behaviour differs from the one-shot CLI in ways a user feels. A failed command prints error: <e> and the REPL continues; the REPL never exits non-zero because a command failed. An unrecognised line prints unknown command: <line> plus type 'help' for available commands. History is rustyline, in memory only — no history file is configured. Some commands exist only in the REPL (delete, rename among them), and the REPL has no serve, world, group, doc, claim or key groups; those are one-shot CLI commands, started before entering the REPL. World sessions from the terminal use the world session protocol directly: the client frame vocabulary has 43 kinds and the server’s 35, shared with the web shell’s world bridge and the Iroh transport.

The web shell

The web shell is the id-web crate served by id serve: an Axum server whose frontend (pkgs/id/web, Bun and TypeScript) is embedded into the binary at compile time with rust-embed. It is off by default (--web off), binds 127.0.0.1 by default, and serves on port 3000 by default. Every router passes through the security layer in crates/id-web/src/security.rs: a loopback bind by default, a Host allow-list on loopback binds (localhost, 127.0.0.1, ::1, plus operator extras), a same-origin check on any request carrying an Origin header, and an optional gate token accepted as the id_token cookie, an Authorization: Bearer header, or a ?token= parameter that sets the cookie and redirects to the clean path.

The web shell has two faces. The Explorer face is the file and document UI: 54 distinct paths and 58 method bindings in the main router — file browser, ProseMirror collaborative editor over the /ws/collab/{doc_id} WebSocket (binary MessagePack, tags 0–11), tag editing with the /ws/tags broadcast socket, identity registration, the groups and peers pages, and the program gallery. The world face is the world bridge: an HTTP surface (/api/world/invite, /api/world/host-view, /api/world/metrics, /api/world/directory) plus the world session WebSocket at the socket named by the app’s [interfaces.web] binding — default /ws/world, default page route /world. A program-only router (10 paths) serves one world pinned to one listener, and publication mounts serve that same router under a mounted prefix.

The frontend renders in exactly three DaisyUI themes, all on #000000: sneak (the default, blue #00aaff), arch (green #00ff00) and mech (orange #ff6600), stored in the localStorage key id-theme and cycled with Alt+T. The older WEB.md manual describes only the file and editor face of this shell; it never mentions the world or gallery surfaces, and its route table covers less than half of the shipped router (survey disagreements WEB-2, WEB-3, WEB-15).

The native shell: id-native-shell

The native shell is the F13.6 native reference shell (design #788), shipped as the id-native-shell binary in crates/id-native-shell. It is a Bevy desktop client for the F13.1 shell contract. It is a workspace member but not a default member, so a plain cargo build in pkgs/id/ never acquires Bevy or the desktop system libraries. Its production dependency is the facade crate alone (id, with default-features = false, features = ["world"]), plus Bevy 0.19 and Iroh; it is, with the hardware shell, one of only two production consumers of the facade outside the workspace’s internal graph (survey disagreement LIB-12 records that the architecture table hides this edge direction).

The native shell is a client only. It connects to a world host over the existing session protocol — its session code calls id::world_net::WorldClient::connect — renders the host’s view frames, and emits only the client frames the contract already names: input, paste, resize, chat. It adds no frame kinds, needs no host change, and no shell frame depends on the guest ABI. Its library surface includes the frame builders (input_frame, input_frame_with_revision, paste_frame, resize_frame, chat_frame, agent_join_frame, screen_subscribe_frame), the present(data, surface) view fallback, and run_session, the live WorldClient session loop.

Its modules are render (a styled model and Bevy UI renderer for validated surfaces), scene (validated scene/1 surfaces as 3D entities via bevy_pbr), audio (validated audio/1 surfaces as scheduled cue entities — presentation state only; the crate’s feature set carries no audio output backend), widget (validated widget/1 surfaces as placed control entities), events, form, providers and session. Shells without a renderer for a surface keep the surface’s text projection; that fallback rule is uniform across scene, audio and widget.

Current state, from the library survey: steps 1 and 2 of design #788 are in the code. Step 1 is the isolated package, identity and connection bootstrap, contract frame builders, view fallback, and a transcript fixture checked against the machine-readable contract. Step 2 is the window and render plugin set and the live session loop; tests/live_session.rs proves the durable-outcome half of the parity criterion against a live host. The binary parses --node and --capability and exits with code 2 on bad arguments or a failed session spawn. One environment variable is specific to this shell: ID_SHELL_FILE_READ_ROOT, read in crates/id-native-shell/src/main.rs; unset, the native shell’s file-read root is not additionally restricted or configured by environment. The native shell also declares the only client provider in the conformance suite: client.file.read.

The hardware shell: id-hw-shell

The hardware shell is crates/id-hw-shell: an ESP32-class hardware shell spike (more-shells v1 slice 3, #10929; design doc/2026-11-10T20-40-00Z_design_more_shells_v1, section 3). It is one file, src/lib.rs at 996 lines, with no submodules. Like the native shell it is a workspace member but not a default member, and its production dependency is the facade alone (id, features = ["world"]); id-worlds with the sandbox appears only in dev-dependencies, for the in-process host harness in its tests.

The hardware shell is the F13.1 contract reduced to exactly the subset that survives at ESP32-class device size:

  • Presence: a wake-time read of the snapshot’s participant list, with journal joined and left events folded on top.
  • Journal-head state in compressed form: the newest durable sequence folded, nothing else.
  • Confirm and act: answer a presented form choice with a form_result frame — submit or cancel, choice selections, yes/no.

Rich rendering, free text and world hosting are excluded by name in its capability_statement(), and the code makes the exclusions real: the only client frames the crate can build are join and form_result, and a form requiring free text is refused with HwError::FreeTextExcluded. Every built frame is checked against the embedded F13.1 contract before it is returned, and every folded frame is checked on the way in. Its API is HwShell (new, head, presence, diverged, last_status, choice), with PresentedChoice and SelectableField describing a presented choice, and the constants CONTRACT_NAME = "shell" and CONTRACT_VERSION = 1.

The shell is transport-free by design: the frame builders and the fold are pure functions, so the same code runs over a real Iroh session on a device — or on the paired full node the design names — and over recorded frames in tests. It builds no frames for any transport because it owns no transport. Its power posture follows: no live session is held open. The device wakes, joins, folds to the journal head, acts if a choice is presented, and disconnects. If a resume replay does not continue contiguously from the recorded head, continuity is unprovable, and the shell discards its folded presence and waits for a fresh snapshot.

Its state must be stated as plainly as the hosted edition’s: it is a spike, complete at its stated subset — not a port in progress. The exclusions are the deliverable.

One contract, four sizes

The four shells are one conformance story at four sizes: the terminal and web shells carry the full surface; the native shell carries the full session protocol with rich surfaces and a text fallback; the hardware shell carries presence, head and confirm/act only, and says so in its capability statement. The forward design for shells — presentation tiers, the rendering pipeline, input models, Android and further embedded surfaces (43 records in the survey’s mapping) — is carried by the design chapter shells and client surfaces.

Agents in worlds: the MCP bridge and policy

An agent in a world is a participant that is not a person at a keyboard: a model-driven client that joins a world with a capability, reads the screen, posts chat and invokes programs, under a ceiling set by the world’s owner. ID’s mechanism for that is described in the design series #6300 (v1 spike) through #6303 (hosted services). This chapter describes what has shipped, and it starts with the boundary of what has shipped, stated plainly:

There is no MCP server for ID. The shipped tree contains no standalone MCP server binary, no stdio or HTTP MCP transport, and no JSON-RPC tools/list implementation. There is no mcpx or home wiring for ID either: home/common/mcpx-settings.nix contains no ID or world MCP server entry (its remote MCP entry is Atlas Search), and home/ and nixos/ contain no ID MCP entry. There is no gate-token environment variable for the ID MCP bridge; the bridge reads none of ID_WORLD_CAPABILITY, ID_WORLD_ADMIN_TOKEN or ID_WEB_TOKEN.

What exists is a library-level translator plus a host policy point, in id-caps, exercised by two integration tests in the facade package: pkgs/id/tests/mcp_bridge_e2e.rs and pkgs/id/tests/mcp_spike_e2e.rs. An agent reaches a world today by a host program embedding these two components, not by connecting an MCP client to an ID server.

The translator: id_caps::mcp_bridge

id_caps::mcp_bridge (in crates/id-caps/src/mcp_bridge.rs) is authority-free. It translates one MCP tool call into one of three things: an F13.1 world-session client frame (JSON), a locally rendered answer computed from server frames the bridge has already observed, or a session close. It holds no credentials. The only credential value it touches is the agent’s own join capability, which it passes through into the join frame and does not store as authority of its own.

Tool definitions are pinned at session start. BridgeSession::start and verify_definitions take the SHA-256 over the canonical JSON of the definition set; if the definition set changes mid-session, the session terminates permanently. That is an anti-poisoning rule: a tool whose meaning changes under an agent is not the tool the agent was granted.

The bridge consumes three kinds of server frame — view, semantic_diff and screen_subscription — and ignores all others by design. Its answers for read tools come only from what it has observed.

The v1 tool list: 8 tools

v1_tool_definitions() pins 8 tools, in this order:

#ToolMaps toCeiling keyBehaviour
1world.joinF13.1 session.presencepresenceSends {type:"join", capability, after, agent_profile:true}. capability is a required string; after is an optional u64. A second join returns AlreadyJoined.
2world.leaveF13.1 session.presencepresenceNo frame exists for leaving: returns ToolAction::Close. Presence is connection-scoped, so closing is leaving.
3screen.readscreen.readscreen.readA local answer: the latest full view text plus pending semantic-diff changes, which it drains. No frame is sent.
4screen.subscribescreen.subscribescreen.readSends {type:"screen_subscribe", …}. Takes an optional region (x, y, width, height, each u64) and an optional event_classes list; at least one of the two is required.
5object.inspectobject.inspectscreen.readA local answer from observed object_changed diffs, keyed by the JSON string of the required entity_ref (any JSON value). If nothing was observed: "object not in the observed screen state".
6program.invokeinputprogram.invokeSends exactly one {type:"input", data_hex: hex(arguments), screen_revision?} frame; no chaining. program and object are required non-empty strings, arguments is a required string, screen_revision is optional. The bridge validates the fields; the policy layer enforces the allowlist.
7chat.postchat.postchat.postSends {type:"chat", text, screen_revision?}. text is a required string; screen_revision is optional.
8presence.setpresence.setpresenceListed but unimplemented in v1 — see below.

Five names are explicitly forbidden (FORBIDDEN_TOOL_NAMES): capability.mint, credential.read, audit.mutate, world.export, host.exec. Any name that is neither a v1 tool nor handled returns BridgeError::UnknownTool. Every tool except world.join requires a joined session and returns NotJoined otherwise.

presence.set is the honesty case in the shipped surface, recorded as survey disagreement WEB-13. It is one of the 8 pinned definitions, so a client discovering the surface is offered it — and tool_action refuses it unconditionally with BridgeError::NoFrameMapping, because presence is the join itself and no presence frame exists. A v1 client must treat presence.set as a tool that can never succeed.

The world session the bridge targets carries contract revision 11 for the agent profile and semantic diffs (#6300 section 4.2): the subscribable event classes are chat_posted, input_applied, object_changed, system_event and program_changed, with region_changed and notification as non-subscribable change kinds. Revision 12 adds negotiated binary MessagePack screen patches, only on byte-capable transports.

The policy point: PolicySession

id_caps::mcp_policy (in crates/id-caps/src/mcp_policy.rs) is the host-side policy point. PolicySession wraps a BridgeSession and runs three steps for every action, in this order:

  1. Capability-ceiling check.
  2. Quota charge, taken before execution.
  3. Exactly one audit event per action — hash-chained and signed with the journal key — refusals included.

The grant the session runs under is RoleGrant, set by the owner at grant time and never widened by the session: agent_key (a 32-byte array), agent_label, owner, world, capability_ref (the delegation or grant record ID stamped on every audit event), ceiling, quota, and rate_limits.

The ceiling is CapabilityCeiling: four sets — tools, worlds, object_classes, program_allowlist — each a BTreeSet<String>. Anything unnamed is outside the ceiling. The per-tool ceiling keys in the table above are how a tool call is matched against the tools set.

Quota has three axes: frames, tool_calls, program_invocations. The charge per admitted action is fixed: 1 tool call always; plus 1 frame for world.join, screen.subscribe, chat.post and program.invoke; plus 1 program invocation for program.invoke. When quota is exhausted, the agent is parked, with a first-class world event: QUOTA_PARK_EVENT = "agent parked, quota exhausted", a ParkEvent of kind agent_parked and reason quota_exhausted. Two further refusal rules apply: the stale-decision rule — a screen_revision argument must name the latest observed revision — and per-tool sliding-window rate limits, each a RateLimit{tool, max_calls, window_secs}.

Audit outcomes are the AuditOutcome variants: Executed, RefusedCeiling, RefusedQuota{axis}, RefusedParked, RefusedStaleInput{token, current}, RefusedRateLimit{tool, max_calls, window_secs}, plus refusals carrying the bridge error. The agent is the audit subject, never its editor: the log and the spend are exposed to it read-only. One action is exempt from refusal: world.leave is never refused by ceiling or quota and is charged nothing — but it is audited. An agent can always leave, and the leaving is always on the record. The audit chain those events join is the subject of Events and the signed audit chain.

What is design, not shipped

The agents-in-worlds programme beyond the spike — citizens (#6301), shared worlds (#6302), hosted services (#6303) and the v4 listing and registry records (#10662) — is design. The survey maps 6 records to this theme. None of them changes the statement at the top of this chapter: as shipped, the MCP bridge is a translator and a policy point in a library crate, with pinned tools, a pinned refusal, and no server, no transport and no mcpx wiring. The design chapter agents in worlds and the MCP bridge carries the four generations of that programme.

Currency, tokens and metering

ID currencies let a world, a group or a service keep score in units it defines: a game currency, a community token, a metered credit. The shipped system splits that job in two. A control plane decides what the units mean — which ledger number is which currency, who issues it, what its supply policy is. A data plane (TigerBeetle) moves the units between accounts. This chapter covers the shipped control plane, the proofs of concept that connect it to a ledger, and the metering budgets that bound how much of anything a node will accept. It also corrects, in place, a wrong address: the listing, suspension and delisting lifecycle does not live where a reader would first look for it.

The registry: id-currency-registry

The control plane is the crate id-currency-registry (crates/id-currency-registry), built as F1 of #2062 (issue #2317), with the account factory as F2 (issue #2318). Its own statement of purpose is exact: the registry is the authority for which u32 means what. TigerBeetle ledgers are bare non-zero u32 values; the currency’s name, symbol, scale, issuer and supply policy, and its status, live in the registry, not in the ledger.

Ledger numbers are allocated monotonically and are never recycled. Ledger 0 is never allocated. The ratified split of the number space is: 0x00000001 to 0x000FFFFF for tenancy and system ledgers, and 0x00100000 upward for currencies (CURRENCY_RANGE_START). The allocator is the Allocator type, with allocate and reserve_specific, and its error type AllocError. The registry proper is Registry, over CurrencyRecord, CurrencyStatus, SupplyPolicy, RegisterCurrency and RegisterAccount, with RegistryError.

Persistence is a Postgres schema with migrations for four tables — ledger_allocation, currency, currency_issuer and account — with the migration text carried in the crate as the constants MIGRATION_0001_UP and MIGRATION_0001_DOWN. The crate also ships a Store trait with an InMemoryStore: the in-memory store enforces the same constraints as the Postgres migration, so acceptance behaviour is testable without a database.

The crate has five public modules: allocator, factory, grants, registry and store. It depends on nothing else in the workspace, and nothing at the facade’s public surface re-exports it: its only production consumer is the facade’s own currency gateway proof of concept, which names it by its crate path (id_currency_registry::…). A library consumer who wants the registry names the crate directly.

The account factory

The factory (F2) creates the accounts a currency needs on a ledger cluster. Its types are Factory and FactoryError, CurrencyAccounts, the AccountCluster trait (the seam to a real cluster), AccountSpec, AccountKind, CreateOutcome and ClusterError, plus factory::transfer_code and the constants PLATFORM_OWNER_ID and CURRENCY_RANGE_START. Account creation is specified against the registry record: the gateway proof of concept builds an account spec from a record’s ledger ID with AccountKind::Holder, an owner, and an empty memo string.

What is proof of concept, and what is not shipped

Three currency artefacts exist beyond the registry crate, and all three are proofs of concept. None of them is a running currency service.

  • The facade’s currency modules: the root crate owns currency and currency_poc modules. The gateway proof of concept (src/currency/gateway_poc.rs, #2321) composes the registry with a ledger backend. The facade feature currency-poc-tb adds the official TigerBeetle Rust client for the #2289 live-cluster proof of concept; the feature has no CLI surface.
  • The PoC harness reads one environment variable: TIGERBEETLE_POC_BINARY (in src/currency_poc/harness.rs). Unset, there is no external TigerBeetle binary. It is a harness setting, not a service configuration.
  • The hosted worker carries a second gateway proof of concept (src/currency/{gateway,ledger,relay,crypto}.ts, #2298), described in The hosted edition: an in-process ledger stub modelled on TigerBeetle, gateway-signed balance snapshots, and a UserDO relay reconciling by request-ID lookup. Its own text states it is not the permanent currency service.

One format from this family is named in the shipped tree: the currency receipt domain, id.currency.receipt.v1. Beyond that, the surveys do not enumerate a shipped transfer, issuance or conversion command surface, and this chapter claims none. The design records for the rest — ID currencies v1 (#2043) and its token extension rulings, the conversion engine with linked transfer pairs and RateAuthorisation as a signed graph object (#2063, #2290), refundable grants via pending transfers, graph-native currency contracts, and the TigerBeetle topology investigations — are carried by the design chapter currency, tokens and metering (26 records in the survey’s mapping).

A toy example, with invented data only: a registry operator registers a currency with symbol EXM (an invented example symbol) and is allocated the next free ledger number at or above 0x00100000; the number, once allocated, is never handed to a second currency, even if the first is retired. The example is an illustration of the allocation rule, not a record of a real currency.

Metering: the server budgets

Metering that does ship, and that every operator meets, is the id serve budget family in the server configuration TOML ([budgets], in crates/id-cli/src/server_config/). Budgets bound inbound traffic per application, per peer and per IP. The surveyed defaults are:

KeyDefault
app_inbound_bytes_per_hour20 GiB per hour (21,474,836,480 bytes)
per_peer_bytes_per_hour100 MiB per hour (104,857,600 bytes)
per_ip_bytes_per_hour250 MiB per hour (262,144,000 bytes)

Two further keys are implemented in the parser (parse.rs) but missing from the module’s own doc table — survey disagreement WEB-14: app_inbound_bytes_per_second, default 33,554,432 (32 MiB, 1-second window), and per_peer_burst_bytes_per_minute, default 8,388,608 (8 MiB, 60-second window), both from BudgetPolicy::default in crates/id-core/src/abuse.rs (verified in the source for this book; the reference chapter on configuration is their home). A per-counterparty override table, [[budgets.counterparty]] with peer, bytes_per_window, window_seconds and optional messages_per_window, replaces — it does not stack on — the per-peer limits for that peer.

World execution is metered separately, at the guest boundary: the sandbox runs guests under fuel budgets, worlds carry per-account charge configuration (id-worlds account_charge, with WorldChargeConfig, WorldAccountRegistry and ChargeMode), and guest burn budgets are their own module (guest_burn). The two-level metering design — a burst bucket plus a hard per-tick ceiling, per function — is a design record (2026-11-10), not a shipped mechanism this chapter can point to in the budget table.

Agent actions are metered a third way, by quota: the MCP policy point charges tool calls, frames and program invocations against a grant’s quota before execution, and parks the agent when the quota is exhausted. That mechanism is covered in Agents in worlds: the MCP bridge and policy.

Listing, suspension and delisting: the corrected address

The commissioning assumption for this chapter placed the listing, suspension and delisting family in id-directory. The survey checked, and that is wrong: no listing, suspension or delisting record kind exists in crates/id-directory. The directory journal’s 17 entry kinds contain none of them. The family lives in three other places:

  • Signed registry lists, in crates/id-sync/src/registry.rs. A registry list body is canonical CBOR, signed by the registry key (Ed25519). Each entry is a RegistryEntry: the announcement verbatim (signed by the world key), an included_at time, and a registry_seq. A delisting is a Tombstone{world_id, removed_at, reason, registry_seq}, with the reason at most 200 characters. The registry’s policy statement is at most 2000 characters. Unlisted worlds are refused at inclusion and skipped on import.
  • The provider declaration lifecycle, in crates/id-caps/src/declaration.rs: LifecycleState runs Filed → Admitted → Live → Suspended / Superseded / Stale → Tombstoned. Suspension is registry state; the declared contents are unchanged. The signing domains are id.provider-manifest.v1, id.provider-withdrawal.v1 and the id.host-attested-provider: prefix.
  • Gallery listing decisions, in crates/id-worlds/src/program_gallery_admission.rs: admission decisions with a ReasonClass, and the transparency entries — removal, refusal, reinstatement — served by the web shell’s gallery transparency route, with the operator’s admission posture.

A fourth, narrower member of the family sits in federation: key suspension records in crates/id-sync/src/federation/slices/b02_key_revocation.rs, covering operator maintenance suspension, bounded or indefinite. The residency side of suspension is noted in Residency, jurisdiction and boundaries.

The correction matters because the three homes have three different authorities: a registry key lists and tombstones worlds, a declaration lifecycle governs providers, and a gallery operator admits and removes programs. A reader sent to id-directory would find none of them, and would miss that listing is a signed, sequenced, tombstone-bearing record — not a flag in a directory entry.

The id command line

Source: pkgs/id/src/main.rs and pkgs/id/crates/id-cli/src/cli/mod.rs under https://github.com/developing-today/code/blob/main/pkgs/id/ — provenance only; this chapter is complete without following it.

id is a single binary (version 0.1.0) described in its own help as “An iroh-based peer-to-peer file sharing CLI”. This chapter covers the top-level invocation, the six global flags, logging configuration, and exit behaviour. The command families themselves are covered by the sibling reference chapters listed in the command-family map at the end.

Invocation

id [GLOBAL FLAGS] [COMMAND] [COMMAND FLAGS] [ARGUMENTS]
id
id repl [NODE]
id --help
id --version

Three invocation rules decide what a bare or lightly-flagged id does:

  1. No subcommand starts the REPL. Running id with no subcommand starts the interactive REPL (src/main.rs: None => run_repl(None)). The REPL is a separate, hand-written parser, not the clap parser documented here; see The interactive REPL.
  2. The remote-node positional rule. For the file commands, if the first positional argument is a 64-character hex node ID, that argument is consumed as the remote node and the remaining arguments operate on that node. The rule, and its exceptions (send takes explicit node arguments; the search family uses --node), are specified in File commands: put, get, find and kin.
  3. --no-relay is per-command, not global. There is no global --no-relay. Each command that can operate on a remote node defines its own --no-relay flag, which disables relay servers for that operation and restricts the connection to direct paths. It is defined on serve, on every file command, and on the search family.

id --version prints two lines: the short version (id 0.1.0) and a second line giving the provenance of the embedded defaults, in the form defaults: file sha256=… mode=append or the built-in equivalent. The two-line form is the long version installed by src/main.rs.

Global flags

The six global flags are defined with clap global = true: each one is accepted at the top level and on every subcommand, before or after the subcommand name. Every command also accepts -h/--help, and the top level accepts -V/--version.

FlagArgumentDefaultMeaning
--debugnone (switch)offEnable debug logging. Takes precedence over --log-level and over every logging environment variable.
--log-levelLEVELnoneSet the log level. The help text lists trace, debug, info, warn, error; the value is not a clap value-enum, so any string reaches the tracing filter. Overrides the logging environment variables, but not --debug.
-d, --data-dirDIRcurrent directoryBase directory for .iroh-store, .iroh-key and .iroh-serve.lock. Created if it does not exist. The process changes its working directory into DIR at startup. Conflicts with --new.
--newNAME (optional)noneCreate a new instance directory .iroh/<NAME>/ under the current directory and change into it. A missing value means the empty string, which generates a random 8-hex-character name. Fails if the directory already exists. Conflicts with --data-dir.
--groups-logFILEgroups.jsonl in the data directoryThe group log read and appended to by group, delegate and revoke. A relative path is resolved relative to the data directory.
--event-storeDIRevents in the data directoryThe event store read and appended to by doc, claim and writer-sets. A relative path is resolved relative to the data directory.

Behaviour notes:

  • --data-dir is the mechanism for running several independent instances on one machine: each instance gets its own data directory, and client commands take the same flag to target a specific instance.
  • --new validates its name before creating anything: a name containing /, \ or .. fails with --new name must be a simple identifier, not a path. A name whose directory .iroh/<NAME>/ already exists fails with instance directory already exists: … (use --data-dir to reuse an existing directory).
  • A bare --new followed by a subcommand name is rewritten before parsing (normalize_args in cli/mod.rs): id --new serve becomes id --new= serve, so serve is parsed as the subcommand and not swallowed as the instance name. The empty value still means “random name”.

Worked example (toy data):

$ id --new demo-node put notes.txt
$ id --new demo-node list
notes.txt
$ id --data-dir .iroh/demo-node list
notes.txt

The first command creates .iroh/demo-node/, stores notes.txt there, and the second lists it back through the same named instance. The third reaches the same store by naming the directory directly.

Log-level resolution

The log level is resolved by hand-written code in src/main.rs, not by clap environment fallback. The order is fixed:

  1. --debug — wins over everything; the level is debug.
  2. --log-level <LEVEL> — the flag value.
  3. RUST_LOG — if non-empty, it is used verbatim as a tracing EnvFilter, so per-module directives such as debug,mainline::rpc=trace keep their meaning.
  4. LOG_LEVEL — the environment value.
  5. DEBUG — if truthy, the level is debug. Truthy means: not empty, not 0, and not false (compared case-insensitively).
  6. Default: warn.

Blank values count as unset at every step: an empty or whitespace-only --log-level, RUST_LOG or LOG_LEVEL falls through to the next step.

After resolution, src/main.rs appends fixed per-module filters that cap a fixed list of noisy modules at info, unless the base filter is trace or the filter already names that module.

Structured logging environment

Four further environment variables configure the log output itself. They are read by hand in src/main.rs and src/structured_logging.rs; none of them is a clap argument.

VariableValuesDefaultMeaning
ID_LOG_FORMATtext, jsontextOutput format. json emits one JSON object per line, with span and trace context when present.
ID_LOG_FILEpathnone (stderr only)A second destination: events are appended to this file in the same format as the console destination, without ANSI escapes. No size or retention limit is imposed; the writer follows rename-and-create external rotation and must not be used with copytruncate.
ID_LOG_FILE_LEVELfilterthe console filterAn independent filter for the file destination; it accepts anything a tracing EnvFilter accepts, for example debug or id=trace,iroh=info.
ID_LOG_TZIANA name, UTC, local, or a fixed offset such as +05:30host local timezoneTimezone for log timestamps. Unset and local both mean the host local zone.

Failure behaviour for these variables is warn-and-continue: an unrecognised ID_LOG_FORMAT value prints warning: ID_LOG_FORMAT value not recognized; logs use text format on stderr and logging continues in text format; an unrecognised ID_LOG_TZ value prints warning: ID_LOG_TZ value not recognized; log timestamps use UTC and timestamps fall back to UTC; a log file that cannot be opened prints a warning naming the path and the error, and logging continues to stderr only.

Exit behaviour

main returns an anyhow::Result<()>, and the exit code follows from that single fact plus clap’s own error handling:

OutcomeExit codeOutput
Success0The command’s normal output.
--help, help <command>, --version0Help or version text on stdout.
Handler error (any error returned by a command)1Error: <anyhow chain> on stderr.
Clap parse error (unknown subcommand or flag, missing required argument, conflicting flags, invalid value)2error: … plus usage on stderr.

There is no per-command exit-code table and no process::exit call anywhere in the id binary or in id-cli: every handler error exits 1, whatever the command. Value-parser failures are clap errors and exit 2; for example --first 0 fails with zero is not a valid limit: use at least 1.

The REPL is the one exception to the handler-error row: inside a REPL session a failed command prints error: <e> and the session continues, and the REPL process exits 0 on quit, exit, q, Ctrl+D, or a second Ctrl+C. REPL startup failures (for example an invalid node ID) are handler errors and exit 1. The separate id-native-shell binary has its own hand-coded exit codes and is covered in id-native-shell.

Worked example (toy data):

$ id get not-there.txt
Error: file not found
$ echo $?
1
$ id put --bogus-flag notes.txt
error: unexpected argument '--bogus-flag' found
$ echo $?
2

Command-family map

The parser defines 32 top-level commands and 113 leaf commands. The reference chapters divide them as follows:

FamilyCommandsChapter
File storage and retrievalput, put-hash, send, get, get-hash, cat, list, migrate-tagsFile commands: put, get, find and kin
Searchfind, search, show, peekFile commands: put, get, find and kin
Tagstag set, tag del, tag list, tag searchThe tag family
Hosting and publicationsserve, publish, unpublish, publicationsserve and publications
Worlds (playing)world invite, world join, world records, world mirror, world download, and kinWorld commands: joining and playing
Worlds (administering)world install, world compile, world caps, world doctor, and kinWorld commands: administering and verifying
Gallery, match-audit, walkgallery …, match-audit …, walk …Gallery, match-audit and walk
Groups, documents, claims, keysgroup …, delegate, revoke, doc …, claim …, writer-sets …, id, key …, keyset …, peersGroups, documents, claims and keys
Interactive shellrepl (alias shell), bare idThe interactive REPL
Desktop shellthe separate id-native-shell binaryid-native-shell

Cross-cutting configuration — defaults.json, the full environment variable list, and feature-gated builds — is covered in Configuration and environment. The on-disk layout behind --data-dir, --groups-log and --event-store is covered in Data stores and schemas.

File commands: put, get, find and kin

Source: pkgs/id/crates/id-cli/src/cli/mod.rs under https://github.com/developing-today/code/blob/main/pkgs/id/ — provenance only; this chapter is complete without following it.

This chapter covers the commands that store, retrieve and search for files: put, put-hash, send, get, get-hash, cat, list and migrate-tags, followed by the search family find, search, show and peek. The global flags accepted by every command are defined in The id command line. Tags attached to stored files are covered in The tag family.

The remote-node rule

Every command in this chapter except put-hash, send and migrate-tags accepts a remote target by position:

id get 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef config.json

If the first positional argument is a 64-character hex node ID, it is consumed as the remote node and the rest of the arguments operate on that node. A first positional that is not 64 hex characters is treated as a local file, name or query. Each of these commands also defines --no-relay, which disables relay servers for the remote operation and restricts the connection to direct paths. The search family additionally accepts --node <NODE_ID> as an explicit alternative to the positional rule.

A malformed node ID where a node ID is parsed fails with invalid node ID: must be 64 hex characters and exit 1.

put

id put [FILES]...
id put --content NAME
id in|add|store|import [FILES]...

Aliases: in, add, store, import.

FlagArgumentDefaultMeaning
--content (visible alias --data)none (switch)offRead the content from stdin instead of from file paths. Requires exactly one name argument. Conflicts with --stdin.
--stdinnone (switch)offRead more file paths from stdin, split on newline, tab or comma. Conflicts with --content.
--hash-onlynone (switch)offStore the content without creating a named tag. The content is retrievable by hash only.
--no-relaynone (switch)offDisable relay servers for a remote operation.

Behaviour notes:

  • Each FILES entry is a path. The form path:name renames the file during storage: the bytes come from path and the stored name is name.
  • With --content, the single positional argument is the stored name, not a path. Supplying zero or more than one name fails with --content requires exactly one name argument. Discrepancy CLI-14: the --help summary line for --content (“Read content from stdin instead of file paths”) omits the one-name requirement; the requirement is stated in the field documentation and enforced by the handler.
  • With no files and no stdin input, put fails with no files provided.
  • When several files are stored and some fail, the failures are collected into one aggregated error, some puts failed: followed by the individual failures, and the command exits 1.

Worked example (toy data):

$ printf 'rice, lentils, tea\n' > shopping.txt
$ id put shopping.txt
$ id put shopping.txt:pantry-list.txt
$ printf 'oats, honey\n' | id put --content staples.txt
$ id list
pantry-list.txt
shopping.txt
staples.txt

Failure shapes: a missing input file is a handler error (exit 1); --content combined with --stdin is a clap conflict (exit 2); --content with the wrong number of names fails with --content requires exactly one name argument (exit 1).

put-hash

id put-hash <SOURCE>
FlagArgumentDefaultMeaning
(none)——put-hash defines no flags of its own; the global flags apply.

Behaviour notes:

  • SOURCE is a single file path, or - for stdin. The content is stored by hash only, with no named tag — the single-source form of put --hash-only.
  • put-hash takes no remote-node positional: its one argument is always the source.

Worked example (toy data):

$ printf 'release checklist v3\n' | id put-hash -

Failure shapes: a missing source file is a handler error (exit 1). A missing SOURCE argument is a clap error (exit 2).

send

id send <SOURCE_NODE> <NAME> --to <DEST_NODE> [--as <NAME>] [--replace] [--no-relay]
FlagArgumentDefaultMeaning
--toDEST_NODErequired (no default)Destination server node ID (64 hex characters).
--asNAMEthe source nameName to register on the destination.
--replacenone (switch)offReplace an existing, different destination file; the old destination file is archived under an archive name first.
--no-relaynone (switch)offDisable relay servers for the connection to the source.

Behaviour notes:

  • send is a server-to-server copy. The source server performs the transfer with its own identity: it pushes the file’s blob to the destination and registers the name there. No file bytes pass through the client running send.
  • The destination’s write policy must allow the source server’s node ID; the source node is recorded as the copy’s origin.
  • An invalid destination node ID fails with invalid node ID: must be 64 hex characters.

Worked example (toy data; both node IDs are invented):

$ id send 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef report.txt --to fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 --as summary.txt

Failure shapes: omitting --to is a clap error (exit 2). A name that does not exist on the source, or a destination that refuses the source’s writes, is a handler error (exit 1).

get

id get [SOURCES]...
id get --hash [SOURCES]...
id get --name-only [SOURCES]...
FlagArgumentDefaultMeaning
--stdinnone (switch)offRead more sources from stdin, split on newline, tab or comma.
--hashnone (switch)offTreat all sources as hashes. A source that matches no known hash fails. Conflicts with --name-only.
--name-onlynone (switch)offTreat all sources as names only; hash interpretation is skipped even for 64-character hex strings. Conflicts with --hash.
--stdoutnone (switch)offWrite all retrieved files to stdout, concatenated. Overrides the per-item output specifications.
--no-relaynone (switch)offDisable relay servers for a remote operation.

Behaviour notes:

  • Each source is a name or a hash. Source resolution tries, in order: exact tag name; then hash, if the source is 64 hex characters. --hash and --name-only force one interpretation.
  • The form source:output writes that item to output instead of to a file of the source’s name. An output of - means stdout.
  • With no sources and no stdin input, get fails with no sources provided.
  • When several sources are retrieved and some fail, the failures are collected into one aggregated error, some gets failed: followed by the individual failures, and the command exits 1.

Worked example (toy data):

$ id get shopping.txt
$ id get shopping.txt:groceries-copy.txt
$ id get shopping.txt:-
rice, lentils, tea

Failure shapes: a name or hash with no stored content fails with file not found locally, or file not found on remote for a remote operation (exit 1). --hash together with --name-only is a clap conflict (exit 2).

get-hash

id get-hash <HASH> <OUTPUT>
FlagArgumentDefaultMeaning
(none)——get-hash defines no flags of its own; the global flags apply.

Behaviour notes:

  • A shortcut for get --hash, with the output path as a required second positional. OUTPUT may be - for stdout.
  • HASH is the 64-hex-character blob hash.

Worked example (toy data; the hash is invented):

$ id get-hash fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 checklist.txt

Failure shapes: a hash with no stored content is a handler error (exit 1). A missing HASH or OUTPUT is a clap error (exit 2).

cat

id cat [SOURCES]...
id output|out [SOURCES]...

Aliases: output, out.

FlagArgumentDefaultMeaning
--stdinnone (switch)offRead more sources from stdin, split on newline, tab or comma.
--hashnone (switch)offTreat all sources as hashes. Conflicts with --name-only.
--name-onlynone (switch)offTreat all sources as names only, skipping hash interpretation. Conflicts with --hash.
--no-relaynone (switch)offDisable relay servers for a remote operation.

Behaviour notes:

  • cat is get forced to stdout: sources resolve by the same name-then-hash rule, and the content is written to stdout. cat has no --stdout flag, because stdout is its only destination.

Worked example (toy data):

$ id cat shopping.txt
rice, lentils, tea

Failure shapes: a missing source fails with file not found or file not found on remote (exit 1). --hash together with --name-only is a clap conflict (exit 2).

list

id list [NODE]
FlagArgumentDefaultMeaning
--no-relaynone (switch)offDisable relay servers for a remote listing.

Behaviour notes:

  • Lists all stored files (names) in the local store, or in the remote node’s store when NODE (a 64-character hex node ID) is given.
  • Discrepancy CLI-1: list has no ls alias in the clap parser. id ls fails with error: unrecognized subcommand 'ls' and the tip “a similar subcommand exists: ‘list’” (exit 2), even though the README command table lists ls as an alias. The ls spelling exists only inside the REPL, and as the alias of tag list (see The tag family).

Worked example (toy data):

$ id list
pantry-list.txt
shopping.txt
staples.txt

Failure shapes: an unreachable remote node is a handler error (exit 1). id ls is a clap error (exit 2).

migrate-tags

id migrate-tags
id migrate

Alias: migrate.

FlagArgumentDefaultMeaning
(none)——migrate-tags takes no arguments and defines no flags of its own; the global flags apply.

Behaviour notes:

  • Scans all blob tags in the store and adds the name and file auto-tags to any subject that does not already have them. Existing tags are never overwritten.
  • The command reports the number migrated, in the form migrated 42 files.

Worked example (toy data):

$ id migrate-tags
migrated 3 files

Failure shapes: a store that cannot be opened is a handler error (exit 1).

Search-family shared semantics

find, search, show and peek share one matching model:

  • Queries are case-insensitive and match against both names and hashes.
  • Match quality is ordered: exact match ranks above prefix match, which ranks above contains (substring) match.
  • Discrepancy CLI-8: there is no glob or wildcard matching anywhere in the search implementation. A query of *.rs is the literal two-character substring *. followed by rs; in practice it matches nothing, despite the README usage example id find "*.rs" being labelled “Find files by pattern”.
  • --first [N] and --last [N] are optional-value flags on all four commands. Each takes zero or one value (num_args = 0..=1); a bare --first or --last means 1. The two flags conflict with each other. A value of 0 is rejected by the value parser with zero is not a valid limit: use at least 1 (clap error, exit 2); a non-numeric value fails in the same parser.
  • --exclude <PAT> is repeatable on all four commands and drops matches whose name or hash contains the pattern.
  • --name is accepted by all four commands and makes name matches rank above hash matches.
  • --node <NODE_ID> names a remote node explicitly, as an alternative to the positional rule; --no-relay applies to that remote search.
  • A query with no matches fails in the CLI handlers with no matches found for: <queries> (exit 1). Inside the REPL the same condition prints a line and the session continues; see The interactive REPL.

--format and the REPL difference

--format exists on find and search only:

ValueMeaning
tagEach match printed with its query.
groupMatches grouped by query.
unionMatches deduplicated by hash.

The clap default is tag. Discrepancy CLI-11: the REPL’s find and search default to union, because the REPL hand parser enters with union as its default format. The same query therefore prints tag-grouped output from the command line and union-deduplicated output in the REPL, and neither side’s help mentions the other’s default.

find

id find <QUERIES>...
FlagArgumentDefaultMeaning
--namenone (switch)offPrefer name matches over hash matches.
--stdoutnone (switch)offWrite the best match to stdout instead of to a file.
--all (visible aliases --out, --export, --save, --full)none (switch)offOutput all matches instead of only the best match.
--dirDIRnoneOutput directory for --all; each match is saved by name.
--formattag, group or uniontagOutput format (see the --format table above).
--firstN (optional)bare flag = 1Return only the first N matches. Conflicts with --last.
--lastN (optional)bare flag = 1Return only the last N matches. Conflicts with --first.
--countnone (switch)offPrint the count of matches instead of the matches.
--excludePATnoneExclude matches whose name or hash contains PAT. Repeatable.
--nodeNODE_IDnoneRemote node to search.
--no-relaynone (switch)offDisable relay servers for a remote search.

Behaviour notes:

  • Default output mode: the best match for each query is written to a file of its own name. --stdout sends the best match to stdout instead; --all writes every match (to stdout, or into --dir by name).
  • Multiple queries are accepted; each query is matched separately.

Worked example (toy data):

$ id find shopping
$ id find --count shop
2
$ id find --first 1 --stdout pantry
rice, lentils, tea

Failure shapes: no matches fails with no matches found for: <queries> (exit 1). --first 0 is a value-parser error (exit 2). --first together with --last is a clap conflict (exit 2).

id search <QUERIES>...
FlagArgumentDefaultMeaning
--namenone (switch)offPrefer name matches over hash matches.
--all (visible aliases --out, --export, --save, --full)none (switch)offInclude all matches in the output.
--dirDIRnoneOutput directory for --all.
--formattag, group or uniontagOutput format (see the --format table above).
--firstN (optional)bare flag = 1Return only the first N matches. Conflicts with --last.
--lastN (optional)bare flag = 1Return only the last N matches. Conflicts with --first.
--countnone (switch)offPrint the count of matches instead of the matches.
--excludePATnoneExclude matches whose name or hash contains PAT. Repeatable.
--nodeNODE_IDnoneRemote node to search.
--no-relaynone (switch)offDisable relay servers for a remote search.

Behaviour notes:

  • search takes the same flags as find except --stdout, and differs in effect: it lists matches and retrieves nothing.

Worked example (toy data):

$ id search shop
shopping.txt
$ id search --format group shop pantry

Failure shapes: identical to find — no matches exits 1 with no matches found for: <queries>; --first 0 and --first with --last exit 2.

show

id show <QUERIES>...
id view <QUERIES>...

Alias: view.

FlagArgumentDefaultMeaning
--namenone (switch)offPrefer name matches over hash matches.
--allnone (switch)offOutput all matches instead of only the first.
-o, --outputFILEstdoutWrite the matched content to FILE instead of stdout.
--firstN (optional)bare flag = 1Return only the first N matches. Conflicts with --last.
--lastN (optional)bare flag = 1Return only the last N matches. Conflicts with --first.
--excludePATnoneExclude matches whose name or hash contains PAT. Repeatable.
--nodeNODE_IDnoneRemote node to search.
--no-relaynone (switch)offDisable relay servers for a remote search.

Behaviour notes:

  • show is cat over the search matcher: it outputs the content of the first (best) match for each query, or of every match with --all.
  • show has no --count and no --format flag.

Worked example (toy data):

$ id show shopping
rice, lentils, tea
$ id show --first 2 -o combined.txt shop

Failure shapes: no matches fails with no matches found for: <queries> (exit 1). --first 0 and --first with --last exit 2.

peek

id peek <QUERIES>...
FlagArgumentDefaultMeaning
--namenone (switch)offPrefer name matches over hash matches.
-n, --linesN5Number of head and tail units to show. Zero is rejected by the value parser.
--head-onlynone (switch)offShow only the head. Conflicts with --tail-only.
--tail-onlynone (switch)offShow only the tail. Conflicts with --head-only.
--charsnone (switch)offCount by characters instead of lines. Conflicts with --words.
--wordsnone (switch)offCount by words instead of lines. Conflicts with --chars.
-q, --quietnone (switch)offSuppress the header banner; print content only.
-o, --outputFILEstdoutWrite the preview to FILE instead of stdout.
--allnone (switch)offPeek all matches instead of only the first per query.
--firstN (optional)bare flag = 1Return only the first N matches. Conflicts with --last.
--lastN (optional)bare flag = 1Return only the last N matches. Conflicts with --first.
--excludePATnoneExclude matches whose name or hash contains PAT. Repeatable.
--nodeNODE_IDnoneRemote node to search.
--no-relaynone (switch)offDisable relay servers for a remote search.

Behaviour notes:

  • The default preview shows a header banner, then 5 head lines and 5 tail lines; content of 10 lines or fewer is shown in full.
  • --lines sets the head and tail size together. With --chars or --words, the same number counts characters or words instead of lines.
  • --lines 0 is rejected by the same value parser as --first/--last, with zero is not a valid limit: use at least 1.

Worked example (toy data):

$ id peek --lines 2 shopping
rice, lentils, tea
$ id peek --head-only --lines 20 --quiet staples
oats, honey

Failure shapes: no matches fails with no matches found for: <queries> (exit 1). --lines 0 is a value-parser error (exit 2). --head-only with --tail-only, --chars with --words, and --first with --last are clap conflicts (exit 2).

Exit behaviour for this chapter

All commands in this chapter follow the process-wide rules in The id command line: success exits 0, a handler error prints Error: <message> on stderr and exits 1, and a clap parse error (unknown flag, conflict, invalid value) exits 2. The multi-file commands put and get aggregate partial failures into a single exit-1 error (some puts failed: / some gets failed:) rather than exiting on the first failure.

The tag family

Source: pkgs/id/crates/id-cli/src/cli/tag.rs and pkgs/id/crates/id-cli/src/cli/mod.rs under https://github.com/developing-today/code/blob/main/pkgs/id/ — provenance only; this chapter is complete without following it.

id tag manages metadata tags: key/value pairs attached to stored files. The parent command has two aliases, label and link, so every command in this chapter also runs as id label … and id link ….

Storage note

Tags are stored in iroh-docs CRDT documents and replicate conflict-free across peers. A tag is a triple: a subject (the file), a key, and an optional value. Multiple values can exist under one key on one file, and a key can also exist with no value at all (a key-only tag).

Tags are a different mechanism from claims. The claim family records signed statements about subjects in the event store; the tag family records file metadata in the docs store. Claims are covered in Groups, documents, claims and keys; the file commands that create the subjects tags attach to are covered in File commands: put, get, find and kin.

Display rules shared by tag list and tag search:

  • A non-UTF-8 value is displayed as <binary N bytes> by default, where N is the byte count.
  • --hex displays a non-UTF-8 value as hex (0x...) instead.
  • --binary displays a non-UTF-8 value as lossy text instead.
  • Values are truncated at 256 bytes by default; --no-truncate disables the truncation.

tag set

id tag set <FILE> <KEY> [VALUE]
id tag add <FILE> <KEY> [VALUE]

Alias: add.

FlagArgumentDefaultMeaning
--value-hexHEXnoneTag value as hex-encoded raw bytes (binary-safe). Conflicts with the positional VALUE and with --value-file.
--value-filePATHnoneRead the raw tag value from PATH; - reads stdin. Conflicts with --value-hex.

Behaviour notes:

  • With a positional VALUE, the tag is (FILE, KEY, VALUE). With no value from any source, the tag is key-only: (FILE, KEY) with no value.
  • Setting a second value under an existing key adds it; multiple values per key are stored side by side. Setting a tag never removes other values of the same key.
  • The value source is exactly one of: positional VALUE, --value-hex, --value-file, or none.

Worked example (toy data):

$ id put field-notes.txt
$ id tag set field-notes.txt priority high
$ id tag set field-notes.txt pinned
$ printf '\x01\x02' > sig.bin
$ id tag set field-notes.txt marker --value-file sig.bin
$ id tag list field-notes.txt
priority: high
pinned
marker: <binary 2 bytes>

Failure shapes: --value-hex together with a positional value or with --value-file is a clap conflict (exit 2). Missing FILE or KEY positionals are clap errors (exit 2). Handler errors exit 1 under the process-wide rules in The id command line; whether set requires the file to already exist in the store is unverified against the source for this chapter.

tag del

id tag del <FILE> <KEY> [VALUE]

Aliases: rm, remove, rem, delete, unset.

FlagArgumentDefaultMeaning
--value-hexHEXnoneSpecific value to remove, as hex-encoded raw bytes. Conflicts with the positional VALUE.

Behaviour notes:

  • With a value (positional or --value-hex), del removes exactly that (KEY, VALUE) pair from the file.
  • With no value, del removes every value stored under the key, plus the key-only tag for that key if one exists.

Worked example (toy data):

$ id tag set field-notes.txt priority high
$ id tag set field-notes.txt priority low
$ id tag del field-notes.txt priority high
$ id tag list field-notes.txt
priority: low
$ id tag del field-notes.txt priority
$ id tag list field-notes.txt

The first del removes only priority=high and leaves priority=low. The second, with no value, removes the key entirely.

Failure shapes: --value-hex together with a positional value is a clap conflict (exit 2). Missing FILE or KEY positionals are clap errors (exit 2). Handler errors exit 1 under the process-wide rules in The id command line.

tag list

id tag list [FILE]
id tag ls [FILE]

Alias: ls.

FlagArgumentDefaultMeaning
--hexnone (switch)offShow non-UTF-8 values as hex (0x...) instead of <binary N bytes>.
--binarynone (switch)offShow non-UTF-8 values as lossy text instead of <binary N bytes>.
--no-truncatenone (switch)offDo not truncate long values; the display default truncates at 256 bytes.

Behaviour notes:

  • With FILE, lists the tags on that file. Without FILE, lists all tags in the store.
  • The ls alias belongs to tag list itself. It does not extend to the top-level list command, which has no ls alias (discrepancy CLI-1, covered in File commands: put, get, find and kin).

Worked example (toy data):

$ id tag list
field-notes.txt  priority: high
field-notes.txt  pinned
$ id tag ls field-notes.txt
priority: high
pinned

Failure shapes: handler errors exit 1 under the process-wide rules in The id command line. The display flags never change what is stored; they change only the rendering of non-UTF-8 and long values.

tag search

id tag search <QUERY>...
id tag find <QUERY>...

Alias: find. At least one query term is required.

FlagArgumentDefaultMeaning
--hexnone (switch)offShow non-UTF-8 values as hex (0x...) instead of <binary N bytes>.
--binarynone (switch)offShow non-UTF-8 values as lossy text instead of <binary N bytes>.
--no-truncatenone (switch)offDo not truncate long values; the display default truncates at 256 bytes.

Behaviour notes — the structured query syntax. Each query term takes one of five forms:

Term formMatches
key:Tags whose key is key (any value, or key-only).
:valueTags whose value is value (any key).
key:valueTags with exactly that key and that value.
"literal"Tags where the literal text occurs in any field (subject, key or value).
bareCase-insensitive search across subject, key and value.
  • Multiple terms are ANDed: a tag must satisfy every term to be returned.
  • Quoted strings are accepted in the key and value positions of a key:value term: "key:":":value" matches the key key: with the value :value.

Worked example (toy data):

$ id tag search priority:
field-notes.txt  priority: high
$ id tag search :high
field-notes.txt  priority: high
$ id tag search priority:high
field-notes.txt  priority: high
$ id tag search "field-notes"
field-notes.txt  priority: high
field-notes.txt  pinned
$ id tag search priority pinned

The last search returns nothing: priority and pinned are separate tags on the file, and ANDed terms must all be satisfied by one tag.

Failure shapes: running tag search with no query term is a clap error (exit 2), because the parser requires at least one term. The exit behaviour of a search that matches nothing is unverified against the source for this chapter; the file search family, by contrast, fails on no matches (see File commands: put, get, find and kin).

Exit behaviour for this chapter

All commands in this chapter follow the process-wide rules in The id command line: success exits 0, a handler error prints Error: <message> on stderr and exits 1, and a clap parse error (missing required argument, conflicting value sources) exits 2.

serve and publications

Source: pkgs/id/crates/id-cli/src/cli/mod.rs (including ServeArgs and the flattened WorldRuntimeArgs in pkgs/id/crates/id-cli/src/cli/world.rs) and pkgs/id/src/main.rs under https://github.com/developing-today/code/blob/main/pkgs/id/ — provenance only; this chapter is complete without following it.

serve

id serve [FLAGS]

serve is the only hosting command. It runs indefinitely, hosting stored blobs, and optionally a world and the web UI. Every other command — including all id world … subcommands — is a client that connects out to a host; the client side is covered in World commands: joining and playing and World commands: administering and verifying. The global flags from The id command line apply as usual; --data-dir selects the store the server hosts.

Core and discovery flags

FlagArgumentDefaultMeaning
--ephemeralnone (switch)offUse in-memory storage instead of persistent disk storage. Content is lost when the server stops.
--server-configFILEnoneOperator server-config TOML. A malformed file fails startup, naming the parse error. Loading the config requires a build with the world feature (see Feature gates).
--no-relaynone (switch)offDirect connections only; no relay servers. Connections through NATs or firewalls can fail in this mode.
--no-gossipnone (switch)offDisable gossip discovery entirely: the server accepts connections but does not join a gossip topic, does not announce itself, and does not discover peers. Conflicts with --gossip.
--gossipnone (switch)offForce gossip discovery on, overriding a build-time disabled default. Conflicts with --no-gossip.
--bootstrapIDSnoneComma-separated node IDs for manual peer bootstrapping; the flag is repeatable and each occurrence is split on commas. Supplementary to automatic discovery.
--topicTOPICsee the topic caveat belowGossip topic name for peer discovery. All servers on the same topic discover each other.
--topic-secretSECRETsee the topic caveat belowShared secret for topic access control, used to encrypt DHT bootstrap records. Only nodes with the same secret discover each other via DHT. The value is a secret: pass it by flag or configuration, never print it.
--no-default-bootstrapnone (switch)offIgnore the bootstrap node IDs from defaults.json; only --bootstrap nodes are used.
--no-default-topicnone (switch)offIgnore the topic and secret from defaults.json and fall back to the hardcoded constants. Explicit --topic/--topic-secret values still take precedence.
--no-mdnsnone (switch)off (mDNS on)Disable mDNS local peer discovery. By default the server uses mDNS on the local network and announces its node ID and addresses to every host there.
--dhtnone (switch)offEnable mainline DHT address lookup and publishing for the server’s endpoint. The flag exists in the parser regardless of the dht cargo feature.
--iroh-portPORT0Port for the Iroh QUIC endpoint. 0 lets the OS assign a random available port.

Topic and secret default caveat (discrepancy CLI-6): the help text for --topic states “Default: id-peer-discovery-v1” and the help text for --topic-secret states “Default: id-public-discovery-v1”. Those two strings are the hardcoded constants, and the constants are the fallback, not the operative default. On a stock serve, the topic and secret are read first from defaults.json; the constants apply only when defaults.json supplies neither, or when --no-default-topic is passed. The --version provenance line (see The id command line) reports which defaults source is in force. Help alone therefore misstates what a stock serve uses.

Web UI flags

FlagArgumentDefaultMeaning
--webnone (switch)offStart the HTTP web UI. On a build without the web feature this fails at startup (see Feature gates). The UI itself is covered in The web UI: pages and HTTP API.
--bindIP127.0.0.1Address the web interface binds to. The loopback default makes the UI reachable only from this machine. Binding 0.0.0.0 exposes it on the network; set --web-token when doing so.
--portPORT3000Port for the web interface. 0 lets the OS assign a random available port.
--web-listenIP:PORTnoneAdd one web listener, in IP:PORT form (IPv6 in brackets, for example [::1]:3001). Repeatable. The set of --web-listen values replaces the web_bindings entries from defaults.json entirely. Subject to the explicitness rule below.
--web-tokenTOKENnone; environment fallback ID_WEB_TOKENRequire this token to use the web interface. A browser opens http://host:port/?token=<TOKEN> once and keeps a cookie; scripts send Authorization: Bearer <TOKEN>. The value is hidden in clap and is a secret: name it, never print it.
--web-cookie-securenone (switch)off; environment fallback ID_WEB_COOKIE_SECUREMark the web session cookies Secure. Set it only when HTTPS is terminated in front of the server; browsers drop Secure cookies over plain HTTP except on localhost.

The --web-listen explicitness rule (#2145): combining --web-listen with an explicitly set --bind or --port is a startup error naming the conflict. Explicitness is read from the clap value sources in src/main.rs, so the clap defaults for --bind and --port do not count: id serve --web-listen 127.0.0.1:8080 is valid, while id serve --web-listen 127.0.0.1:8080 --port 3000 fails at startup even though 3000 is the default value, because the operator set it explicitly.

The --web-token warning: startup prints a warning when a web listener is bound without --web-token. The warning is the whole protection on a loopback-only listener; on a non-loopback bind the UI is reachable by anyone on the network who can reach the port.

Worked example (toy data; the token value is a placeholder name, not a real secret):

$ id serve --web --port 8080 --web-token $ID_WEB_TOKEN
FlagArgumentDefaultMeaning
--gallery-dirDIRnone; environment fallback ID_GALLERY_DIRServe the program gallery stored in this directory: as a program registry over Iroh, and with --web also over the /api/gallery/* HTTP routes. Every bundle file in the directory is verified at startup.
--gallery-accept-publishnone (switch)off; environment fallback ID_GALLERY_ACCEPT_PUBLISHAccept bundle publishes from any peer over Iroh; each is verified and then goes through the gallery’s admission. Requires --gallery-dir.

Gallery administration itself is covered in Gallery, match-audit and walk.

World hosting flags

Every flag in this section requires --world, except --world itself, which requires --world-admin-token.

FlagArgumentDefaultMeaning
--worldnone (switch)offHost a multiplayer world over Iroh (and over /ws/world with --web). Requires --world-admin-token.
--world-admin-tokenTOKENnone; environment fallback ID_WORLD_ADMIN_TOKENAdmin secret required to mint world guest capabilities. The value is hidden in clap and is a secret: name it, never print it.
--world-moduleFILEnoneStart with this precompiled Wasm world module (Roc platform ABI). Requires --world. Loading a module requires a build with the sandbox feature (see Feature gates). Conflicts with --world-source-only.
--world-nameNAMElobbyName of the world this server offers (one world per process). The world’s files live in .id-worlds/<NAME>/. The name may contain a-z, 0-9, - and _.
--world-ssh-portPORTnoneServe the world over SSH on this port, bound to --bind. Actual SSH serving exists only in ssh-feature builds (see Feature gates).
--world-checkpoint-everyN1000Trim the world’s journal behind a program snapshot every N events. 0 never trims.
--world-max-openN256Most worlds open at once; idle durable worlds close to make room.
--world-max-sessionsN1024Most world sessions at once, across every world.
--world-idle-secsN600Close durable worlds that no session used for this many seconds; they reopen from their journal on demand. 0 keeps worlds open.
--world-boot-window-secsN600Refuse signed world and directory requests for this many seconds after startup, so a request captured before a restart cannot be replayed into a server with empty replay memory. 0 disables the window.
--world-nativenone (switch)offAccept native (ELF) module installs. The guarantee for this tier is the OS sandbox (Landlock, seccomp, rlimits), so the tier is opt-in.
--world-source-onlynone (switch)off; environment fallback ID_WORLD_SOURCE_ONLYAccept new world programs only as Roc source compiled by this server. Disables raw Wasm and native module uploads and --world-module. Conflicts with --world-module.
--world-module-trust-keyHEXnoneEd25519 module-signing public key trusted by this server, in hex. Repeatable. The flag name is singular (…-key); the parser field collects multiple keys.
--world-capNAMEnoneCapability the default world’s program may use. Repeatable. * grants the whole catalog.
--world-cap-policyPOLICYdenyWhat an unlisted capability costs the program: deny, or grant-on-use, which grants a known capability the first time the program uses it.
--world-allowed-capsNAMESthe whole catalogServer-wide capability ceiling, comma-separated. A world may grant less, never more. * is refused here.
--roc-binBINroc from PATH; environment fallback ID_ROC_BINThe Roc binary used to compile sources sent to id world compile.
--roc-platformDIR./examples/roc-world; environment fallback ID_ROC_PLATFORMThe world platform directory used for on-the-fly compilation.

World runtime flags (flattened WorldRuntimeArgs)

These flags are defined by the flattened WorldRuntimeArgs struct and flattened into ServeArgs. Each requires --world.

FlagArgumentDefaultMeaning
--world-fuelUNITS10000000Wasm fuel (instruction budget) for one world call.
--world-memory-mibMIB16Linear memory for a Wasm world program, in MiB (range 1..=2048).
--world-message-kibKIB1024Largest Wasm payload (input or output), in KiB (range 1..=1024).
--world-native-memory-mibMIB256Address-space cap for a native worker, in MiB (range 16..=65536).
--world-native-cpu-secsSECS10CPU seconds a native worker may use in total.
--world-native-deadline-msMS10000Wall-clock budget for one native worker call, in milliseconds.
--world-total-memory-mibMIB64Total per-world logical memory budget, in MiB (range 1..=65536).
--world-guest-burn-concurrencyCOUNT0Concurrent synchronous guest burns admitted hub-wide. 0 means auto (parallelism − 2).
--world-guest-burn-per-account-concurrencyCOUNT0Concurrent synchronous guest burns admitted per charged account. 0 means no per-account bound.

Confirmation-mail sinks

A world host can send confirmation mail through exactly one of three sinks. The three sink flags conflict with each other pairwise, and each requires --world.

FlagArgumentDefaultMeaning
--world-mail-outboxDIRnoneWrite confirmation mail into this directory, one private file per message.
--world-mail-commandPROGnoneRun this program for each confirmation mail. serve sets ID_MAIL_TO, ID_MAIL_SUBJECT and ID_MAIL_BODY in the program’s environment for each message.
--world-mail-smtpIP:PORTnoneRelay confirmation mail through this SMTP server. The server must be on loopback and must forward with TLS. Requires --world-mail-from.
--world-mail-fromADDRnoneSender address for mail sent with --world-mail-smtp. Requires --world-mail-smtp.

Worked example (toy data):

$ id serve --world --world-admin-token $ID_WORLD_ADMIN_TOKEN --world-name toy-lobby --world-mail-outbox ./mail-outbox

Write access flags

FlagArgumentDefaultMeaning
--allow-nodeIDSnoneAllow this node to modify the store. Repeatable and comma-separated. The same list can be supplied by the .iroh-allowed file, one node ID per line. This machine’s own server and client keys are always allowed.
--open-writesnone (switch)offLet every peer modify the store. The parser documentation labels this flag “insecure” and scopes it to demos and trusted networks.

Reading names, hashes and tags is public. Writing — put, delete, rename, copy, tag changes and blob pushes — requires the writer’s node ID to be listed through --allow-node or .iroh-allowed, or requires --open-writes.

Serve runtime environment

Three environment variables are read by the serve handler outside clap: ID_WORLD_COMPILE_CACHE_DIR and ID_WORLD_COMPILE_CACHE_LRU_BYTES (the world compile cache), and ID_APPS_DIR. The mail variables ID_MAIL_TO, ID_MAIL_SUBJECT and ID_MAIL_BODY are set by serve for --world-mail-command, not read from the operator’s environment. The full environment list is covered in Configuration and environment.

Feature gates

Requested surfaceGateBehaviour when the feature is off
--web, --web-listen, explicit --port/--bindweb cargo featureStartup fails with: “the web interface was requested (–web/–web-listen/–port/–bind), but this id binary was built without the web feature; rebuild with --features web to serve it”.
--server-configworld cargo featureStartup fails with a message stating the binary was built without the world feature.
--world-modulesandbox cargo featureStartup fails with: “–world-module requires a build with the sandbox feature”.
--world-ssh-portssh cargo featureThe flag parses in every build; SSH serving exists only in ssh-feature builds (the Nix id-web package has it; id-lib does not).

The default Cargo build (default = [sandbox, world]) has no web UI and no world SSH serving. The Nix id-web package (the default package) is built with web + sandbox + ssh + world; the Nix id-lib package is built with sandbox + world only.

Serve failure shapes and exit behaviour

serve runs indefinitely; a clean stop is by interruption. Startup failures are handler errors and exit 1, including: a malformed --server-config file (the error names the TOML parse error); --web-listen combined with an explicitly set --bind or --port; the feature-gate failures in the table above. Giving two of the three mail sinks, --gossip with --no-gossip, or --world without --world-admin-token is a clap error and exits 2. The process-wide rules are stated in The id command line.

Publications: publish, unpublish, publications

The publications trio manages dynamic publications on a running serve (#2147). All three are operator-only: each connects with the serve node’s own key, and each fails when no serve is running. None of the three edits local state directly; each drives the running serve’s publication manager. A publication made this way goes live without restarting the node and persists across restarts.

publish

id publish <WORLD> --listen <ADDR>
id publish <WORLD> --path <PATH> [--acknowledge-shadow]
FlagArgumentDefaultMeaning
--listenADDRnonePublish on a dedicated listener at this address (for example 127.0.0.1:8080; port 0 is OS-assigned). Conflicts with --path.
--pathPATHnonePublish as a path mount on the primary Explorer listener (for example /prog). Conflicts with --listen.
--acknowledge-shadownone (switch)offAcknowledge that a path mount shadows an Explorer route. Required to publish a mount that shadows one; without it the mount is refused.

Behaviour notes:

  • Exactly one of --listen and --path is required. The requirement is enforced at runtime, not by clap: giving neither, or both, fails with exactly one placement is required: --listen ADDR or --path PATH (exit 1). Giving both is not a clap conflict, because --path carries no parser-level conflict in publish; the runtime check fires instead.

Worked example (toy data):

With a serve already running (started, for example, by id serve --web --web-token $ID_WEB_TOKEN in another terminal):

$ id publish toy-lobby --path /toy
$ id publish toy-lobby
Error: exactly one placement is required: --listen ADDR or --path PATH

The first command mounts the world toy-lobby at /toy on the running serve. The second fails: it supplies no placement, and the runtime check rejects the invocation with the placement error and exit 1.

Failure shapes: no serve running (handler error, exit 1); a protocol mismatch against the running serve fails with unexpected response or unexpected response from serve: … (exit 1); a shadowing path mount without --acknowledge-shadow is refused (exit 1).

unpublish

id unpublish --listen <ADDR>
id unpublish --path <PATH>
FlagArgumentDefaultMeaning
--listenADDRnoneUnpublish the dedicated listener at this address. Conflicts with --path (parser-level conflict).
--pathPATHnoneUnpublish the path mount at this path.

Behaviour notes:

  • Removes a dynamic publication from the running serve without restarting the node: the listener closes, or the Explorer route is restored.
  • Unlike publish, unpublish declares the --listen/--path conflict in the parser, so giving both is a clap error (exit 2).

Worked example (toy data):

$ id unpublish --path /toy

Failure shapes: no serve running is a handler error (exit 1). Giving both --listen and --path exits 2.

publications

id publications
FlagArgumentDefaultMeaning
(none)——publications takes no arguments and defines no flags of its own; the global flags apply.

Behaviour notes:

  • Lists the running serve’s dynamic publications, with their live listener addresses.

Worked example (toy data):

$ id publications
/toy
127.0.0.1:8080

Failure shapes: no serve running is a handler error (exit 1).

World commands: joining and playing

Source: pkgs/id/crates/id-cli/src/cli/world.rs under https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-cli/src/cli/world.rs — provenance only; this chapter is complete without following it.

Every id world subcommand is a client. No world subcommand hosts a world: hosting is id serve --world, covered in serve and publications. The commands in this chapter are the participant and authoring side: minting an invite, installing and compiling a program, reading records, joining and chatting, mirroring and downloading, and the local-only commands that scaffold, fork and inspect world directories on disk. The operator side — changing capabilities and profiles, drift, fixtures, replicas and journal files — is in World commands: administering and verifying. The runtime model behind these commands is in Worlds and the Roc guest runtime and Capabilities, ceilings and providers.

Feature gating is inconsistent, and the source behaviour is what this chapter documents (disagreement CLI-10). id world dev is gated on the sandbox cargo feature at the parser level: in a build without sandbox, the subcommand does not exist and clap reports unrecognized subcommand, exit 2. The rest of the world tree is not parser-gated: in a build without the world feature, id world --help prints the full tree, but every id world invocation fails at runtime with this build has no world support, exit 1. The default build (default = [sandbox, world]) and both Nix packages (id-web, id-lib) include both features.

Exit behaviour, all world commands unless a command states otherwise: success exits 0; a handler error prints Error: <message> to stderr and exits 1; a clap parse error (unknown subcommand or flag, missing required argument, conflicting flags, bad value) prints the error and usage to stderr and exits 2. There is no per-command exit-code table in the binary.

Common flags

The flags below repeat in each world command’s argument struct; they are not global flags. They are stated once here. Each command’s own table lists only the flags specific to that command, plus its credential requirement where that differs.

FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequired positionalThe host’s node ID. With join --via ssh it is instead the SSH target (see join).
--admin-tokentoken— (none)The host’s admin secret, as configured with serve --world-admin-token. Environment fallback: ID_WORLD_ADMIN_TOKEN. The value is never echoed; clap hides environment values for this flag.
--capabilitycapability string— (none)A guest capability minted by world invite. Environment fallback: ID_WORLD_CAPABILITY. The value is never echoed; clap hides environment values for this flag.
--worldnamehost’s default worldWhich world on the host to use. Environment fallback: ID_WORLD. One command overrides this default: world replica defaults --world to lobby (see World commands: administering and verifying).
--addrIP:PORT— (none)Direct socket address of the host; repeatable. Giving one skips discovery.
--no-relayswitchoffDisable relay servers; direct connections only.

A command needs the admin token, a capability, both, or neither, as its own section states. Token and capability values are secrets: this chapter names them and never prints a value. In the examples, toy-cap-0001 and similar strings are invented toy credentials.

The toy host used throughout this chapter and World commands: administering and verifying is the invented node ID 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef.

invite

Mints a guest capability on a world host. This is the only way a participant credential comes into existence, and it needs the host’s admin token.

id world invite <NODE> --name <NAME> [--admin-token <TOKEN>] [OPTIONS]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--namestringrequiredDisplay name for the new participant. There is no default; omitting it is a clap error, exit 2.
--admin-tokentoken— (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret. Required in effect: the host refuses the mint without it.
--rolespectator|observer|player|guest|delegator|builder|moderatorguestRole preset. spectator sees the world but not the chat; observer also reads chat; player also inputs; guest also chats; delegator may also mint narrower capabilities. builder and moderator complete the set of seven accepted values. Any other value is a clap error, exit 2.
--expires-induration, e.g. 12h, 3d7 daysHow long the invite works. The maximum is 30 days.
--usesintegerunlimitedHow many committed actions the invite may take. Must be at least 1 when given.

Behaviour: only the capability goes to stdout, so it can be captured into a variable or a file. Give that string to the participant; it is the --capability value (or the ID_WORLD_CAPABILITY environment value) for records, mirror, download and join. Losing it is losing the invite: re-invite rather than trying to recover it. The --expires-in and --uses bounds are checked locally, before the host is contacted.

Example — invite a toy participant named toy-guest as a player for 12 hours:

$ id world invite 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --name toy-guest --role player --expires-in 12h --uses 100

Failures: a missing --name or an unknown --role value is a clap error, exit 2. A wrong or missing admin token is refused by the host, exit 1. An --expires-in value past the 30-day maximum, or a --uses of 0, fails the local bounds check, exit 1, before any connection is made.

install

Uploads a compiled Wasm module built for the id Roc world ABI and activates it on the host.

id world install <NODE> <MODULE> [--admin-token <TOKEN>] [OPTIONS]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
<MODULE>file pathrequiredThe .wasm module to upload and activate.
--admin-tokentoken— (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret.
--seedinteger1Deterministic seed supplied to the guest initializer. Record it: world replay and world verify need the same seed later (see World commands: administering and verifying).

Example — install a toy module with the default seed:

$ id world install 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    ./toy-world.wasm

Failures: a missing module file fails before any upload, exit 1; the file is read and size-checked locally first, and a module over the world module size limit fails with module exceeds <N> bytes, exit 1. A wrong admin token is refused by the host, exit 1. A module not built for the Roc world ABI is refused by the host, exit 1.

records

Prints the world’s structured records as one JSON object.

id world records <NODE> --capability <CAP> [OPTIONS]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--capabilitycapability stringrequired (env ID_WORLD_CAPABILITY)A guest capability for the world.
--prefixstring— (none)Only keys starting with this prefix.

Example — read the records under a toy key prefix:

$ id world records 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --capability toy-cap-0001 --prefix toy/

Failures: an expired, exhausted or unknown capability is refused by the host, exit 1. Output on success is the JSON object on stdout; there is no text form.

mirror

Replicates the world’s records over iroh with an iroh-docs replica. It runs a local replica endpoint that accepts sync connections. It is not a world host: it serves the replica, not the world program.

id world mirror <NODE> --capability <CAP> [OPTIONS]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--capabilitycapability stringrequired (env ID_WORLD_CAPABILITY)A guest capability for the world.
-f, --followswitchoffKeep printing whenever the records change, instead of syncing once and printing the current records.
--dirpath— (none)Store the replica on disk so it survives between runs. Without it the replica is in memory for this run only.
--timeout-secsinteger, 0..=8640030Give up after this many seconds without a completed sync. A value above 86400 is a clap error, exit 2.

Example — keep a persistent toy replica in ./toy-replica and follow changes:

$ id world mirror 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --capability toy-cap-0001 --dir ./toy-replica --follow

Failures: no completed sync inside --timeout-secs ends the command with an error, exit 1. An invalid capability is refused by the host, exit 1.

download

Downloads the module backing the world’s current state, verified by hash.

id world download <NODE> --capability <CAP> --output <FILE>
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--capabilitycapability stringrequired (env ID_WORLD_CAPABILITY)A guest capability for the world.
--outputfile pathrequiredWhere to write the verified module bytes. Omitting it is a clap error, exit 2.

Behaviour: the command asks the host for the world’s active module hash, downloads the module by that hash (verified by hash), writes the bytes to --output, and prints the module hash.

Example:

$ id world download 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --capability toy-cap-0001 --output ./toy-downloaded.wasm

Failures: a world with no installed module fails with world has no installed module to download, exit 1. A hash mismatch fails the command, exit 1. An invalid capability is refused by the host, exit 1.

join

Joins a world and chats. Stdin lines are chat; /input <hex> sends opaque input. Server frames print as JSON lines on stdout.

id world join <NODE> --capability <CAP> [OPTIONS]
FlagArgumentDefaultMeaning
<NODE>64 hex characters, or an SSH target with --via sshrequiredWith iroh, the host’s node ID. With ssh, [user@]host[:port] of the host’s world SSH server.
--capabilitycapability stringrequired (env ID_WORLD_CAPABILITY)A guest capability for the world. With --via ssh it is presented over the SSH channel.
--afterinteger (sequence)— (none)Replay events after this sequence instead of receiving a full snapshot.
--command-modeswitchoffParse stdin lines as commands (/chat, /records, /stats, /caps, /quit, and the rest of the in-session command set) instead of sending every line as chat.
--jsonswitchoffEmit local command responses as JSONL records on stdout. Requires --command-mode; giving it alone is a clap error, exit 2.
--viairoh|sshirohHow to reach the host: an iroh QUIC stream to the node ID, or an exec channel on the host’s world SSH server, for networks and jump hosts that only pass SSH.
--ssh-host-keyfingerprint, SHA256:...— (none)With --via ssh: the host key fingerprint id serve prints. Without it, the key must be in ~/.ssh/known_hosts.

Example — join in command mode with JSONL responses, over SSH:

$ id world join toyuser@toyhost.example:2222 --capability toy-cap-0001 \
    --via ssh --command-mode --json

Example — a plain chat join over iroh, resuming after sequence 40:

$ id world join 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --capability toy-cap-0001 --after 40

Failures: --json without --command-mode is a clap error, exit 2. An unknown --via value is a clap error, exit 2. An invalid capability is refused by the host, exit 1. With --via ssh, a host key that matches neither --ssh-host-key nor ~/.ssh/known_hosts fails the connection, exit 1.

ssh-tunnel

Reaches a host’s world SSH server through iroh, so an ordinary ssh client can reach a world behind NAT. This command takes no capability and no admin token: the capability is the SSH password the ssh client presents.

id world ssh-tunnel <NODE> [--listen <ADDR> | --stdio] [OPTIONS]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--listenaddress— (none)Local address to listen on. Loopback only is recommended. Conflicts with --stdio.
--stdioswitchoffSpeak SSH on stdin/stdout, for use as an ssh -o ProxyCommand. Conflicts with --listen.

Example — listen locally, then connect with a normal ssh client (the password is the guest capability):

$ id world ssh-tunnel 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --listen 127.0.0.1:2222
$ ssh -p 2222 toy-world@127.0.0.1

Failures: --listen together with --stdio is a clap error, exit 2. An unreachable host fails the tunnel, exit 1.

compile

Compiles Roc sources on the host and installs the result. The host rewrites the app’s pf: platform "..." path to its staged copy of the world platform, so any relative platform path in the source works.

id world compile <NODE> <MAIN_FILE> [--admin-token <TOKEN>] [OPTIONS]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
<MAIN_FILE>file pathrequiredThe app’s main.roc.
-f, --filefile path— (none)Additional source files; repeatable. Paths become file names on the host.
--seedintegerrandomSeed for the compiled program’s initializer. Omitted means a random seed is chosen; contrast install and dev, where the seed defaults to 1.
--admin-tokentoken— (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret.
--nativeswitchoffBuild a native worker (x64musl) instead of Wasm. The host must run with --world-native and a platform with native targets.

Example — compile a toy app from its main file plus one extra source:

$ id world compile 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    ./toy-app/main.roc --file ./toy-app/helpers.roc --seed 7

Failures: a Roc compile error on the host fails the command, exit 1. --native against a host that does not run with --world-native is refused, exit 1. A wrong admin token is refused, exit 1.

dev

The offline authoring loop. It compiles a Roc world app locally and launches it in a disposable in-memory scratch world. It is fully offline: no host is contacted, nothing is installed into a named world, and the scratch world is discarded when the session ends. It prints one JSON report: the compiled module’s provenance, the initial view, and the view after each --input.

This command exists only in sandbox builds; see the gating note at the top of this chapter.

id world dev <DIR> [OPTIONS]
FlagArgumentDefaultMeaning
<DIR>directory pathrequiredApp directory holding the app’s main.roc and its sibling .roc sources.
--platformdirectorythe platform path main.roc declares, resolved against the app directoryWorld platform directory (or its platform.roc file).
--rocbinaryID_ROC_BIN, then the bundled toolchain lookup the host compiler usesRoc compiler binary. This flag has no clap environment fallback of its own; the default resolution consults ID_ROC_BIN.
--seedinteger1Deterministic seed for the scratch world’s guest initializer.
--inputtext— (none)Input to send to the scratch world after launch, as the dev guest; repeatable, in order. The view is reported after each input.
--fixturefile path— (none)Fixture to replay against the compiled candidate before launch; repeatable, in order. A fixture whose replayed records mismatch its recorded expectation blocks promotion: the candidate is not launched and the command fails. Fixtures recorded under an earlier module hash still replay (the cross-module regression mode) and the report says so.
--fuzzfile path— (none)Deterministic fuzz declaration file: a bounded, versioned JSON file naming a generated input alphabet and the invariants the compiled candidate must hold. Given, the command compiles the candidate and runs a fuzz campaign instead of launching a session.
--fuzz-seedinteger42Seed for the fuzz campaign’s input generator. The same declaration, seed and case budget reproduce the same input sequences and the same first failure.
--fuzz-casesinteger32Bounded fuzz case budget. Cases are generated input sequences, each applied to a fresh scratch world.
--watchswitchoffWatch the app’s declared sources and hot-swap each debounced change into the scratch world. A failed or stale candidate leaves the last-good program running.
--watch-max-cyclesinteger1000Bounded watch poll budget; the session ends on its own after this many polls.
--watch-debounce-msinteger (milliseconds)150Debounce window for watch polls; change events inside the window coalesce into one candidate.

Example — compile a toy app, launch it, and send two inputs:

$ id world dev ./toy-app --input "toy move one" --input "toy move two"

Example — run a toy fuzz campaign instead of a session:

$ id world dev ./toy-app --fuzz ./toy-fuzz.json --fuzz-seed 42 --fuzz-cases 32

Failures: a compile error fails the command, exit 1, and no scratch world is launched. A fixture mismatch fails the command, exit 1, and the candidate is not launched. In a build without the sandbox feature the subcommand does not exist: clap error, exit 2.

caps (read form)

Shows a world’s capabilities. The change form (--grant, --revoke, --ceiling) is in World commands: administering and verifying.

id world caps <NODE> [--capability <CAP>] [--admin-token <TOKEN>]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--capabilitycapability string— (env ID_WORLD_CAPABILITY)A guest capability. Sufficient on its own for the read form.
--admin-tokentoken— (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret. Optional for the read form.

Behaviour: with no --grant, --revoke or --ceiling, the command prints what the world has granted, what its program wants, and what it has used. It needs only a guest capability.

Example:

$ id world caps 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --capability toy-cap-0001

Failures: an invalid capability is refused by the host, exit 1.

profile (read form)

Views a world’s requested execution profile bounds. The write form (any limit flag) is in World commands: administering and verifying.

id world profile <NODE> [--capability <CAP>] [--admin-token <TOKEN>]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--capabilitycapability string— (env ID_WORLD_CAPABILITY)A guest capability; sufficient to inspect the profile.
--admin-tokentoken— (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret; the alternative credential for the read form.

Behaviour: with no limit flag, the command prints the current persisted profile. It requires either --admin-token or a guest --capability.

Example:

$ id world profile 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --capability toy-cap-0001

Failures: giving neither credential fails the command, exit 1. An invalid credential is refused by the host, exit 1.

new

Scaffolds a new Roc world app directory. Local only; no host is contacted.

id world new <DIR> [--name <NAME>]
FlagArgumentDefaultMeaning
<DIR>directory pathrequiredDirectory to create. It must be absent or empty.
--namestringworldApp name used in the README and the Wasm output.

Behaviour: writes main.roc, build.sh and README.md into the directory. The platform path in the scaffold points at ../roc-world/platform.roc, so create the directory next to a checkout of the examples/roc-world platform.

Example:

$ id world new ./toy-app --name toy-app

Failures: a directory that exists and is not empty fails the command, exit 1, and nothing is written into it by this command.

fork

Forks a durable world on disk into a new world. Local only; no host is contacted.

id world fork <SOURCE_DIR> <DIR> [OPTIONS]
FlagArgumentDefaultMeaning
<SOURCE_DIR>directory pathrequiredDirectory of the world to fork (the one holding journal.jsonl).
<DIR>directory pathrequiredDirectory to create for the fork. It must be absent or empty.
--namestring (a-z, 0-9, -, _)destination directory’s nameThe new world’s ID. The default is the ID a host serving that directory will open it under.
--templateswitchoffMark the fork reusable as a template, recorded in its provenance (see provenance below).
--jsonswitchoffPrint one JSON object instead of text lines.

Behaviour: copies the source world’s journal and modules into the destination directory under a new world ID and records the fork provenance in the new journal. Only the journal and the modules are copied: no seed secret or other source file comes along. On success it prints forked <DIR>.

Example:

$ id world fork ./toy-world-dir ./toy-world-copy --name toy-world-copy

Failures: a destination that exists and is not empty fails the command, exit 1. A source directory without a journal.jsonl fails the command, exit 1.

provenance

Prints a durable world’s provenance from its journal. Local only; no host is contacted.

id world provenance <DIR> [--json]
FlagArgumentDefaultMeaning
<DIR>directory pathrequiredDirectory of the world to inspect (the one holding journal.jsonl).
--jsonswitchoffPrint one JSON object instead of text lines.

Behaviour: prints the world’s ID and, for a fork, the world it was forked from, the module hash at the fork point, and whether it was marked a template.

Example:

$ id world provenance ./toy-world-copy

Failures: a directory without a readable journal.jsonl fails the command, exit 1.

owner

Prints a durable world’s owner report: joins, on-disk storage, and which facts are unavailable and why. Local only: it reads the world directory, contacts no host, never wakes a world and writes nothing, so live-only facts (connected members, program runs) are reported unavailable. Only the user who owns the world directory, or root, may read it.

id world owner <DIR> [OPTIONS]
FlagArgumentDefaultMeaning
<DIR>directory pathrequiredDirectory of the world to report on (the one holding journal.jsonl).
--sinceduration, e.g. 12h, 7d7dThe window the report covers, ending now.
--jsonswitchoffPrint one JSON object (schema version 1) instead of text.

Example:

$ id world owner ./toy-world-dir --since 12h --json

Failures: a directory the invoking user does not own (and is not root for) fails the command, exit 1. A directory without a journal.jsonl fails the command, exit 1.

list (public directory form)

Lists the worlds a host serves. The admin form is in World commands: administering and verifying.

id world list <NODE> [--json]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--admin-tokentoken— (env ID_WORLD_ADMIN_TOKEN)Optional. Omit it to read the public directory; give it for the admin listing.
--jsonswitchoffPrint one JSON object instead of tab-separated lines.

Behaviour: without --admin-token this reads the host’s public directory: world names, loaded state and presence counts. It needs no credential.

Example:

$ id world list 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef

Failures: an unreachable host fails the command, exit 1.

World commands: administering and verifying

Source: pkgs/id/crates/id-cli/src/cli/world.rs under https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-cli/src/cli/world.rs — provenance only; this chapter is complete without following it.

This chapter is the operator side of id world: changing a live world’s capabilities, profile, isolation and file scope; diagnosing a setup; reconciling a world to a world.toml; checking sessions against the shell contract; recording, replaying and verifying fixtures offline; replicating a world durably; creating worlds; and managing a world directory’s journal file. The participant side is in World commands: joining and playing.

The common per-command flags — <NODE>, --admin-token (environment fallback ID_WORLD_ADMIN_TOKEN), --capability (environment fallback ID_WORLD_CAPABILITY), --world (environment fallback ID_WORLD), --addr and --no-relay — are stated once in World commands: joining and playing and are not repeated in the tables below. Each table below lists the flags specific to the command, plus its credential requirement where that is the point of the command.

Exit behaviour, all commands in this chapter unless a command states otherwise: success exits 0; a handler error prints Error: <message> to stderr and exits 1; a clap parse error prints the error and usage to stderr and exits 2. Three commands define their own non-zero behaviour in source and state it in their sections: doctor, journal check, and the offline pair replay / verify. measure and contract also narrow their failure conditions, stated in their sections.

Feature gating follows the pattern documented in World commands: joining and playing (disagreement CLI-10): measure, replay and verify are gated on the sandbox cargo feature at the parser level and do not exist in a build without it (clap error, exit 2); every other command in this chapter parses in every build and fails at runtime with this build has no world support, exit 1, in a build without the world feature.

The toy host used in the examples is the invented node ID 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef. Token and capability values in examples (toy-cap-0001 and similar) are invented toy credentials; real values are never printed by these commands and are named, never valued, in this chapter.

caps (grant, revoke and ceiling changes)

Changes a world’s capabilities. The read form is in World commands: joining and playing.

id world caps <NODE> [--grant <CAP>]... [--revoke <CAP>]... [--ceiling <CAPS>] [--admin-token <TOKEN>]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--grantcapability name— (none)Capability to grant; repeatable. * grants the whole catalog.
--revokecapability name— (none)Capability to revoke; repeatable.
--ceilingcapability names, comma-separated or repeatable— (none)Capability ceiling to set. Only known capabilities; * is not accepted in a ceiling.
--admin-tokentoken— (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret. Required for any change.
--capabilitycapability string— (env ID_WORLD_CAPABILITY)A guest capability. Sufficient for reading; never sufficient for a change.

Behaviour: any of --grant, --revoke or --ceiling turns the invocation into a change, and a change needs the admin token. A guest capability alone cannot change anything. The background model is in Capabilities, ceilings and providers.

Example — grant one toy capability, revoke another, and set a two-capability ceiling:

$ id world caps 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --grant toy.cap.read --revoke toy.cap.write \
    --ceiling toy.cap.read,toy.cap.chat

Failures: a change attempted without the admin token, or with only a guest capability, is refused, exit 1. An unknown capability name in --ceiling, or * in --ceiling, is refused, exit 1.

profile (limit writes)

Persists a world’s requested execution profile bounds. The read form is in World commands: joining and playing.

id world profile <NODE> [--wasm-fuel <N>] [--wasm-memory-bytes <N>] [...] [--admin-token <TOKEN>]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--wasm-fuelinteger— (none)Requested Wasm fuel limit per transaction/event. Visible alias: --fuel.
--wasm-memory-bytesinteger (bytes)— (none)Requested Wasm linear memory in bytes. Visible alias: --wasm-memory.
--wasm-message-bytesinteger (bytes)— (none)Requested Wasm message payload limit in bytes. Visible alias: --wasm-message.
--native-memory-bytesinteger (bytes)— (none)Requested native address-space cap in bytes. Visible alias: --native-memory.
--native-cpu-secondsinteger (seconds)— (none)Requested native CPU cap in seconds. Visible alias: --native-cpu.
--native-call-deadline-msinteger (milliseconds)— (none)Requested native call deadline in milliseconds. Visible alias: --native-deadline.
--admin-tokentoken— (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret. Required when any limit flag is given.

Behaviour: giving any limit flag persists the new profile and requires the admin token. Giving none prints the current persisted profile (the read form). The limit flags take bytes, seconds and milliseconds as raw integers; contrast the serve-side runtime flags in serve and publications, which take MiB and KiB units.

Example — set a toy fuel limit using the short alias:

$ id world profile 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --fuel 5000000

Failures: a limit flag without the admin token is refused, exit 1.

doctor

Diagnoses a broken world setup and prints the fix for each problem. It takes no <NODE>: every check is local.

id world doctor [OPTIONS]
FlagArgumentDefaultMeaning
--roc-binbinaryID_ROC_BIN, then the pinned nightly, then roc on PATHRoc compiler binary to check. Environment fallback: ID_ROC_BIN.
--platformdirectoryID_ROC_PLATFORM, or ./examples/roc-worldWorld platform directory to check. Environment fallback: ID_ROC_PLATFORM.
--journalfile path— (none)World journal (journal.jsonl) to check for format errors.
--ceilingcapability names, comma-separated or repeatable— (none)Capability ceiling to check. Only known capabilities, no *. Without it, the ceiling check reports that none is configured.
--profilefile path (JSON)— (none)Execution profile to check, as a JSON file whose fields are the execution-profile bounds, e.g. {"wasm_fuel": 0}. Without it, the profile check reports that none is configured.
--jsonswitchoffPrint one machine-readable report instead of text.

Behaviour: checks the Roc toolchain, the platform build, the capability ceiling, the execution profile, the journal format and the clock. Each problem is printed with its fix.

Exit behaviour, defined in source: doctor exits non-zero only when a check FAILs. A warning does not fail the command.

Example:

$ id world doctor --journal ./toy-world-dir/journal.jsonl --json

Failures: a FAIL check exits 1. Warnings alone exit 0.

diff

Shows the drift between a world.toml file and a live world. Read-only: it changes nothing on the host.

id world diff <NODE> --file <FILE> --capability <CAP>
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--filefile pathrequiredPath to the world.toml to compare against.
--capabilitycapability stringrequired (env ID_WORLD_CAPABILITY)A guest capability, enough to read the world. No admin token is needed or accepted for this command.

Behaviour: prints the drift report and stays informational: drift alone does not fail the command. If the manifest’s plan is one an apply would refuse (the schedule-horizon check), diff prints warning: \world apply` would refuse this manifest: to stderr and still exits0`.

Example:

$ id world diff 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --file ./toy-world.toml --capability toy-cap-0001

Failures: a missing or malformed world.toml fails the command, exit 1. An invalid capability is refused by the host, exit 1. Drift itself is not a failure.

apply

Reconciles a live world to a world.toml. Idempotent and journaled by the host.

id world apply <NODE> --file <FILE> --admin-token <TOKEN> --capability <CAP> [--dry-run]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--filefile pathrequiredPath to the world.toml to apply.
--admin-tokentokenrequired (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret.
--capabilitycapability stringrequired (env ID_WORLD_CAPABILITY)A guest capability, used to read the current state. Applying reads before it writes, so both credentials are required.
--dry-runswitchoffPrint the plan only; change nothing.

Behaviour: prints the plan and applies it. Every step — module install, grants, ceiling, profile, schedules — is applied through the admin operations and journaled by the host. When the plan is empty the command prints no drift and changes nothing. A full apply prints applied <N> step(s); a partial apply prints applied <N> of <M> step(s); the rest were reported but not applied. With --dry-run it prints the plan and then dry run: nothing changed. Before any step runs, the plan passes the schedule-horizon check: a plan that fails it is refused whole, so no partial apply happens on that account.

Example — preview, then apply, a toy manifest:

$ id world apply 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --file ./toy-world.toml --capability toy-cap-0001 --dry-run
$ id world apply 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --file ./toy-world.toml --capability toy-cap-0001

Failures: omitting either credential is refused, exit 1. A plan that fails the schedule-horizon check is refused before any step runs, exit 1, with no partial apply.

contract

Prints the versioned shell contract — the frame protocol every shell speaks — or checks a recorded session against it. It takes no <NODE>.

id world contract [--check <FILE> | --check-suite <FILE>]
FlagArgumentDefaultMeaning
--checkfile path— (none)Transcript to check. - reads stdin. Without --check or --check-suite, the command prints the shell contract itself. Conflicts with --check-suite.
--check-suitefile path— (none)Suite manifest to run (contract/shell-suite.v1.json): every shell’s capability statement and recorded session, checked in one pass. Conflicts with --check.

Behaviour: a transcript has one JSON object per line, of the form {"from": "client"|"server", "frame": {...}}. The check prints each violation.

Exit behaviour: the command fails, exit 1, if there is any violation under --check, or if any shell fails under --check-suite. Printing the contract with no flags exits 0.

Example — check a toy recorded session from stdin:

$ cat ./toy-session.jsonl | id world contract --check -

Failures: --check together with --check-suite is a clap error, exit 2. A malformed transcript fails the check, exit 1.

measure

Measures a compiled .wasm world program’s fuel use, offline. No host is contacted. This command exists only in sandbox builds.

id world measure --module <FILE> [OPTIONS]
FlagArgumentDefaultMeaning
--modulefile pathrequiredWasm module built for the id Roc world ABI.
--seedinteger1Deterministic seed supplied to the guest initializer.
--inputhex string— (none)Event to apply as participant 1, hex-encoded; repeatable, in order.
--widthinteger— (none)Viewport width for the layout call. Requires --height.
--heightinteger— (none)Viewport height for the layout call. Requires --width.

Behaviour: compiles the module with the default limits, runs view, then layout (with --width/--height), records, wants and snapshot, then each --input as participant 1 followed by a view. It prints one JSON object with, per call kind, the calls made, total and worst fuel, and the worst call as a percent of the fuel limit.

Exit behaviour: non-zero only if the module fails to compile or a call traps.

Example:

$ id world measure --module ./toy-world.wasm --width 80 --height 24

Failures: --width without --height (or the reverse) is a clap error, exit 2. A module that fails to compile, or a call that traps, exits 1. In a build without the sandbox feature the subcommand does not exist: clap error, exit 2.

logs

Tails a world’s recent events, bounded by retention and a deadline.

id world logs <NODE> --capability <CAP> [OPTIONS]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--capabilitycapability stringrequired (env ID_WORLD_CAPABILITY)A guest capability for the world.
--secondsinteger, 0..=864005Stop after this many seconds. The maximum is 86400 (24 hours); a larger value is a clap error, exit 2.

Example — tail a toy world for 30 seconds:

$ id world logs 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --capability toy-cap-0001 --seconds 30

Failures: an invalid capability is refused by the host, exit 1.

stats

Prints a world’s module, capability and profile state as one JSON object.

id world stats <NODE> --capability <CAP>
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--capabilitycapability stringrequired (env ID_WORLD_CAPABILITY)A guest capability for the world.

Example:

$ id world stats 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --capability toy-cap-0001

Failures: an invalid capability is refused by the host, exit 1. There is no text form; stdout is the JSON object.

record

Writes a world’s retained journal history and records to a replayable fixture (JSON Lines). The fixture is the input to replay and verify below. Host events require the host’s admin token.

id world record <NODE> --admin-token <TOKEN> [--out <FILE>]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--admin-tokentokenrequired (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret.
--outfile pathstdoutWrite the fixture here instead of standard output.

Example:

$ id world record 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --out ./toy-fixture.jsonl

Failures: a wrong admin token is refused by the host, exit 1. Note what the fixture does not carry: the install seed. replay and verify take it as a separate --seed argument, supplied by the admin who installed the module.

replay

Replays a recorded fixture offline through a module and compares records. No host is contacted. This command exists only in sandbox builds.

id world replay --module <FILE> --fixture <FILE> --seed <N> [--allow-partial]
FlagArgumentDefaultMeaning
--modulefile pathrequiredThe Wasm module the fixture was recorded under.
--fixturefile pathrequiredFixture written by world record.
--seedintegerrequiredThe seed the module was installed with. The fixture does not carry it.
--allow-partialswitchoffReplay a window that does not start at sequence 1. Its records are not compared.

Behaviour: prints a verdict line first — records match, records differ, or records not compared (<reason>) — followed by the replayed records and view.

Exit behaviour: exits non-zero when the records differ.

Example:

$ id world replay --module ./toy-world.wasm --fixture ./toy-fixture.jsonl --seed 1

Failures: omitting any of --module, --fixture or --seed is a clap error, exit 2. A record mismatch exits 1 after the verdict line. In a build without the sandbox feature the subcommand does not exist: clap error, exit 2.

verify

Verifies a recorded fixture’s determinism: replays it twice offline through a module and compares the records after every event. No host is contacted. This command exists only in sandbox builds.

id world verify --module <FILE> --fixture <FILE> --seed <N> [--allow-partial]
FlagArgumentDefaultMeaning
--modulefile pathrequiredThe Wasm module the fixture was recorded under.
--fixturefile pathrequiredFixture written by world record.
--seedintegerrequiredThe seed the module was installed with. The fixture does not carry it.
--allow-partialswitchoffReplay a window that does not start at sequence 1. Its records are not compared against the fixture’s header, but the two replays are still compared against each other.

Behaviour: prints a verdict line first. Verification covers the events captured by the admin-authorized fixture, including host-originated events in their recorded order. It proves determinism for that history, not correctness of host policy.

Exit behaviour: exits non-zero at the first divergence, or when the two replays agree with each other but mismatch the fixture’s header records (that header verdict is printed, as replay prints it).

Example:

$ id world verify --module ./toy-world.wasm --fixture ./toy-fixture.jsonl --seed 1

Failures: omitting any of --module, --fixture or --seed is a clap error, exit 2. A divergence exits 1 after the verdict line. In a build without the sandbox feature the subcommand does not exist: clap error, exit 2.

list (admin form)

Lists the worlds a host serves, using the admin listing. The public directory form is in World commands: joining and playing.

id world list <NODE> --admin-token <TOKEN> [--json]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--admin-tokentoken— (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret. Giving it selects the admin listing; omitting it reads the public directory instead.
--jsonswitchoffPrint one JSON object instead of tab-separated lines.

Example:

$ id world list 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef --json

Failures: a wrong admin token is refused by the host, exit 1. An unreachable host fails the command, exit 1.

isolation

Sets whether a world’s directory may be read from other unisolated worlds. Worlds are isolated by default; writes never cross worlds.

id world isolation <NODE> <isolated|unisolated> --admin-token <TOKEN>
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
<MODE>isolated|unisolatedrequired positionalisolated: no cross-world reads. unisolated: readable from other unisolated worlds. Any other value is a clap error, exit 2.
--admin-tokentokenrequired (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret.

Example:

$ id world isolation 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    unisolated

Failures: a wrong admin token is refused, exit 1.

cross-world-write

Lets other unisolated worlds write into a world, or stops them.

id world cross-world-write <NODE> <on|off> --admin-token <TOKEN>
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
<MODE>on|offrequired positionalon: other unisolated worlds may write here. off: they may not. Any other value is a clap error, exit 2.
--admin-tokentokenrequired (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret.

Example:

$ id world cross-world-write 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    on

Failures: a wrong admin token is refused, exit 1.

force-cross-world-write

Forces cross-world writes on for an unisolated world, overriding its own setting. There is no mode positional and no off form in this command: it is force-on only. Moderators cannot undo a force.

id world force-cross-world-write <NODE> --admin-token <TOKEN>
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
--admin-tokentokenrequired (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret.

Example:

$ id world force-cross-world-write 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef

Failures: a wrong admin token is refused, exit 1. Passing a mode such as off is a clap error (unexpected argument), exit 2.

file-scope

Sets a world’s file scope.

id world file-scope <NODE> <confined|unrestricted> --admin-token <TOKEN> [--write-override <on|off>]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
<SCOPE>confined|unrestrictedrequired positionalconfined: the world’s own sandbox root. unrestricted: any path. Any other value is a clap error, exit 2.
--write-overrideon|off— (none)Admin file write override for an isolated world.
--admin-tokentokenrequired (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret.

Example:

$ id world file-scope 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    confined --write-override off

Failures: a wrong admin token is refused, exit 1. An invalid --write-override value is a clap error, exit 2.

replica

Follows a pinned writer into a durable replica, opens it under the policy-B admission gate, and serves it.

id world replica <NODE> --dir <DIR> --admin-token <TOKEN> [OPTIONS]
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe writer host’s node ID.
--dirdirectory pathrequiredReplica directory: the durable journal lives here and is opened in place on later runs (created on first follow). Omitting it is a clap error, exit 2.
--admin-tokentokenrequired (env ID_WORLD_ADMIN_TOKEN)Admin secret of the writer host, authorizing the raw journal feed.
--worldnamelobbyWorld to replicate (the writer’s world name). Environment fallback: ID_WORLD. This is the only world command where --world has a clap default value.
--source64 hex charactersthe writer’s node IDPinned writer source key: the replication stream and the admission lease must both verify against it. The default holds because the writer’s node ID is the key the writer signs its replication stream with.
--leasefile path (JSON)— (none)A writer-signed admission lease to hold while serving: new spectators are admitted only while it verifies (policy B). Without one the replica serves gated, admitting no new spectators.
--onceswitchoffSync once from the writer, print the replica status as JSON, and exit without serving. Conflicts with --follow.
--followswitchoffKeep following the writer (reconnecting across sessions), printing one JSON line per committed cursor; never serves. Conflicts with --once.

Behaviour: in its default mode the command syncs the replica directory from the writer’s signed journal feed, prints the replica status (source, world, cursor, staleness) as one JSON object, then serves the replica’s world sessions on this node. --once stops after the status print. --follow keeps the replica journal current without serving.

Example — take one sync of a toy world, print the status, and exit:

$ id world replica 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --dir ./toy-replica --world lobby --once

Failures: --once together with --follow is a clap error, exit 2. A replication stream or lease that does not verify against --source is refused, exit 1. A wrong admin token is refused by the writer host, exit 1.

create

Creates a world on a host.

id world create <NODE> <NAME> --admin-token <TOKEN>
FlagArgumentDefaultMeaning
<NODE>64 hex charactersrequiredThe host’s node ID.
<NAME>stringrequired positionalName of the new world. Charset: a-z, 0-9, - and _.
--admin-tokentokenrequired (env ID_WORLD_ADMIN_TOKEN)The host’s admin secret.

Behaviour: on success the command prints created; if the world already exists on the host it prints exists.

Example:

$ id world create 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    toy-arena

Failures: a name outside the charset is refused, exit 1. A wrong admin token is refused, exit 1.

journal check and journal backup

Inspects or copies a durable world directory’s journal.jsonl. Local only; no host is contacted. The local read-only reports over the same directory are fork, provenance and owner in World commands: joining and playing.

id world journal check <DIR> [--json]
id world journal backup <DIR> <OUT>

journal check

FlagArgumentDefaultMeaning
<DIR>directory pathrequiredDirectory of the world to check (the one holding journal.jsonl).
--jsonswitchoffPrint one JSON object instead of text lines.

Behaviour: reports the journal’s format version and validity, flagging a journal written in a newer format than this binary can read.

Exit behaviour, defined in source: exits non-zero when the journal is invalid or written in a newer format than the binary reads.

Example:

$ id world journal check ./toy-world-dir

journal backup

FlagArgumentDefaultMeaning
<DIR>directory pathrequiredDirectory of the world to back up (the one holding journal.jsonl).
<OUT>file pathrequired positionalThe backup file to write. It must not already exist.

Behaviour: copies the journal to the backup file, byte for byte, so the copy restores the world exactly. The journal must check valid first: the backup runs the same validity check before copying.

Example:

$ id world journal backup ./toy-world-dir ./toy-world-journal-backup.jsonl

Failures: an <OUT> path that already exists fails the command, exit 1, and the existing file is not overwritten. A journal that does not check valid fails the backup, exit 1.

Gallery, match-audit and walk

Source: pkgs/id/crates/id-cli/src/cli/gallery.rs, pkgs/id/crates/id-cli/src/cli/match_audit.rs, pkgs/id/crates/id-cli/src/cli/walk.rs under https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-cli/src/cli/gallery.rs — provenance only; this chapter is complete without following it.

Three unrelated command groups share this chapter. id gallery administers the program gallery directory that id serve --gallery-dir serves. id match-audit exports and verifies tic-tac-toe match logs. id walk is the walking skeleton: stored nodes, signed records at id:// addresses, sync between two nodes, and conflict reports.

Exit behaviour, all commands in this chapter unless a command states otherwise: success exits 0; a handler error prints Error: <message> to stderr and exits 1; a clap parse error (unknown subcommand or flag, missing required argument, conflicting flags, bad value) prints the error and usage to stderr and exits 2.

Feature gating differs per group. id gallery and id walk are not feature-gated: both work in every build, including a --no-default-features build. id match-audit is gated on the sandbox cargo feature at the parser level: in a build without sandbox the command does not exist in help or in the parser, and invoking it is a clap error, exit 2. That is one half of disagreement CLI-10; the other half is id world, which parses without its feature and fails only at runtime — see World commands: joining and playing.

id gallery --dir <DIR> <SUBCOMMAND>
FlagArgumentDefaultMeaning
--dirdirectory pathrequired (env ID_GALLERY_DIR)The gallery directory: the one serve --gallery-dir serves (see serve and publications). It is a flag on the gallery parent, given before the subcommand. Environment fallback: ID_GALLERY_DIR.

Behaviour common to all gallery subcommands: the subcommands edit the directory on disk. A running server reads the directory when it starts, so restart the server to serve a change. Admission is this endpoint’s policy only: a removed record keeps verifying, keeps its bundle file here, and stays listed on any other host. Every removal, refusal and reinstatement is appended to the public transparency list.

Failure common to all gallery subcommands: a --dir that is not a gallery directory fails with <dir> is not a gallery directory, exit 1.

The toy content hash used in the examples is the invented value 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef.

Stops listing a record here and writes the removal to the public transparency list. The bundle file is kept, and the record stays valid on other hosts.

id gallery --dir <DIR> remove <CONTENT_HASH> --reason <REASON> [--note <TEXT>]
FlagArgumentDefaultMeaning
<CONTENT_HASH>64 hex charactersrequired positionalThe record’s content hash.
--reasonillegal_content|malware|spam|policyrequiredThe reason class for the transparency entry. The parser also accepts the hyphen spelling illegal-content. Omitting --reason is a clap error, exit 2.
--notetext— (none)A short public note for the transparency list.

Example:

$ id gallery --dir ./toy-gallery remove \
    0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --reason spam --note "toy example removal"

Failures: an unknown --reason value is a clap error, exit 2. A malformed content hash fails with invalid hash: expected 64 hex characters, exit 1.

Refuses a record waiting for review, publicly. The refusal goes on the transparency list, like a removal.

id gallery --dir <DIR> refuse <CONTENT_HASH> --reason <REASON> [--note <TEXT>]
FlagArgumentDefaultMeaning
<CONTENT_HASH>64 hex charactersrequired positionalThe record’s content hash.
--reasonillegal_content|malware|spam|policyrequiredThe reason class for the transparency entry. The parser also accepts the hyphen spelling illegal-content.
--notetext— (none)A short public note for the transparency list.

Example:

$ id gallery --dir ./toy-gallery refuse \
    0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --reason malware

Failures: an unknown --reason value is a clap error, exit 2. A malformed content hash fails with invalid hash: expected 64 hex characters, exit 1.

Reverses a removal or refusal (an appeal upheld) and lists the record again. The reinstatement goes on the transparency list.

id gallery --dir <DIR> reinstate <CONTENT_HASH> [--note <TEXT>]
FlagArgumentDefaultMeaning
<CONTENT_HASH>64 hex charactersrequired positionalThe record’s content hash.
--notetext— (none)A short public note for the transparency list.

Example:

$ id gallery --dir ./toy-gallery reinstate \
    0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    --note "toy appeal upheld"

Failures: a malformed content hash fails with invalid hash: expected 64 hex characters, exit 1. There is no --reason flag on this subcommand; passing one is a clap error, exit 2.

Lists a record waiting for review. Under the reviewed posture (see gallery posture below), approval is what makes a record listed.

id gallery --dir <DIR> approve <CONTENT_HASH>
FlagArgumentDefaultMeaning
<CONTENT_HASH>64 hex charactersrequired positionalThe record’s content hash.

This subcommand takes no flags of its own.

Example:

$ id gallery --dir ./toy-gallery approve \
    0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef

Failures: a malformed content hash fails with invalid hash: expected 64 hex characters, exit 1.

Shows the records waiting for review.

id gallery --dir <DIR> pending
FlagArgumentDefaultMeaning
--dirdirectory pathrequired (env ID_GALLERY_DIR)The parent gallery flag; the only flag this subcommand takes.

Example:

$ id gallery --dir ./toy-gallery pending

Failures: only the common gallery failure applies (<dir> is not a gallery directory, exit 1).

Shows the transparency list: every removal, refusal and reinstatement, in order, with the record, the time and the reason class.

id gallery --dir <DIR> transparency
FlagArgumentDefaultMeaning
--dirdirectory pathrequired (env ID_GALLERY_DIR)The parent gallery flag; the only flag this subcommand takes.

Example:

$ id gallery --dir ./toy-gallery transparency

Failures: only the common gallery failure applies (<dir> is not a gallery directory, exit 1).

Sets the admission posture.

id gallery --dir <DIR> posture <open|reviewed>
FlagArgumentDefaultMeaning
<POSTURE>open|reviewedrequired positionalopen: every verified record is listed until it is removed. reviewed: a record is listed once the operator approves it. Any other value is a clap error, exit 2.

Behaviour: the gallery’s default posture, before any operator ruling is stored, is open. Switching posture changes what is listed at once, because a record’s visibility is computed from the posture, the approvals and the transparency list.

Example:

$ id gallery --dir ./toy-gallery posture reviewed

Failures: an unknown posture value is a clap error, exit 2.

States, or withdraws, the response time published for one reason class.

id gallery --dir <DIR> response-hours <REASON> [HOURS]
FlagArgumentDefaultMeaning
<REASON>illegal_content|malware|spam|policyrequired positionalThe reason class the statement covers. The parser also accepts the hyphen spelling illegal-content.
[HOURS]integer— (none)The published response time in hours. Omit it to withdraw the statement for that reason class.

Example — publish a 24-hour response statement for malware, then withdraw it:

$ id gallery --dir ./toy-gallery response-hours malware 24
$ id gallery --dir ./toy-gallery response-hours malware

Failures: an unknown reason class is a clap error, exit 2.

Sets the operator’s own tags for a program or an author. Tags are operator speech, served apart from signed records.

id gallery --dir <DIR> tag [TAGS]... [--program <HASH> | --author <KEY>]
FlagArgumentDefaultMeaning
[TAGS]...tag strings— (none)The tags to set, in the portable form: lower-case letters, digits and -. Giving no tags clears the target’s tags.
--program64 hex charactersrequired unless --author is givenA program’s content hash. Conflicts with --author.
--authorpublic key— (none)An author’s public key. Conflicts with --program.

Example — tag a toy program, then clear its tags:

$ id gallery --dir ./toy-gallery tag toy-favourite editors-pick \
    --program 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
$ id gallery --dir ./toy-gallery tag \
    --program 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef

Failures: giving neither --program nor --author is a clap error, exit 2 (the handler’s form of the same refusal is name a --program or an --author). Giving both is a clap error, exit 2. A malformed program hash fails with invalid hash: expected 64 hex characters, exit 1.

match-audit

Exports and verifies match-audit v0 logs for tic-tac-toe. The whole command is gated on the sandbox cargo feature; see the gating note at the top of this chapter.

match-audit export-tic-tac-toe

Exports a reference tic-tac-toe transcript using synthetic demo keys, as a binary v0 log.

id match-audit export-tic-tac-toe --output <FILE>
FlagArgumentDefaultMeaning
--outputfile pathrequiredWrite the binary v0 log to this path. Omitting it is a clap error, exit 2.

Example:

$ id match-audit export-tic-tac-toe --output ./toy-match.log

Failures: an unwritable output path fails the command, exit 1. In a build without the sandbox feature the command does not exist: clap error, exit 2.

match-audit verify

Verifies a v0 log against the pinned bundled tic-tac-toe program.

id match-audit verify <LOG>
FlagArgumentDefaultMeaning
<LOG>file pathrequired positionalBinary match-audit v0 log, as written by export-tic-tac-toe.

Example:

$ id match-audit verify ./toy-match.log

Failures: a log that does not verify against the pinned program fails the command, exit 1. A missing log file fails the command, exit 1. In a build without the sandbox feature the command does not exist: clap error, exit 2.

walk

The #9106 walking skeleton, driven by hand. One stored node per directory; the path is: init a node, write a signed record at an id:// address, serve the node so a peer can sync with it, sync to the peer, read the record back from the other node’s store, and use reports for the conflict a diverged write opens.

Every walk command takes <DIR>, the node directory, as its first argument. One process may hold a node directory at a time: opening a directory that a walk serve process holds reports that the directory is held rather than waiting.

walk is not feature-gated anywhere: it works in every build, including a --no-default-features build.

walk init

Creates a walk node in a directory.

id walk init <DIR> --name <NAME>
FlagArgumentDefaultMeaning
<DIR>directory pathrequired positionalThe node directory.
--namestringrequiredThe node’s name: the resolver name in the addresses it mints, and the source label on what it produces. Omitting it is a clap error, exit 2.

Behaviour: re-running init on an existing node keeps its records. The recorded name must match the --name given.

Example:

$ id walk init ./toy-node-a --name toy-a

Failures: re-initialising with a different name than the recorded one fails the command, exit 1.

walk write

Writes a signed record (a note) on a node, and prints the record’s id:// address and event ID.

id walk write <DIR> --as <alice|bob> --text <TEXT> [--parent <HEX>]...
FlagArgumentDefaultMeaning
<DIR>directory pathrequired positionalThe node directory.
--asalice|bobrequiredThe demo writer signing the record. Writers are demo keys derived from the name; alice and bob are the two demo writers. The flag is spelled --as.
--texttextrequiredThe note’s text.
--parenthex event IDthe node’s current headsA parent version the record follows; repeatable. Omitting it follows the node’s current heads for the demo graph. Naming two or more parents resolves the conflict between them.

Example — Alice writes a toy note, then Bob writes a follow-up:

$ id walk write ./toy-node-a --as alice --text "toy note one"
$ id walk write ./toy-node-a --as bob --text "toy note two"

The first command prints an address of the form id://toy-a/...; that address is the argument to walk read.

Failures: omitting --as or --text is a clap error, exit 2. Writing to a directory with no initialised node fails the command, exit 1.

walk read

Reads the record an id:// address names, from a node’s store. The address may have been minted by any node: the address’s target names the record, and the serving node must hold the version.

id walk read <DIR> <ADDRESS>
FlagArgumentDefaultMeaning
<DIR>directory pathrequired positionalThe node directory.
<ADDRESS>id://... stringrequired positionalThe address, as printed by walk write.

Example:

$ id walk read ./toy-node-b id://toy-a/toy-record-address

(The address above is a shortened toy form; use the full address walk write printed.)

Failures: reading a record the node does not hold is an error, not a fetch: the command fails with a message of the form this node does not hold the record at id://..., exit 1. Sync first (see walk sync) if the record lives on another node.

walk reports

Shows a node’s heads and conflict reports for the demo graph.

id walk reports <DIR>
FlagArgumentDefaultMeaning
<DIR>directory pathrequired positionalThe node directory. This command takes no flags beyond this positional.

Example:

$ id walk reports ./toy-node-a

Failures: a directory with no initialised node fails the command, exit 1. A diverged write shows up here as a conflict report; resolve it with a walk write that names both sides as --parent values.

walk serve

Serves a node: answers federation exchanges from its directory until interrupted, persisting what sessions admit. It prints the peer token a walk sync dials, of the form <endpoint-id>@<socket-address>.

id walk serve <DIR>
FlagArgumentDefaultMeaning
<DIR>directory pathrequired positionalThe node directory. This command takes no flags beyond this positional.

Example:

$ id walk serve ./toy-node-a

Failures: while serve holds the directory, other walk commands against the same directory report that it is held, exit 1. Interrupting serve ends it; the records it persisted stay in the directory.

walk sync

Runs one exchange from a node to a serving peer, and persists what the node admits.

id walk sync <DIR> --peer <TOKEN>
FlagArgumentDefaultMeaning
<DIR>directory pathrequired positionalThe node directory.
--peerpeer tokenrequiredThe peer token printed by the peer’s walk serve: <endpoint-id>@<socket-address>. Omitting it is a clap error, exit 2.

Example — sync toy node B from the toy node A that is serving (the token is the invented one printed by that serve):

$ id walk sync ./toy-node-b --peer toy-endpoint-id@127.0.0.1:41001

Failures: an unreachable peer fails the exchange, exit 1. A malformed peer token fails the command, exit 1. Sync is one exchange per invocation; run it again for a later state.

Groups, documents, claims and keys

Source: pkgs/id/crates/id-cli/src/cli/mod.rs, pkgs/id/crates/id-cli/src/cli/groups.rs, pkgs/id/crates/id-cli/src/cli/doc.rs, pkgs/id/crates/id-cli/src/cli/claim.rs, pkgs/id/crates/id-cli/src/cli/writer_sets.rs under https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-cli/src/cli/mod.rs — provenance only; this chapter is complete without following it.

This chapter covers the event-backed identity surface of id: group with delegate and revoke; doc; claim; writer-sets; and the identity commands id, key, keyset and peers. The concepts behind them are in Identity, the directory and groups and Events and the signed audit chain. The event-backed claims here are a separate store from the file tags of The tag family.

Two global flags place the stores (see The id command line and Configuration and environment):

FlagArgumentDefaultMeaning
--groups-logfile pathgroups.jsonl in the data dirThe group log for group, delegate and revoke. A relative path is relative to the data dir.
--event-storedirectory pathevents in the data dirThe event store for doc, claim and writer-sets. A relative path is relative to the data dir.

group, doc, claim and writer-sets each take a --json flag that is global to that parent command: it may appear before or after the subcommand. With --json, an action prints one JSON object; group list, doc lists, claim list/search and writer-sets discover print one JSON array. delegate and revoke are top-level commands with their own --json flag.

Exit behaviour, all commands in this chapter unless a command states otherwise: success exits 0; a handler error prints Error: <message> to stderr and exits 1; a clap parse error prints the error and usage to stderr and exits 2. Accounts and groups are 64 hex characters throughout. The toy group used in the examples is the invented ID 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef; the toy accounts are fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 and 1111111111111111111111111111111111111111111111111111111111111111.

group

Each group action records one event in the group log and prints one line, or one JSON object with --json. A refused action exits non-zero, and its event stays in the log.

The role vocabulary used by group add, group role and delegate is one ordered enum, least to most: pull (replicates ciphertext without keys), read (reads content), write (edits content), manage (adds and removes members), admin (manages, and changes roles and the policy record).

group create

Creates a group. A normal group makes its creator Admin. A friendship names its other side with --with, has no Admin unless --admins-on-create, and is active once the other side accepts.

id group create [--template <normal|friendship>] [--with <ACCOUNT>] [--max <N>] [--admins-on-create]
FlagArgumentDefaultMeaning
--templatenormal|friendshipnormalThe kind of group to create.
--withaccount (64 hex)— (none)The other side of a friendship. Required for --template friendship.
--maxinteger— (none; no cap)The most members the group may have, counting the creator. Normal groups only.
--admins-on-createswitchoffMake both friends Admin (friendships).
--jsonswitchoffParent flag: print one JSON object instead of a line.

Example — a normal toy group capped at 8 members, and a toy friendship:

$ id group create --max 8
$ id group create --template friendship \
    --with fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210

Failures: a friendship without --with fails the command, exit 1. A friendship with --max fails with a friendship has two members, so it takes no --max, exit 1. An unknown --template value is a clap error, exit 2.

group policy

Shows a group’s policy record.

id group policy <GROUP>
FlagArgumentDefaultMeaning
<GROUP>group ID (64 hex)required positionalThe group.
--jsonswitchoffParent flag: print one JSON object instead of a line.

This subcommand takes no flags of its own.

Example:

$ id group policy 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef

Failures: an unknown group fails the command, exit 1.

group list

Lists the groups in the log, one line each, or one JSON array with --json.

id group list
FlagArgumentDefaultMeaning
--jsonswitchoffParent flag: print one JSON array instead of one line per group.

This subcommand takes no arguments and no flags of its own.

Example:

$ id group list --json

Failures: none specific to this subcommand beyond the common exit behaviour.

group add

Adds a member with a role. The author must be a manager of the group.

id group add <GROUP> <MEMBER> [--role <ROLE>]
FlagArgumentDefaultMeaning
<GROUP>group ID (64 hex)required positionalThe group.
<MEMBER>account (64 hex)required positionalThe account to add.
--rolepull|read|write|manage|adminreadThe member’s role.
--jsonswitchoffParent flag: print one JSON object instead of a line.

Example:

$ id group add 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 --role write

Failures: an author who is not a manager is refused, exit 1, and the refused event stays in the log. An unknown --role value is a clap error, exit 2. Granting admin requires an Admin author, exit 1 when refused.

group remove

Removes a member. Removing yourself is leaving. The group’s default mode is used when --mode is omitted.

id group remove <GROUP> <MEMBER> [--mode <MODE>] [--successor-kind <KIND>] [--successor <ACCOUNT>]
FlagArgumentDefaultMeaning
<GROUP>group ID (64 hex)required positionalThe group.
<MEMBER>account (64 hex)required positionalThe account to remove.
--modeserver-default|revoke|transfer|keep-prior|reassign-to-groupthe group’s configured remove defaultGrant-disposition mode. server-default is resolved to the group’s configured default before the event is recorded. revoke ends the removed member’s grants. transfer reissues the grants to a successor. keep-prior retains grants under their original grantor (a re-add starts clean: pre-removal grants do not revive and must be re-issued). reassign-to-group re-anchors grants at the group.
--successor-kindmember|admin|designated|actormemberThe successor category for --mode transfer: a named member, a group administrator, a designated account, or the account performing the removal. The successor flags require --mode transfer.
--successoraccount (64 hex)— (none)The account for a member or designated transfer successor. Requires --mode transfer.
--jsonswitchoffParent flag: print one JSON object instead of a line.

Example — remove a toy member and transfer the member’s grants to a named successor:

$ id group remove 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 \
    --mode transfer --successor-kind member \
    --successor 1111111111111111111111111111111111111111111111111111111111111111

Failures: a mode or successor category the group’s policy does not allow is refused, exit 1, and the refused event stays in the log. Giving --successor or --successor-kind without --mode transfer fails the command, exit 1. An unknown --mode value is a clap error, exit 2.

group role

Sets a member’s role. The subcommand name is role. Only an Admin may use it.

id group role <GROUP> <MEMBER> <ROLE>
FlagArgumentDefaultMeaning
<GROUP>group ID (64 hex)required positionalThe group.
<MEMBER>account (64 hex)required positionalThe member whose role changes.
<ROLE>pull|read|write|manage|adminrequired positionalIts new role.
--jsonswitchoffParent flag: print one JSON object instead of a line.

Example:

$ id group role 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 manage

Failures: a non-Admin author is refused, exit 1, and the refused event stays in the log. An unknown role value is a clap error, exit 2.

group join

Parses an invitation ticket, then always fails. Group admission and network joining are not implemented: no group membership is ever recorded by this command. This is the source behaviour, and it contradicts the top-level help, which lists join among the things group can do (disagreement CLI-9). The subcommand’s own help states the truth in its first line: Unavailable: group admission and network joining are not implemented yet.

id group join <INVITE>
FlagArgumentDefaultMeaning
<INVITE>ticket or link stringrequired positionalThe pasted ticket or link. It is parsed, and nothing further happens.
--jsonswitchoffParent flag. It does not change the outcome: the command still fails.

Example — the outcome is the same for every well-formed ticket (<ticket> stands for one):

$ id group join <ticket>
Error: group join is unavailable: invitation parsing works, but admission and network acceptance are not implemented yet; no group membership was recorded

(exit 1.)

Failures: this command has no success path. A malformed ticket fails earlier, with the invitation parse error, exit 1. A well-formed ticket fails with the group join is unavailable: ... message above, exit 1.

delegate

Grants a delegate a scope in a group, with the group’s delegation mode. It prints the grant’s event ID; that ID is the <GRANT> argument of revoke.

id delegate <GROUP> <GRANTEE> [--scope <ROLE>] [--redelegate] [--mode <MODE>] [--json]
FlagArgumentDefaultMeaning
<GROUP>group ID (64 hex)required positionalThe group.
<GRANTEE>account (64 hex)required positionalThe account that is granted the scope.
--scopepull|read|write|manage|adminreadThe scope to grant.
--redelegateswitchoffLet the grantee pass the scope on to others. Only a redelegatable grant extends a chain.
--modekeep_prior|cascade|transfer— (none)The group’s delegation mode, set first if it differs. The spellings use underscores. cascade is the delegation default in the group policy layer.
--jsonswitchoffPrint JSON instead of a line.

Example:

$ id delegate 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 \
    --scope write --redelegate

Failures: a grant the author is not authorised to make is refused, exit 1. An unknown --scope or --mode value is a clap error, exit 2. Note the mode spellings: --mode keep-prior (with a hyphen) is the spelling of group remove --mode; delegate --mode takes keep_prior (with an underscore). The hyphen form here is a clap error, exit 2.

revoke

Revokes a delegation by its grant’s event ID, as delegate printed it.

id revoke <GROUP> <GRANT> [--json]
FlagArgumentDefaultMeaning
<GROUP>group ID (64 hex)required positionalThe group.
<GRANT>event IDrequired positionalThe grant’s event ID, as id delegate printed it.
--jsonswitchoffPrint JSON instead of a line.

Example:

$ id revoke 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    toy-grant-event-id

(The grant value above is a toy placeholder; use the event ID a real delegate printed.)

Failures: an unknown grant ID fails the command, exit 1.

doc

Each document action signs one event into the event store (the global --event-store) and prints one line, or one JSON object with --json. The store stands in for sync: nodes that share it see each other’s events. A document is a document.put event over the content’s hash. Lists print one line per row, or one JSON array with --json.

doc publish

Publishes a file as a document, and sets a tag for each --tag.

id doc publish <FILE> --media-type <TYPE> [--tag <NAME[=VALUE]>]...
FlagArgumentDefaultMeaning
<FILE>file pathrequired positionalThe file to publish.
--media-typemedia type string, e.g. text/markdownrequiredThe media type of the file. Omitting it is a clap error, exit 2.
--tagNAME or NAME=VALUE— (none)A tag to set on the document; repeatable. The flag name is --tag.
--jsonswitchoffParent flag: print one JSON object instead of a line.

Behaviour: prints publish document=<ID>, the document’s event ID. The file’s bytes are hashed, and the event names their hash and size. The bytes are not stored in the event: publish stores them in the blob store under their hash, so doc content can fetch them back.

Example:

$ id doc publish ./toy-notes.md --media-type text/markdown --tag topic=toy-plans
publish document=toy-document-event-id

(The document ID above is a toy placeholder for the event ID a real publish prints.)

Failures: a missing file fails the command, exit 1. Omitting --media-type is a clap error, exit 2.

doc events

Lists the tags and removal on a document, in causal order.

id doc events <DOCUMENT>
FlagArgumentDefaultMeaning
<DOCUMENT>event IDrequired positionalThe document’s event ID, as publish printed it.
--jsonswitchoffParent flag: print one JSON object instead of lines.

Example:

$ id doc events toy-document-event-id

Failures: an unknown document ID fails the command, exit 1.

doc frontier

Lists the head of each author’s chain: the latest event each author has recorded. It takes no arguments.

id doc frontier
FlagArgumentDefaultMeaning
--jsonswitchoffParent flag: print one JSON object instead of lines.

Example:

$ id doc frontier --json

Failures: none specific to this subcommand beyond the common exit behaviour.

doc history

Lists a document’s events in causal order, its document.put first.

id doc history <DOCUMENT>
FlagArgumentDefaultMeaning
<DOCUMENT>event IDrequired positionalThe document’s event ID, as publish printed it.
--jsonswitchoffParent flag: print one JSON object instead of lines.

Example:

$ id doc history toy-document-event-id

Failures: an unknown document ID fails the command, exit 1.

doc content

Prints a document’s blob bytes, by document event ID. It resolves the document.put event to the content hash it names and exports the bytes the publish step stored.

id doc content <DOCUMENT> [OUTPUT]
FlagArgumentDefaultMeaning
<DOCUMENT>event IDrequired positionalThe document’s event ID, as publish printed it.
[OUTPUT]file path, or -- (stdout)Output path, or - for stdout.
--jsonswitchoffParent flag (effect on this subcommand’s byte output: unverified).

Example — write a toy document back out to a file, and to stdout:

$ id doc content toy-document-event-id ./toy-notes-copy.md
$ id doc content toy-document-event-id

Failures: an unknown document ID fails the command, exit 1. An unwritable output path fails the command, exit 1.

claim

A claim is a signed tag.set event that sets a tag on a subject, where a subject is any event ID, such as a document’s. clear removes the live claims it names. Claims live in the event store (the global --event-store).

Scope: a claim is shared (published to peers, the default) or local (kept on this node only, never published or synced).

claim set

Sets a tag on a subject.

id claim set <SUBJECT> <NAME> [VALUE] [--scope <shared|local>]
FlagArgumentDefaultMeaning
<SUBJECT>event IDrequired positionalThe subject’s event ID.
<NAME>tag namerequired positionalThe tag name. A local: prefix is shorthand for --scope local when --scope is absent.
[VALUE]string— (none)The tag value. Without one, the tag is bare.
--scopeshared|localsharedWhether the claim is shared with peers or stays on this node. An explicit --scope wins over a local: name prefix: with --scope shared, a name written local:NAME is a shared claim whose name keeps the prefix.
--jsonswitchoffParent flag: print one JSON object instead of a line.

Example — a shared toy claim, and the same claim kept local by the prefix shorthand:

$ id claim set toy-document-event-id topic toy-plans
$ id claim set toy-document-event-id local:topic toy-plans

Failures: none specific to this subcommand beyond the common exit behaviour.

claim clear

Clears the live claims with this name on a subject, whoever set them.

id claim clear <SUBJECT> <NAME>
FlagArgumentDefaultMeaning
<SUBJECT>event IDrequired positionalThe subject’s event ID.
<NAME>tag namerequired positionalThe tag name.
--jsonswitchoffParent flag: print one JSON object instead of a line.

Behaviour: clearing stops future replication. It cannot unsend copies peers already hold.

Example:

$ id claim clear toy-document-event-id topic

Failures: none specific to this subcommand beyond the common exit behaviour.

Lists the live claims with this name, and value if given, on any subject.

id claim search <NAME> [VALUE]
FlagArgumentDefaultMeaning
<NAME>tag namerequired positionalThe tag name.
[VALUE]string— (none)The tag value to match as a whole. Without one, any value and a bare tag match.
--jsonswitchoffParent flag: print one JSON array instead of lines.

Example:

$ id claim search topic toy-plans --json

Failures: none specific to this subcommand beyond the common exit behaviour.

claim scope

Changes the scope of this node’s claims with this name on a subject.

id claim scope <SUBJECT> <NAME> <shared|local> [--yes]
FlagArgumentDefaultMeaning
<SUBJECT>event IDrequired positionalThe subject’s event ID.
<NAME>tag namerequired positionalThe tag name.
<SCOPE>shared|localrequired positionalThe target scope. It is explicit, so it wins over any local: prefix shorthand used when a claim was set.
--yesswitchoffConfirm publishing local claims as shared. Required when the move would publish a local claim: publishing cannot be undone.
--jsonswitchoffParent flag: print one JSON object instead of a line.

Behaviour: moving to local stops future replication but cannot unsend copies peers already hold. Moving to shared publishes this node’s local claims and cannot be undone.

Example:

$ id claim scope toy-document-event-id topic shared --yes

Failures: moving to shared when a local claim would be published, without --yes, is refused, exit 1. An unknown scope value is a clap error, exit 2.

claim review

Reviews every live claim visible to this node, with its scope. It takes no arguments.

id claim review
FlagArgumentDefaultMeaning
--jsonswitchoffParent flag: print one JSON object instead of lines.

Example:

$ id claim review

Failures: none specific to this subcommand beyond the common exit behaviour.

claim list

Lists the live claims on a subject.

id claim list <SUBJECT>
FlagArgumentDefaultMeaning
<SUBJECT>event IDrequired positionalThe subject’s event ID.
--jsonswitchoffParent flag: print one JSON array instead of lines.

Example:

$ id claim list toy-document-event-id

Failures: none specific to this subcommand beyond the common exit behaviour.

writer-sets

Writer sets stored in the event store (the global --event-store). A writer set is a signed idset.writer event whose body the store retains at ingest. show prints the stored object, expand runs the view projection over the store’s resolved group state at the set’s own publishing frontier, and discover lists every stored set for a scope with the writers each expands to. --resolution names the resolution snapshot the projection is pinned under; without one, the zero hash names the store’s current resolved state.

writer-sets show

Shows one stored writer set: its ID, version, owner, scope, and the counts of its admission entries and exclusions.

id writer-sets show <EVENT>
FlagArgumentDefaultMeaning
<EVENT>event IDrequired positionalThe publishing event’s ID.
--jsonswitchoffParent flag: print one JSON object instead of lines.

Example:

$ id writer-sets show toy-writer-set-event-id

Failures: an unknown event ID fails the command, exit 1.

writer-sets expand

Expands one stored writer set at its publishing frontier: whether the expansion is public, and the explicit authors it admits after exclusions.

id writer-sets expand <EVENT> [--resolution <HEX>] [--retro]
FlagArgumentDefaultMeaning
<EVENT>event IDrequired positionalThe publishing event’s ID.
--resolutionhex string— (none; the zero hash)The resolution snapshot to pin the projection under, as hex. Without one, the zero hash names the store’s current resolved state.
--retroswitchoffExpand retroactively: only entries marked include-history contribute. Exclusions always apply.
--jsonswitchoffParent flag: print one JSON object instead of lines.

Example:

$ id writer-sets expand toy-writer-set-event-id --retro

Failures: an unknown event ID fails the command, exit 1.

writer-sets discover

Discovers stored writer sets by scope: one row per set, with the writers it expands to.

id writer-sets discover [--scope <SCOPE>] [--resolution <HEX>]
FlagArgumentDefaultMeaning
--scopestring— (none; all sets)The scope (subject) to match, exactly. Without --scope, every stored set matches.
--resolutionhex string— (none; the zero hash)The resolution snapshot to pin each expansion under, as hex. Without one, the zero hash names the store’s current resolved state.
--jsonswitchoffParent flag: print one JSON array instead of lines.

Example:

$ id writer-sets discover --scope toy-metrics

Failures: none specific to this subcommand beyond the common exit behaviour.

id

Prints the local node’s public ID. The command name collides with the binary name by design: the invocation is id id. The node ID is derived from the keypair and is what remote nodes connect to.

id id [--client]
FlagArgumentDefaultMeaning
--clientswitchoffPrint the client identity instead of the server identity. The client identity is the one this machine uses when connecting to other nodes; a server owner adds it with id serve --allow-node <ID> so this machine may write to that server.

Example:

$ id id
$ id id --client

Each prints one node ID (64 hex characters) on stdout.

Failures: none specific to this command beyond the common exit behaviour.

key

Exports or imports a local identity key. Passphrases are always hidden prompts, never flags: no key subcommand accepts a passphrase on the command line. A passphrase must be at least 8 bytes; the exact refusal is passphrase must be at least 8 bytes. A mismatched confirmation is refused with passphrases do not match. A key file that is not 32 bytes is refused with <path> is not a 32-byte key file.

key export

Exports the server identity (or, with --client, the client identity) to an encrypted file. The passphrase is entered at a hidden prompt.

id key export <OUTPUT> [--client]
FlagArgumentDefaultMeaning
<OUTPUT>file pathrequired positionalDestination for the encrypted key envelope.
--clientswitchoffExport the client identity instead of the server identity.

Example:

$ id key export ./toy-server-key-envelope
Passphrase: (hidden prompt)

Failures: a passphrase under 8 bytes, or a confirmation that does not match, fails the command, exit 1, and no envelope is written by that attempt.

key import

Imports an encrypted key envelope as the server or client identity. The passphrase is entered at a hidden prompt.

id key import <INPUT> [--client] [--replace]
FlagArgumentDefaultMeaning
<INPUT>file pathrequired positionalThe encrypted key envelope to import.
--clientswitchoffImport as the client identity instead of the server identity.
--replaceswitchoffReplace an existing identity key file atomically.

Example:

$ id key import ./toy-server-key-envelope --replace
Passphrase: (hidden prompt)

Failures: a wrong passphrase fails the command, exit 1. An existing identity key file without --replace fails the command, exit 1.

key export-seed

Prints the server identity (or, with --client, the client identity) as a 24-word seed phrase. The phrase is the key: anyone holding it holds the identity. It is printed once, never written to a file by this command, and never taken on the command line.

id key export-seed [--client]
FlagArgumentDefaultMeaning
--clientswitchoffExport the client identity instead of the server identity.

Example:

$ id key export-seed --client

The output is the 24-word phrase on stdout, once. This chapter does not print an example phrase: a seed phrase is a secret value, and only its shape (24 words, printed once, no file written) is documented here.

Failures: none specific to this subcommand beyond the common exit behaviour.

key import-seed

Restores the server or client identity from a 24-word seed phrase entered at a hidden prompt, never on the command line.

id key import-seed [--client] [--replace]
FlagArgumentDefaultMeaning
--clientswitchoffImport as the client identity instead of the server identity.
--replaceswitchoffReplace an existing identity key file atomically.

Example:

$ id key import-seed --replace
Seed phrase: (hidden prompt)

Failures: a phrase that does not decode to a key fails the command, exit 1. An existing identity key file without --replace fails the command, exit 1.

keyset

Shows or changes this identity’s keyset: its admin key and the device keys allowed to act for it. Each subcommand acts on the server identity, or the client identity with --client, and signs with that identity’s key, which must be an active admin key of the keyset to change it.

First use: the first keyset use migrates a single-key account by writing a genesis record signed by the existing key. The identity ID does not change.

Every keyset subcommand takes --client except keyset recovery status, which has no --client flag at all.

keyset show

Prints the identity ID, admin keys and device keys.

id keyset show [--client]
FlagArgumentDefaultMeaning
--clientswitchoffShow the client identity’s keyset instead of the server’s.

Example:

$ id keyset show

Failures: none specific to this subcommand beyond the common exit behaviour, apart from the first-use migration described above, which is not a failure.

keyset enrol

Enrols another device key. The device’s 32-byte key file is read to countersign the enrolment, proving the device holds the key.

id keyset enrol <DEVICE_KEY_FILE> --label <NAME> [--client]
FlagArgumentDefaultMeaning
<DEVICE_KEY_FILE>file pathrequired positionalThe new device’s key file (the .iroh-key it was created with).
--labelstringrequiredA name for the device, shown by id keyset show. Omitting it is a clap error, exit 2.
--clientswitchoffChange the client identity’s keyset instead of the server’s.

Example:

$ id keyset enrol ./toy-device.iroh-key --label toy-laptop

Failures: a device key file that is not 32 bytes is refused with <path> is not a 32-byte key file, exit 1. A signing key that is not an active admin key of the keyset is refused, exit 1.

keyset revoke

Revokes a device key, given as its hex public key. Records it signed before the revocation stay valid history.

id keyset revoke <DEVICE_KEY> [--reason <TEXT>] [--client]
FlagArgumentDefaultMeaning
<DEVICE_KEY>hex public keyrequired positionalThe device’s hex public key, as id keyset show prints it.
--reasontextrevokedWhy it was revoked, kept in the record.
--clientswitchoffChange the client identity’s keyset instead of the server’s.

Example:

$ id keyset revoke fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 \
    --reason "toy device retired"

Failures: an unknown device key fails the command, exit 1. A signing key that is not an active admin key of the keyset is refused, exit 1.

keyset rotate

Hands admin power to another key. The new key’s 32-byte key file is read to countersign the rotation; afterwards this key can no longer change the keyset.

id keyset rotate <NEW_ADMIN_KEY_FILE> [--client]
FlagArgumentDefaultMeaning
<NEW_ADMIN_KEY_FILE>file pathrequired positionalThe new admin key’s key file.
--clientswitchoffChange the client identity’s keyset instead of the server’s.

Example:

$ id keyset rotate ./toy-new-admin.iroh-key

Failures: a new admin key file that is not 32 bytes is refused with <path> is not a 32-byte key file, exit 1. A signing key that is not an active admin key of the keyset is refused, exit 1.

keyset guardians

Names the guardians who can approve a recovery of this identity, and how many must approve.

id keyset guardians <GUARDIANS>... --threshold <N> [--client]
FlagArgumentDefaultMeaning
<GUARDIANS>...identity IDs (hex public keys)required positional, at least oneEach guardian’s identity ID.
--thresholdintegerrequiredHow many of the guardians must approve a recovery. Omitting it is a clap error, exit 2.
--clientswitchoffChange the client identity’s keyset instead of the server’s.

Behaviour: adding guardians or raising the threshold takes effect at once. Removing a guardian or lowering the threshold waits out the recovery delay, so a stolen admin key cannot swap in guardians of its own.

Example:

$ id keyset guardians \
    fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 \
    1111111111111111111111111111111111111111111111111111111111111111 \
    --threshold 2

Failures: a signing key that is not an active admin key of the keyset is refused, exit 1.

keyset checkpoint

Checkpoints the current keyset head with this identity’s key, which must be an active device key. The head becomes final here: a fork that later arrives can no longer displace it.

id keyset checkpoint [--client]
FlagArgumentDefaultMeaning
--clientswitchoffCheckpoint the client identity’s keyset instead of the server’s.

Example:

$ id keyset checkpoint

Failures: a signing key that is not an active device key is refused, exit 1.

keyset recovery

Guardian recovery of an identity whose keys are all lost. Records go through a recovery relay file, which attests when it first saw each one; share that file among the devices and guardians taking part. --relay is required on all six recovery subcommands; omitting it is a clap error, exit 2. Each recovery subcommand signs with this device’s identity key, or the client key with --client — except status, which takes no --client.

keyset recovery publish

Copies this identity’s keyset records into the relay, so a successor can pin its head and its approvals can be checked. Owners and guardians both publish.

id keyset recovery publish --relay <FILE> [--client]
FlagArgumentDefaultMeaning
--relayfile pathrequiredThe recovery relay file.
--clientswitchoffPublish the client identity’s keyset instead of the server’s.

Example:

$ id keyset recovery publish --relay ./toy-relay.json

Failures: an unwritable relay file fails the command, exit 1.

keyset recovery request

From a new device, asks the guardians of an identity to recover it. This device’s key becomes the identity’s admin and device key once enough guardians approve and the recovery delay has passed.

id keyset recovery request <IDENTITY> --relay <FILE> [--reason <TEXT>] [--client]
FlagArgumentDefaultMeaning
<IDENTITY>hex identity IDrequired positionalThe identity to recover (its hex identity ID).
--relayfile pathrequiredThe recovery relay file.
--reasontextlost every keyWhy, shown to every device and guardian told of the request.
--clientswitchoffSign with the client key instead of the server key.

The command prints the request ID; that ID is the <REQUEST> argument of approve, cancel, status and complete.

Example:

$ id keyset recovery request \
    fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 \
    --relay ./toy-relay.json

Failures: an identity with no keyset records in the relay fails the command, exit 1.

keyset recovery approve

As a guardian, approves a recovery request. Also publishes this guardian identity’s keyset, so the approval can be checked.

id keyset recovery approve <REQUEST> --relay <FILE> [--client]
FlagArgumentDefaultMeaning
<REQUEST>request IDrequired positionalThe request ID, as request printed it.
--relayfile pathrequiredThe recovery relay file.
--clientswitchoffApprove as the client identity instead of the server’s.

Example:

$ id keyset recovery approve toy-request-id --relay ./toy-relay.json

Failures: a signer who is not a named guardian of the identity is refused, exit 1. An unknown request ID fails the command, exit 1.

keyset recovery cancel

Cancels a recovery request with any surviving admin or device key of the identity being recovered.

id keyset recovery cancel <REQUEST> --relay <FILE> [--client]
FlagArgumentDefaultMeaning
<REQUEST>request IDrequired positionalThe request ID.
--relayfile pathrequiredThe recovery relay file.
--clientswitchoffSign with the client key instead of the server key.

Example:

$ id keyset recovery cancel toy-request-id --relay ./toy-relay.json

Failures: a signer holding no surviving admin or device key of the identity is refused, exit 1. An unknown request ID fails the command, exit 1.

keyset recovery status

Shows where a recovery request stands. This is the one keyset subcommand with no --client flag; passing --client is a clap error, exit 2.

id keyset recovery status <REQUEST> --relay <FILE>
FlagArgumentDefaultMeaning
<REQUEST>request IDrequired positionalThe request ID.
--relayfile pathrequiredThe recovery relay file.

Example:

$ id keyset recovery status toy-request-id --relay ./toy-relay.json

Failures: an unknown request ID fails the command, exit 1.

keyset recovery complete

On the requesting device, completes a recovery that is ready by relaying the rotation to the successor keys.

id keyset recovery complete <REQUEST> --relay <FILE> [--client]
FlagArgumentDefaultMeaning
<REQUEST>request IDrequired positionalThe request ID.
--relayfile pathrequiredThe recovery relay file.
--clientswitchoffSign with the client key instead of the server key.

Example:

$ id keyset recovery complete toy-request-id --relay ./toy-relay.json

Failures: a request that is not ready — too few guardian approvals, or the recovery delay has not passed — fails the command, exit 1. An unknown request ID fails the command, exit 1.

peers

Discovers and lists known peers. It discovers other id servers via gossip-based networking, RPC queries to a running serve instance, or both, and supports depth-based recursive crawling to find peers-of-peers.

id peers [NODE] [OPTIONS]
FlagArgumentDefaultMeaning
[NODE]64 hex characters— (none; the local serve)Remote node ID to query. When set, queries this specific node instead of the local serve instance.
--gossipswitchoffGossip-only discovery: join the topic and collect announcements, bypassing RPC entirely. Useful when no local serve is running.
--rpcswitchoffRPC-only discovery: query the server’s ListPeers RPC. Fails if no local serve is running, unless a node ID is given.
--depthinteger, 0..1Recursive depth for peer-of-peer crawling. 0 = no crawl, 1 = query direct peers, N = recursively query up to N levels deep. A negative value fails: clap’s value parser rejects it (the handler also refuses a negative depth).
--max-peersinteger1000Maximum total peers to discover. A hard cap to prevent unbounded crawling.
--timeoutinteger (seconds)30Per-crawl timeout in seconds.
--bootstrapcomma-separated node IDs— (none)Node IDs for gossip bootstrapping, supplementary to DHT auto-discovery. These nodes are contacted first when joining the gossip topic.
--topicstringfrom defaults.json, else the constant id-peer-discovery-v1Gossip topic name for peer discovery. Use a custom topic for private networks.
--topic-secretstringfrom defaults.json, else the constant id-public-discovery-v1Shared secret for topic access control, used to encrypt DHT bootstrap records. The value is never echoed.
--no-default-bootstrapswitchoffSkip default bootstrap node IDs from defaults.json; only CLI-provided --bootstrap nodes are used.
--no-default-topicswitchoffSkip the topic and secret from defaults.json; fall back to the hardcoded constant values.
--no-relayswitchoffDisable relay servers and use direct connections only.
--no-mdnsswitchoffDisable mDNS local peer discovery, which is on by default.
--abuseswitchoffShow the local serve instance’s per-peer abuse counters instead of listing peers: frames and bytes admitted by the abuse evaluator, split by direction, with the policy rates shown alongside. Read-only. Local serve only; cannot be combined with --gossip or a remote [NODE]. The counters cover world-protocol traffic only: a serve running without --world records none and the report is empty.

Behaviour: the default mode is RPC-then-gossip: try RPC (query the local serve), then gossip as fallback. --rpc and --gossip each pin one mode. The topic and topic-secret defaults follow the same resolution as serve: file defaults from defaults.json are consulted first and the named constants are the fallback, which is why --no-default-topic exists (the same pattern as disagreement CLI-6 for serve).

Examples — list peers from the local serve, crawl three levels deep, and discover directly by gossip on a toy private topic:

$ id peers
$ id peers --depth 3
$ id peers --gossip --topic toy-net
$ id peers --abuse

Failures: an invalid [NODE] fails with invalid node ID: must be 64 hex characters, exit 1. --rpc with no local serve running and no node ID fails the command, exit 1. --abuse combined with --gossip or a remote [NODE] fails the command, exit 1. A negative --depth is a clap error, exit 2.

The interactive REPL

Source: https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-cli/src/repl/runner.rs, https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-cli/src/repl/input.rs, https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-cli/src/commands/repl.rs

The interactive REPL is a second command language inside the id binary. It does not reuse the clap parser described in The id command line. A line is whitespace-split and matched against literal patterns in runner.rs, so clap flags, clap defaults and --help do not exist inside the REPL except where a hand parser re-implements them. Global flags such as --data-dir must be given to id repl itself, before entering; they cannot be set from inside a session.

Entry

InvocationBehaviour
id (no subcommand)Starts the REPL with no session target.
id replStarts the REPL with no session target.
id repl [NODE]Starts the REPL with NODE as the session-level remote target. NODE must be a 64-character hex node ID.
id shellHidden alias for id repl.

An invalid session target fails startup before the prompt appears:

Error: invalid node ID: must be 64 hex characters

Startup failures of this kind, and failures to open the store, exit with status 1, like any other id handler error. Once the prompt is running, command failures never change the exit status; see “Error behaviour” below.

Modes

The mode is detected at startup and printed in the banner as id repl (<mode>).

ModeConditionWhere operations run
LocalNo serve is running for the data directory.Directly against the local store.
RemoteThe serve lock .iroh-serve.lock is present in the data directory.Proxied to the local id serve process.
RemoteNodeStarted as id repl <NODE_ID> with a valid node ID.Against that remote node for the whole session.

The session target is fixed at startup. In local-serve (Remote) mode, individual commands can additionally be aimed at another node with the @NODE_ID syntax described below.

The banner, and what it omits (CLI-12)

At startup the REPL prints a one-line command summary:

commands: list, put, get, cat, gethash, peers, help, quit

That line lists 8 commands. The dispatch in runner.rs implements 20 command groups. The banner omits delete, rename, copy, send, find, search, show, peek, the whole tag family, tags, and migrate-tags, all of which work and all of which the REPL’s own help command lists. This is disagreement CLI-12: the banner is the incomplete side; the dispatch table in this chapter is the complete one.

Command list

In the table, ◐ marks the commands that also accept an @NODE_ID target as the second token. All other commands run against the session target only.

CommandArgumentsBehaviour
list / ls ◐—List stored files.
put <FILE> [NAME] ◐File path, optional stored nameStore a file. NAME defaults to the file name. Only the put spelling accepts @NODE_ID; the in alias does not.
in <FILE> [NAME]File path, optional stored nameAlias of put (no @NODE_ID form).
get <NAME> [OUTPUT] ◐Stored name, optional output pathFetch a file. OUTPUT defaults to NAME; - writes to stdout.
cat <NAME> ◐Stored namePrint a file to stdout. Only the cat spelling accepts @NODE_ID.
output <NAME> / out <NAME>Stored nameAliases of cat (no @NODE_ID form).
gethash <HASH> <OUTPUT>64-hex content hash, output pathFetch by hash. Both arguments are required. - writes to stdout. No @NODE_ID form.
delete <NAME> / rm <NAME> ◐Stored nameDelete a stored file. REPL-only: the clap CLI has no delete command.
rename <FROM> <TO>Two stored namesRename a stored file. REPL-only. No @NODE_ID form.
copy <FROM> <TO> / cp <FROM> <TO>Two stored namesCopy a stored file to a new name. REPL-only.
send <NAME> <DEST_NODE> [DEST_NAME]Stored name, destination node ID, optional destination nameServer-to-server copy: the source server pushes with its own identity and no bytes pass through this client.
send --replace <NAME> <DEST_NODE> [DEST_NAME]As aboveAs above, archiving the old destination file first. --replace is recognised only in that exact second position.
peers ◐—List peers.
find <QUERY>... [flags]Queries plus hand-parsed flagsFind and fetch matches; see “Search commands” below.
search <QUERY>... [flags]Queries plus hand-parsed flagsList matches; fetches nothing.
show <QUERY>... [flags] / view ...Queries plus hand-parsed flagsShow match content.
peek <QUERY>... [flags]Queries plus hand-parsed flagsPreview match content.
tag set <FILE> <KEY> [VALUE]File, key, optional valueSet a file metadata tag. The head word may be tag, label or link; set may be add.
tag del <FILE> <KEY> [VALUE]File, key, optional valueDelete a tag value, or every value for the key when VALUE is omitted. del may be rm, remove, rem, delete or unset.
tag list [FILE] / tag ls [FILE]Optional fileList tags.
tags [FILE] / labels [FILE] / links [FILE]Optional fileBare forms of tag list.
tag search <QUERY>... / tag find <QUERY>...Structured query termsSearch tags; same structured syntax as the clap tag search in The tag family. A bare tag search with no query prints usage instead of erroring.
migrate-tags / migrate—Add the name/file auto-tags where missing; never overwrites.
help / ?—Print the REPL help text.
quit / exit / q—Leave the REPL; exit status 0.
!<cmd>Shell command lineShell escape; see below.

REPL-only commands

delete, rename, copy/cp, gethash (one word), the bare tags form, and the interactive match-selection prompt have no clap counterpart. The top-level CLI cannot delete, rename or copy a stored file at all; those operations exist only here and in the shared FileOps layer used by the web UI (see Data stores and schemas).

Conversely, the REPL has no serve, world, group, doc, claim, key, keyset, gallery or walk commands.

Tag commands: what the hand parser drops

The REPL tag commands accept no value-encoding flags. --value-hex and --value-file on tag set, --value-hex on tag del, and --hex, --binary and --no-truncate on tag list exist only in the clap commands in The tag family.

Search commands and their hand-parsed flags

find and search share one hand parser. show and peek have their own, smaller flag sets.

Flagfind / searchshow / viewpeek
--nameyesyes—
--allyesyesyes
--first [N]yesyesyes
--last [N]yesyesyes
--countyes——
--exclude <PAT>yesyesyes
--dir <DIR>yes (find output directory)——
--format <tag|group|union>yes——
--fileyes——
>FILE redirect tokenyes—yes
-o <FILE>—yesyes
--lines <N> / -n <N>——yes; default 5
--head-only / --tail-only——yes
--chars / --words——yes
--quiet / -q——yes

Queries are case-insensitive. Match quality is exact, then prefix, then contains, over name and hash. There is no glob matching.

The format default differs from the clap CLI (CLI-11)

In the REPL, find and search default to --format union. The clap id find and id search commands default to --format tag. The same query therefore prints union-deduplicated output interactively and tag-grouped output non-interactively. Neither side’s help mentions the other’s default, and the REPL help text lists no --format flag at all even though the hand parser accepts one. This is disagreement CLI-11; the code behaviour is as stated here.

Interactive match selection

With multiple matches and no --all, find and search prompt before fetching:

select numbers (e.g. '1 3 5' or '1,2,3') or enter to cancel

Entering numbers selects those matches. Pressing Enter with no input cancels the fetch.

Remote targeting with @NODE_ID

Syntax: @<64-hex> as the second token of the line.

list @NODE_ID
put @NODE_ID FILE
get @NODE_ID NAME
cat @NODE_ID NAME
delete @NODE_ID NAME
peers @NODE_ID

Rules:

  • Only list, put, get, cat, delete and peers accept the form.
  • Any other command written with an @NODE_ID second token falls into a catch-all that reports it as unsupported for remote targeting.
  • A malformed @… token is not treated as a target at all. It stays in the command words, so the line is then parsed as the plain command with that token as an ordinary argument.
  • Per-command targeting works in local-serve mode. A session started as id repl <NODE_ID> already has its target fixed; see “Modes” above.

The input language: substitution, pipes, here-strings, heredocs

Before dispatch, preprocess_repl_line in input.rs rewrites a line in this order: heredoc detection, then here-string, then the |> pipe, then $(…) and backtick substitution. The scans are quote- and nesting-aware: a << or |> inside a $(…) or backtick span is shell source, not REPL syntax.

FormExampleBehaviour
Command substitutionput $(date +%F) nameRuns sh -c on the inner command, captures stdout, and stores it under name. The captured text travels through the line as a __STDIN_CONTENT__:<text> marker token.
Backtick substitutionput `date +%F` nameSame capture as $(…).
Pipe-incmd |> put - nameRuns the left side as a shell command; its output becomes the put content. The - placeholder is the content slot. Only the |> spelling exists.
Here-stringput - name <<< 'text'Stores the literal text under name. Single and double quotes around the text are stripped.
Heredocput - name <<EOFEnters continuation mode; see below.

Capture is bounded. Oversized output and a non-zero exit from the substituted command are errors (ShellCaptureError) and the put does not happen.

Content with no name is an error:

error: content requires a name (e.g., put $(cmd) name.txt)

Heredocs

put - name <<EOF returns a need-more-input state. The runner then reads continuation lines and shows the prompt note:

(heredoc: type 'EOF' on its own line to end, Ctrl+C to cancel)
  • The delimiter may be quoted: <<'EOF' or <<"EOF".
  • Trailing text after the delimiter is an error: unexpected trailing text after heredoc delimiter.
  • An empty delimiter is an error: heredoc delimiter cannot be empty.
  • Ctrl+C cancels the heredoc. Ctrl+D ends it with what was read.

The pipe that does not exist (CLI-7)

The README’s REPL section shows:

> cat myfile.txt | head -5   # Pipe output to shell

That example does not work. The REPL implements exactly four operators — <<DELIM heredoc, <<< here-string, |> pipe-in, and $(…)/backtick capture — and dispatch splits on whitespace with no | handling. The line parses as cat with the extra arguments |, head and -5, matches no pattern, and is reported as an unknown command. To send REPL output to a shell tool, fetch the file with get first and run the tool outside the REPL, or use the shell escape below. This is disagreement CLI-7; the code behaviour is as stated here.

Shell escape

A line beginning with ! runs the rest of the line as a shell command:

!ls -la

The command runs as sh -c <cmd> with no REPL preprocessing: no substitution, pipe or heredoc handling is applied to it. A non-zero shell exit prints:

exit: <code>

The REPL continues after either outcome.

Leaving the REPL

InputBehaviour
quit, exit, qExit, status 0.
Ctrl+D (EOF)Exit, status 0.
Ctrl+C onceWarns.
Ctrl+C twiceExits, status 0.
Ctrl+C during a heredocCancels the heredoc; the REPL stays open.

History is provided by rustyline and is in-memory only. No history file is configured, so history does not survive the session.

Error behaviour

  • An unrecognised line prints unknown command: <line> followed by type 'help' for available commands, and the loop continues.
  • A command that fails prints error: <e> and the loop continues.
  • The REPL never exits non-zero because a command failed. The only non-zero exits are startup failures, which exit 1 before the prompt appears.

Worked example

Toy data: a node whose ID is written here as NODE_ID, and two small text files.

$ id repl
id repl (Local)
> put notes.txt shopping-list
> put $(printf 'milk\neggs\n') groceries.txt
> list
groceries.txt
shopping-list
> cat groceries.txt
milk
eggs
> printf 'bread\n' |> put - bakery.txt
> put - motto.txt <<< 'buy local'
> rename motto.txt slogan.txt
> copy slogan.txt slogan-copy.txt
> delete slogan-copy.txt
> tags slogan.txt
> !echo done
done
> quit

In a local-serve (Remote) session, the delete line could instead be aimed at another node as delete @NODE_ID slogan-copy.txt; in the Local session shown, that spelling would be reported as unsupported for remote targeting.

id-native-shell

Source: https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-native-shell/src/main.rs

id-native-shell is the second binary in pkgs/id: a Bevy desktop shell that connects to one world on one node and renders it in a window. It is a workspace member of pkgs/id but not a default member, so a normal id build never builds it. Unlike the id binary, which is parsed by clap, this binary has a hand-rolled argument parser with no clap dependency. The parser’s behaviour — including what it refuses — is the whole command-line surface.

For the terminal equivalent of the same connection, see World commands: joining and playing; for the browser equivalent, see The web UI: pages and HTTP API.

Usage

The usage string, verbatim:

usage: id-native-shell [--node <node-id> --capability <cap>] [--world <name>] [--addr <ip:port>]... [--no-relay]

Arguments

ArgumentValueRule
--node <node-id>64-hex node IDMust be given together with --capability.
--capability <cap>Capability stringMust be given together with --node.
--world <name>World nameSelects the world on the node.
--addr <ip:port>Socket addressRepeatable. Each occurrence adds a direct address and skips discovery for it.
--no-relayFlag, no valueDirect connections only; relay use is disabled.

The pairing rule

--node and --capability must be given together. Either one alone is an argument error: the usage text is printed to stderr and the process exits with status 2.

There is no way to connect with a node ID and no capability, and no way to supply a capability without naming its node, from this command line.

Environment

One environment variable is read by this binary:

NameEffect
ID_SHELL_FILE_READ_ROOTWhen set, configures an additional restriction on the native shell’s file-read root. When unset, the file-read root is not additionally restricted or configured by environment.

There is no --help and no --version

The parser recognises exactly the five arguments above. --help is not one of them, and neither is --version.

  • id-native-shell --help is an error: usage text on stderr, exit status 2.
  • id-native-shell --version is an error the same way.
  • Any unknown flag is an error the same way.

This is deliberate parser behaviour, not a missing feature flag: the hand-rolled parser has no help or version branch at all.

Exit behaviour

OutcomeExit status
Argument error (unknown flag, --help, --version, unpaired --node/--capability)2, usage text on stderr
Session-start failure2, error on stderr
Clean window close0

id-native-shell is the only binary in the workspace with a hand-coded exit code. The id binary exits 1 on handler errors and 2 only on clap parse errors; here both argument errors and session-start failures exit 2.

Starting unconnected

With no target — no --node/--capability pair — the window still opens. It opens on an empty view and announces that it is not connected. Nothing is rendered from any world until a connected invocation supplies a node and a capability.

Worked example

Toy data: a node whose ID is written here as NODE_ID, a guest capability written as CAP, and a world named lobby.

Connected, direct address, no relay:

$ id-native-shell --node NODE_ID --capability CAP --world lobby --addr 192.0.2.10:11204 --no-relay

Connected, discovery left to defaults:

$ id-native-shell --node NODE_ID --capability CAP

Unconnected (empty view):

$ id-native-shell

Failures:

$ id-native-shell --node NODE_ID
usage: id-native-shell [--node <node-id> --capability <cap>] [--world <name>] [--addr <ip:port>]... [--no-relay]
$ echo $?
2

$ id-native-shell --help
usage: id-native-shell [--node <node-id> --capability <cap>] [--world <name>] [--addr <ip:port>]... [--no-relay]
$ echo $?
2

The first failure is the pairing rule: --capability is missing. The second is the absence of a help flag: --help is an unknown flag to this parser.

The web UI: pages and HTTP API

Source: https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-web/src/routes.rs, https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-web/src/security.rs, https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-web/src/assets.rs, https://github.com/developing-today/code/blob/main/pkgs/id/web/package.json

The web UI is served by id serve --web. It lives in the id-web crate (crates/id-web) with a Bun + TypeScript frontend in pkgs/id/web. The main router has 54 distinct paths and 58 method bindings. A second, program-only router has 10 paths. Both are constructed in crates/id-web/src/lib.rs and routes.rs:

ConstructorSurface
create_routerThe main Explorer router below.
create_router_for_appThe Explorer router parameterised for one app.
create_program_routerThe program-only router: one listener pinned to one world.
Publication mountsA dynamic mount that rewrites a mounted path prefix into the program router inside the listener’s security layer. Publications are covered in serve and publications.

Serving defaults, from the CLI: --web is off by default, --port defaults to 3000, --bind defaults to 127.0.0.1. The repeatable --web-listen <IP:PORT> flag replaces the web_bindings list from the embedded defaults.json; see Configuration and environment. Multiple listeners can each be an Explorer listener, a program listener (program:<world>), or a document target.

Authentication and the security layer (WEB-15)

Every router is wrapped by security::protect in crates/id-web/src/security.rs. Four controls apply to every route, in this order:

  1. Bind. Loopback by default: the CLI --bind default is 127.0.0.1.
  2. Host allow-list. On loopback binds, the request Host must be localhost, 127.0.0.1 or ::1, plus any operator-configured extras. Other hosts are refused.
  3. Origin check. Any request carrying an Origin header must be same-origin: scheme, host and port must match, with no default-port expansion. The scheme counts as https only when the operator declared a TLS-terminating proxy via --web-cookie-secure.
  4. Token gate. When a token is configured (--web-token, or the environment variable ID_WEB_TOKEN), it is accepted in three forms: the cookie id_token, an Authorization: Bearer header, or a ?token= query parameter. The query form sets the cookie and then redirects to the clean path with the parameter removed. When no token is configured, this gate is open; id serve prints a warning at startup when a web listener is bound without --web-token.

Older documentation presents the web UI as an unauthenticated local tool and never mentions this layer. That is disagreement WEB-15: the Host allow-list, the Origin check and the token gate apply to every route in the code, and this chapter documents the code.

Body limits: a router-wide default body limit applies, and /api/upload overrides it with a larger route-scoped limit sized so that a file of exactly the maximum image size plus its multipart envelope fits.

Pages

Full HTML pages in the main router:

MethodPathPurpose
GET/Index / home: world list, globally-tagged documents, and a global-chat iframe.
GET/.well-known/id-transport-advertisementThe transport advertisement document.
GET/filesFile browser page.
GET/worldWorld page: the adapter surface for the hosted world. The path is the default; AppState.web_route parameterises it per app.
GET/settingsSettings page.
GET/peersDiscovered peers page.
GET/blocksOperator block-list page.
GET/groupsGroups page.
GET/edit/{*name}Editor/viewer for a file by name (wildcard).
GET/hash/{hash}Redirect from a content hash to its named file.
GET/view/{*name}Read-only view of a file by name.
GET/blob/{hash}Raw blob bytes with a Content-Type.

Correct route spellings (WEB-1)

The editor and view routes take a name, not a hash, and the name is a wildcard segment:

  • Edit: /edit/{*name}
  • View: /view/{*name}
  • Hash entry point: /hash/{hash}

WEB.md documents GET /edit/{hash} and GET /file/{name}. Neither route exists in the code. That is disagreement WEB-1; the spellings above are the routes routes.rs registers.

HTTP API and partials

MethodPathPurpose
GET/api/filesFile list, as an HTML partial for SPA navigation.
GET/api/home/feedHome feed partial.
GET/api/peersPeers partial.
GET, POST/api/blocksList blocks / create a block.
POST/api/blocks/removeRemove a block.
POST/api/saveSave editor content to the blob store.
POST/api/newCreate a new named file.
POST/api/renameRename, with optional archive of the original or replaced file.
POST/api/copyCopy a name to a new name.
POST/api/files/sendServer-side send of file references to another server.
POST/api/downloadDownload file content.
POST/api/deleteSoft-delete a file.
POST/api/restoreRestore a soft-deleted file. Returns 404 when the file is missing and 409 when it is not deleted.
POST/api/hard-deletePermanently delete a file.
POST/api/uploadImage upload, multipart, with the route-scoped body limit.
GET/api/imagesImage listing, paged, with a cursor clamped to the result set.
GET, POST, DELETE/api/tagsGet, set or delete tags. DELETE modes: exact match, all: true, and all_values: true. Binary values travel as value_b64. The tag wire protocol is in WebSocket protocols.
GET/api/tags/searchStructured tag search: q and ns parameters; key:, :value, key:value, quoted and bare terms, ANDed.
POST/api/identity/registerRegister a web client identity. Bounded by ID_WEB_MAX_IDENTITIES; see Configuration and environment.
GET/api/identity/meThe current identity.
POST/api/identity/nameUpdate the identity display name.
POST/api/seitan/inviteSeitan admission: create an invite.
POST/api/seitan/admitSeitan admission: admit with an invite.
GET/assets/{*path}Embedded static assets; see “Assets” below.

The delete pair is a web-layer construction: /api/delete and /api/restore implement soft delete on top of the FileOps hard delete described in Data stores and schemas.

World bridge HTTP routes

These 9 paths are merged into the main router always. The WebSocket socket path comes from [interfaces.web] in the app’s app.toml and defaults to /ws/world; see Configuration and environment.

MethodPathPurpose
POST/api/world/inviteMint a world guest invite. Fields: display_name, optional world, expires_in_secs, uses.
GET/api/world/host-viewHost view: snapshot, surface, and paged records. Paging uses an after cursor; the records revision is an FNV-1a 53-bit value.
GET/api/world/metricsWorld host metrics.
GET, POST/api/world/directoryDirectory read / signed directory write action.
GET/exploreScript-free HTML directory explorer: forms only, strict CSP default-src 'none'.
POST/explore/loginExplorer login: an admin token is exchanged for the id_explore session cookie, scoped to path /explore.
POST/explore/actExplorer directory action.
GET/inviteInvite landing page.
WS/ws/world (default socket)World session bridge; the frame protocol is in WebSocket protocols.

These 7 paths are merged into the main router always. Every one of them answers 404 unless a gallery was wired in with --gallery-dir or ID_GALLERY_DIR. The operator commands behind them are in Gallery, match-audit and walk.

MethodPathPurpose
GET/api/gallery/recordsSigned bundle records list. Filters: ?author= and ?name=.
GET/api/gallery/bundles/{content_hash}Bundle bytes, immutable cache. Answers 410 Gone, with a transparency entry, when the bundle is unlisted here.
GET/api/gallery/searchSearch with ?q=, ?category=, ?limit=. Result order: exact-name, then category, then most-recent-version.
GET/api/gallery/authors/{author}Author page by key.
GET/api/gallery/collectionsOperator-signed featured collections.
GET/api/gallery/collections/{operator}/{name}One collection.
GET/api/gallery/transparencyRemovals, refusals and reinstatements, plus the admission posture. Paging: ?after= and ?limit=.

WebSocket routes

PathProtocol
/ws/collab/{doc_id}Collaborative editing, binary MessagePack.
/ws/tagsTag-change broadcast, JSON text, server to client only.

Both protocols are specified in full in WebSocket protocols.

The program-only router

create_program_router serves one listener pinned to one world. It has 10 paths:

  • GET / — the program page.
  • GET /assets/{*path} — embedded static assets.
  • The full world bridge surface above (8 HTTP paths plus the world socket), bound at that world’s socket.

A publication mount serves exactly this router under a mounted prefix.

Content modes and themes

A file’s content mode is decided from its extension, and for text modes from its content:

ModeSelected forWire name
Media(Image|Video|Audio|Pdf)Media and PDF extensionsmedia
Rich.pm.json ProseMirror JSONrich
Markdown.md, .markdownmarkdown
Plain.txtplain
RawA long list of code and config extensions; also the default for unknown or missing extensionsraw
BinaryOnly when a text-mode file is not valid UTF-8binary

Editable modes: Rich, Markdown, Plain, Raw. Toolbar modes: Rich, Markdown, Plain. get_content_type maps extensions to MIME types and defaults to application/octet-stream.

The frontend ships exactly three DaisyUI themes, all on a #000000 background: sneak (default, blue #00aaff), arch (green #00ff00) and mech (orange #ff6600). The choice is stored in the localStorage key id-theme, applied as the data-theme attribute, cycled with Alt+T, and announced with a theme:change CustomEvent.

Assets: how they are built and served

Build, from web/package.json:

bun build src/main.ts --outdir=dist --minify --sourcemap=external --entry-naming=[name].[hash].js

CSS is built with the Tailwind v4 CLI from src/input.css to dist/styles.css. A manifest script then renames the stylesheet to its hashed name and writes the manifest the templates consume (AssetUrls).

Serving: web/dist is embedded into the binary at compile time with rust-embed (#[folder = "../../web/dist"], struct Assets) and served at /assets/{*path}. The checkout’s web/dist contains only a tracked .gitkeep; the assets are a build product, not source.

Asset naming and cache contract (WEB-4)

The cache contract is derived from the emitted file name:

FileCache header
main.<8 base36>.js and its .js.mappublic, max-age=31536000, immutable
styles.<8 lower-hex>.csspublic, max-age=31536000, immutable
Everything elseno-cache

WEB.md names the assets main.css and main.js. The build never emits either name. That is disagreement WEB-4; the hashed names above are what assets.rs recognises.

Worked example

Toy data: a node serving on the default port, with a web token set, and a file named shopping-list.txt.

Start the server (flags are specified in serve and publications):

$ id serve --web --port 3000 --web-token TOKEN

First visit with the token in the query string; the server sets the id_token cookie and redirects to the clean path:

GET /?token=TOKEN        → 302 → GET /
GET /                    → 200  (index page, cookie now set)

Read and edit the file by name:

GET  /view/shopping-list.txt   → 200  (read-only view)
GET  /edit/shopping-list.txt   → 200  (editor)
POST /api/save                 → 200  (editor content written to the blob store)
GET  /hash/0123abcd…           → 302  (redirect to the named file for that hash)
GET  /blob/0123abcd…           → 200  (raw bytes, Content-Type set)

A request from a disallowed host, or a cross-origin POST, is refused by the security layer before any handler runs — that refusal is the Host allow-list and Origin check above, not a per-route check.

WebSocket protocols

Source: https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-web/src/collab.rs, https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-web/src/tags_ws.rs, https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-web/src/world_ws.rs, https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-worlds/src/world_session/types.rs

id serve --web exposes three WebSocket protocols. Their routes are listed in The web UI: pages and HTTP API; this chapter is the wire reference for each.

SocketRouteEncodingDirection
Collab/ws/collab/{doc_id}Binary MessagePackBoth
Tags/ws/tagsJSON textServer to client only
World bridge/ws/world (default; from [interfaces.web])JSON textBoth

Collab: collaborative editing

Implementation: crates/id-web/src/collab.rs. Frames are MessagePack arrays of the form [tag, …fields], encoded and decoded with rmp_serde. The message type is CollabMessage.

TagNameDirectionFields
0InitServer → client[0, version, doc, mode]
1StepsClient → server[1, version, steps, clientID]
2UpdateServer → client[2, steps, clientIDs]
3AckServer → client[3, version]
4CursorBoth[4, clientID, head, anchor, name?, idleSecs?]
5ErrorServer → client[5, error]
6CursorRemoveServer → client[6, clientID]
7NewVersionServer → client[7, hash, name]
8AuthClient → server[8, token] — the first message after connect
9AuthOkServer → client[9, client_id, name, token?] — the token field carries a refreshed token when one is issued
10CheckpointClient → server[10, text] — publish a durable note-session checkpoint. Filename sessions refuse this message.
11CheckpointedServer → client[11, head] — head is the hex of the new note head revision
—Empty text ""BothCursor-refresh ping/pong for throttled inactive tabs; see the cadence below

Compatibility: a legacy Init frame without the mode field still decodes; mode defaults to raw.

The route parameter (WEB-6)

The route is /ws/collab/{doc_id}. The web/README connection flow names the parameter {file_path}. That is disagreement WEB-6: the registered route, and WEB.md’s own table, both use {doc_id}.

The documented tag table is six tags behind (WEB-5)

The web/README wire table lists tags 0–5 only, and gives Init as [0, version, doc]. The code defines tags 0–11, and Init is [0, version, doc, mode]. CursorRemove (6), NewVersion (7), Auth (8), AuthOk (9), Checkpoint (10) and Checkpointed (11) are absent from that README. The collab.rs module documentation is complete; the README is the stale copy. That is disagreement WEB-5.

Keepalive, timeouts and cleanup

ConstantValueBehaviour
PING_INTERVAL30 s of inactivityA Ping is sent every 30 s idle cycle.
EMPTY_TEXT_MESSAGE_EVERY_N_PINGS2Every 2nd ping cycle sends the empty text message "" instead of a Ping frame.
PONG_TIMEOUT30 minThe connection is closed after 30 min without a pong or message.
Cursor removal5 min after disconnectA disconnected client’s cursor is removed.
Document cleanup1 h after the last client leavesThe document’s in-memory collab state is cleaned up.

The empty-text cadence (WEB-8)

The web/README timeout section states that the server sends empty text messages instead of Ping frames. The code sends both: a Ping frame on each 30 s idle cycle, with every 2nd cycle’s Ping replaced by the empty text message. A client must therefore handle Ping frames and empty text frames on the same socket. That is disagreement WEB-8; the cadence in the table above is the code behaviour.

Worked example

Toy data: a document notes.pm.json, one client, one edit.

C→S  [8, "TOKEN"]                          Auth, first message after connect
S→C  [9, 41, "Ada", "TOKEN2"]              AuthOk: client_id 41, refreshed token
S→C  [0, 7, "notes.pm.json", "rich"]       Init: version 7, mode rich
C→S  [1, 7, <steps>, 41]                   Steps based on version 7
S→C  [3, 8]                                Ack: now at version 8
S→C  [2, <steps>, [42]]                    Update: steps from client 42
C→S  [4, 41, 120, 118, "Ada", 0]           Cursor at head 120, anchor 118
S→C  [7, "0123abcd…", "notes.pm.json"]     NewVersion after a save
C→S  [10, "draft text"]                    Checkpoint (note sessions only)
S→C  [11, "beef…"]                         Checkpointed: new head revision hex

A filename-based session that receives tag 10 refuses it; checkpoints exist only for note sessions.

Tags: tag-change broadcast

Route: /ws/tags. Implementation: crates/id-web/src/tags_ws.rs; the event type is TagEvent in crates/id-store/src/tags.rs. Frames are JSON text. The socket is server → client only: no inbound messages are expected.

TagEvent is serialised with #[serde(tag = "type")] and lowercase renames. The four kinds are:

typeFieldsMeaning
setns, subject, key, value?A tag value was set.
delns, subject, key, value?A tag value was deleted; value absent means the key’s values were deleted.
del_allns, subjectAll tags for the subject were deleted.
transferns, from, to, countcount tags moved from subject from to subject to.

Namespaces: ns is global (the default), node, or a custom paired (α/Ω) namespace. Tag values are arbitrary bytes on the store side; the REST surface in The web UI: pages and HTTP API carries binary values as value_b64.

The documented field names do not parse (WEB-7)

Both WEB.md and web/README show the event types capitalised — {"type":"Set"|"Del"|"DelAll"|"Transfer", …} — and name the transfer fields from_subject and to_subject. The code serialises lowercase type names (set, del, del_all, transfer), and the transfer fields are from, to and count. There are no from_subject or to_subject fields. A client written to the documents cannot parse real frames. That is disagreement WEB-7; the table above is the wire format.

Worked example

Toy data: a file named report.txt in the global namespace.

{"type":"set","ns":"global","subject":"report.txt","key":"status","value":"draft"}
{"type":"set","ns":"global","subject":"report.txt","key":"status","value":"reviewed"}
{"type":"del","ns":"global","subject":"report.txt","key":"status","value":"draft"}
{"type":"transfer","ns":"global","from":"report.txt","to":"report-final.txt","count":3}
{"type":"del_all","ns":"global","subject":"report-final.txt"}

World bridge: world session frames

Socket: /ws/world by default. The path is the app’s [interfaces.web] socket value; see Configuration and environment. The adapter is crates/id-web/src/world_ws.rs. The protocol itself is owned by id_worlds::world_session and is shared with the Iroh transport, so the same frames travel over both.

Rules that apply to every frame:

  • Frames are JSON text.
  • Each frame is bounded by MAX_FRAME_BYTES.
  • The first frame must arrive within the 10 s join timeout (SessionConfig::default). A client that connects and sends nothing for 10 s is dropped before it joins.
  • Client frames are the ClientFrame type, server frames the ServerFrame type, both in crates/id-worlds/src/world_session/types.rs, serialised with the serde tag type in snake_case.

Client frames: 43 kinds

KindNotes
joinFields: capability, optional after, screen_patches, screen_msgpack, resume_token, agent_profile, device_input.
infoSession information request.
metricsMetrics request.
recordsRecords request.
records_ticketRecords ticket request.
documentsDocument list request.
documentSingle document request.
download_moduleModule download.
download_module_adminModule download, admin form.
event_history_adminEvent history, admin form.
inviteCarries an admin_token.
directoryPublic directory request; no token.
list_worldsList worlds on the host.
create_worldCreate a world.
set_isolationSet a world’s isolation state.
set_cross_world_writeSet cross-world write.
force_cross_world_writeForce cross-world write on.
set_file_scopeSet file scope.
compileCompile a module.
update_capsUpdate capabilities.
set_caps_ceilingSet the capability ceiling.
set_scheduleSet a schedule.
cancel_scheduleCancel a schedule.
world_stateWorld state request.
set_execution_profileSet the execution profile.
execution_profile_infoExecution profile information request.
capsCapability query.
chatChat post. May carry screen_revision, the stale-decision token checked by the policy layer in The MCP bridge.
form_resultA submitted form result.
attenuateAttenuate a capability.
delegate_to_friendDelegate to a friend.
inputProgram input; the payload travels as data_hex.
resizeTerminal/surface resize.
pastePaste input.
screen_subscribeSubscribe to a screen region and/or to event classes.
pointerPointer input.
hoverHover input.
install_beginBegin a module install upload.
install_chunkOne install chunk.
install_endFinish a module install upload.
revokeRevoke a capability.
provider_offerProvider offer.
provider_replyProvider reply.

Server frames: 35 kinds

KindNotes
snapshotFull world snapshot.
eventA world event.
provider_requestA provider request to the client.
form_result_statusStatus of a form result.
viewScreen view: data/surface/patch, plus view_revision and resume_token.
semantic_diffA semantic diff of the screen state.
screen_subscriptionA screen subscription delivery.
module_infoModule information.
metricsMetrics reply.
recordsRecords reply.
records_ticketRecords ticket reply.
documentsDocuments reply.
documentDocument reply.
module_beginBegin a module download.
module_chunkOne module chunk.
module_endEnd a module download.
event_history_beginBegin an event history download.
event_history_eventOne event history entry.
inviteInvite reply.
worldsWorld list reply.
world_createdA world was created.
isolationIsolation state.
policyPolicy state.
capsCapability reply.
execution_profileExecution profile reply.
caps_ceilingCapability ceiling reply.
schedulesSchedules reply.
world_stateWorld state reply.
compiledA compile finished.
upload_readyThe host is ready for an install upload.
module_installedA module was installed.
revokedA capability was revoked.
program_changedThe program changed.
errorAn error. May carry a stable code, for example actor_denied.
input_refusedAn input frame was refused.

Contract revisions

Two contract revisions are referenced in the code:

  • Revision 11 — agent profiles and semantic diffs. The subscribable event classes are chat_posted, input_applied, object_changed, system_event and program_changed. Two further change kinds exist and are not subscribable: region_changed and notification.
  • Revision 12 — negotiated binary MessagePack screen patches. This revision applies only on byte-capable transports.

Worked example

Toy data: a guest joining the world lobby with capability CAP.

{"type":"join","capability":"CAP"}
{"type":"snapshot", "…": "full world snapshot"}
{"type":"view","view_revision":1,"resume_token":"…"}
{"type":"chat","text":"hello from a toy client"}
{"type":"event", "…": "chat event broadcast"}
{"type":"screen_subscribe","event_classes":["chat_posted","object_changed"]}
{"type":"error","code":"actor_denied"}

The last frame shows the failure shape: an error server frame whose code is a stable string (actor_denied), not free text to parse. A refused input frame is reported separately, as an input_refused frame, not as an error.

The hosted Worker API

Source: https://github.com/developing-today/code/blob/main/pkgs/id/hosted-worker/src/worker.ts, https://github.com/developing-today/code/blob/main/pkgs/id/hosted-worker/src/user-do.ts, https://github.com/developing-today/code/blob/main/pkgs/id/hosted-worker/wrangler.toml, https://github.com/developing-today/code/blob/main/pkgs/id/worker-poc/README.md

This chapter documents the hosted Worker as it stands. Two packages exist, and neither is a live service:

PackageStatus
pkgs/id/hosted-workerA local-only scaffold. Not deployed.
pkgs/id/worker-pocA completed proof of concept. Not a production path.

Disposition: local-only scaffold, not deployed

The header of hosted-worker/wrangler.toml states the position in full:

LOCAL ONLY: this config is for wrangler dev / tests. No account-level deployment, production binding, or billable resource is authorized by this package — deployment and the real-account jurisdiction canary are gated on #2285 / #3403.

Two consequences follow from that gate:

  1. There is no production deployment, no production binding, and no billable resource for this package.
  2. Local workerd does not implement jurisdiction restrictions. The app worker therefore fails closed: every fully-valid request run locally is answered 503 with the error jurisdiction_unavailable, by design. A local 503 jurisdiction_unavailable is the expected result of a correct request, not a bug.

Deployment stays gated on issues #2285 and #3403 until both close.

What it would host, and for whom

The hosted data plane for bound hosted-edition users. There is one UserDO Durable Object per binding_id, holding that user’s:

  • per-user key/value store,
  • blob references (the bytes live in R2),
  • a signed-object bridge store that acts as a sync peer: it holds signed objects and fork evidence, assigns no order, re-signs nothing, and serves no authoritative snapshot.

The front door

src/worker.ts (73 lines) is the entry point. It does not authenticate users itself. It consumes an already-authenticated resolved context set by an authenticated internal caller; the binding ceremony that produces that context is native code, in pkgs/id/src/hosted_binding.rs.

Request handling, in order:

  1. Read the resolved context headers X-Binding-Id and X-Jurisdiction (and X-Iroh-Id).
  2. Strip every client-supplied internal header.
  3. Re-set the internal headers itself: x-hosted-binding-id, x-hosted-jurisdiction, x-hosted-routed: restricted, x-hosted-iroh-id.
  4. Enforce the front-door body limit (see USER_CEILING_BYTES below; the cap is 100 MiB).
  5. Forward to the per-user Durable Object through the jurisdiction-restricted namespace only.

Routing rules in src/routing.ts — the only module that touches the raw USERS namespace:

  • Durable Objects are named by binding_id: 32 lowercase hex characters.
  • Objects are never named by email or by provider subject.
  • There is no unrestricted fallback. If the restricted namespace cannot serve the request, the request fails; it is not retried against an unrestricted namespace.

Bindings

From wrangler.toml: Worker name id-hosted-worker, compatibility_date 2025-06-01.

Binding / varTypeNotes
USERSDurable Object namespace → UserDOMigration tag v1, new_sqlite_classes = ["UserDO"].
BLOBSR2 bucket id-hosted-blobsContent-addressed blob bytes. Local emulation only. In the UserDO interface the binding is optional, and the code that needs it fails closed without it.
USER_CEILING_BYTESString var, optionalPer-user storage ceiling. Absent or empty means no ceiling. A malformed value fails writes closed. Also read by the front door for the body limit: MAX_BODY_BYTES is a 100 MiB cap.
BRIDGE_WAITING_PER_AUTHORString var, optionalBridge waiting-pool bound, per author. Absent means the native default in bridge-store.ts. A malformed value fails bridge writes closed.
BRIDGE_WAITING_TOTALString var, optionalBridge waiting-pool bound, total. Same default and failure rule.
BRIDGE_WAITING_MAX_AGE_MSString var, optionalBridge waiting-pool bound, maximum age in milliseconds. Same default and failure rule.

Test harness: wrangler.test.toml defines a separate Worker, name id-hosted-worker-test, main src/test-harness.ts, with binding TEST_USERS → UserDO, bucket id-hosted-blobs-test, and USER_CEILING_BYTES = "1073741824". It is test-only and is never an application entry point.

UserDO routes

Implementation: src/user-do.ts. There are 13 paths and 15 method routes.

Every route first runs a common guard:

  1. The routing context is present.
  2. The runtime jurisdiction matches the routed jurisdiction.
  3. The persisted (binding_id, jurisdiction) pair matches. That pair is bound immutably by the first routed request and cannot be changed by later requests.

The object’s SQLite schema is SCHEMA_VERSION = 3, with tables meta, kv and blobs, plus the bridge schema listed in Data stores and schemas.

MethodPathPurpose
GET/v1/statebinding_id, jurisdiction, schema_version, object name.
GET/v1/usageUsage, ceiling, and at_cap.
GET/v1/exportFull KV plus blob index export. Stays available at cap, by design.
PUT/v1/kv/{key}Per-user KV write. The key must match [A-Za-z0-9._-]{1,128}.
GET/v1/kv/{key}KV read.
DELETE/v1/kv/{key}KV delete. Available at cap.
PUT/v1/blobsStore a content-addressed blob. The key is the SHA-256 hex of the content. Bytes are deduplicated across users in R2; each user gets a per-user reference row.
GET/v1/blobs/{64-hex}Fetch a blob this user references.
DELETE/v1/blobs/{64-hex}Drop this user’s reference only. The R2 bytes are deliberately not deleted; garbage collection is a separate, unimplemented family of work.
GET/v1/bridge/challengeIssue a single-use ID-key proof nonce for the bridge.
GET/v1/bridge/headsBridge chain heads. Requires a fresh ID-key proof per call.
POST/v1/bridge/pushIngest a batch of signed events. Per-event outcomes: accepted, duplicate, fork, waiting, refused.
POST/v1/bridge/pullPull events beyond per-author positions. Returns a binary batch, with x-bridge-more and x-bridge-heads headers.
GET/v1/bridge/exportExport sets for the native build_export. Answers 502 naming the hash if R2 cannot produce a cited blob.
WS/v1/bridge/wsBridge session: in-band CHALLENGE/AUTH, binary frames only.

Failure shapes:

  • Any other path or method: 404 with body {"error":"not_found"}.
  • Locally, any fully-valid request: 503 with jurisdiction_unavailable (see “Disposition” above).
  • Bridge routes additionally fail closed when the binding record names no ID (Iroh root) key.
  • A KV key outside [A-Za-z0-9._-]{1,128} is not a valid route key.
  • A blob path whose segment is not 64 hex characters does not name a blob.

The README route list is a first-slice fossil (WEB-9)

The hosted-worker README describes the UserDO routes as GET /v1/state and PUT|GET /v1/kv/<key>, calls the KV store minimal, and states that R2 blobs, metering and caps are later steps and out of scope. The code implements blobs (PUT, GET, DELETE), usage and metering, export, KV DELETE, and the full bridge. The README’s later sections cover the bridge and export but never revise that paragraph, and blobs, usage and KV-delete appear in no README route list. That is disagreement WEB-9; the table above is the implemented surface.

In-package surfaces that the front door does not route

These modules exist in the package but are not routed by worker.ts:

ModuleWhat it is
src/provisioning.ts, src/provisioning-surface.tsThe provisioning surface.
src/account-directory.tsAccount directory.
src/admission-gate.tsAdmission gate.
src/export.tsExport support behind /v1/bridge/export.
src/currency/{gateway,ledger,relay,crypto}.tsA currency gateway proof of concept. Its own documentation states it is “not the permanent currency service”: an in-process ledger stub modelled on TigerBeetle, gateway-signed balance snapshots, and a UserDO relay that reconciles by request-ID lookup.

worker-poc: a completed proof, not live

pkgs/id/worker-poc is a proof of concept for issue #2271: run one example world unmodified in a Worker isolate and prove journal equality against the native wasmtime host. All of its acceptance boxes are checked (2026-11-01). Nothing in it is a production path.

Its Worker (src/worker.ts) exposes a WorldObject Durable Object (binding WORLD, migration v1-sqlite, with a CompiledWasm rule for the prebuilt guest):

MethodPathPurpose
POST/stepApply one step. Body: {participant, event}.
POST/cold-startCold-start the object.
GET/stateRead the state.

The SQLite journal table is the source of truth. The hosted loader (src/manifest.ts) refuses a manifest with portability=native, and refuses a manifest declaring more than 64 MB of memory, up front.

The d1-journal-poc/ subfolder is a second, local-only D1 fit probe. It uses a placeholder database ID and always runs --local. Binding DB (D1):

MethodPathPurpose
GET/healthHealth check.
POST/appendAppend a journal entry.
GET/snapshotRead a snapshot.
GET/tailRead the journal tail. Journal header version is 1; entries include created and caps_granted. A D1 bookmark is not a stream cursor.

Worked example

Toy data: a bound user with binding_id written here as BINDING_ID, run under the local test harness, where the ceiling is 1073741824 bytes.

PUT  /v1/kv/profile.name        body: "Ada (toy)"   → 200
GET  /v1/kv/profile.name                            → 200  "Ada (toy)"
PUT  /v1/blobs                  body: <toy bytes>   → 200  (SHA-256 hex key returned)
GET  /v1/usage                                      → 200  {usage, ceiling: 1073741824, at_cap: false}
GET  /v1/export                                     → 200  (KV plus blob index)
DELETE /v1/kv/profile.name                          → 200
DELETE /v1/blobs/<64-hex>                           → 200  (reference dropped; R2 bytes remain)
GET  /v1/nope                                       → 404  {"error":"not_found"}

The same sequence against the local app worker (not the test harness) stops earlier: each fully-valid request is answered 503 jurisdiction_unavailable, because local workerd has no jurisdiction restriction support and the worker fails closed. That is the designed local behaviour until the #2285 / #3403 gates clear.

The MCP bridge

Source: https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-caps/src/mcp_bridge.rs, https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-caps/src/mcp_policy.rs

This chapter documents the MCP bridge as it stands. The short version: there is a translator and a policy layer, and there is no server.

What does not exist

  • There is no MCP server in pkgs/id: no standalone server binary.
  • There is no MCP transport: no stdio transport and no HTTP transport.
  • There is no JSON-RPC tools/list implementation.
  • There is no mcpx or home wiring for ID. Searching home/common/mcpx-settings.nix finds no ID or world MCP server at all; its remote MCP entry is Atlas Search, with a gate token from services.mcpx.environmentFile. Neither home/ nor nixos/ contains an ID MCP entry.
  • There is no gate-token environment variable for the ID MCP bridge. The bridge reads no environment variables. The nearest authentication environment names are the world and web ones in Configuration and environment — ID_WORLD_CAPABILITY, ID_WORLD_ADMIN_TOKEN, ID_WEB_TOKEN — and the bridge itself never reads any of them.

What a reader would need for a live MCP client

A live MCP client needs a server process speaking MCP over a transport, advertising a tool list it can call. None of that exists for ID today. To use an agent with an ID world now, the agent must speak the world session protocol directly — the frames in WebSocket protocols — or be driven through the library translator below by a host that supplies its own transport. The design for a live bridge is carried in the design chapter Design: agents in worlds and the MCP bridge; nothing in this chapter should be read as a connection recipe.

What exists: the id-caps translator

id_caps::mcp_bridge is a library-level translator plus id_caps::mcp_policy, a host-side policy point. Together they are the “agent-in-worlds” spike surface. They are exercised by pkgs/id/tests/mcp_bridge_e2e.rs and pkgs/id/tests/mcp_spike_e2e.rs.

The bridge is authority-free:

  • It translates one MCP tool call into one world-session client frame (JSON), into a locally-rendered answer built from observed server frames, or into a session close.
  • It holds no credentials. The only value it touches that resembles a secret is the agent’s own join capability, which it passes through into the join frame.
  • It consumes three kinds of observed server frame — view, semantic_diff and screen_subscription — and ignores all others by design.

Pinned tool definitions

Tool definitions are pinned at session start by SHA-256 over their canonical JSON (BridgeSession::start / verify_definitions). If the definition set changes, the session terminates permanently. This is an anti-poisoning rule: a tool list that changes mid-session is treated as hostile, not as an update.

The 8 v1 tools

v1_tool_definitions() in mcp_bridge.rs defines 8 tools, in this pinned order.

#ToolMaps toCeiling keyParametersBehaviour
1world.joinsession.presencepresencecapability: string (required), after: u64 (optional)Sends {type:"join", capability, after, agent_profile:true}. A second join returns AlreadyJoined.
2world.leavesession.presencepresencenoneNo frame exists for leaving: returns ToolAction::Close. Presence is connection-scoped, so leaving is closing.
3screen.readscreen.readscreen.readnoneLocal answer: the latest full view text plus pending semantic-diff changes. Reading drains the pending changes. Sends no frame.
4screen.subscribescreen.subscribescreen.readregion (optional: {x, y, width, height}, all u64), event_classes (optional string array). At least one of the two is required.Sends {type:"screen_subscribe", …}.
5object.inspectobject.inspectscreen.readentity_ref (required, any JSON value; keyed by its JSON string)Local answer from observed object_changed diffs. When nothing is known: "object not in the observed screen state". Sends no frame.
6program.invokeinputprogram.invokeprogram: non-empty string, object: non-empty string, arguments: string, screen_revision: optional u64Sends exactly one {type:"input", data_hex: hex(arguments), screen_revision?} frame. No chaining: one call, one frame. program and object are validated here and allowlist-enforced by the policy layer.
7chat.postchat.postchat.posttext: string (required), screen_revision: optional u64Sends {type:"chat", text, screen_revision?}.
8presence.setpresence.setpresence—Listed but unimplemented in v1: always refused. See below.

Session rule: every tool except world.join requires a joined session. Calling one before joining returns NotJoined.

Forbidden tool names

Five names are explicitly not tools (FORBIDDEN_TOOL_NAMES in mcp_bridge.rs):

capability.mint
credential.read
audit.mutate
world.export
host.exec

Any other unrecognised name returns BridgeError::UnknownTool. The forbidden list and the unknown-tool error are different answers: a forbidden name is a name the surface has considered and excluded; an unknown name was never part of the surface.

presence.set: a pinned tool the bridge always refuses (WEB-13)

presence.set is one of the 8 pinned v1_tool_definitions(), so a client discovering the surface is offered it. Calling it always fails: tool_action refuses it unconditionally with BridgeError::NoFrameMapping. The reason is structural — presence is the join. There is no presence frame in the world session protocol to map the call onto. That is disagreement WEB-13: the v1 surface lists a tool that can never succeed in v1.

The policy layer: PolicySession

id_caps::mcp_policy provides PolicySession, which wraps a BridgeSession on the host side. Every action passes three steps, in order:

  1. Capability-ceiling check. The action must be inside the session’s ceiling.
  2. Quota charge, before execution. The charge is taken first; an action that cannot pay does not run.
  3. Signed audit. Exactly one hash-chained, journal-key-signed audit event per action — refusals included. A refused action produces an audit event and no frame.

Two further rules are enforced in the same layer:

  • Stale-decision rule. A screen_revision supplied with chat.post or program.invoke must name the latest observed revision. An older revision is refused.
  • Rate limits. Per-tool sliding-window rate limits.

The grant: RoleGrant

The ceiling and quota come from a RoleGrant, set by the owner at grant time and never widened by the session:

FieldMeaning
agent_key[u8; 32], the agent’s key.
agent_labelThe agent’s label.
ownerThe granting owner.
worldThe world the grant covers.
capability_refThe delegation/grant record ID, stamped on every audit event.
ceilingA CapabilityCeiling.
quotaA Quota.
rate_limitsA list of RateLimit{tool, max_calls, window_secs}.

CapabilityCeiling has four sets — tools, worlds, object_classes, program_allowlist — all BTreeSet<String>. Anything unnamed in the relevant set is outside the ceiling.

Quota axes and charges

Quota has three axes: frames, tool_calls, program_invocations.

Actiontool_callsframesprogram_invocations
Any admitted action1——
world.join11—
screen.subscribe11—
chat.post11—
program.invoke111
screen.read, object.inspect100
world.leave000

world.leave is never refused by ceiling or quota and is charged nothing. It is still audited.

Quota exhaustion parks the agent

When a quota axis is exhausted, the agent is parked: the policy layer emits the first-class world event

QUOTA_PARK_EVENT = "agent parked, quota exhausted"

as a ParkEvent{kind: "agent_parked", reason: "quota_exhausted", …}. Parking is a world-visible state, not a silent refusal: other participants can observe that the agent stopped because its quota ran out.

Audit outcomes and refusal shapes

AuditOutcome records what happened to each action:

OutcomeMeaning
ExecutedThe action ran.
RefusedCeilingOutside the capability ceiling.
RefusedQuota{axis}A quota axis could not pay; axis names which one.
RefusedParkedThe agent is already parked.
RefusedStaleInput{token, current}The supplied screen_revision (token) is not the latest observed revision (current).
RefusedRateLimit{tool, max_calls, window_secs}The tool’s sliding-window limit was hit.
Bridge-error refusalsThe underlying bridge returned an error, for example NotJoined, AlreadyJoined, UnknownTool or NoFrameMapping.

The agent is the audit subject, never its editor: the audit log and the spend figures are exposed to the agent read-only.

Worked example

Toy data: an agent labelled toy-agent, granted a ceiling naming the tools world.join, world.leave, screen.read, chat.post, the world lobby, and a quota of 10 tool calls.

world.join      {capability: "CAP"}        → frame {"type":"join","capability":"CAP","agent_profile":true}
                                             audit: Executed (charge: 1 tool call, 1 frame)
screen.read     {}                         → local answer: latest view text; no frame sent
                                             audit: Executed (charge: 1 tool call)
chat.post       {text: "hello", screen_revision: 3}
                                           → frame {"type":"chat","text":"hello","screen_revision":3}
                                             audit: Executed (charge: 1 tool call, 1 frame)
chat.post       {text: "again", screen_revision: 3}     (revision 4 has since been observed)
                                           → no frame
                                             audit: RefusedStaleInput{token: 3, current: 4}
presence.set    {…}                        → no frame
                                             audit: bridge-error refusal, NoFrameMapping
capability.mint {…}                        → no frame; forbidden name, not a tool
world.leave     {}                         → ToolAction::Close; no charge
                                             audit: Executed

After the tenth charged tool call, the next chargeable action is refused with RefusedQuota and the agent is parked with the agent_parked / quota_exhausted world event.

Configuration and environment

Source: https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-config/src/lib.rs, https://github.com/developing-today/code/blob/main/pkgs/id/config/id-config-v1.schema.json, https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-cli/src/server_config/mod.rs, https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-core/src/defaults.json

ID has five distinct configuration surfaces, and they are not interchangeable:

SurfaceFormWho reads it
Environment variablesProcess environment, 66 named variablesThe id binary, its crates, benches and tests
The id-config v1 documentJSON, parsed in memoryThe id-config crate; no file location, no loader
The server-config fileTOML, operator-chosen pathid serve --server-config <path>
Embedded defaults.jsonJSON, compiled into the binaryServe/peers discovery and web bindings
[interfaces.web] in app.tomlTOML, per appThe web layer, for one app’s route and socket

Environment variables: the complete table

66 named variables are read across the tree: 29 production/build, 20 bench, 17 test. The production set is given in full below, with read site and the behaviour when the variable is unset. Bench and test variables are summarised by family. A further six hosted-Worker bindings, one dynamic credential scheme, and three variables the process writes follow the tables; none of those are counted in the 66.

Production and build variables (29)

#NameRead siteDefault behaviour when unset
1ID_WEB_TOKENclap env for --web-token, crates/id-cli/src/cli/mod.rsNo web gate token; the web UI is ungated (and serve warns). See The web UI: pages and HTTP API.
2ID_WEB_COOKIE_SECUREclap env for --web-cookie-secure, cli/mod.rsfalse.
3ID_WEB_MAX_IDENTITIEScrates/id-web/src/identity.rs (MAX_IDENTITIES_ENV)10000. The value none means unbounded. 0 or an unparsable value warns and falls back to 10000.
4ID_WORLD_ADMIN_TOKENclap env in cli/mod.rs and throughout cli/world.rs (values hidden)World admin frames and invites are disabled unless the flag is given.
5ID_WORLDclap env in cli/world.rs, on many subcommandsUnset. One subcommand (world replica) defaults it to lobby.
6ID_WORLD_CAPABILITYclap env in cli/world.rs (values hidden)The capability must come from the --capability flag.
7ID_WORLD_SOURCE_ONLYclap env for --world-source-only, cli/mod.rsfalse.
8ID_GALLERY_DIRclap env in cli/mod.rs and cli/gallery.rsNo gallery is served.
9ID_GALLERY_ACCEPT_PUBLISHclap env, cli/mod.rsfalse. Requires a gallery directory.
10ID_ROC_BINclap env in cli/mod.rs and cli/world.rs; env::var in id-web world bridge, id-worlds compile, and serveFalls back to a roc binary found on PATH or in roc-home candidates.
11ID_ROC_PLATFORMclap env in cli/mod.rs and cli/world.rs; env::var in world commands and serveFalls back to ./examples/roc-world.
12ID_WORLD_COMPILE_CACHE_DIRcrates/id-cli/src/commands/serve.rsUnset or empty: the shared compiled-world cache is disabled. The cache is opt-in.
13ID_WORLD_COMPILE_CACHE_LRU_BYTEScommands/serve.rsThe id-worlds cache default, 2 GiB. An unparsable value falls back to the default.
14ID_APPS_DIRcommands/serve.rs (var_os)Falls back to the built-in apps root.
15ID_PUBLICATIONS_FILEcrates/id-cli/src/publications.rs (var_os)Falls back to the default publications file path.
16ID_SHELL_FILE_READ_ROOTcrates/id-native-shell/src/main.rsThe native shell file-read root is not additionally restricted or configured by environment. See id-native-shell.
17RUST_LOGsrc/main.rsWhen no CLI log level is set, the filter is debug plus noisy-module filters. Log-level resolution order is in The id command line.
18LOG_LEVELsrc/main.rsParticipates in log-level resolution; unset means ignored.
19DEBUGsrc/main.rsA truthy value raises the log level in resolution; unset means ignored.
20ID_LOG_FORMATsrc/main.rs (structured logging)Historical plain-text stderr logging. Recognised values: text, json.
21ID_LOG_FILEsrc/main.rsNo log file.
22ID_LOG_FILE_LEVELsrc/main.rsThe log file uses the main level.
23ID_LOG_TZsrc/main.rsThe default timestamp timezone.
24HOMEid-worlds compile, world commands, CLI integration test helperUsed for roc-home candidates and home resolution; the test falls back to /home/user.
25PATHid-worlds compile and world doctor (split_paths)An empty path list.
26TIGERBEETLE_POC_BINARYsrc/currency_poc/harness.rs (BINARY_ENV, var_os)Proof-of-concept harness only: no external TigerBeetle binary.
27CARGO_MANIFEST_DIRbuild.rs, plus compile-time env! in tests and helpers".".
28CARGO_FEATURE_WEBbuild.rsUnset means the web feature is off and the build script skips the web asset step.
29PROFILEbuild.rs"".

Notes on the logging set: an unrecognised ID_LOG_FORMAT or ID_LOG_TZ value, or a log file that cannot be opened, warns on stderr and logging continues without that piece. Blank flag and environment values count as unset in log-level resolution.

Bench variables (20), by family

All are read only by benches/world_bench.rs.

FamilyVariablesDefault behaviour
Guest burn / framesID_BENCH_GUEST_BURN_CONCURRENCY, ID_BENCH_FRAME_EVENTSHelper-parsed; unset means the committed bench value.
ProvenanceID_BENCH_MACHINE_CLASS (default fleet-laptop), ID_BENCH_GIT_SHA (falls back to GITHUB_SHA, then a computed value), GITHUB_SHA, ID_BENCH_TOOLCHAIN (default unknown), ID_BENCH_RESULTS (default results.jsonl)As stated.
Many-worldsID_BENCH_MW_IDLE_WORLDS (1000), ID_BENCH_MW_ACTIVE_WORLDS (100), ID_BENCH_MW_EVENTS_PER_SECOND (20), ID_BENCH_MW_DURATION_SECS (10)Parsed by one helper with the stated literal defaults.
StressID_BENCH_STRESS_TIER, ID_BENCH_STRESS_SEED, ID_BENCH_STRESS_OUT, ID_BENCH_STRESS_MEM_PART (all), ID_BENCH_STRESS_IDLE_WORLDS, ID_BENCH_STRESS_ACTIVE_WORLDS, ID_BENCH_STRESS_ACTIVE_EVENTS, ID_BENCH_STRESS_HOT_EVENTS, ID_BENCH_STRESS_HOT_MEMBERSParsed by one helper with a per-tier default.

Test variables (17), by family

Read only in tests, test helpers, or test configuration. None affects a production run.

VariablesWhere
ID_FED_NODE_Bid-sync substrate transport test; unset means the test peer B is absent.
BAKEOFF_RESULTSid-store graph-encoding bakeoff; unset means no results file is written.
CARGOid-store store-traits test; default cargo.
SCREEN_PARITY_GENERATEid-core screen parity test; unset means the parity corpus is not regenerated.
ID_TEST_FAKE_SHid-worlds compile test helper, also set by flake.nix; unset means the real shell.
TERRITORY_WASMid-worlds sandbox test; unset means the test module is not loaded.
ID_IDENTITY_PROBE_PATHid-web identity tests; unset means the probe is not run.
WORKER_POC_REFERENCE_OUTWorker PoC reference test; unset means the reference JSONL is not written.
PROPTEST_CASES, PROPTEST_RNG_SEEDProperty tests; unset means the proptest default case count and a random seed.
ID_BINARY, ID_TEST_EXAMPLES_DIR, ID_TEST_APPS_DIRCLI integration tests; unset means the built binary path and the in-tree examples/apps directories.
ID_TUPLE_FUZZ_CASESTuple property tests; unset means the default case count.
ID_E2E_WORLD_ADMIN_TOKENPlaywright config (TypeScript); unset means the config-file fallback token.
UPDATE_EXPORT_FIXTUREHosted-worker export test (TypeScript); unset means the fixture is not regenerated.
Playwright runner variables: TEST_PORT (4173), NIX_BUILD_TOP, PLAYWRIGHT_VM_TEST, CHROMIUM_BASE_URL, FIREFOX_BASE_URL, CIRead by e2e/playwright.config.ts, as coded there.

Hosted-Worker bindings (not process environment)

The hosted Worker reads Cloudflare Env bindings, not process environment variables: USERS, BLOBS, USER_CEILING_BYTES, BRIDGE_WAITING_PER_AUTHOR, BRIDGE_WAITING_TOTAL, BRIDGE_WAITING_MAX_AGE_MS, plus test-only TEST_USERS. They are specified in The hosted Worker API.

The dynamic env:<VAR> credential scheme

One reader names no fixed variable. The EnvCredentialResolver in src/foreign_libsql.rs resolves any credential reference string of the form env:<VAR> from configuration, looking up <VAR> in the process environment. The variable name is data, not code, so no name can be listed for this reader. (Its own test uses TEST_LIBSQL_TOKEN.) A configuration that carries env:MY_TOKEN therefore reads the variable MY_TOKEN at resolve time; the secret value itself never appears in the configuration.

Variables the process writes

Three variables are set by ID, not read by it. When id serve --world-mail-command <PROG> runs a confirmation-mail command, the child process receives:

NameContent
ID_MAIL_TOThe recipient address for that confirmation.
ID_MAIL_SUBJECTThe confirmation subject.
ID_MAIL_BODYThe confirmation body.

These are set in crates/id-directory/src/directory_mail.rs during construction of the child’s environment. That construction is the only production set_var path in the tree.

The id-config v1 document

The id-config crate defines the canonical versioned configuration contract: a ConfigDocument in JSON. The crate has no file location and no loader. ConfigDocument::parse(&str) parses a JSON string in memory, validate() checks the hard invariants, and resolve() produces a deterministic ResolvedConfig, serialised with canonical_json(). A deployment that uses this document supplies the string itself; there is no path the crate opens.

The JSON Schema twin lives at pkgs/id/config/id-config-v1.schema.json and is kept in lockstep with the Rust types by pkgs/id/tests/config_invariants.rs. Companion modules cover layered resolution (LayerOverride, ResolutionInput, ResolvedLayers) and protocol negotiation, whose transcript domain is id-config/negotiation-transcript/v1.

The document has 10 top-level keys and 29 leaf keys. Every struct is deny_unknown_fields: an unknown key rejects the document. Validation is fail-closed throughout.

KeyType / valuesDefault / rule
schema_versionu32Required. Must equal 1, else the document is rejected with UnsupportedSchemaVersion.
config_idstringRequired, non-empty.
revisionu64Required.
modesingle-node | hosted-tenant | federated-relayRequired. Seeds the behaviour defaults below.
protocol_versionsstring arrayRequired, non-empty, duplicate-free. The resolved form is sorted.
ceilingsobjectRequired. Every field must be ≥ 1, else ZeroCeiling.
ceilings.max_hopsu32Hard cap on relay hops.
ceilings.max_bytesu64Hard cap on a single-operation payload.
ceilings.max_time_msu64Hard cap on single-operation wall-clock time.
ceilings.max_fan_outu32Hard cap on delivery targets.
gatesobjectDefault: all true. Setting any gate to false rejects the document with FixedGateDisabled.
gates.signature_verificationbool, const trueOne of the five fixed gate IDs: signature-verification, validation, replay-protection, authorization, tenant-scope. Gates are mechanism, not behaviour.
gates.validationbool, const trueAs above.
gates.replay_protectionbool, const trueAs above.
gates.authorizationbool, const trueAs above.
gates.tenant_scopebool, const trueAs above.
behaviorobjectDefault: empty. Every field None means “inherit the previous plane”.
behavior.max_hopsu32, optionalMust fit the applicable (possibly narrowed) ceiling.
behavior.sync_scopemetadata | full, optional—
behavior.tiercold | warm | hot, optionalTier labels never authorise access.
overridesarray of scoped overridesDefault []. Applied in scope-name order. A duplicate scope rejects the document.
overrides[].scopestringRequired, non-empty.
overrides[].ceilingsobject: max_hops?, max_bytes?, max_time_ms?, max_fan_out?May only narrow a ceiling. Widening is rejected with CeilingWidened; it is never clamped.
overrides[].behaviorobjectSame shape and rules as behavior.
extensionsmap of string to JSONDefault {}. Keys must be namespaced, matching ^[^./\s]+([./][^./\s]+)+$ (for example example.com/experiment). Values are retained verbatim in the resolved output and are never executed.

Field classes: mechanism fields are schema_version, config_id, revision, protocol_versions, ceilings, gates. Behaviour fields are mode, behavior, overrides, extensions. The ResolvedConfig adds provenance: for each behaviour field, one of mode:<mode>, document, or override:<scope>.

Mode behaviour defaults

Modemax_hopssync_scopetier
single-node1metadatacold
hosted-tenant3fullwarm
federated-relay5fullhot

Worked example

A toy document, and what resolution does to it:

{
  "schema_version": 1,
  "config_id": "toy-node",
  "revision": 4,
  "mode": "single-node",
  "protocol_versions": ["v1"],
  "ceilings": {"max_hops": 4, "max_bytes": 1048576, "max_time_ms": 5000, "max_fan_out": 8},
  "behavior": {"tier": "warm"},
  "overrides": [
    {"scope": "relay", "ceilings": {"max_hops": 2}}
  ]
}

Resolution: behaviour starts from the single-node defaults (max_hops 1, metadata, cold), the document’s behavior.tier replaces tier with warm (provenance document), and the relay override narrows that scope’s max_hops ceiling to 2. Changing the override to "max_hops": 9 would reject the whole document with CeilingWidened, because 9 widens the document ceiling of 4. Adding "gates": {"validation": false} would reject it with FixedGateDisabled.

On-disk configuration: the server-config TOML

id serve --server-config <FILE> loads an operator server-config file (ServerConfig::load, in crates/id-cli/src/server_config/). Every table is optional; an empty file is valid. A malformed file fails startup, naming the parse error. Loading the file needs a build with the world feature; see serve and publications.

The file has 23 named keys, including 5 [budgets] keys.

KeyDefault / rule
[create] users[]With [create] absent, anyone may create a group.
[create] groups[]As above.
[create] min_roleUnset means any member may create.
[[users]] keyA provisioned user entry.
[[users]] idThe user’s 64-hex Ed25519 public key.
[[users]] aliasOptional. Users are provisioned at startup, idempotently.
[[groups]] keyA provisioned group entry.
[[groups]] nameThe group name.
[[groups]] creatorA user key; that user becomes Admin.
[[groups]] aliasOptional.
[[groups.members]] userA member entry for the group above it.
[[groups.members]] roleOne of pull, read, write, manage, admin.
[policy] freshness_window_seconds300 (5 minutes).
[policy] pull_policyopen. The other value is members.
[budgets] app_inbound_bytes_per_hour20 GiB/h: 21474836480.
[budgets] app_inbound_bytes_per_second32 MiB/s: 33554432 (the 1-second window of BudgetPolicy::default in id-core); see WEB-14 below.
[budgets] per_peer_bytes_per_hour100 MiB/h: 104857600.
[budgets] per_peer_burst_bytes_per_minute8 MiB/min: 8388608 (the 60-second window of BudgetPolicy::default in id-core); see WEB-14 below.
[budgets] per_ip_bytes_per_hour250 MiB/h: 262144000.
[[budgets.counterparty]] peerA per-peer override entry.
[[budgets.counterparty]] bytes_per_windowReplaces — does not stack with — the per-peer limits for that peer.
[[budgets.counterparty]] window_secondsThe override window.
[[budgets.counterparty]] messages_per_windowOptional.
[residency], [[boundaries]]Optional tables; their shapes are owned by server_config/boundaries.rs.

The operator block list is explicitly not configuration: it lives in the event store’s blocks table (see Data stores and schemas), not in this file.

Two budget keys the module documentation omits (WEB-14)

The server_config/mod.rs header documents three [budgets] keys. The parser implements five, adding app_inbound_bytes_per_second and per_peer_burst_bytes_per_minute. An operator reading only the module documentation cannot discover those two live knobs. That is disagreement WEB-14; both keys are listed in the table above because the parser accepts them.

Worked example

A toy server-config file:

[create]
min_role = "write"

[[users]]
key = "alice"
id = "0123abcd0123abcd0123abcd0123abcd0123abcd0123abcd0123abcd0123abcd"
alias = "Ada (toy)"

[[groups]]
key = "toy-club"
name = "Toy Club"
creator = "alice"

[[groups.members]]
user = "alice"
role = "admin"

[policy]
freshness_window_seconds = 300
pull_policy = "members"

[budgets]
per_peer_bytes_per_hour = 104857600

At startup, user alice and group toy-club are provisioned idempotently, group creation requires role write or above, pulls are restricted to members, and each peer is budgeted at 100 MiB per hour.

Embedded defaults.json

crates/id-core/src/defaults.json is embedded at compile time with include_str!. Its shipped content is:

{"mode":"append","topic":"id-peer-discovery-v1","topic_secret":"id-public-discovery-v1"}

The schema is the Defaults struct in crates/id-core/src/discovery.rs, deserialised with deny_unknown_fields, so an unknown key fails the parse. Verified against the checkout, it has 7 keys — the survey’s count of 6 is one short; the code is the side documented here:

KeyType / defaultMeaning
bootstrapstring array, default []Bootstrap node IDs.
topicstring, optionalThe gossip discovery topic. Must be supplied together with topic_secret.
topic_secretstring, optionalThe gossip discovery topic secret. Must be supplied together with topic.
web_bindingsstring array, default []Web listener bindings, replaced wholesale by --web-listen.
relayrelay policy selector, default N0The relay policy used for connections.
gossipbool, default trueWhether gossip discovery is enabled by default.
modeappend or replace, default appendHow these defaults combine with the hardcoded constants: append keeps the built-in list defaults and appends the file values; replace uses the file lists instead.

Precedence, lowest to highest: hardcoded constants, then defaults.json, then CLI flags, then the runtime skip flags --no-default-bootstrap and --no-default-topic, which discard the file’s bootstrap IDs or topic values and fall back to the constants. The id --version long form prints which defaults source is in force, as a provenance line naming the file’s SHA-256 and mode.

[interfaces.web]: per-app web binding

Each app’s app.toml may carry an [interfaces.web] table, read by web_interface_from_app_toml in crates/id-web/src/app_interface.rs. It has 3 keys:

KeyDefaultRule
mode—adapter: host surfaces render the app. direct: the app ships its own frontend; accepted by the parser but not adapter-bound.
route/world (for the default world app)Must start with /, be a valid axum pattern, differ from socket, and not collide with the host-reserved route list.
socket/ws/world (for the default world app)Same rules as route.

The host-reserved route list is mirrored against the main router and the world bridge routes in The web UI: pages and HTTP API, so an app cannot claim a host path.

Data directory layout (paths, not a config file)

The data directory is the current directory by default. --data-dir <path> selects one; --new [NAME] creates .iroh/<NAME>/ under the current directory and uses it. All data paths are relative to it: .iroh-store/, .iroh-key, .iroh-serve.lock, .iroh-meta/, .id-worlds/<NAME>/. --ephemeral uses in-memory stores instead. The formats at those paths are specified in Data stores and schemas.

Other on-disk configuration locations:

FileLocation
App manifestsapp.toml per app, under ID_APPS_DIR or the built-in apps root.
Gallery directory--gallery-dir / ID_GALLERY_DIR: verified <content-hash>.idpb bundle files plus an operator/ folder holding collections, tags and admission decisions.
Directory journaldirectory.jsonl in the server-config directory.
Keysets.id-keyset.jsonl and .id-keyset-client.jsonl.

Serve, web and world defaults that act as configuration

These CLI defaults are configuration in effect; the flags themselves are specified in serve and publications and World commands: administering and verifying.

SettingLiteral default
--weboff
--port3000
--bind127.0.0.1
--web-tokenunset (no gate)
--web-cookie-securefalse
--world-namelobby
--world-checkpoint-every1000; 0 means never trim
--world-max-open256
--world-max-sessions1024
--world-idle-secs600
--world-boot-window-secs600
--world-cap-policydeny
Gossip topic (hardcoded fallback)id-peer-discovery-v1
Gossip topic secret (hardcoded fallback)id-public-discovery-v1

Data stores and schemas

Source: https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-store/src/event_types.rs, https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-events/src/event_store/mod.rs, https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-store/src/tags.rs, https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-sync/src/fileops.rs, https://github.com/developing-today/code/blob/main/pkgs/id/test-vectors/schema.json

This chapter is the inventory of named, versioned formats a reader, operator or implementer will meet on disk or on the wire: about 35 of them. Paths are relative to the data directory unless stated; the data directory itself is covered in Configuration and environment.

The blob and name store (id-store)

ItemValue
Implementationiroh-blobs FsStore: a redb database plus data files.
Path.iroh-store/; the iroh-docs store lives under .iroh-store/docs/.
Open ruleSingle-opener: the redb file lock admits one process.
Ephemeral formAn in-memory variant backs id serve --ephemeral and the other --ephemeral paths.
Node keyThe .iroh-key file family sits alongside the store, in the data directory.

A “file” in ID is a name (an iroh-blobs tag) pointing at an immutable blob hash, plus TagStore metadata. That model is implemented once, in FileOps (below), and shared by the CLI, the REPL, the meta protocol and the web layer.

The tag store and registry

ItemValue
Backingiroh-docs α/Ω namespace pairs: a global namespace, a node-private namespace, and custom paired or single namespaces.
Registry file.iroh-meta/registry.json
Registry versionREGISTRY_VERSION = 1 (crates/id-store/src/tags.rs). The file records the namespaces and one-time migration completion.
ValuesArbitrary bytes. Display and wire forms use lossy UTF-8, plus value_b64 where binary fidelity is required; see WebSocket protocols.

Other named hash domains in id-store: id.name-candidate/v1, id.name-curation/v1, id.location-tombstone/v1, and id.local-claim.v1 (the tag-claims hash domain).

The graph index

ItemValue
Backingredb.
Tablesgraph_spo, graph_pos, graph_osp, graph_index_meta.
Sort profileaddress-asc/v1.

Sidecar snapshots

ItemValue
Head filehash.metadata.
Snapshot fileshash.metadata.<hex digest of content id>.
Record formatCBOR records with RECORD_VERSION = 1.
Head domainid.sidecar-head/v1.

The event store (id-events)

ItemValue
Fileevents.redb, in the event-store directory (CLI --event-store, default events in the data directory). The temporary write name is events.redb.tmp.
Format markerid.events.store.v9, stored in the meta table. id.events.store.v8 is also accepted: a v8 store is a v9 store with no bodies table and nothing else different.
Key encodingBig-endian, so one author’s events sort in sequence order.
Chain rowsA fixed 41-byte encoding: next sequence (big-endian u64) ‖ head hash (32 bytes) ‖ frozen flag (0/1).

Tables: 17

events            hashes            chains            forks
groups (multimap) proof_ids         proof_headers     waiting
waiting_by_dep (multimap)           meta              blocks
writer_set_bodies actions           device_ops        applied
bodies            tag_fold

The blocks table holds the operator block list. It is data, not configuration: no server-config key writes it (see Configuration and environment).

The event wire format

Every event is a p2panda-core Header<ChainExt> in canonical CBOR (crates/id-store/src/chain.rs):

FieldRule
Domain tagid.events.v1
Operation IDBLAKE3 over the received bytes.
Signaturesverify_strict.
ChainExt{kind, group, after}.
afterAt most 32 hashes (MAX_AFTER).
kind1–64 bytes, NFC-normalised.

Ingest outcomes are accepted, duplicate, fork, waiting and refused — the same five outcomes the hosted bridge returns in The hosted Worker API.

Event-kind constants

About 25 kind values are named as constants across id-store, id-events and id-core:

chat.message.v1        chat.anchor.v1         document.put
document.remove        media.put              media.remove
note.create            note.revise            note.link
tag.set                tag.clear              session.checkpoint
identity               issuer.rotation        device.add
device.revoke          attestation.genesis    attestation.claim
attestation.witness_decision                 attestation.objection
idset.writer           idset.rescind          chained.message

In addition, the group operation kinds are carried by id_events::groups — group create, member and role operations, validated in the event store’s resolve and ingest paths. The group commands that produce them are in Groups, documents, claims and keys.

The directory journal (id-directory)

ItemValue
Filedirectory.jsonl, in the server-config directory.
FormatOne JSON DirectoryEntry per line. Serde-tagged on the field entry, snake_case. Replayed through the same apply path as live changes, so replay and live writes cannot diverge in effect.
Secrets ruleAccount secrets enter only as SHA-256 digests. The account key domain is id-account-v1.

DirectoryEntry kinds: 17

account_signed_up       account_keyed           account_verified
account_key_added       account_key_removed     account_email_confirmed
account_email_removed   group_created           group_updated
group_visibility        group_deleted           member_set
tier_set                friend_requested        friend_accepted
friend_removed          friend_removal_noted

Supporting enums in the same records: Member, tagged on kind, with variants account and group; Level with variants access, read, write, manage, moderator, admin; Tier with variants anonymous, registered, verified.

Keyset files

FileContent
.id-keyset.jsonlJSONL key records for the server identity.
.id-keyset-client.jsonlJSONL key records for the client identity.

Signed artifacts

Envelope wire types live in id-sync::artifact and are re-exported by id-directory.

ItemValue
Kinds: 4friend_remove, home_declared, document, tag. Their wire-name constants are FRIEND_REMOVE, HOME_DECLARED, DOCUMENT, TAG.
Signed-bytes profileid-artifact-serde-json/v1 (the LEGACY_PROFILE constant).
Signed bodySignedBody{author, seq, prev, kind, body, after} serialised as compact serde_json. The after field is omitted when empty.
HashSHA-256, hex.
SignatureEd25519, hex.

The profile is pinned by a conformance vector file; see “Test vectors” below.

Listing, suspension and delisting records

No listing, suspension or delisting record kind exists in crates/id-directory. That family lives in three other places:

LocationFormat
crates/id-sync/src/registry.rsSigned registry lists: a canonical-CBOR body with a registry-key Ed25519 signature. Entries are RegistryEntry{announcement, included_at, registry_seq}, where announcement is verbatim and world-key-signed. Delistings are Tombstone{world_id, removed_at, reason, registry_seq}; reason is at most 200 characters. The policy statement is at most 2000 characters. Unlisted worlds are refused at inclusion and skipped on import.
crates/id-caps/src/declaration.rsProvider declaration lifecycle: Filed → Admitted → Live → Suspended / Superseded / Stale → Tombstoned. Suspension is registry state; the provider’s contents are unchanged. Signing domains: id.provider-manifest.v1, id.provider-withdrawal.v1, id.host-attested-provider:.
crates/id-worlds/src/program_gallery_admission.rsGallery listing decisions and transparency entries (removal, refusal, reinstatement) behind the routes in The web UI: pages and HTTP API.
crates/id-sync/src/federation/slices/b02_key_revocation.rsKey suspension records: operator maintenance suspension, bounded or indefinite.

FileOps and the archive naming rule

FileOps (crates/id-sync/src/fileops.rs) is the single put/rename/copy/delete implementation for the CLI, the REPL, the meta protocol and the web UI.

Archive naming

When a rename or replace archives the old file, the archive name is:

{name}.archive.{unix-ts}
  • On a same-second collision, the suffix is bumped — {ts+1}, then {ts+2}, and so on — until the name is free. The claim happens under an in-process lock.
  • The shape {stem}.archive.{digits}, where the digits fit a u64, is a reserved namespace at the writer: such names are refused as user files, with the error ReservedArchiveName. Non-numeric lookalikes such as a.archive.notes stay valid user names.

Archive and identity metadata keys

KeyPlaced onMeaning
archive.rename—Records a rename archive relationship.
archive.replaceThe live nameNames the archives the live name owns.
archive.ownerThe archiveNames the archive’s owner.
name, file, pathThe fileIdentity keys, refreshed on rename and copy.
originThe fileStamped at first write.

Archives are dropped only with their owner. There is no per-archive delete.

Delete semantics

FileOps::delete is a hard delete of the name, its metadata and its archives. The blob bytes survive until garbage collection. The web layer’s soft-delete/restore pair (/api/delete, /api/restore) is built on top of FileOps and is not FileOps behaviour.

Other id-sync formats

FormatValue
Envelope ALPN/id-envelope/1
Record-store envelope domainid-sync/record-store-envelope/v1
Bridge authentication domainid.bridge-auth.v1 (the hosted bridge in The hosted Worker API)
Federation record storefederation/record_store.rs, with RecordStatus, and slices B01–B09, B15–B24, B28, B31, B32 covering key lifecycle and revocation, the replay guard, signature suites, signer binding, rejection events, conflict reports, sync scope, anti-entropy, peer priority, fanout budget, query grants and privacy, signed receipts, request identity, result dedup, loop inform, routing state, topology probe, takeover response, peer classes, and the ingest gate.

The tag registry

Covered above with the tag store: .iroh-meta/registry.json, format registry.json v1 (REGISTRY_VERSION = 1), recording namespaces and one-time migration completion.

Hosted Durable Object SQLite schema

The hosted Worker’s UserDO (see The hosted Worker API) uses SQLite with SCHEMA_VERSION = 3:

TablesGroup
meta, kv, blobsCore object state: metadata, per-user KV, blob references.
bridge_events, bridge_chains, bridge_forks, bridge_proof_ids, bridge_proof_headers, bridge_waiting, bridge_waiting_by_dep, bridge_metaThe bridge store: the signed-object sync peer state, mirroring the native event store’s table roles.

Two related proof-of-concept schemas, neither a production format:

SchemaValue
worker-poc WorldObject journalAn unversioned SQLite journal table; the source of truth for that PoC.
d1-journal-poc journal headerVersion 1; entries include created and caps_granted. A D1 bookmark is not a stream cursor.

Program bundles and world formats

FormatMagic / version
Program bundle (.idpb files)Magic line developing-today/id-program-bundle/v1 followed by \n.
World snapshotMagic IDWS.
World replication frameMagic id-world-replication/v1 followed by \n.
World module signature domaindeveloping-today/id-world-module/v1 followed by a NUL byte.
Program-registry ALPN/id-program-registry/1.

Keys, invites and presence

FormatMagic / version
Key envelope (also the backup envelope)Magic IDKEY.
InviteMagic IDINV, version 2.
Presence frameMagic id-presence/v1 followed by \n.
Peer announcement frameMagic id-peer-announcement/v2 followed by \n.

Remaining named domains and versions

FormatValue
Match-audit formatVersion 0; domains id.match-audit.v0/header, id.match-audit.v0/entry, id.match-audit.v0/footer.
Boundary evidence domainid.boundary.evidence.v1.
Boundary declaration hash domainid.boundary.declaration.v1.
Currency receipt domainid.currency.receipt.v1.
Array address format (id-core)FORMAT_VERSION 0x01.
Typed value format (id-core)FORMAT_VERSION 0x02.
Config schemaid-config version 1, plus the negotiation transcript domain id-config/negotiation-transcript/v1; see Configuration and environment.

Test vectors

pkgs/id/test-vectors/ contains exactly 3 files. They are conformance fixtures, not stores.

FileSchema / content
schema.jsonA JSON Schema (draft 2020-12) titled “ID/Atlas shared conformance test vectors”, with schema_version const 1. port_kind is one of record_store, blob_store, event_log, world_store, object_bucket, message_stream, request_transport. Operations are negotiate, append, read, ack. Negotiation outcomes are granted, unsupported_capability, version_mismatch.
atlas-content-hash-v1.json"schema": "atlas-content-hash-compatibility-v1". It records the Atlas chunks.content_hash field as producer_unavailable with empty vectors, and states the interop claim verbatim: “forbidden: do not equate Atlas chunks.content_hash with any ID ContentId profile”.
legacy-artifact-signatures.json"schema": "id-atlas-signed-artifact-profiles/v1". It pins the legacy id-artifact-serde-json signed-bytes definition, the SHA-256 hash rule and the Ed25519 signature rule, using a test-only Ed25519 key (seed = 32 × 0x07). The file itself warns that this key is never a production key.

Worked example

Toy data: a node stores one file, renames it twice in the same second, and an operator reads the resulting on-disk state.

> put report.txt report
> rename report report-v2
> rename report-v2 report-final

What exists afterwards:

PlaceEntry
.iroh-store/One blob (the toy bytes), referenced by the live name report-final; the redb name index holds the archive names below.
Tag storereport-final carries the identity keys name, file, path and the first-write origin key, plus archive.replace naming its archives.
Archive namesreport.archive.1700000000 and report-v2.archive.1700000000, each carrying archive.owner. Because both renames landed in the same second, the second archive’s suffix was bumped until free if the first claim collided.
Name refusalA later attempt to store a user file literally named report.archive.1700000000 is refused with ReservedArchiveName; report.archive.notes would be accepted.
events.redbThe meta table reads id.events.store.v9; the rename operations appear as events whose headers are canonical CBOR under the domain tag id.events.v1.
directory.jsonlUnchanged by file operations: it records account, group, member, tier and friend entries only — 17 kinds, none of them a file kind.

The crates

Source: primary sources are pkgs/id/Cargo.toml, pkgs/id/src/lib.rs, and the per-crate manifests and lib.rs files under pkgs/id/crates/. This chapter is complete without following those links; they record provenance only.

The id code lives in one Cargo workspace rooted at pkgs/id/. The workspace has 17 members: the root package id plus 16 crates under pkgs/id/crates/. Default members are 15: the root plus 14 crates. id-native-shell and id-hw-shell are workspace members but not default members, so a plain cargo build in pkgs/id/ never acquires the Bevy desktop dependencies or the hardware-shell code. The 16 sub-crates declare 228 pub mod items in total across their lib.rs files; the root adds 26 modules of its own code plus about 90 re-exported modules (see The id facade crate).

The workspace is the product of a numbered split of one original crate, recorded in the crate doc headers as umbrella issue #3447: Phase 1 extracted id-core (#3447), step 1 extracted id-caps (#4403), steps 2a and 2b extracted id-store and id-events (#4405), step 3 extracted id-sync (#4406), step 4 extracted id-groups (#4407), step 5 extracted id-worlds (#4408), steps 6b and 6c extracted id-directory and id-web (#4409), and step 7b extracted id-cli (#4411). Four crates are not split products: id-config (slice 9111-01, #10178), id-currency-registry (F1 and F2 of #2062, #2317 and #2318), id-render (#7918, decision records #5849 and #5855), and id-import-notion (slice 1, #8419). The two shells are separate consumers, covered in Guest apps and shells as consumers.

Dependency direction

Production [dependencies] edges only; dev-dependencies are named where they matter.

  • id-core has 10 production dependents: every other split crate plus the facade.
  • id-caps depends on id-core. id-store depends on id-core. id-events depends on id-core and id-store. id-groups depends on id-core, id-events, and id-store. id-sync depends on id-core, id-events, and id-store.
  • id-directory depends on id-caps, id-core, id-events, and id-sync. It does not depend on id-worlds; id-worlds depends on id-directory, because WorldCore holds a directory::Directory as persisted state.
  • id-worlds depends on id-caps, id-core, id-directory, id-events, id-groups, id-store, and id-sync. id-web depends on all of those plus id-worlds. id-cli depends on the same set as id-worlds, plus optional id-web.
  • The facade id depends on id-caps, id-cli, id-core, id-currency-registry, id-directory, id-events, id-groups, id-store, id-sync, and id-worlds, plus optional id-web.
  • Both shells production-depend on the facade only, each with default-features = false, features = ["world"]. Each shell also dev-depends on id-worlds with the sandbox feature for its test harness.
  • id-config has no production dependent anywhere in the workspace. The facade names it only under [dev-dependencies], for the invariant tests in pkgs/id/tests/. ARCHITECTURE.md states that only the root depends on id-config; the code disagrees — that root edge is a dev-dependency, not a production dependency (disagreement LIB-4).
  • id-currency-registry depends on nothing and its only production dependent is the facade.
  • id-render and id-import-notion depend on nothing and have no dependents, but both are default members and both carry maintained integration test suites. ARCHITECTURE.md calls them candidates for removal or for documenting as unused; no code, manifest, or test marks either crate deprecated or slated for removal (disagreement LIB-11).

The seventeen members

id (root, the facade). Purpose: the published library surface and the id binary; the root Cargo.toml description, “A peer-to-peer file sharing CLI built with Iroh”, predates the worlds, directory, and currency surface (disagreement LIB-13). Public modules: 26 modules of its own code in pkgs/id/src/, plus about 90 modules re-exported from sub-crates at id:: paths. Key types and functions: Cli, Command, the cmd_* command functions, open_store, StoreType, load_or_create_keypair, and the constants KEY_FILE, CLIENT_KEY_FILE, SERVE_LOCK, STORE_PATH, and META_ALPN. Features: default = ["sandbox", "world"], plus sandbox, world, ssh, web, dht, and currency-poc-tb. Dependents: id-native-shell and id-hw-shell in production; id-store dev-depends on it for tests. Full treatment: The id facade crate.

id-core — 58 public modules. Purpose: foundation leaf modules (Phase 1 of the split, #3447); everything depends on these modules and they depend on almost nothing. Key types and functions: the constants KEY_FILE = ".iroh-key", CLIENT_KEY_FILE = ".iroh-key-client", SERVE_LOCK = ".iroh-serve.lock"; discovery (PeerDiscovery, PeerInfo, PeerAnnouncement); tuple, canonical_cbor, frames (MAX_FRAME_BYTES), membership, holders, signed_envelope, and the graph record model. Features: default = ["world", "sandbox"], plus web, test-utils, and test-provider. Dependents: all ten production consumers in the workspace. Full treatment: The data crates.

id-caps — 18 public modules. Purpose: the capability catalog, execution limits, and the declarative world manifest (split step 1, #4403). Key types and functions: the provider catalog in world_caps (entries include time.now, chat.say, kv.get, blob.put, http.fetch); world_limits (RuntimeLimits); agent_delegation (AgentId, Role, Delegation, JoinGrant, verify_join); the Roc library-import gate family (library_manifest, library_resolution, library_gate, library_attach); and mcp_bridge / mcp_policy. Features: default = ["sandbox"], plus the test-only test-provider. Dependents: the facade, id-cli, id-directory, id-web, and id-worlds. Full treatment: Worlds and capabilities as a library.

id-store — 26 public modules. Purpose: the store layer — store traits, blob store, event headers, documents, tags, and search (split step 2a, #4405). Key types and functions: store::{StoreType, open_store, load_or_create_keypair} with STORE_PATH = ".iroh-store"; chain::{ChainExt, Event, sign}; tags, tag_index, and tag_claims; documents::{DocumentRef, DOCUMENT_KIND}; and search. Features: none beyond default = []. Dependents: the facade, id-cli, id-events, id-groups, id-sync, id-web, and id-worlds. Full treatment: The data crates.

id-events — 12 public modules. Purpose: the event store, group projection, writer sets, and sync gating (split step 2b, #4405). Key types and functions: EventStore and Ingest; the attestation family (GenesisAgreement, ResultClaim, sign_genesis, sign_claim, compute_state); the deterministic group projection in groups::fold (GroupView, Projection); writer sets in idset (WriterSet, Entry, Excludes); and WorldAccess. Features: none beyond default = []. Dependents: the facade, id-cli, id-directory, id-groups, id-sync, id-web, and id-worlds. Full treatment: The data crates.

id-groups — 3 public modules. Purpose: the group policy and enforcement remainder — group actions and log, local warnings, the blob gate, and group encryption (split step 4, #4407). The group model itself lives in id-events; this crate holds blob_gate::{BlobPolicy, Request, decide}, the encryption family built on p2panda-encryption’s DataScheme, and groups::{actions, log, warnings}. Features: none beyond default = []. Dependents: the facade, id-cli, id-web, and id-worlds. Full treatment: The data crates.

id-sync — 21 public modules. Purpose: log sync, the meta protocol, file operations, envelopes, and artifacts (split step 3, #4406). Key types and functions: protocol::{META_ALPN, MetaRequest, MetaResponse} with META_ALPN = b"/iroh-meta/3"; log_sync (SyncProtocol); transfer; artifact; envelope_outbox::Outbox; announcement::{Announcement, SignedAnnouncement}; and the federation family. Features: default = [], plus opt-in dht (off by default) and test-utils. Dependents: the facade, id-cli, id-directory, id-web, and id-worlds. Full treatment: The data crates.

id-directory — 15 public modules. Purpose: the home-server directory — directory, views, auth, mail, invites, and seitan admission (split step 6b, #4409). Key types and functions: Directory (new, open, replay, append, sign_up, add_key, verify_account), Account, Group, Member, DirectoryEntry, Actor, and the BoundaryGate trait; the seitan V2 admission protocol; and the keyset and recovery family. Features: none beyond default = []. Dependents: the facade, id-cli, id-web, and id-worlds. Full treatment: The data crates.

id-worlds — 31 public modules. Purpose: the world runtime, sessions, sandbox, and cross-world authority (split step 5, #4408); at 75 .rs files it is the largest crate in the workspace. Key types and functions: sandbox::{Sandbox, WorldInstance, GuestCall, CallStats, CallMetrics}; world::{WorldCore, WorldHandle}; shell_contract; program_bundle; guest_burn; and account_charge::{WorldChargeConfig, WorldAccountRegistry, ChargeMode}. Features: default = [], plus sandbox (adds wasmtime), ssh, and test-utils. Dependents: the facade, id-cli, and id-web in production; both shells dev-depend on it. Full treatment: Worlds and capabilities as a library.

id-web — 2 public modules. Purpose: the web layer — HTTP and WebSocket server, routes, templates, and markdown (split step 6c, #4409). Only gallery and world_ws are declared pub mod; the rest of the surface is private modules behind curated re-exports. Key types and functions: create_router, create_router_for_app, create_program_router, WebInterface, WebMode, WebSecurity, SeitanState, and PublicationMounts. Features: default = [], plus sandbox. Dependents: the facade (optional, under the facade web feature, re-exported as id::web) and id-cli (optional, under its web feature).

id-cli — 19 public modules plus 3 bridge modules. Purpose: the command-line application layer (split step 7b, #4411): cli (argument parsing), commands (subcommand implementations), repl, and server_config, plus shared support modules. Key types and functions: Cli, Command, KeyCommand, KeysetCommand, TagCommand; the cmd_* functions; option structs ServeOptions, ServeInfo, PeekOptions, PeersOptions, SearchOptions, ReplContext; MetaClient (the local-versus-remote chooser, defined at crates/id-cli/src/meta_client.rs:31); MetaProtocol, MetaRequest, MetaResponse, FindMatch, TaggedMatch, MatchKind; and run_repl. Features: default = ["sandbox", "world"], plus world, sandbox, ssh, web, and dht. Dependents: the facade only. The command surface itself is documented in The id command line.

id-config — 1 public module. Purpose: the versioned configuration contract and its hard invariants (slice 9111-01, #10178). Public modules: resolve only, re-exporting resolve::{LayerOverride, ResolutionInput, ResolveError, ResolvedLayers, resolve}; everything else is defined at the crate root. Key types and functions: CONFIG_SCHEMA_VERSION = 1; FIXED_GATE_IDS (the 5 ids signature-verification, validation, replay-protection, authorization, tenant-scope); ConfigDocument (parse, validate, resolve); ResolvedConfig (canonical_json); ConfigError (12 variants); Mode, SyncScope, Tier, Ceilings, and field_class. The doctrine in the crate header is literal: the five fixed admission gates can never be disabled by configuration, ceilings only narrow, validation is fail-closed, and resolution is deterministic. Features: none. Dependents: none in production; the facade dev-depends on it only. One further disagreement: crates/id-config/src/negotiation.rs exists on disk but is never declared in the crate’s lib.rs, so the published crate does not contain it; its only compilation is by path from the facade’s tests/config_downgrade.rs (disagreement LIB-5). The configuration surface is documented in Configuration and environment.

id-currency-registry — 5 public modules. Purpose: the currency control-plane registry (F1 of #2062, #2317; account factory F2, #2318): the Postgres schema and migrations for ledger_allocation, currency, currency_issuer, and account, plus the monotonic, never-recycled ledger-u32 allocator. Public modules: allocator, factory, grants, registry, store. Key types and functions: Allocator and AllocError; Registry, RegistryError, CurrencyRecord, CurrencyStatus, SupplyPolicy; Factory, FactoryError, CurrencyAccounts, AccountCluster, AccountSpec, AccountKind, CreateOutcome; the Store trait with InMemoryStore; and the MIGRATION_0001_UP / MIGRATION_0001_DOWN constants. The ratified split is 0x00000001..=0x000FFFFF for tenancy and system, 0x00100000.. for currencies; ledger 0 is never allocated. Features: default = [] only. Dependents: the facade only, which composes it in pkgs/id/src/currency/gateway_poc.rs.

id-render — 10 public modules. Purpose: the rendering pipeline compiler core (#7918): parse and vocabulary validation of semantic markup, then a five-stage pipeline over one target-neutral intermediate representation — parse, validate, compose, lower per target, emit artefact plus coverage report. Public modules: assertion_vocabulary, compose, gui_table, lower, lower_gui, lower_native, native_table, tooling, vocabulary, web_table; parse and validate are private modules whose functions are wrapped at the crate root. Key types and functions: Document, Element, Node, Span, BuildError; parse, validate, parse_and_validate, compose_document, lower_document, lower_document_native, lower_document_gui. Features: none. Dependents: none; it is a default member with six integration test files.

id-import-notion — 0 public modules. Purpose: Notion importer manifest and inventory primitives (slice 1, #8419): durable inventory and resume primitives, with the API transport injected by callers. The whole crate is one src/lib.rs of 1,241 lines. Key types and functions: NOTION_API_VERSION; the NotionApi transport trait; crawl_inventory; Inventory, InventoryObject, Stage, Outcome; and Manifest (new, verify_resume_identity, record_progress, validate_inventory_reconciles, save_atomic, load). A bearer token is never accepted by or serialized from Manifest. Features: none. Dependents: none; it is a default member with its own integration test, crates/id-import-notion/tests/recorded_inventory.rs.

id-native-shell — 7 public modules. Purpose: the native reference shell (F13.6, design #788): a Bevy desktop client speaking the F13.1 shell contract. Public modules: audio, events, form, providers, render, scene, widget, plus a private session module whose surface is re-exported at the crate root. Features: none. Production dependency: the facade with features = ["world"], plus Bevy 0.19 and iroh. Dependents: none; not a default member. Full treatment: Guest apps and shells as consumers.

id-hw-shell — 0 public modules. Purpose: the ESP32-class hardware shell spike (more-shells v1 slice 3, #10929): the presence, journal-head, and confirm/act subset of the F13.1 shell contract. The whole crate is one src/lib.rs of 996 lines. Key types and functions: CONTRACT_NAME = "shell", CONTRACT_VERSION = 1, capability_statement(), HwShell, PresentedChoice, SelectableField, and HwError. Features: none. Production dependency: the facade with features = ["world"]. Dependents: none; not a default member. Full treatment: Guest apps and shells as consumers.

Embedding examples from real call sites

The shipped binary is itself a facade consumer: pkgs/id/src/main.rs:10-13 imports id::{Cli, Command, PeekOptions, PeersOptions, SearchOptions, ServeOptions, cmd_find, cmd_get_multi, cmd_gethash, cmd_id, cmd_list, cmd_migrate_tags, cmd_peek, cmd_peers, cmd_put_hash, cmd_put_multi, cmd_search, cmd_serve, cmd_show, cmd_tag, run_repl}, and pkgs/id/src/main.rs:202 calls id::cli::normalize_args(std::env::args_os()).

The integration suite is the largest consumer: use id:: occurs 165 times under pkgs/id/tests/. One import block in pkgs/id/tests/first_app_poc.rs:33-45 spans three crates entirely through facade paths — id-store (chain, documents, tag_claims), id-events (event_store, idset), and id-core (waiting).

Direct crate paths are also in use where the facade does not re-export a crate. pkgs/id/src/currency/gateway_poc.rs:120-125 imports id_currency_registry::{AccountCluster, AccountKind, AccountSpec, ClusterError, CreateOutcome, Factory, FactoryError, InMemoryStore, Registry, RegistryError, Store, SupplyPolicy} directly, because the facade exposes nothing from id-currency-registry at id:: paths. The three config test files under pkgs/id/tests/ (config_invariants.rs, config_precedence.rs, config_downgrade.rs) consume id_config:: directly for the same reason.

The id facade crate

Source: primary sources are pkgs/id/src/lib.rs, pkgs/id/Cargo.toml, and pkgs/id/src/main.rs. This chapter is complete without following those links; they record provenance only.

The root package id (version 0.1.0, edition 2024, rust-version 1.96) is the facade for the workspace described in The crates. It is not a thin re-export shim. pkgs/id/src/ owns 26 modules of first-party code, and src/lib.rs re-exports about 90 modules from ten sub-crates at id:: paths, plus a curated set of individual types, functions, and constants. A Rust consumer depends on this one package and writes id:: paths for the whole split family: files, tags, events, sync, directory, worlds, the command layer, and — under the web feature — the web server.

Two scope warnings belong at the front. First, the crate’s self-description is stale: the root Cargo.toml description and the src/lib.rs title both read “A peer-to-peer file sharing CLI built with Iroh”, and the compiled surface also includes a sandboxed world runtime, a home-server directory, group encryption, and a currency registry (disagreement LIB-13). Second, the src/lib.rs doc header still describes the pre-split architecture: its Architecture diagram and Modules list present cli, commands, protocol, store, tags, and repl as this crate’s own modules and show no worlds, sync, events, directory, or currency layer at all. Every one of those modules moved out in split steps 2a to 7b; the header was not updated (disagreement LIB-3). A reader who learns the library from the rustdoc front page gets the 2025 single-crate architecture. This chapter documents the code, not the header. The header does carry one load-bearing piece of current documentation: the family-wide signing contract (“sign only what receipt would accept”, design #6487, audit #6488) with its four decidability classes — (a) intrinsic, (b) signer-relative, (c) seam-extended, (d) receiver-state.

The facade’s own 26 modules

These are pub mod declarations with code in pkgs/id/src/. Feature gates are noted; unmarked modules are unconditional.

ModuleGateContent
artifactworldShim over the split artifact owners
backup—Backup and restore
blob_gate—Blob gate at its historical path, over id-store / id-groups / id-worlds owners
boardsworldGame posts; runs guest packages through id::sandbox
conversion—Format conversion
currency—Currency surface; composes id-currency-registry
currency_poc—TigerBeetle proof-of-concept harness for #2289
device_bridge—Device bridge
didit—The did-it counted view
encryptionworldEncryption at its historical path
envelope_networldEnvelope networking, over id-sync owners
envelope_outboxworldEnvelope outbox, over id-sync owners
fileops—File operations at their historical path, over id-sync
foreign_libsql—Foreign libSQL access
grant_service—Grant service
grants—Grants
groups—Group facade: src/groups/mod.rs re-exports from id_events::groups, id_groups::groups, and id_worlds::groups::worlds
hosted_binding—Hosted-edition binding ceremony
hosted_export—Hosted export
hosted_ingest—Hosted ingest
input_framing—Input framing
pull_policy—Pull policy at its historical path, over id-events
references—References
serve_proxy—Serve proxy
store_traits—Store traits at their historical path, over id-store
structured_logging—Structured logging configuration

The binary entry point src/main.rs also stays in this package and consumes the library through id:: paths exactly like an external consumer.

The re-export surface

Each module below becomes available at the id:: path shown. Feature gates are noted; unmarked items are unconditional.

From id-core: abuse, access, admission_gate, connectivity, discovery, frames, holders, membership, rejection, residency, sync_method, tuple, waiting; plus petname and world_presentation under world, and qr under web.

From id-events: attestation, event_store, event_sync, idset, local_claims, local_events.

From id-store: admission, chain, chat, chat_anchor, documents, issuer_rotation, media, note_links, notes, search, store, tag_claims, tag_index, tags; plus session_checkpoint under world.

From id-sync: chained_message, dht, log_sync, transfer. The dht module itself is feature-built inside id-sync.

From id-directory: keyset, invite, invites unconditionally; directory, directory_auth, directory_log, directory_mail, directory_view, and seitan under world.

From id-caps: world_caps unconditionally; world_limits and world_manifest under world.

From id-worlds: world_compile and world_hub unconditionally; shell_contract, world, world_cache, world_doctor, world_fixture, world_native, world_net, world_records, world_replication_net, world_session, world_store under world; guest_burn, sandbox, and world_dev under sandbox; world_ssh under ssh.

From id-cli, in one block: aliases, app_manifest, chat_presence, cli, commands, helpers, local, match_audit, meta_client, protocol, publications, publications_runtime, repl, server_config.

From id-web: the whole crate as id::web, under the web feature only.

ARCHITECTURE.md lists the root’s id-core re-exports as 12 modules and concludes that modules not re-exported by id are internal to the workspace. The code disagrees: the facade also re-exports id-core’s admission_gate, petname, world_presentation, and qr, and about 90 modules from ten other crates in total (disagreement LIB-6). The re-export list in src/lib.rs is the public/internal line.

Item-level re-exports

Beyond whole modules, src/lib.rs re-exports individual items as the convenience surface:

  • From id_core::discovery, 17 items: ANNOUNCE_INTERVAL, DEFAULT_TOPIC, DEFAULT_TOPIC_SECRET, Defaults, DefaultsMode, DefaultsProvenance, DefaultsSource, MAX_PEER_NAME_BYTES, MAX_PEERS, PeerAnnouncement, PeerDiscovery, PeerInfo, ResolvedConfig, STALE_CHECK_INTERVAL, STALE_THRESHOLD, defaults, defaults_provenance, resolve_config. Note that id::ResolvedConfig is the discovery type from id-core. A second type with the same name, id_config::ResolvedConfig, exists in the workspace and is not exposed at id::.
  • From id_cli::cli: Cli, Command, KeyCommand, KeysetCommand, TagCommand.
  • From id_cli::commands: PeekOptions, PeersOptions, ReplContext, ReplContextInner, SearchOptions, ServeInfo, ServeOptions, and the functions cmd_find, cmd_find_matches, cmd_get_local, cmd_get_multi, cmd_get_one, cmd_get_one_remote, cmd_gethash, cmd_id, cmd_list, cmd_list_remote, cmd_migrate_tags, cmd_peek, cmd_peers, cmd_put_hash, cmd_put_local_file, cmd_put_local_stdin, cmd_put_multi, cmd_put_one, cmd_put_one_remote, cmd_search, cmd_send, cmd_serve, cmd_show, cmd_tag, create_local_client_endpoint, create_serve_lock, get_serve_info, is_process_alive, remove_serve_lock.
  • From id_cli::helpers: download_output_path, parse_get_spec, parse_put_spec, print_match_cli, print_match_repl, print_matches_cli.
  • From id_cli::protocol: match_kind, FindMatch, MatchKind, MetaProtocol, MetaRequest, MetaResponse, TaggedMatch.
  • From id_cli::repl: run_repl.
  • From id_store::store: StoreType, load_or_create_keypair, open_store.
  • Constants: CLIENT_KEY_FILE, KEY_FILE, SERVE_LOCK from id-core; STORE_PATH from id-store; META_ALPN from id-sync::protocol.
  • Functions: to_absolute, parse_stdin_items, read_input, export_blob from id-cli; is_node_id from id-core.

What the facade does not expose

Nothing from five crates is available at id:: paths: id-config (a dev-dependency of the facade only), id-currency-registry (consumed by the facade-internal src/currency/gateway_poc.rs under its own crate path), id-render, id-import-notion, id-native-shell, and id-hw-shell. A library consumer who wants those names the crates directly. The facade’s role as the only public surface holds for the split family, not for these crates.

One documentation disagreement sits in the facade’s own manifest: the dht feature comment in the root Cargo.toml states that src/dht.rs decides per server. No src/dht.rs exists in the facade; the module is crates/id-sync/src/dht.rs, re-exported as id::dht (disagreement LIB-15).

Features

  • default = ["sandbox", "world"].
  • sandbox forwards to id-core/sandbox, id-caps/sandbox, id-worlds/sandbox, and id-cli/sandbox, and implies world.
  • world forwards to id-core/world and id-cli/world.
  • ssh forwards to id-worlds/ssh and id-cli/ssh.
  • web adds the optional id-web dependency and forwards to id-core/web and id-cli/web.
  • dht forwards to id-sync/dht and id-cli/dht.
  • currency-poc-tb adds the optional tigerbeetle dependency, the official TigerBeetle Rust client, for the #2289 live-cluster proof of concept.

Dependents

Two production consumers depend on the facade from outside the split family: id-native-shell and id-hw-shell, each with default-features = false, features = ["world"] (see Guest apps and shells as consumers). Inside the workspace, id-store dev-depends on the facade: its store_traits tests run against the real EventStore, and a comment at crates/id-store/Cargo.toml in the [dev-dependencies] section states that production code in id-store never names the facade. Direct-crate-path use inside the facade’s own src/ runs the other way: mentions of id_<crate>:: count id-core 32, id-worlds 23, id-store 23, id-events 16, id-currency-registry 15, id-directory 11, id-cli 11, id-sync 10, id-groups 7, and id-caps 5.

Embedding examples from real call sites

The shipped binary is the first example. pkgs/id/src/main.rs:10-13:

#![allow(unused)]
fn main() {
use id::{Cli, Command, PeekOptions, PeersOptions, SearchOptions,
         ServeOptions, cmd_find, cmd_get_multi, cmd_gethash, cmd_id,
         cmd_list, cmd_migrate_tags, cmd_peek, cmd_peers, cmd_put_hash,
         cmd_put_multi, cmd_search, cmd_serve, cmd_show, cmd_tag, run_repl};
}

The same file calls id::cli::normalize_args(std::env::args_os()) at line 202, reads structured-logging configuration through id::structured_logging::{LogConfig, LogFormat} at lines 98–99, and calls the id-core discovery module by its direct crate path at line 195: let provenance = id_core::discovery::defaults_provenance();.

The documented quick-start in the src/lib.rs header is the embedding form for the store: open_store(false).await?, then store.as_store().blobs().add_bytes(…) and store.as_store().tags().set(…). All three entry points — open_store, StoreType, and load_or_create_keypair — reach the consumer through the facade’s re-exports from id_store::store.

A world example comes from the facade’s own game-post path. pkgs/id/src/boards.rs:1592-1594 compiles and runs a guest package through the facade’s id::sandbox re-export of id_worlds::sandbox:

#![allow(unused)]
fn main() {
let sandbox = crate::sandbox::Sandbox::compile(package_bytes,
    crate::sandbox::SandboxLimits::default())?;
let mut instance = sandbox.instantiate(0)?;
let genesis_bytes = instance.snapshot()?;
instance.restore(&genesis_bytes)?;
}

The integration test pkgs/id/tests/first_app_poc.rs:33-45 composes three crates through facade paths in one import block — id::{chain::{sign, ChainExt, Event}, documents::{DocumentRef, DOCUMENT_KIND}, event_store::{EventStore, Ingest}, idset::…, tag_claims::{TagOp, SET_KIND}, waiting::…} — and builds the counted did-it view from id-events and id-store parts with no new protocol code. In total, use id:: occurs 165 times under pkgs/id/tests/, which is the strongest evidence that the re-export list above is the real public API.

Worlds and capabilities as a library

Source: primary sources are pkgs/id/crates/id-worlds/src/lib.rs, pkgs/id/crates/id-worlds/src/sandbox.rs, pkgs/id/crates/id-caps/src/lib.rs, and pkgs/id/crates/id-caps/src/world_caps.rs. This chapter is complete without following those links; they record provenance only.

Two crates carry the world system as a library: id-worlds owns the runtime — world state, sessions, the guest sandbox, and cross-world authority — and id-caps owns the capability data model that the runtime enforces: the provider catalog, execution limits, the world manifest, delegation, and the gates that decide what a guest or an agent may do. A consumer embedding worlds uses both, normally through the facade paths id::world, id::sandbox, id::world_caps, and id::world_limits (see The id facade crate). The guest side of the contract is covered in Guest apps and shells as consumers.

id-worlds

Purpose (from its Cargo.toml): “Worlds layer of the id crate: the world runtime, sessions, sandbox and cross-world authority (pkgs/id crate split step 5, #4408)”. At 75 .rs files it is the largest crate in the workspace. It depends on id-caps, id-core, id-directory, id-events, id-groups, id-store, and id-sync.

Public modules

id-worlds declares 31 pub mod items: account_charge, blob_gate, chat_anchor_render, groups (the worlds bridge), guest_burn, program_bundle, program_gallery, program_gallery_admission, program_gallery_operator, program_registry, program_registry_net, shell_contract, world (with submodules for actor, core, coordinator, handle, journal, replica, replication, signed, http_fetch, and provider_broker), world_cache, world_compile, world_doctor, world_fixture, world_hub, world_line, world_native, world_net, world_owner_report, world_records, world_replication_net, world_session, world_storage, world_store, and world_terminal. Two modules are feature-gated: sandbox and world_dev under the sandbox feature, and world_ssh under the ssh feature.

About 20 further names are alias re-exports, so code moved during the split keeps its historical crate:: paths inside this crate: world_caps and world_limits from id-caps; abuse, connectivity, frames, petname, and world_presentation from id-core; directory, directory_auth, directory_mail, and directory_view from id-directory; event_store from id-events; chain, store, and tags from id-store; artifact and envelope_outbox from id-sync; plus pub use id_core::port.

Two disagreements attach to this crate’s documentation. First, the id-worlds lib.rs Contents section lists the directory cluster — directory, directory_auth, directory_view, directory_mail — as this crate’s own contents and states that step 6’s extraction must still invert or re-home WorldCore’s hold on the directory. Step 6b (#4409) has landed: those four names are re-exports from id-directory (pub use id_directory::directory; and its siblings at crates/id-worlds/src/lib.rs:93-96), and crates/id-directory/src/lib.rs records the move. The code behaviour is that the directory lives in id-directory and id-worlds re-exports it (disagreement LIB-8). Second, the id-groups lib.rs states that the FoldedWorlds implementation of the blob-gate trait stays in the facade until step 5 extracts id-worlds. Step 5 has landed: FoldedWorlds is defined at crates/id-worlds/src/blob_gate.rs:36, and no FoldedWorlds definition exists in the facade’s src/ (disagreement LIB-9). The id-cli bridge module re-exports both halves of the gate for command code: id_groups::blob_gate::{BlobPolicy, Request, decide} and id_worlds::blob_gate::{FoldedWorlds, RefreshingWorlds}.

Key types and functions

  • sandbox::{Sandbox, WorldInstance, GuestCall, CallStats, CallMetrics} — the wasmtime runner for the Plaza ABI v1. Sandbox::compile(wasm, SandboxLimits) compiles a guest module; Sandbox::instantiate(seed) returns a WorldInstance; WorldInstance provides update, view, layout_at, records, wants, snapshot, restore, set_charge_key, and set_burn_budget. The runner accepts import-free guests only. Fuel budgets are the determinism canary named in the id-worlds lib.rs.
  • world::{WorldCore, WorldHandle} — the world state machine and its handle.
  • world_hub — the multi-world host; world_hub::testing is available under the test-utils feature.
  • world_store::{FileJournal, ModuleDir} — the on-disk journal and module storage.
  • shell_contract — the F13.1 shell contract that both shells speak; the contract file itself is pkgs/id/contract/shell-contract.v1.json.
  • program_bundle — the signed single-file program bundle (#8280): export, verify, and fork, fully offline.
  • guest_burn — guest fuel and burn budgets.
  • account_charge::{WorldChargeConfig, WorldAccountRegistry, ChargeMode} — per-account charging for world use.

Features and dependents

Features: default = []; sandbox = ["dep:wasmtime", "id-caps/sandbox", "id-core/sandbox"]; ssh = ["dep:russh"]; test-utils = [], never in production builds. Production dependents: the facade, id-cli, and id-web. Both shells dev-depend on id-worlds with the sandbox feature for their in-process host harnesses.

Embedding example

The facade’s game-post path is a real call site. pkgs/id/src/boards.rs:1592-1594 compiles a guest package through the facade’s id::sandbox re-export of this crate’s sandbox module:

#![allow(unused)]
fn main() {
let sandbox = crate::sandbox::Sandbox::compile(package_bytes,
    crate::sandbox::SandboxLimits::default())?;
let mut instance = sandbox.instantiate(0)?;
let genesis_bytes = instance.snapshot()?;
instance.restore(&genesis_bytes)?;
}

id-caps

Purpose (from its Cargo.toml): “Capability catalog, execution limits and world manifest of the id crate (pkgs/id crate split step 1, #4403)”. Its lib.rs describes the crate as the capability data model of id: the capability catalog, execution limits, and the declarative world manifest. It depends on id-core for id_core::json_unique only.

The lib.rs doc header is stale in the same pattern as the facade’s: it describes only the original three moved modules — world_caps and world_limits from id-core, world_manifest from the facade package. The crate publishes 18 public modules, not three (disagreement LIB-14).

Public modules

agent_delegation, cap_baseline, cap_class, cap_diff, declaration, http_fetch_url, library_attach, library_gate, library_manifest, library_resolution, mcp_bridge, mcp_policy, portal, used_caps, world_caps, world_limits, world_manifest, world_scopes.

The modules fall into families:

  • The catalog and its arithmetic: world_caps (the provider catalog), world_limits (execution limits), world_manifest (the declarative world manifest), world_scopes, cap_baseline, cap_class, cap_diff, and used_caps (which capabilities a program actually used).
  • Delegation: agent_delegation — AgentId, Role, RoleBinding, Delegation, JoinGrant, DelegationRefusal, and verify_join. This is the library form of the join-grant flow that Tutorial: join a world and run a guest app exercises from the command line.
  • The Roc library-import gate: library_manifest, library_resolution, library_gate, and library_attach — the pipeline that decides whether a Roc library import is admitted, exercised end to end by the fixtures in pkgs/id/examples/roc-import-policy/.
  • The MCP bridge: mcp_bridge and mcp_policy (#7914) — the translator and policy point that map MCP tool calls onto world-session frames. The bridge holds no credentials; the full tool list and policy rules are in The MCP bridge.
  • Singles: declaration (the provider declaration lifecycle: Filed, Admitted, Live, Suspended, Superseded, Stale, Tombstoned), http_fetch_url (URL handling for the http.fetch provider), and portal.

The provider catalog

world_caps registers the providers a guest can request through the wants protocol: time.now, time.tick, random.u64, players, players.list, chat.say, chat.history, records.read, kv.get, kv.set, kv.delete, blob.put, blob.get, blob.delete, http.fetch, notify, schedule.at, schedule.cancel, world.info, device.info, form.present, form.result, form.cancel, loc.position, and loc.watch, each with argument schemas and bounds. The client-provider namespace constant is CLIENT_PROVIDER_NAMESPACE = "client." at crates/id-caps/src/world_caps.rs:312. Grants and ceilings are enforced host-side: a known but ungranted request returns a refusal event with a stable error code, never silent execution. The error codes are cap_denied, unknown_cap, bad_args, failed, actor_denied, outside_ceiling, and result_too_large.

world_limits holds RuntimeLimits and the SandboxLimits / NativeLimits vocabulary. Serve-side defaults that reach these types are literal: --world-fuel defaults to 10000000 units, --world-memory-mib to 16, and --world-message-kib to 1024 (see serve and publications).

On the guest side, the Roc client library for the same catalog is RocCap, one of the six modules the shared platform package exposes (Screen, Key, RocJson, RocGrid, RocCap, RocText). RocCap keeps a session with request ids r0, r1, and so on, and provides issue, attach, requests, and route, plus request builders: chat_request (chat.say), now_request (time.now), players_request (players.list), world_request (world.info), history_request (chat.history), records_request (records.read), schedule_at_request, and schedule_cancel_request. The wire form is defined in Guest apps and shells as consumers.

Features and dependents

Features: default = ["sandbox"]; sandbox = [], a marker forwarded through the graph; test-provider = [], a test-only provider for the #1061 registry exit proof, never in production builds. Production dependents: the facade, id-cli, id-directory, id-web, and id-worlds.

Embedding example

The import gate’s real call site is a test that runs production code: crates/id-caps/tests/roc_import_policy.rs runs the full manifest, resolution, and gate pipeline from this crate against pkgs/id/examples/roc-import-policy/fixtures.json; the fixture directory’s README names that test as its executor. Inside the facade’s own source, id_caps:: is named 5 times, and the facade’s dev-dependency enables id-caps/test-provider for pkgs/id/tests/provider_registry_exit_proof.rs.

The data crates

Source: primary sources are the lib.rs and Cargo.toml files of pkgs/id/crates/id-core/, pkgs/id/crates/id-store/, pkgs/id/crates/id-events/, pkgs/id/crates/id-sync/, pkgs/id/crates/id-directory/, and pkgs/id/crates/id-groups/. This chapter is complete without following those links; they record provenance only.

Six crates hold the data layer under the world runtime: id-core (foundation leaves), id-store (blobs, chains, documents, tags, search), id-events (the event store and the group projection), id-sync (log sync, the meta protocol, envelopes, artifacts), id-directory (the home-server directory), and id-groups (group policy and enforcement). All six are reachable through the facade at id:: paths (see The id facade crate and the map in The crates). The on-disk formats these crates own are inventoried in Data stores and schemas.

id-core — 58 public modules

Purpose (from its Cargo.toml): “Foundation leaf modules of the id crate (Phase 1 of the pkgs/id crate split, #3447)”. Its lib.rs states the layering rule directly: the modules here are the crate’s leaves — everything in the binary crate depends on them, and they depended on almost nothing in it. At 79 .rs files it is the largest leaf crate by file count after id-worlds and id-cli.

Public modules: abuse, access, admission_gate, append_list, append_list_client, array_address, array_order, array_shorthand, block_list, boundary, boundary_surfaces, canonical_cbor, connectivity, content_id, discovery, durable_write, frames, graph (with submodules append_list, attribute, cross_signing, cursor, delegation, deletion, query, record, space_binding, term, version), hash_profile, hex, holders, id_namespace, id_shape, id_uri, id_uri_format, id_uri_parse, intranet, ip_evidence, iroh_hash, json_unique, key_envelope, location_ref, membership (with submodules body, frontier, gate, layer), namespace_definition, numeric_order, numeric_value, port, rejection, residency, residency_inventory, sanctions, sanctions_store, seed_phrase, signed_envelope, swarm, sync_method, text, time, transport_advertisement, triples, tuple, typed_value, and waiting. Feature-gated modules: petname, screen_codec, and world_presentation under world; qr under web; test_forgeries under any of test or the test-utils feature. The crate root also re-exports pub use unicode::is_format_char.

Key types, functions, and constants: KEY_FILE = ".iroh-key", CLIENT_KEY_FILE = ".iroh-key-client", SERVE_LOCK = ".iroh-serve.lock"; is_node_id (a 64-hex check); discovery (PeerDiscovery, PeerInfo, PeerAnnouncement, Defaults, resolve_config, defaults_provenance, MAX_PEERS — the facade re-exports 17 items from this module alone); port (the 9110 port contract vocabulary, re-exported onward by id-store, id-events, and id-worlds); tuple (sort-preserving encoding); canonical_cbor; frames (MAX_FRAME_BYTES); membership; holders; waiting; signed_envelope; key_envelope; seed_phrase; and the graph record model.

One disagreement concerns this crate’s re-export list. ARCHITECTURE.md lists the root’s id-core re-exports as 12 modules — abuse, access, connectivity, discovery, frames, holders, membership, rejection, residency, sync_method, tuple, waiting — plus constants and is_node_id. The code in pkgs/id/src/lib.rs also re-exports admission_gate unconditionally, petname and world_presentation under world, and qr under web (disagreement LIB-6). The full facade list is in The id facade crate.

Features: default = ["world", "sandbox"]; world adds rmp-serde and gates petname, screen_codec, and world_presentation; sandbox = []; web adds qrcode and gates qr; test-utils = []; test-provider = [] (test-only, for the #1061 exit proof). Dependents: all ten production consumers — the facade, id-caps, id-cli, id-directory, id-events, id-groups, id-store, id-sync, id-web, and id-worlds.

Embedding example: the facade binary calls this crate by its direct path at pkgs/id/src/main.rs:195 — let provenance = id_core::discovery::defaults_provenance(); — and the integration suite reaches the same modules through facade paths, for example id::waiting::WaitingLimits in pkgs/id/tests/first_app_poc.rs.

id-store — 26 public modules

Purpose (from its Cargo.toml): “Store layer of the id crate: store traits, blob store, event headers, documents, tags and search (pkgs/id crate split step 2a, #4405)”. Its lib.rs records two vocabularies it owns for layering reasons: the event store’s own types (event_types, range) sit below the event-store implementation in id-events, and the op vocabularies the signed header embeds (chat, notes, note_links, session_checkpoint, issuer_rotation, policy) live with chain::ChainExt, which carries them as fields.

Public modules: admission, chain, chat, chat_anchor, content_store, documents, event_types, graph_index, identity, issuer_rotation, media, namespace_registry, note_blocks, note_checkpoints, note_links, notes, numeric_registry, policy, range, search, session_checkpoint, store, store_traits, tag_claims, tag_index, and tags; plus pub use id_core::{port, content_id} and pub use store::STORE_PATH.

Key types and functions: store::StoreType (Persistent(FsStore) or Ephemeral(MemStore)), open_store, and load_or_create_keypair, with STORE_PATH = ".iroh-store"; chain::{ChainExt, Event, sign} — the signed event-header chain; store_traits, including EventStoreBackend, the consumer seam consumed via SharedEventStore; the admission hooks PrepareHook, OutboxHook, Reauthorizer, OperationLedger, MemoryOperationLedger, PrepareDecision, and OpState; the tag model in tags, tag_index, and tag_claims; documents::{DocumentRef, DOCUMENT_KIND}; and search, media, and the notes family.

Features: default = [] only. Dependents: the facade, id-cli, id-events, id-groups, id-sync, id-web, and id-worlds. This crate also dev-depends on the facade: its store_traits tests run against the real EventStore, and a comment in crates/id-store/Cargo.toml states that production code in id-store never names the facade.

Embedding example: the facade lib.rs quick-start is this crate’s surface reached through id:: paths — open_store(false).await?, store.as_store().blobs().add_bytes(…), store.as_store().tags().set(…). The tag commands in Tutorial: organise a library with tags and claims write into this crate’s tag store.

id-events — 12 public modules

Purpose (from its Cargo.toml): “Events layer of the id crate: event store, group projection, writer sets and sync gating (pkgs/id crate split step 2b, #4405)”.

Public modules: attestation (with attestation/v1), event_store (with submodules anchors, author_events, chat, claims, documents, ingest, range, resolve, sync, validity, waiting_rows, writer_set), event_sync, graph_admission, groups (with submodules delegation, event, fold, friendship, policy, wire), idset (with submodules expand, project, view), local_claims, local_events, pull_policy, residency_routes, residency_sync, and world_access; plus pub use id_core::port.

Key types and functions: EventStore (behind the Storage / FileStorage file seam) and Ingest; the attestation family — GenesisAgreement, ResultClaim, MatchState, sign_genesis, sign_claim, compute_state, SignError, and in v1 WitnessDecision, Objection, sign_witness_decision; the group model with the deterministic groups::fold projection — GroupView, Projection, Refusal, FoldError, DeviceGrant, friendship_id; writer sets — idset::{WriterSet, Entry, Excludes} and idset::view::expand_set; WorldAccess; and LocalEvents, surfaced to command code through the id-cli bridge module local_events.

Features: default = [] only. Dependents: the facade, id-cli, id-directory, id-groups, id-sync, id-web, and id-worlds.

Embedding example: pkgs/id/tests/first_app_poc.rs:33-45 imports event_store::{EventStore, Ingest} and the idset projection through facade paths in the same import block as the id-store modules, and the worked example in pkgs/id/examples/first-app-poc/README.md records that the PoC’s counted did-it view is an id-events / id-store composition, not new protocol code.

id-sync — 21 public modules

Purpose (from its Cargo.toml): “Sync layer of the id crate: log sync, the meta protocol, file operations and the meta client wire half (pkgs/id crate split step 3, #4406)”. Step 3c added the friend-envelope and artifact family (envelope, envelope_net, envelope_outbox, artifact), seamed to worlds and the directory through host::SessionHost and artifact::ArtifactSink.

Public modules: announcement, artifact, bridge, bridge_http, chained_message, dht, envelope, envelope_net, envelope_outbox, fanout_answer, federation (the module plus record_join, record_store, exchange_net, and slices b01 to b32), fileops, graph_frontier, host, log_sync, meta_client, protocol, registry, relay_gate, relay_ingest, and transfer. One further module, hex, is pub(crate).

Key types and functions: protocol::META_ALPN = b"/iroh-meta/3" and the MetaRequest / MetaResponse wire types; log_sync (p2panda log-sync sessions and the range-sync bridge; SyncProtocol); transfer (server-to-server file transfer, #5345, re-exported by the facade at id::transfer and exercised by Tutorial: store, share and fetch a file between two nodes); artifact (signed artifacts, push and pull); envelope_outbox::Outbox (an append-only journal, replayed on open); announcement::{Announcement, SignedAnnouncement} (sign and verify); dht (the opt-in mainline lookup policy); and the federation family (the #9106 federation exchange).

One naming trap is documented in the survey and worth repeating: this crate’s protocol module is the wire half of the meta protocol. The facade-facing MetaProtocol, FindMatch, and TaggedMatch surface lives in id-cli’s protocol module, not here. A second disagreement sits in this crate’s own lib.rs, which states that the MetaClient enum composition stays in the facade until step 7. Step 7b (#4411) has landed: pub enum MetaClient is defined at crates/id-cli/src/meta_client.rs:31, and the facade only re-exports the meta_client module from id-cli (disagreement LIB-10). The code behaviour is that MetaClient — the enum that chooses between a running server and the in-process local node — lives in id-cli.

Features: default = []; dht = ["dep:iroh-mainline-address-lookup"], off by default, with the facade forwarding its own dht feature here; test-utils = []. Dependents: the facade, id-cli, id-directory, id-web, and id-worlds.

Embedding example: id-cli’s serve code wires this crate’s surfaces into the running node, and the facade re-exports transfer at id::transfer; the id send command in Tutorial: store, share and fetch a file between two nodes is the user-visible end of that module.

id-directory — 15 public modules

Purpose (from its Cargo.toml): “Directory layer of the id crate: home-server directory, views, auth, mail, invites and seitan admission (pkgs/id crate split step 6b, #4409)”. It depends downward on id-core, id-caps, id-events, and id-sync, and never on id-worlds; the dependency runs the other way because WorldCore holds a directory::Directory as persisted state. The directory cluster used to live in id-worlds, which now re-exports these modules from this crate (disagreement LIB-8, covered in Worlds and capabilities as a library).

Public modules: directory (with directory/replica and directory/validate), directory_auth, directory_log, directory_mail, directory_view, invite, invites (with event and invitation), keyset, keyset_file, recovery, recovery_flow, recovery_relay, recovery_view, restored_key, and seitan (with accept, admit, derive, freshness, and token).

Key types and functions: Directory (new, open, replay, replay_read_only, append, sign_up, sign_up_keyed, add_key, remove_key, confirm_email, account_for, verify_account), Account, Group, Member, DirectoryEntry, Actor, and the BoundaryGate trait; the seitan V2 admission protocol (HMAC-SHA512 invite derivation with a scrypt stretch, per the facade Cargo.toml comments); and the keyset and recovery family (keyset, keyset_file, recovery, recovery_flow, recovery_relay, recovery_view, restored_key).

Features: default = [] only. Dependents: the facade, id-cli, id-web, and id-worlds.

Embedding example: id-worlds consumes this crate as persisted world state — WorldCore holds a directory::Directory — and re-exports directory, directory_auth, directory_mail, and directory_view so moved code keeps its historical paths. The web layer consumes the same crate for its directory routes (see The web UI: pages and HTTP API).

id-groups — 3 public modules

Purpose (from its Cargo.toml): “Groups layer of the id crate: group actions and log, local warnings, blob gate and group encryption (pkgs/id crate split step 4, #4407)”. Its lib.rs is explicit about the boundary: the group model does not live here. Model, fold, policy, friendship, and writer-set vocabulary are owned by id-events; this crate is the policy and enforcement remainder over that model.

Public modules: blob_gate; encryption (with submodules history, notice, ordering, roster, scheme, welcome); and groups (with submodules actions, log, warnings), which re-exports the id_events::groups model at the same paths.

Key types and functions: blob_gate::{BlobPolicy, Request, decide, decide_with_blocks, decide_with_local, blob_events, blob_events_with_blocks} — the decision of who may fetch or observe a blob, taken over the WorldAccess trait from id-events; encryption — group encryption on p2panda-encryption’s DataScheme, with a session adapter, causal ordering, history modes (HistoryMode, HistoryRequest, HistoryAnswer), and welcome chunking bounded by id_core::frames::MAX_FRAME_BYTES; and groups::actions (user group actions), groups::log, and groups::warnings (local size and churn warnings).

This crate’s lib.rs carries the stale FoldedWorlds sentence recorded as disagreement LIB-9: it parks FoldedWorlds in the facade pending step 5, but step 5 has landed and the type is defined at crates/id-worlds/src/blob_gate.rs:36. The code behaviour is that id-groups owns the gate policy (BlobPolicy, Request, decide) and id-worlds owns the FoldedWorlds implementation of the gate’s world trait.

Features: default = [] only. Dependents: the facade, id-cli, id-web, and id-worlds.

Embedding example: command code reaches the gate through the id-cli bridge module, which re-exports id_groups::blob_gate::{BlobPolicy, Request, decide} alongside id_worlds::blob_gate::{FoldedWorlds, RefreshingWorlds} — one import site, two owner crates, matching the policy/implementation split above.

Guest apps and shells as consumers

Source: primary sources are pkgs/id/examples/roc-world/ABI.md, pkgs/id/examples/roc-world/platform.roc, pkgs/id/crates/id-worlds/src/sandbox.rs, pkgs/id/crates/id-native-shell/src/lib.rs, and pkgs/id/crates/id-hw-shell/src/lib.rs. This chapter is complete without following those links; they record provenance only.

This chapter covers the two kinds of consumer that sit at the edge of the library: guest apps, which run inside a world under the sandbox, and shells, which connect to a world from outside and render it. Both consume the public surface only. Guests consume the Plaza platform package and the capability protocol; shells consume the facade crate (see The id facade crate). The host-side crates are covered in Worlds and capabilities as a library.

The shared platform package

All Roc guests build against one platform package, pkgs/id/examples/roc-world/: platform.roc plus a freestanding Zig host adapter (host/src/host.zig, host/src/native_worker.zig, and the generated host/src/roc_platform_abi.zig), pinned to Roc nightly-2026-10-04-130536d per the app READMEs, with Zig 0.16. The platform exposes six pure-Roc modules to apps, declared in platform.roc as exposes [Screen, Key, RocJson, RocGrid, RocCap, RocText].

Every app provides the same eight functions (the requires block in platform.roc); an app with no use for one provides a stub:

  • init : U64 -> model — the model, seeded from the host.
  • update : model, U64, Str -> model — the second argument is the participant id; participant 0 is host events.
  • view : model -> Str — legacy text or a portable screen document.
  • layout : model, U64, U64 -> Str — viewport-sized rendering.
  • records : model -> Str — a JSON object projection, mirrored by the host.
  • wants : model -> Str — subscriptions and one-shot capability requests, as JSON.
  • snapshot : model -> Str — state as text, for journal checkpoints.
  • restore : Str -> model — the inverse of snapshot.

update and view are pure. The platform requires no Task.

The Plaza ABI v1

The host/guest contract is the Plaza ABI v1, specified in pkgs/id/examples/roc-world/ABI.md. A guest module exports memory plus 14 plaza_* exports: plaza_abi_version (() -> i32, returns 1; optional for back-compatibility), plaza_alloc, plaza_free, plaza_init ((i64 seed) -> i32 model), plaza_update ((model, participant, event_ptr, event_len) -> model), plaza_view, plaza_layout (optional), plaza_records (optional), plaza_wants (optional), plaza_snapshot and plaza_restore (both present or neither), plaza_out_len (one shared output slot), and plaza_error_ptr / plaza_error_len (optional diagnostics, at most 4096 bytes). The required set is memory, plaza_alloc, plaza_free, plaza_init, plaza_update, plaza_view, and plaza_out_len.

There are no Wasm host functions. Guests compile to import-free Wasm modules: no WASI, and no filesystem, network, clock, or randomness imports. Every effect a guest needs goes through the wants capability protocol below. This is the central fact of the guest model, and it is what makes journal replay deterministic: host events are journaled, so replay feeds the same events back through update.

One documentation disagreement names the runner’s location. ABI.md and the Rust example READMEs locate the import-free guest runner at pkgs/id/src/sandbox.rs. That file does not exist. The runner is crates/id-worlds/src/sandbox.rs — id_worlds::sandbox::{Sandbox, WorldInstance}, built on wasmtime — surfaced to consumers as id::sandbox (disagreement LIB-7). The code location is the one to use.

The wants capability protocol

plaza_wants returns a JSON document of the form {"v":1, "subscribe":[…], "requests":[{"id":"r1","cap":"time.now","args":{…}}]}. The bounds are literal: at most 64 KiB per document, at most 64 subscriptions, at most 64 requests, and at most 4 distinct tick intervals. The host answers each request with a participant-0 update event of the form {"cap":"result","id":…,"ok":true,"value":…}, or with "ok":false and one of the stable error codes cap_denied, unknown_cap, bad_args, failed, actor_denied, outside_ceiling, result_too_large. Grants and ceilings are enforced host-side; a known but ungranted request returns a refusal event, never silent execution.

The runtime provider set named in ABI.md is time.now, time.tick (subscribed as time.tick:<ms>), random.u64, players (subscription), players.list, chat.say, chat.history, records.read, schedule.at, schedule.cancel, and world.info. The wider catalog registered in id_caps::world_caps adds kv.get, kv.set, kv.delete, blob.put, blob.get, blob.delete, http.fetch, notify, device.info, form.present, form.result, form.cancel, loc.position, and loc.watch (see Worlds and capabilities as a library).

The Roc client library is RocCap: a session issuing request ids r0, r1, and so on, with issue, attach, requests, and route, and builders chat_request, now_request, players_request, world_request, history_request, records_request, schedule_at_request, and schedule_cancel_request.

The nine Roc guest apps

Checked-in .wasm artefacts sit beside most apps, so the host conformance suites run without a Roc toolchain. pkgs/id/apps/tic-tac-toe/ is the sole packaged app; the other eight live in pkgs/id/examples/.

AppLocationWhat it does
tic-tac-toeapps/tic-tac-toe/Packaged two-player tic-tac-toe. Its app.toml declares [program] kind = "roc-world" and the guest is program/main.roc; the directory contains no Rust. Digit 0–8 moves, ply parity picks X or O, and records publishes {"board","plays","winner"}. The install path is serve-time: id serve --world-module … or id world install.
loungeexamples/lounge/Capability-system demo: subscribes to players and time.tick:5000, greets arrivals through chat.say requests with refusals counted as denied=N, and polls time.now.
roc-counterexamples/roc-counter/Tiny pure counter world: guests send inc, all participants see count=N; demonstrates records mirroring and the Screen presentation.
roc-text-counterexamples/roc-text-counter/The no-Screen legacy-text twin of roc-counter: imports no platform modules and keeps the plain-text presentation path covered (#3181).
roc-chatexamples/roc-chat/Minimal chat client on RocCap with chat.say and chat.history; typing hist shows the newest 8 lines.
roc-gridexamples/roc-grid/RocGrid demo: a 4×3 byte grid where set claims the centre cell; bounds-checked reads with a fallback.
roc-screenexamples/roc-screen/Screen and Key demo: a bordered-box counter screen document, + increments; presenters (SSH ANSI, browser DOM) render the structured grid.
territoryexamples/territory/Multiplayer territory game: at most 8 seated players on a 16×8 grid, adjacency-only claiming, seats persist across leave, rejoin, and restart.
roc-cap-demoexamples/roc-cap-demo/Library-import worked example (#5957): a capability-dependent Roc library (lib/Greeter.roc over records.read) plus its app, with two compile-must-fail negative tests — a missing capability on platform-no-caps.roc, and a wrong RocCap signature.

Two neighbours in examples/ are not apps. examples/roc-world/ is the shared platform package itself, and examples/roc-import-policy/ is a compile-fixture matrix (fixtures.json) for the import gate (#5994, #5956), executed by the id-caps integration test.

The Rust twins

The Plaza ABI has a Rust guest SDK beside the Roc platform: examples/rust-world/ provides the plaza_sdk::World trait and the plaza_guest! macro, which emit the same 14 exports, with modules screen, json, grid, cap, and text mirroring the Roc libraries. examples/rust-counter/ is its counter example; the checked-in counter.wasm is the host conformance fixture. A Rust guest and a Roc guest are interchangeable to the host: the runner checks exports and the wants protocol, not the source language. Writing a first guest is covered in Add a Roc guest app.

One Rust file in examples/ is not a guest at all: examples/session_checkpoint_poc.rs is a self-contained throwaway proof of concept (#2241) that deliberately uses no id:: API. The first-app proof of concept (examples/first-app-poc/) is a README only; its executable artefact is the integration test pkgs/id/tests/first_app_poc.rs, by design.

Shells as consumers of the facade

Both shells are workspace members but not default members, and both production-depend on the facade with default-features = false, features = ["world"]. ARCHITECTURE.md lists them as workspace members with no dependents, which is true and incomplete: they are consumers of the public surface — in fact the only two production consumers of the facade outside the workspace’s internal graph (disagreement LIB-12). Each also dev-depends on id-worlds with the sandbox feature for tests.

id-native-shell

Purpose (from its Cargo.toml): “Native reference shell for id (F13.6, design #788): a Bevy client speaking the F13.1 shell contract”. The contract itself is pkgs/id/contract/shell-contract.v1.json, owned host-side by id_worlds::shell_contract.

The shell is a client only. It connects to a world host over the existing session protocol, renders the host’s view frames, and emits only the client frames the contract already names: input, paste, resize, chat. It adds no frame kinds, needs no host change, and no shell frame depends on the guest ABI.

Public modules (7): audio, events, form, providers, render, scene, widget; a private session module’s surface is re-exported at the crate root, as is providers. The library surface includes the frame builders input_frame, input_frame_with_revision, paste_frame, resize_frame, chat_frame, agent_join_frame, screen_subscribe_frame; the view fallback present(data, surface); ShellConfig::new(world); FrameError; and session::run_session, the live WorldClient session loop feeding render::PresentedView. The binary is src/main.rs: it parses --node and --capability, builds a Bevy App with DefaultPlugins plus the shell’s render, scene, audio, and widget plugins, and — when a node is given — runs a SessionBridge resource.

The session connects through the facade, not through id-worlds directly: the connect helper above main calls id::world_net::WorldClient::connect(&endpoint, addr). That call is the shell-as-consumer pattern in one line. The shell’s command-line surface — a hand-rolled parser with no clap, no --help, and exit code 2 on argument errors — is documented in id-native-shell.

Renderer coverage follows design #788 steps 1 and 2, both in the code: step 1 delivered the isolated package, identity and connection bootstrap, contract frame builders, the view fallback, and a transcript fixture checked against the machine-readable contract; step 2 added the window and render plugin set and the live session loop. render renders validated surfaces as styled Bevy UI; scene renders validated scene/1 surfaces as 3D entities via bevy_pbr; audio turns validated audio/1 surfaces into scheduled cue entities — presentation state only, since this feature set carries no audio output backend; widget places validated widget/1 surfaces as control entities. A shell without a renderer for a surface keeps that surface’s text projection; the fallback rule is uniform across scene, audio, and widget. Bevy is pinned at 0.19 with a hand-picked feature set (bevy_core_pipeline, bevy_pbr, bevy_render, bevy_text, bevy_ui, bevy_window, bevy_winit, default_font, with x11 and wayland gated to Linux targets). tests/live_session.rs proves the durable-outcome half of the parity criterion against a live host.

id-hw-shell

Purpose (from its Cargo.toml): “ESP32-class hardware shell spike for id (more-shells v1 slice 3, #10929): the presence + journal-head + confirm/act subset of the F13.1 shell contract”. The design source is doc/2026-11-10T20-40-00Z_design_more_shells_v1 §3.

The whole crate is one src/lib.rs of 996 lines with 0 public modules. Its API: CONTRACT_NAME = "shell" and CONTRACT_VERSION = 1; capability_statement() -> serde_json::Value; HwShell (new(), head() -> u64, presence() -> &BTreeSet<String>, diverged(), last_status(), choice() -> Option<PresentedChoice>, and the fold/update entry points returning HwUpdate); PresentedChoice and SelectableField (id, label, required, options, confirm); and HwError.

The subset is the deliverable. The shell implements exactly three parts of the contract: presence (a wake-time read of the snapshot’s participant list, with journal joined and left events folded on top), journal-head state in compressed form (the newest durable sequence folded, nothing else), and confirm/act (answering a presented form choice with a form_result frame: submit or cancel, choice selections, yes/no). Rich rendering, free text, and world hosting are excluded by name in capability_statement(), and the code enforces the exclusions: the only client frames the crate can build are join and form_result, and a form requiring free text is refused with HwError::FreeTextExcluded. Every built frame is checked against the embedded F13.1 contract before return, and every folded frame is checked on the way in.

The crate is transport-free by design: the frame builders and the fold are pure, so the same code runs over a real iroh session on a device and over recorded frames in tests. Its power posture is that no live session is held open — the device wakes, joins, folds to the journal head, acts if a choice is presented, and disconnects. If a resume replay does not continue contiguously from the recorded head, continuity is unprovable and the shell discards its folded presence and waits for a fresh snapshot. It is a spike, complete at its stated subset, not a port in progress.

Tutorial: store, share and fetch a file between two nodes

This tutorial stores a file on one node, starts that node as a server, and fetches the file from a second node. Both nodes run on one machine, in two separate data directories, so every step is repeatable without a second computer. The two nodes find each other through the default gossip discovery and mDNS, which is on by default. All data in this tutorial is toy data: one text file named notes.txt containing one line.

Commands used here are documented in File commands: put, get, find and kin and serve and publications. The global flags --new and --data-dir are documented in The id command line.

Step 1: create the first node’s data directory and store the file

--new <NAME> creates .iroh/<NAME>/ under the current directory and runs the command inside it. It fails if the directory already exists, so use it exactly once per node.

printf 'hello from node a\n' > notes.txt
id --new node-a put notes.txt

id put stores the file’s bytes as a content-addressed blob and records the name notes.txt for it. A file argument of the form path:name stores the file under a different name; this tutorial keeps the file’s own name.

Confirm the store:

id --data-dir .iroh/node-a list

--data-dir <DIR> reuses an existing data directory; it is the documented way to run later commands against a directory that --new created. The list prints notes.txt.

Step 2: print the first node’s ID

id --data-dir .iroh/node-a id

id id prints the node’s server identity: a 64-character hex node ID. Copy it exactly; the next steps use it as <NODE_A_ID>. A mistyped ID fails with the error invalid node ID: must be 64 hex characters and exit code 1.

Step 3: serve the first node

In a terminal that stays open:

id --data-dir .iroh/node-a serve

id serve runs indefinitely. It hosts the blobs in the store and answers remote file operations from other nodes. Gossip discovery and mDNS local discovery are both on by default; this tutorial passes neither --no-gossip nor --no-mdns. Leave this terminal running for the rest of the tutorial.

Step 4: create the second node and fetch the file

In a second terminal, create the second node’s data directory by storing nothing yet — id list against a fresh directory is enough to create it:

id --new node-b list

The list is empty. Now fetch the file from the first node. In id get, when the first positional argument is a 64-character hex node ID, it is consumed as the remote node and the remaining arguments operate there:

id --data-dir .iroh/node-b get `<NODE_A_ID>` notes.txt

This downloads the blob named notes.txt from node A and writes it to a file named notes.txt in the current directory. A get argument of the form source:output chooses a different output name, and an output of - writes to stdout.

Confirm the fetch in three ways:

cat notes.txt
id --data-dir .iroh/node-b list
id --data-dir .iroh/node-b cat notes.txt

The first command prints hello from node a. The list now shows notes.txt in node B’s own store: a successful get stores the blob locally, it does not stream it on every read. id cat is get forced to stdout, and prints the same line from node B’s store.

Step 5 (alternative): push the file server-to-server with send

Fetching is a pull. id send is the push form: the source server copies the file to the destination server with its own identity, and no bytes pass through the client issuing the command.

First print node B’s ID:

id --data-dir .iroh/node-b id

Then, with node A still serving, store a second file on node A and send it:

printf 'second file\n' > second.txt
id --data-dir .iroh/node-a put second.txt
id send `<NODE_A_ID>` second.txt --to `<NODE_B_ID>`

--to <DEST_NODE> is required. The flag --as <NAME> sets a different destination name; the flag --replace archives the old destination file first when the destination already holds that name. Afterwards, id --data-dir .iroh/node-b list shows second.txt without node B having run a get.

What success looks like

  • id --data-dir .iroh/node-b list lists both notes.txt and second.txt.
  • id --data-dir .iroh/node-b cat notes.txt prints hello from node a.
  • The fetched files are byte-identical copies in node B’s own store, listed and readable after node A’s serve is stopped.

One failure shape

Run the fetch with node A’s serve stopped, or with a name node A does not hold:

id --data-dir .iroh/node-b get `<NODE_A_ID>` missing.txt

The command fails with a not-found error — file not found on remote for a missing name on a reachable node — printed as Error: <message> on stderr with exit code 1. Nothing is written locally: no partial file and no entry in node B’s list. Start node A’s serve again, check the name with id --data-dir .iroh/node-a list, and re-run the get.

Tutorial: organise a library with tags and claims

This tutorial organises a small library of stored files with two different metadata systems that the command line keeps separate. Tags (id tag) are file metadata held in the node’s tag store: key/value pairs attached to a file, with multiple values allowed per key. Claims (id claim) are statements about a subject held in the event store: a name and an optional value, in either the shared scope or the local scope. Tags answer “what did I label this file”; claims answer “what is asserted about this subject, and who else can see it”. All names and values in this tutorial are toy data.

The tag family is documented in The tag family; claims, documents, and groups are documented in Groups, documents, claims and keys. Claims live in the event store, selected by the global flag --event-store <DIR>, whose runtime default is the directory events inside the data dir.

Step 1: store three files

id --new library put shopping.txt reading.txt photos.txt

Create the three files first with any content; the content does not matter for this tutorial. The command form is the one from Tutorial: store, share and fetch a file between two nodes: --new <NAME> creates .iroh/library/ once, and later commands in this tutorial reuse it with --data-dir .iroh/library.

Step 2: set tags

id tag set <FILE> <KEY> [VALUE] attaches one value. Run it again with a different value to attach a second value under the same key; a key with no value is a key-only tag.

id --data-dir .iroh/library tag set shopping.txt kind list
id --data-dir .iroh/library tag set shopping.txt topic food
id --data-dir .iroh/library tag set reading.txt kind list
id --data-dir .iroh/library tag set reading.txt topic books
id --data-dir .iroh/library tag set photos.txt kind photo
id --data-dir .iroh/library tag set photos.txt pinned

The last command sets a key-only tag named pinned on photos.txt. Binary values are supported without putting raw bytes on the command line: --value-hex <HEX> takes a hex value, and --value-file <PATH> reads the value from a file (- reads stdin). The two flags conflict with each other and with the positional value.

Step 3: read tags back

id --data-dir .iroh/library tag list
id --data-dir .iroh/library tag list shopping.txt

With a file argument, tag list prints that file’s tags; without one, it prints tags for every file. Display defaults are literal: a non-UTF-8 value is shown as <binary N bytes>, and values are truncated at 256 bytes. The flags --hex and --binary change the value display, and --no-truncate prints full values.

Step 4: search by tags

id tag search takes structured terms, and all terms must match (they are ANDed). A term is one of key:, :value, key:value, a "literal" quoted string, or a bare word matched case-insensitively across subject, key, and value.

id --data-dir .iroh/library tag search kind:list
id --data-dir .iroh/library tag search kind:list topic:books
id --data-dir .iroh/library tag search pinned

The first search lists shopping.txt and reading.txt. The second lists only reading.txt. The third lists photos.txt, matched on its key-only tag. The same query forms work against stored files in general search: id search kind:list is not a tag search — for file search by name and hash, see File commands: put, get, find and kin. Keep the two apart: tag search queries the tag store; find and search query file names and hashes.

Step 5: remove a tag value

id tag del <FILE> <KEY> [VALUE] with a value removes that one value. Without a value it deletes every value for the key, plus the key-only tag.

id --data-dir .iroh/library tag del photos.txt pinned
id --data-dir .iroh/library tag list photos.txt

The list for photos.txt now shows kind with value photo, and no pinned entry.

Step 6: set claims, shared and local

id claim set <SUBJECT> <NAME> [VALUE] records a claim about a subject. The default scope is shared. The flag --scope <shared|local> selects the scope explicitly, and a local: prefix on the name is shorthand for the local scope when --scope is absent.

id --data-dir .iroh/library claim set reading.txt status finished
id --data-dir .iroh/library claim set reading.txt local:rating 5
id --data-dir .iroh/library claim set photos.txt status unreviewed

Read them back and search them:

id --data-dir .iroh/library claim list reading.txt
id --data-dir .iroh/library claim search status
id --data-dir .iroh/library claim search status finished

claim list <SUBJECT> prints every claim about one subject. claim search <NAME> [VALUE] finds claims by name, optionally narrowed to one value: the first search lists both status claims, the second lists only the claim about reading.txt. id claim review lists claims awaiting review and takes no arguments.

Step 7: move a claim between scopes, deliberately

id claim scope <SUBJECT> <NAME> <shared|local> moves an existing claim. Moving a local claim to the shared scope publishes it, and that direction requires the confirmation flag --yes:

id --data-dir .iroh/library claim scope reading.txt rating shared --yes
id --data-dir .iroh/library claim clear photos.txt status

claim clear <SUBJECT> <NAME> removes a claim outright; after the second command, claim search status lists only the claim about reading.txt.

What success looks like

  • tag search kind:list lists exactly shopping.txt and reading.txt.
  • tag list photos.txt shows kind = photo and, after Step 5, no pinned entry.
  • claim list reading.txt shows status = finished and rating = 5, with rating in the shared scope after Step 7.
  • claim search status lists one claim: the one about reading.txt.

One failure shape

Omit --yes in Step 7:

id --data-dir .iroh/library claim scope reading.txt rating shared

The handler refuses the move, because it would publish a local claim, and exits with code 1. The claim stays in the local scope — claim list reading.txt still shows it as local — and no partial move is recorded. Add --yes to confirm the publication and re-run. This refusal is the scope system’s guard working as designed: a local claim never becomes shared as a side effect of a command that did not confirm publication.

Tutorial: join a world and run a guest app

This tutorial has two halves, and the split between them is the honest shape of the feature. The first half is fully local: scaffold a world program, run it in the offline scratch-world loop, and check the toolchain. No server, no token, and no network are involved. The second half needs a hosted world: a running id serve --world on some node, an admin token held by that node’s operator, and a guest capability the operator issues to you. A reader working alone runs both halves on one machine by operating the serve themselves; a reader joining someone else’s world starts at Step 4 with a node ID and a capability from that world’s operator.

World commands are clients. id serve is the only command that hosts a world (the F13.8 client-only boundary, stated in its long help). The commands are documented in World commands: joining and playing and World commands: administering and verifying; the guest model itself is in Guest apps and shells as consumers.

Part 1: the local loop

Step 1: scaffold a world program

id world new my-world

id world new <DIR> is a local-only command. It scaffolds main.roc, build.sh, and README.md in the directory. The flag --name <NAME> sets the world name and defaults to world. The directory must be absent or empty.

Step 2: run the scratch-world loop

id world dev my-world

id world dev <DIR> runs the fully offline scratch-world loop: it compiles the program and drives it locally, then prints one JSON report. Useful flags, with their literal defaults: --seed <N> defaults to 1; --input <TEXT> is repeatable and feeds one input per occurrence; --fixture <FILE> is repeatable; --fuzz <FILE> runs a fuzz fixture with --fuzz-seed <N> defaulting to 42 and --fuzz-cases <N> defaulting to 32; --watch re-runs on change, with --watch-max-cycles <N> defaulting to 1000 and --watch-debounce-ms <N> defaulting to 150. The flags --platform <DIR> and --roc <BIN> override the platform package and the Roc compiler; when unset, the compiler falls back to roc on the PATH and the platform to ./examples/roc-world.

Edit my-world/main.roc, re-run id world dev my-world, and read the JSON report after each change. This loop is the whole local development story: compile, run, inspect records and output, repeat. Two more offline commands support it: id world doctor checks the Roc toolchain and related state (it exits non-zero only when a check fails; warnings do not fail it), and id world measure --module <FILE> measures a compiled module’s fuel use offline and prints one JSON object.

id world dev, id world measure, id world replay, and id world verify exist only in builds with the sandbox feature, which the default build has (default = ["sandbox", "world"]). In a build without it, clap reports these four as unrecognized subcommands.

Part 2: a hosted world

Step 3: the operator starts a world host

On the host node, the operator runs:

id serve --world --world-admin-token `<TOKEN>` --world-module `<MODULE.wasm>`

--world hosts a multiplayer world and requires --world-admin-token. The token value is a secret: it is supplied by flag or by the environment variable named ID_WORLD_ADMIN_TOKEN, and it is never printed in this book — only the name is. --world-module <FILE> takes a precompiled Wasm module in the Roc ABI and also requires --world; loading it requires a build with the sandbox feature. The world name flag --world-name <NAME> defaults to lobby, and the world’s files live in .id-worlds/<NAME>/. Instead of a precompiled module, the operator can let guests install Roc source: the flag --world-source-only (environment variable ID_WORLD_SOURCE_ONLY) restricts installs to Roc source and conflicts with --world-module.

The operator prints the host’s node ID with id id and gives three things to each joining reader: the node ID, the world name if it is not lobby, and — after Step 4 — a capability.

Step 4: the operator invites you

An invite is minted per participant:

id world invite `<NODE_ID>` --admin-token `<TOKEN>` --name Ada

--name <NAME> is required: it is the participant’s display name. The flag --role <ROLE> accepts spectator, observer, player, guest, delegator, builder, or moderator, and its documented default is guest. The flag --expires-in <DURATION> takes values such as 12h or 3d; its documented default is 7 days and the maximum is 30 days. The flag --uses <N> requires a value of at least 1; omitted, the invite is unlimited. The command prints the guest capability. Treat that capability as a credential: it travels by the flag --capability or the environment variable named ID_WORLD_CAPABILITY, and command definitions mark both token flags hidden.

Step 5: join

id world join `<NODE_ID>` --capability `<CAPABILITY>`

The flag --world <NAME> (environment variable ID_WORLD) selects a world other than the host’s default. The flag --via <iroh|ssh> defaults to iroh; with ssh, the node argument is a [user@]host[:port] address instead of a node ID. The flag --after <SEQ> resumes from a journal sequence. Inside the session, input lines are chat by default; with --command-mode, stdin lines are parsed as session commands (/chat, /records, /stats, /caps, /quit, and others), and --json — which requires --command-mode — prints session output as JSON.

Once joined, the guest program runs on the host. Your inputs go to its update, its view comes back to your terminal, and its capability requests are answered by the host under the grants your capability carries — a request outside those grants returns a refusal event, not an error that ends the session (see Worlds and capabilities as a library).

Step 6: read records and check capabilities

From a second terminal, while joined or after:

id world records `<NODE_ID>` --capability `<CAPABILITY>`
id world caps `<NODE_ID>` --capability `<CAPABILITY>`

id world records prints the world’s published records; the flag --prefix <PREFIX> filters them. For tic-tac-toe, the records are the JSON object {"board","plays","winner"} that the guest publishes. id world caps with only a guest capability reads the capability state; changing grants (--grant, --revoke, --ceiling) requires the admin token as well.

What success looks like

  • Locally: id world dev my-world prints one JSON report with no compile error, and the report’s records match what main.roc computes.
  • Hosted: id world join connects, the guest’s initial view renders in the terminal, inputs change the view, and id world records prints the records the guest publishes.
  • The operator’s side agrees: the world named lobby (or the chosen --world-name) is the one your session joined, visible in the host’s session counts (id world stats <NODE> --capability <C> prints one JSON object).

One failure shape

Run any id world command other than the four parser-gated ones against a binary built without the world feature — for example a bare --no-default-features build:

id world join `<NODE_ID>` --capability `<CAPABILITY>`

The full world command tree parses, and --help prints it, but the invocation fails at runtime with the message this build has no world support and exit code 1. No connection is attempted. The fix is a build with the default features (sandbox and world) — the Nix id-web package and a plain cargo build both qualify. The related local failure is the mirror image: on a build without sandbox, id world dev does not fail at runtime — it does not exist, and clap exits with code 2 reporting an unrecognized subcommand.

Tutorial: edit a document together in the web UI

This tutorial runs one node with the web UI, creates a document, and edits it from two browser windows at once. Both windows connect to the same collaborative editing session, see each other’s cursors, and converge on one document. One machine is enough: the second window can be a second browser profile or a private window. A second person on the same network works too, with the bind and token changes noted in Step 1.

The web UI is documented in The web UI: pages and HTTP API, and its wire protocol in WebSocket protocols. The editor stores documents in the same blob store as the command line, so a file written here is visible to id list and id cat afterwards — the path between the two surfaces is Tutorial: store, share and fetch a file between two nodes in reverse.

Step 1: serve with the web UI

id --new collab serve --web

--new collab creates the node’s data directory .iroh/collab/; on later runs reuse it with --data-dir .iroh/collab. The flag --web starts the HTTP web UI. Its literal defaults: --port is 3000 and --bind is 127.0.0.1, so the UI is at http://127.0.0.1:3000 and reachable only from this machine. Startup prints a warning when a web listener is bound without a gate token. For this tutorial on one machine, the loopback default is the correct posture and the warning is expected.

To let a second person on another machine in, both changes are needed: bind a non-loopback address with --bind or a repeatable --web-listen <IP:PORT>, and set a gate token with --web-token (environment variable name ID_WEB_TOKEN). The token is a secret value and is never printed in this book — only its name is. A visitor supplies it once; the server accepts it as the cookie named id_token, as an Authorization: Bearer header, or as a ?token= query parameter, which sets the cookie and redirects to the clean path. The flag --web-cookie-secure marks the cookies Secure for deployments behind a TLS-terminating proxy.

One build requirement: the binary must have the web feature. The Nix id-web package (the default package) is built with web + sandbox + ssh + world; a plain default Cargo build is not — its defaults are sandbox and world only.

Step 2: create the document

Open http://127.0.0.1:3000 in the first browser window. The home page lists worlds and globally tagged documents. Go to the file browser at /files and create a new file named meeting-notes.md. Creation posts to POST /api/new; saving posts editor content to POST /api/save. The .md extension selects the Markdown content mode, one of the four editable modes: Rich (.pm.json ProseMirror JSON), Markdown (.md and .markdown), Plain (.txt), and Raw (code and config extensions, and the default for unknown extensions). Editable modes get the editing toolbar in Rich, Markdown, and Plain modes.

Type two lines of toy content:

Meeting notes
First line written by window one.

The editor auto-saves. The file is now a named blob in the node’s store.

Step 3: open the same document in a second window

In the second window, open the editor URL for the same file: http://127.0.0.1:3000/edit/meeting-notes.md. The route is GET /edit/{*name} — editing is by name. (The related routes are GET /view/{*name} for a read-only view, GET /hash/{hash} to redirect from a content hash to its named file, and GET /blob/{hash} for raw bytes.)

Both windows now hold a WebSocket connection to /ws/collab/{doc_id}, where the document id identifies this document’s editing session. The protocol is binary MessagePack, with messages as arrays [tag, …fields]. On connect, the server sends Init, [0, version, doc, mode]; the client answers Auth, [8, token], when a gate token is in force, and receives AuthOk, [9, client_id, name, token?]. Keep both windows open and side by side.

Step 4: edit together

Type a line in window one. The edit leaves as Steps, [1, version, steps, clientID]; the server acknowledges it to window one with Ack, [3, version], and broadcasts it to window two as Update, [2, steps, clientIDs], where the editor applies it. Move the cursor in either window: Cursor frames, [4, clientID, head, anchor, name?, idleSecs?], flow in both directions, and each window renders the other window’s named cursor. When a client disconnects, the server broadcasts CursorRemove, [6, clientID], and removes the cursor state 5 minutes after disconnect.

Edit the same line from both windows in turn. Both editors converge on the same text: the server orders the steps, and each client applies the server’s Update stream. When a save produces a new stored version, the server sends NewVersion, [7, hash, name] to the connected clients.

Two protocol details worth knowing while you watch it work. A named editing session can publish a durable note-session checkpoint: the client sends Checkpoint, [10, text], and the server answers Checkpointed, [11, head], where the head is the hex of the new note head revision; filename sessions refuse Checkpoint. And the connection is kept alive on a fixed cadence: the server pings every 30 seconds of inactivity, every 2nd ping cycle sends an empty text message instead (the cursor-refresh ping), and a connection with no pong or message for 30 minutes is closed. Document state is cleaned up 1 hour after the last client leaves.

Step 5: confirm the result outside the browser

Back in a terminal, read the document through the command line:

id --data-dir .iroh/collab list
id --data-dir .iroh/collab cat meeting-notes.md

The list shows meeting-notes.md, and cat prints the final merged text, including the lines written from both windows. The web UI and the CLI are two surfaces over one store; nothing was exported or converted.

What success looks like

  • Both windows show the same document text, updating live as either side types.
  • Each window shows the other window’s cursor with its display name.
  • id cat meeting-notes.md prints the merged final text from the node’s store.
  • The document survives a restart: serve again with --data-dir .iroh/collab serve --web and reopen /edit/meeting-notes.md to continue editing it.

One failure shape

Start the web UI on a binary built without the web feature — a plain default Cargo build, whose features are sandbox and world:

id serve --web

Startup fails before anything is served, with the error the web interface was requested (--web/--web-listen/--port/--bind), but this id binary was built without the web feature; rebuild with --features web to serve it, and exit code 1. The same guard fires when --web-listen, or an explicitly set --port or --bind, is given without --web. Rebuild with --features web or use the Nix id-web package, and re-run Step 1.

Design: foundations — objects, graph and the file core

This chapter covers the foundation layer of the ID design archive: 32 of the 408 ID-programme design records classified in the book survey. It describes the system as designed in those records. A designed behaviour in this chapter is a statement about the design archive, not a statement that the behaviour runs today; the final section separates the two.

Two epics frame the chapter. Epic #2056 is the core ID programme epic: most design records in the archive state Programme: epic #2056 in their headers, and the programme charter record (2026-11-23T12-06-42Z_design_id_program_investigation_prompt, 2026-11-23) defines ID as a local-first, federated, capability-based application platform. Epic #9106 covers extensible primitives, federation and namespaces; its Part A is the core this chapter describes, Part B is federation and trust, and Part C is the Atlas-facing work tracked as #9109. The store-port contract thread under #9106 is #9110, with slices #10191 and #10213 and the adoption call #9082.

The object model and the signed event graph

The foundation design puts a signed event graph under every other subsystem. The records treat graph objects as the unit of storage and exchange: content-addressed blobs hold bytes, and signed events record who asserted what, in which order, under which authority. Three records fix the invariants the rest of the programme builds on:

  • 2026-11-01_design_id2898.md (2026-11-01) states the admission rule in its title: reconstruction is admission. A node admits an object by reconstructing and verifying it, not by trusting the peer that delivered it. The same rule is homed in the capability chapter’s record set because admission is also a capability boundary; see Design: capabilities and providers.
  • 2026-11-01_design_id3231.md (2026-11-01) designs one receipt contract for pkgs/id artifacts (#3231), and 2026-11-04_audit_id3232_receipt_validation.md (2026-11-04) is the Phase 3 audit of receipt validation under #3232. The design intent is a single receipt format across artifact types instead of one format per subsystem.
  • 2026-11-17_design_id_sign_time_refusal.md (2026-11-17) states the signing-side complement: sign only what receipt would accept. Signing and receipt validation are designed as two ends of one contract.

The graph also carries session structure. 2026-11-01_design_id2240.md (2026-11-01) designs a session header plus a segment checkpoint event kind, so a long event stream has named segments and checkpoint points instead of one undifferentiated chain. 2026-11-01_design_id805.md (2026-11-01) designs delta and binary frames (F12.11), the frame-level encoding for moving graph updates between nodes.

Retrieval of large graph objects gets its own investigation: 2026-10-30T19-28-00Z_investigation_bittorrent_chunk_retrieval_for_graph_objects (2026-10-30) examines BitTorrent-style chunk retrieval for graph objects (archive list item 14b). The record is an investigation, not a decision; the chapter records it as an open design direction, unverified as adopted.

Three naming layers sit on top of content addressing in the design:

  1. Content hashes name immutable bytes.
  2. The id:// URI scheme names objects and namespaces in a portable text form. 2026-11-17T04-55-00Z_design_id9117_id_uri_scheme.md (2026-11-17) is the design record for the scheme and its per-namespace handlers and encodings (#9117).
  3. Friendly names give people local, human-readable references. The lineage is three records deep: 2026-10-30T13-25-00Z_design_friendly_name_references.md (2026-10-30) specifies local-store friendly-name reference resolution as the proof of concept for #2259; 2026-11-01_design_id2259.md (2026-11-01) is the #2259 design itself; 2026-11-04T15-33-00Z_design_friendly_name_fanout.md (2026-11-04) extends resolution to cross-store fan-out as a first slice (v2).

2026-11-17T22-00-00Z_design_id9114_related_path_links.md (2026-11-17) designs related path links carried in hash.metadata (#9114, sections S3.21–S3.22 of its parent design), so a hash can point at related paths without a separate index. 2026-11-17_design_id9127_append_list_user_attributes.md (2026-11-17) and 2026-11-23_design_id9128_social_app_reference_model.md (2026-11-23) extend the object model at the edges: append-list user attributes (#9127) and a social-app reference model (#9128).

Atlas enters the foundation design at two points. 2026-11-09T07-20-00Z_design_atlas_id_publication (2026-11-09) designs the Atlas-to-ID-graph publication format: corpus objects plus provenance and lineage relations published as ID-graph objects. 2026-11-13T00-41-00Z_design_id-atlas-primitives-federation-namespaces (2026-11-13) is the proto-design for ID/Atlas extensible primitives, federation and namespaces, and 2026-11-13T03-40-00Z_design_id-atlas-summit (2026-11-13, a 104-file bundle) records the summit decisions, defaults and owner questions across its parts A, B and C. These records are the foundation end of the #9106 Part C / #9109 thread.

The file core and its design lineage

ID began as a file-sharing system, and the foundation records keep the file core as a first-class layer rather than a legacy residue. The original architecture, preserved in pkgs/id/ARCHITECTURE.md, is a CLI, REPL and web UI over protocol, store, tag store and discovery layers, over Iroh blobs, docs and gossip, with an alpha/omega dual-index tag system. The design records then extend that core:

  • 2026-11-01_design_id2146.md (2026-11-01) designs programs as websites in id serve, turning the file-serving core into a program host.
  • 2026-11-02T11-47-29Z_design_web_listeners (2026-11-02) designs web listener bindings for id serve.
  • 2026-11-04T21-50-26Z_feature_dynamic_publications_runtime (2026-11-04) designs the dynamic publication runtime apply path and its operator CLI.
  • 2026-11-04T10-46-17Z_design_listing_origin_and_upload_time (2026-11-04) adds file listing provenance: origin node and upload time in list output. The origin stamp is the design ancestor of the origin key that FileOps writes at first write (#4973); the FileOps design itself is covered in Design: sync, replication and FileOps.
  • 2026-10-29T12-50-36Z_design_id_app_packaging (2026-10-29) designs ID app packaging: an app manifest, a folder layout, and TUI/web parity as a packaging requirement.
  • 2026-11-07T04-33-34Z_architecture_secure_public_web_routers (2026-11-07) designs secure public web router constructors, the boundary between the local file UI and publicly served routes.

Two records fix housekeeping rules for the whole object space. 2026-11-08T10-28-00Z_design_id6009_public_domain_normalization (2026-11-08) normalizes public-domain storage to CC0-1.0 for content and 0BSD for code. 2026-11-08T09-12-27Z_design_id-self-hosting-interop-stance (2026-11-08) records the self-hosting and interoperability stance. 2026-11-08T23-17-06Z_design_id_setup_ceremony (2026-11-08) designs the native ID creation and setup ceremony, the first-run path that creates an identity and its stores. 2026-11-04T05-11-11Z_feature_structured_logging (2026-11-04) designs structured operational logging for the whole binary.

The payload grammar has its own record: 2026-11-16_decision_id5753_kdl_fork_section5.md (2026-11-16) decides the KDL fork design pass for #5753 section 5 — payload grammar, extension marking and serde form. 2026-11-09_audit_3068-phase3-closing.md (2026-11-09) is the Phase 3 closing audit of the parsed-form contract (#3068 / #3069). 2026-11-08T13-20-00Z_research_id6014_ocapn_captp_watch (2026-11-08) is a watch record on OCapN / CapTP stability and the CapTP bridge spike (#6014): the foundation design tracks that protocol family as a candidate bridge, without adopting it. 2026-11-13T10-15-00Z_design_scaling_technique_comparisons (2026-11-13) compares scaling techniques at the foundation layer; the performance programme that owns the measurements is covered in the scale chapter of this book.

Structure: the crate split and store ports

The foundation design ends at code structure. 2026-10-17T15-00-00Z_architecture_next_stage_platform (2026-10-17), “Next stage of the platform: foundations, then flexibility”, sequences the work: foundations first, flexibility second. Phase 12 (#534) executes the flexibility half, and Phase 13 executes the client-surface half.

The crate split has two records: 2026-11-01T15-42-00Z_architecture_id_crate_split (2026-11-01, Phase 1 architecture) and 2026-11-01T16-53-00Z_design_id_crate_split (2026-11-01, a workspace of importable crates). The design result, recorded in the appended half of pkgs/id/ARCHITECTURE.md, is a workspace in which only the root id crate is the public surface, id-core is the shared core depended on by 10 crates, and the blob, event, world and sync ports are distinct authorities: adapters serve exactly one port, and the rule is enforced by tests/store_port_boundary.rs. That anti-flattening rule is the structural form of the foundation design: no subsystem reaches into another subsystem’s store.

One record in this chapter is present by classification, not by subject fit: 2026-11-01_design_id560.md (2026-11-01) designs the F12.18 denial-of-service suite in CI. The survey homes it here; its substance belongs to the scale and hardening programme. 2026-11-11T03-19-54Z_refactor_markdown_module_split (2026-11-11) is a refactor record for the split of pkgs/id/src/web/markdown.rs (#4704), retained here as file-core history.

What exists today

Grounded in the code surveys, not the design records:

  • The crate split shipped. The tree is a workspace of 16 crates plus the root crate (17 packages in the library survey); the root id crate is the public facade, and the CLI lives in crates/id-cli/. The pre-split paths in pkgs/id/README.md (src/cli.rs, src/store.rs, src/tags.rs and the rest) do not exist; that README section is one generation old (survey disagreement DES-2).
  • The event store shipped with concrete formats: store format marker id.events.store.v9, wire domain id.events.v1, events as p2panda-core headers in canonical CBOR with BLAKE3 operation IDs, a maximum of 32 after hashes per event (MAX_AFTER), and ingest outcomes of accepted, duplicate, fork, waiting and refused.
  • The tag store shipped on iroh-docs alpha/omega namespace pairs, with its registry at .iroh-meta/registry.json, REGISTRY_VERSION = 1.
  • The id:// addressing design has a running demonstration: the #9106 walking skeleton (id walk) reads and writes records by id:// address today. Its design role is covered in Design: sync, replication and FileOps.
  • Still design only, with no shipped counterpart verified in the surveys: BitTorrent-style chunk retrieval for graph objects, the CapTP bridge spike (#6014), and cross-store friendly-name fan-out beyond the local-store resolution. The friendly-name records’ shipped status beyond the local store is unverified in the survey material.

Design: worlds and the guest runtime

This chapter covers 20 design records: the worlds design, the Roc guest runtime, and the contract between a world host and the shells that connect to it. It describes the system as designed in the programme’s design archive. The final section states what runs today.

The worlds programme is tracked as #5955 (Roc libraries, dynamic user functions, presentation assets), with children that include #5973 (world governance), #6006 (threat-list feeds) and #5985/#5986 (licensing and hosting research). Worlds also sit inside the core epic #2056 and inside Phase 12 (#534) and Phase 13 of pkgs/id.

Roc-defined multiplayer worlds

The founding record is 2026-10-07T00-20-00Z_architecture_roc_worlds (2026-10-07), “Roc-Defined Multiplayer Worlds”. The design decision it records is the one the whole programme follows: a world is a multiplayer program written in Roc, compiled to a guest module, and run by a host that owns storage, networking and authority. The guest computes; the host admits, persists and enforces. Guest programs reach the host only through the capability protocol covered in Design: capabilities and providers.

The platform world is the reference world. Two records track it: 2026-10-18T00-00-00Z_reference_platform_state (2026-10-18), “Platform world: current state, findings, and open work”, and 2026-10-18T18-40-00Z_report_platform_world_state (2026-10-18), the state report of the same date. Together they are the design archive’s own status record for the first world, distinct from the design records around it.

2026-11-08T09-10-00Z_research_worlds_conversation_archaeology (2026-11-08) is the programme’s archaeology record: it ties earlier discussions of Second Life and programmable worlds into the #5955 programme, so the design’s lineage is recorded rather than reconstructed later.

Isolation, cross-world access and execution profiles

Three records from 2026-10-10 define how worlds are separated and how they reach each other:

  • 2026-10-10T03-56-25Z_feature_world_isolation (2026-10-10) designs world isolation modes: the set of isolation postures a host can run a world under.
  • 2026-10-10T04-59-57Z_feature_cross_world_access (2026-10-10) designs cross-world access in terms of writes, force, and file scope: a cross-world write is a distinct, named operation with a file scope, not a side effect of holding a capability in the other world.
  • 2026-10-14T19-39-30Z_architecture_portable_world_surfaces (2026-10-14) designs portable world surfaces and controlled execution profiles, so the same world can present on different surfaces under a stated execution profile.

2026-10-30T19-36-00Z_investigation_world_vm_wasm_portability (2026-10-30) audits the portability question directly: what of the worlds runtime runs inside a Web Worker. The audit is the design input for the hosted edition’s world support, covered in Design: hosted and serverless editions.

Module provenance and installs

A host runs code it did not write, so the design gives modules a provenance chain:

  • 2026-10-14T20-00-05Z_feature_source_only_world_installs (2026-10-14) designs source-only world module installation: the install unit is source, and the host compiles it.
  • 2026-10-16T09-00-00Z_feature_world_module_provenance (2026-10-16, 09:00) designs observed world module provenance — the provenance the host observes at runtime.
  • 2026-10-16T09-30-00Z_feature_world_module_provenance (2026-10-16, 09:30) designs world module build provenance — the provenance recorded at build time. The two records share a timestamp prefix and a name; the survey counts them as distinct records, observed provenance and build provenance.
  • 2026-11-02T00-31-45Z_design_module_trust (2026-11-02) designs module trust as an admin trust list plus an install-time signature check. The survey homes this record in the identity chapter; it is cross-linked here because install-time trust is a runtime gate. See Design: identity, directory, groups and delegation.

Licensing constrains hosting: 2026-11-05T15-08-16Z_research_id5986_agpl_gpl_hosting (2026-11-05) researches AGPL/GPL hosting — inspectable worlds, uploads, and self-hosting (#5986, under #5955). The design position the research supports is that world source stays inspectable when a world is hosted for others.

The guest runtime: Roc support libraries and the authoring loop

The runtime design includes the libraries a guest author writes against:

  • 2026-10-15T09-27-28Z_feature_roc_json (2026-10-15) designs pure-Roc JSON for portable world programs, so guests do not depend on a host JSON service.
  • 2026-10-16T16-00-00Z_feature_roc_cap (2026-10-16), RocCap, designs shared request bookkeeping for the capability protocol on the guest side. The host side of that protocol is in Design: capabilities and providers.
  • 2026-11-01T16-09-48Z_feature_world_json_transcript (2026-11-01) designs the id world join --command-mode --json transcript, a machine-readable record of a world session.

The authoring loop has three records that describe one workflow at three dates: 2026-10-16T18-30-00Z_feature_world_authoring_cli (2026-10-16) designs the authoring CLI (id world new and id world stats); 2026-11-01_design_id558.md (2026-11-01) designs the id world dev authoring loop; 2026-11-16_id_world_dev_authoring.md (2026-11-16) documents authoring Roc worlds with id world dev as a working practice. The progression in the archive is CLI surface, then loop design, then authoring guide.

Scheduled events and the host view

Worlds are long-lived, so the design gives them time:

  • 2026-10-17T10-00-00Z_feature_scheduled_events (2026-10-17) designs scheduled events in the minimal form: a world can ask for one fire at a set time.
  • 2026-11-03T01-31-11Z_design_recurring_cross_world_schedules (2026-11-03) extends the design to recurring schedules and cross-world schedules.

2026-11-02T00-53-51Z_feature_world_host_view (2026-11-02) designs an authenticated, read-only world host view: the operator of a host can inspect a world without joining it as a participant and without write authority.

The shell contract’s evolution

Worlds are useless without shells, and the design separates the two with a contract. The prose record is 2026-10-25T05-54-40Z_reference_shell_contract (2026-10-25), “The id shell contract, version 1”, which the survey homes in the shells chapter. The normative form lives in pkgs/id/contract/: shell-contract.v1.json is contract id-shell, version 1, revision 15. The contract as recorded there:

  • ALPN protocol /id-world/1, with three transports: an iroh QUIC stream, a WebSocket at /ws/world, and SSH exec id-world/1.
  • Maximum frame size: 1 MiB.
  • Session phases: opening, query, install, joined.
  • Six frame classes: event, ephemeral, query, control, admin, delegation.
  • A client/server frame vocabulary that includes join, records, documents, caps, invite, directory, list_worlds, create_world, isolation, cross-world and file-scope admin frames, and compile/install frames.

The conformance side is shell-suite.v1.json, which names four shells — terminal, browser, native, hardware — with each shell’s presented and sent frame sets. Only the native shell declares a provider in the suite: client.file.read. Two golden session transcripts, sessions/terminal.jsonl (5 frames) and sessions/native.jsonl (7 frames), record join, snapshot, resize and view sequences, including scene and audio surface payloads, for the suite to check shells against.

The design chapters for the shells themselves, and for the agents that join worlds through the MCP bridge, are Design: shells and client surfaces and Design: agents in worlds and the MCP bridge.

What exists today

Grounded in the code and contract surveys, not the design records:

  • Worlds run today. The default build of the id binary includes the world runtime (default = [sandbox, world] in the CLI survey’s build table), with world join, administration, journal, dev, measure, replay and verify commands in the shipped CLI surface.
  • The shell contract exists as a machine-readable file at revision 15, with the four-shell conformance suite and two golden transcripts in pkgs/id/contract/. That is a shipped contract artifact, not only a design record.
  • The hosted runtime proof is a proof of concept, not a production path: pkgs/id/worker-poc runs one example world unmodified in a Cloudflare Worker isolate and proves journal equality against the native wasmtime host (acceptance boxes checked 2026-11-01, per the web survey). Nothing in worker-poc is a production path.
  • Still design only, with no shipped counterpart verified in the surveys: recurring cross-world schedules as a general facility, and the authenticated read-only host view as a distinct surface. Their shipped status is unverified in the survey material beyond the records cited above.

Design: capabilities and providers

This chapter covers 44 design records: the capability model, ceilings, and the provider system that gives guest programs and shells their effects. It describes the system as designed in the programme’s design archive. The final section states what runs today.

The provider model is tracked as #5686, with children that include #5900 (grants), #5902 (terminal and website host providers), #5904 (offline providers), #5905 (security model), #5898 (declaration model) and #5899 (discovery and negotiation). The first provider implementations are #1062, under Phase 12 (#534): #1061 is the provider registry, #1062 the first providers, #1063 the audit log, #1067 fair scheduling and quotas.

The capability model

The core design record is 2026-11-08T09-15-00Z_design_id_capability_model (2026-11-08): the capability model stated as requested sets versus discovered-used sets, a registry schema, and custom-compiled platforms. The distinction the record fixes is the chapter’s spine: what a program asks for and what it actually uses are two different sets, and the system records both.

The derivation of the used set has two records, written a day apart as a spec and then a design: 2026-11-11T02-55-00Z_design_used-capability-derivation (2026-11-11), the used-capability derivation tool spec, and 2026-11-11T08-50-24Z_design_used_capability_derivation (2026-11-11), the design of the tool as a static call-graph scan producing the registry used-set (#5998).

The earliest record in the chapter is also the model’s root: 2026-10-09T09-59-07Z_design_attenuated_capabilities (2026-10-09), “Attenuated capabilities for world access”. A capability in this design can be passed on only in a weaker form: delegation narrows, it never widens. 2026-11-01_design_id2028.md (2026-11-01) sets the floor for the whole model: ID core v1, the app model and the minimum capabilities every app can assume.

Admission is part of the model, not an implementation detail: 2026-11-01_design_id2898.md (2026-11-01) designs reconstruction-is-admission for pkgs/id (#2898) — an object or program is admitted by reconstructing and verifying it. The foundation chapter covers the same record from the graph side; see Design: foundations — objects, graph and the file core.

Ceilings

A ceiling is the upper bound on what a world, a program or a client may hold, set by an authority above it. The design records:

  • 2026-10-16T11-00-00Z_feature_world_capability_ceilings (2026-10-16) designs world capability ceilings.
  • 2026-10-16T12-00-00Z_feature_world_cli_controls (2026-10-16) designs the world operator CLI controls for capability ceilings and resource profiles — the ceiling is an operator surface, not a config file only.
  • 2026-10-25T05-37-57Z_design_client_capability_providers (2026-10-25) designs client-side capability providers under the ceiling model (F13.7, Phase 13), and 2026-11-01_design_id789.md (2026-11-01) is the Phase 13 F13.7 design for the same subject (#789, with the rollout under #5532).
  • 2026-11-17_runbook_id5532_f13-7_client_file_read_rollout.md (2026-11-17) is the rollout runbook for client.file.read, the first client-side capability provider: the ceiling model’s first concrete client provider is a file-read provider scoped by the shell, recorded again in Design: worlds and the guest runtime because the shell contract’s conformance suite names it as the native shell’s only declared provider.

Change and visibility are designed, not improvised. 2026-11-08T10-12-00Z_design_id_capability_diff_semantics (2026-11-08) designs capability-change diff semantics: user-meaningful change classes and the changes that trigger re-approval. 2026-11-08T10-40-00Z_design_id_capability_observability (2026-11-08) designs capability observability: who can see which capability facts, and where. 2026-11-08T01-10-24Z_design_id_capability_certification_exceptions (2026-11-08) designs the capability-certification exception policy — exceptions exist, and they are a policy with records, not a bypass. 2026-11-23T07-06-00Z_design_id_capability_class_assignments (2026-11-23) assigns capability classes for the post-#5999 registrations.

The provider registry and provider families

Providers are the named implementations behind capabilities. The registry design starts at 2026-11-03T10-06-40Z_architecture_provider_registry_slice1 (2026-11-03), “F12.4 Provider Registry — Slice 1” (#1061). The declaration lifecycle the design gives a provider is filed, admitted, live, then suspended, superseded or stale, then tombstoned; the declaration records are 2026-11-11T00-18-00Z_decision_id5898_provider_declaration_model.md (2026-11-11, manifest contents, signing, versioning, dynamic versus static capabilities; surveyed into the identity chapter) and the security model is 2026-11-09_decision_id5905_provider_security_model.md (2026-11-09, identity, admission, impersonation, rogue providers, bridge compromise, capability confusion, ceiling composition; also surveyed into the identity chapter). Grants for providers are decided in 2026-11-09T00-16-56Z_decision_id5900_provider_capability_grants.md (2026-11-09): grant form, sensitivity classes and approval flows (#5900).

The first provider family (#1062) has one design record per provider, all dated 2026-11-22:

  • 2026-11-22_design_id1062-kv-provider.md — the kv provider, first slice of #1062.
  • 2026-11-22_design_id1062-blob-provider.md — the blob provider, second slice.
  • 2026-11-22_design_id1062-http-fetch-provider.md — the http.fetch provider, third slice.
  • 2026-11-22_design_id1062-notify-provider.md — the notify provider, fourth slice.

Host-side instantiations of the #5686 model are decided in 2026-11-16T09-03-20Z_decision_id5902_terminal_website_host_providers.md (2026-11-16): terminal and website host providers (#5902). Embedded instantiation is decided in 2026-11-08T09-10-00Z_design_embedded_providers_decision.md (2026-11-08): engine and smartphone instantiation of the provider model. Offline behaviour is decided in 2026-11-08_decision_id5904_offline_degraded_providers.md (2026-11-08): offline and degraded operation for capability providers (#5904).

The remaining provider families in the design:

  • 2026-11-04T06-40-00Z_feature_loc-capability.md (2026-11-04) designs the loc.* location capabilities, with an accuracy ceiling and per-use consent as part of the capability itself.
  • 2026-11-20T07-30-11Z_feature_speech-capabilities.md (2026-11-20) designs the speech.* conversational audio capabilities.
  • 2026-11-09T05-00-00Z_feature_mqtt_device_bridge_id_device_v1 (2026-11-09) designs the id.device.v1 MQTT device bridge, schema and proof of concept (#2343); the speech thread pairs with #2344 in the programme’s early trackers.
  • 2026-10-16T18-00-00Z_feature_records_readback (2026-10-16) designs records readback as a capability: records.read.
  • 2026-10-16T16-00-00Z_feature_roc_cap (2026-10-16), RocCap, is the guest-side bookkeeping library for the same protocol; see Design: worlds and the guest runtime.

Discovery and negotiation between a consumer and a provider are designed in 2026-11-08T09-10-14Z_design_id5899_provider_discovery_negotiation (2026-11-08), surveyed into the sync chapter because negotiation is a wire concern; see Design: sync, replication and FileOps. Routing across providers is supplemented by 2026-11-13T09-26-00Z_design_pool_effort_system (2026-11-13): per-capability routing, failover, and pools treated as models.

Audit, admission and quotas

2026-11-01T20-45-00Z_feature_admin_audit (2026-11-01) designs F12.6 slice 1: administrative and provider-use audit (#1063’s audit thread). Provider use is auditable by design; the audit record is part of the grant, not a log added later.

Fair use has two records under #1067, both dated 2026-11-22/23: 2026-11-22_design_id1067-admission.md (2026-11-22), guest-burn admission, the second slice of #1067, and 2026-11-23_design_id1067-account-quotas.md (2026-11-23), per-account quotas, the ownership slice of #1067.

Taxonomy, sensitivity and capability-bearing claims

  • 2026-10-29T14-05-00Z_investigation_capability_taxonomy (2026-10-29) is the capability taxonomy v0 investigation: interface specialization across web, ESP32/MQTT and text/audio surfaces.
  • 2026-11-09T06-25-00Z_research_id5989_prior_art_capability_systems (2026-11-09) records the prior art: capability systems, object-capability design, Spritely Goblins and OCapN, and CRDT shared worlds.
  • 2026-11-11_decision_id5817_sensitivity_classification.md (2026-11-11) decides the sensitivity classification model for ID table queries (#5817).
  • 2026-11-08_decision_id5909_sql_pgq_capability.md (2026-11-08) decides the SQL/PGQ capability boundary for ID triples: graph query access is a capability with a boundary, not a store login.
  • 2026-11-08T17-12-39Z_design_id_package_import_policy (2026-11-08) designs pure-package imports and package classes across capability tiers.
  • 2026-11-08_design_id6015.md (2026-11-08) designs land/parcel capability domains: per-parcel policy granularity without tokenized land.
  • 2026-11-01_design_id786.md (2026-11-01) designs F13.4 presentation capability tiers with in-band terminal detection (#786): presentation itself is tiered as a capability.

Three claim systems are capability-bearing in the design and are recorded here. Tag claims: 2026-11-06_decision_id_tagging_triples.md (2026-11-06) decides ID tag claims as atomic-triple projections, and 2026-11-08T06-25-00Z_design_tag_scope (2026-11-08) designs tag scope, local-only versus shared claims (#1793). Licensing: 2026-11-05T17-24-09Z_design_id_license_detection_pipeline (2026-11-05) designs the upload-time license detection pipeline; 2026-11-06_design_id5985.md (2026-11-06) designs the license combination checker (combination events, v1 incompatibility rules, override versus exception-request flows, audit records); 2026-11-10_design_id5977_license_taxonomy.md (2026-11-10) designs the license taxonomy and classifier: the enumerated set, the warning ladder, and the tag format.

What exists today

Grounded in the code surveys, not the design records:

  • The provider declaration lifecycle exists in code: crates/id-caps/src/declaration.rs implements the states filed, admitted, live, suspended, superseded, stale and tombstoned, with signing domains id.provider-manifest.v1 and id.provider-withdrawal.v1. Suspension in the shipped code is registry state; the provider’s contents do not change.
  • The ceiling model exists in code at the MCP bridge policy point: crates/id-caps/src/mcp_policy.rs enforces a capability ceiling (tools, worlds, object classes, program allowlist), charges quota before execution, and writes exactly one hash-chained audit event per action, refusals included. That is the design’s ceiling-plus-audit rule running in one place; it is a library policy point, not a deployed MCP server.
  • The configuration contract carries ceilings as hard invariants: the id-config crate’s document requires a ceilings object (max_hops, max_bytes, max_time_ms, max_fan_out, each at least 1), and scoped overrides may only narrow a ceiling; a widening override is rejected with CeilingWidened, never clamped.
  • The first client provider rollout is real as a runbook and a shell-contract entry: client.file.read is the only provider the shell conformance suite declares, for the native shell.
  • Still design only, with no shipped counterpart verified in the surveys: the four #1062 provider records (kv, blob, http.fetch, notify) as a complete provider family, the loc.* per-use-consent flow, and the speech.* family. The surveys verify the registry and ceiling machinery; the full provider catalogue remains design. This point is stated as unverified for each individual provider beyond the records cited.

Design: identity, directory, groups and delegation

This chapter covers 56 design records, the largest design theme in the book after the knowledge layer. It describes identity, the directory, groups and delegation as designed in the programme’s design archive. The final section states what runs today.

The thread runs through the core epic #2056, Phase 2 (membership, auth frontier and delegation) and Phase 4 (groups, encryption and history) of the phase records, and a set of named trackers: #2380 (keyset authorization log), #2382 (guardian recovery), #3231/#3232 (the receipt contract and its audit), #8750 (block-list lookups), #9141 (peer trust classes) and the federation cluster #9129–#9148.

Accounts, groups, contacts and delegation

The founding record is 2026-10-09T12-00-00Z_feature_directory_accounts_groups (2026-10-09): accounts, groups, contacts and delegation as one feature design. The directory is the programme’s answer to a concrete question: how does a node know who someone is, which groups they belong to, and what they may do, without a central account server.

The largest single record in the archive belongs to this chapter: 2026-10-11T03-44-33Z_design_groups_events_delegation (2026-10-11), a 407-file bundle covering events, groups, delegation, removal and history, together with a connectivity record and relay, range and BeeKEM spike code, logs and certificates. Group membership in this design is event-sourced: membership changes are signed events, removal is an event with a history, and delegation is a signed narrowing of authority. The removal semantics are made explicit in 2026-11-02T04-44-00Z_design_group_remove_modes (2026-11-02), “Explicit group removal modes”: removal has named modes instead of one ambiguous remove.

2026-10-10T07-00-00Z_feature_petnames_invites (2026-10-10) designs petnames and invite links: local names for people, assigned by the namer, plus invites as the entry path into groups and worlds. Petname safety gets its own record: 2026-11-02T12-47-00Z_design_petname_unicode_confusable_skeleton (2026-11-02) designs petname anti-mimicry using the Unicode UTS #39 confusable skeleton, so a look-alike name is detected by its skeleton, not by eye. Invites get a second, deeper design in 2026-11-14T18-50-00Z_design_id_invite_delegation (2026-11-14): generic invite delegation — encoding, depth, leakage, and group live-set semantics. Invite depth is a designed quantity: an invite can be re-delegated only within its stated depth, and the record treats information leakage through invites as a design constraint.

Worlds consume the directory directly. 2026-10-17T08-00-00Z_feature_world_roles_directory (2026-10-17) designs worlds as places, first slice: role-scoped invites and a machine-readable world list. 2026-11-01_design_id835.md (2026-11-01) designs builder and moderator authority through world-session frames (#835, roles-v2 and moderator wiring under Phase 12). 2026-10-18T04-00-00Z_fix_world_chat_visibility (2026-10-18) records the visibility rule as a fix: world chat is visible only to participants who may chat or read history. 2026-10-16T17-00-00Z_feature_chat_history (2026-10-16) designs server-observed chat history and grantable platform modules.

Signed artifacts, home servers and trust

2026-10-10T04-58-36Z_design_signed_artifacts (2026-10-10) designs signed artifacts, home servers, and cross-world access: a person’s home server holds and serves their signed artifacts, and other worlds accept them on the signature. The trust model that governs acceptance is investigated in 2026-10-30T19-11-04Z_investigation_trust_visibility_model (2026-10-30): accept-all ingest with writer-set views — ingest accepts, and visibility is a projection over writer sets. The writer-set design itself is in Design: sync, replication and FileOps.

Peer-level trust is designed in 2026-11-17T05-15-00Z_design_id9141_peer_trust_classes.md (2026-11-17): peer trust classes plus a signed-data acceptance rule (#9141, in the federation cluster #9129–#9148). The receipt contract binds this chapter to the foundation layer: 2026-11-01_design_id3231.md (2026-11-01) designs one receipt contract for pkgs/id artifacts (#3231), 2026-11-04_audit_id3232_receipt_validation.md (2026-11-04) audits receipt validation (#3232), and 2026-11-17_design_id_sign_time_refusal.md (2026-11-17) designs the sign-time refusal contract: sign only what receipt would accept. Signing mechanics have their own record: 2026-11-08T15-20-00Z_design_sign-request-nonce-domain.md (2026-11-08), the sign_request nonce domain and the fallible signing contract. The legacy boundary is drawn by 2026-11-05T15-10-00Z_architecture_legacy_artifact_receive_cutoff (2026-11-05), the legacy artifact receive cutoff, and blob access by 2026-11-13T09-00-00Z_design_blob_gate_authorization_wiring.md (2026-11-13), blob gate authorization wiring in id serve (#173).

Module trust is an identity question in this design: 2026-11-02T00-31-45Z_design_module_trust (2026-11-02) designs the admin trust list and the install-time signature check. Its runtime side is cross-linked from Design: worlds and the guest runtime.

Key custody and recovery

The design offers key custody as a set of named variants, each with its own record:

  • Variant (a), service-held keys: 2026-11-13_design_id5886.md (2026-11-13).
  • Variant (b), user-held keys: 2026-11-10_design_id5887.md (2026-11-10).
  • Variant (c), recovery codes: 2026-11-08T10-03-00Z_design_id_recovery_codes (2026-11-08), ID recovery codes as a decision record.

Around the variants sit the mechanisms. 2026-11-04T06-07-11Z_feature_local_key_envelope (2026-11-04) designs the local passphrase-wrapped identity key envelope. 2026-11-12T22-55-00Z_design_seed_phrase_recovery (2026-11-12) designs seed-phrase export and restore for the identity key. 2026-11-16T11-00-00Z_design_guardian_recovery (2026-11-16) designs guardian social recovery: record formats, successor-key authority and threshold signing (#2382). 2026-11-12T19-10-07Z_design_keyset_authorization_log (2026-11-12) is the architecture decision record for the keyset authorization log (#2380): the set of authorized keys is itself a signed log. 2026-11-01_design_id2804.md (2026-11-01) designs issuer key rotation and compromise recovery. 2026-11-10_design_id5881_stepup_escrow.md (2026-11-10) designs 2FA step-up gates and org-escrowed credential proxying. 2026-11-16_decision_id5819_owner_override_mechanics.md (2026-11-16) decides owner override mechanics and the encryption boundary (#5819). Encrypted sharing is decided in 2026-11-09T05-06-00Z_decision_id5801_encrypted_shares_key_distribution.md (2026-11-09): share form, key holders, rotation and recipient proofs.

The ceremony that ties delegation to identity is 2026-11-21T04-30-00Z_design_id_delegation_cross_signing_ceremony (2026-11-21): delegation, transfer, and the cross-signed identity ceremony. Delegation in this design is a witnessed, cross-signed act, not a silent key copy.

Grants, permission UX and provider-facing identity

The provider system needs identity at its boundary, and four records surveyed into this chapter carry that half of the #5686 model: 2026-11-09T00-16-56Z_decision_id5900_provider_capability_grants.md (2026-11-09, grant form, sensitivity classes, approval flows, #5900), 2026-11-09_decision_id5905_provider_security_model.md (2026-11-09, the provider security model, #5905), 2026-11-11T00-18-00Z_decision_id5898_provider_declaration_model.md (2026-11-11, the provider declaration model, #5898) and 2026-11-08T09-06-08Z_design_id_permission_ux (2026-11-08, permission UX for worlds: pre-connect disclosure, grant modes, and memory). The capability side of the same records is in Design: capabilities and providers. 2026-11-12T20-58-00Z_research_id_permission_precedents (2026-11-12) records the permission-prompt precedents research: how platforms present, remember and revoke capability grants. 2026-11-23T05-02-30Z_design_id_capability_change_notices (2026-11-23) designs capability-change notices on reconnect: presentation, choices, re-baselining and invite pinning.

2026-11-08T19-52-00Z_feature_groups_page (2026-11-08) designs the local groups and grants page at /groups, the operator’s view of this chapter’s objects. Licensing policy lands here as an account rule: 2026-11-11_design_id5984_licensing_policy.md (2026-11-11) designs the server terms-of-service uploader grant, account-creation defaults and admin license policies; the classifier side is in Design: capabilities and providers.

Governance, moderation and abuse boundaries

  • 2026-11-08T13-45-00Z_design_id_world_governance (2026-11-08) designs world governance: moderation as a library, per-world parameterization, pre-approval (#5973’s thread under #5955).
  • 2026-11-08T12-50-00Z_design_id6004_lambdamoo_governance_arc (2026-11-08) records the reserved-authority lesson from LambdaMOO’s governance arc: what ID must keep off the ballot.
  • 2026-11-09_design_id6005_moderation_pack_format.md (2026-11-09) designs the moderation pack format: data-only packs with a static policy core, feed subscriptions and per-world parameters.
  • 2026-11-10T21-05-00Z_design_id6007_moderation_presets (2026-11-10) designs moderation preset tiers: named presets that compile to concrete rules.
  • 2026-11-08_design_id5861.md (2026-11-08) designs board moderation hooks, and 2026-11-08_design_id5871.md (2026-11-08) designs talk-page semantics: lifecycle, permissions and binding authority.
  • 2026-11-05T13-36-21Z_design_threat_list_feed_protocol (2026-11-05) designs the shared threat-list feed protocol: versioned, signed, subscribable feeds with local override lists (#6006).
  • 2026-11-11T19-15-00Z_design_block_lookup (2026-11-11) designs block-list lookups that can say “the lookup failed” (#8750): a failed lookup is a distinct outcome from a clear lookup.

Records at the chapter’s edges

The survey homes several records here whose primary surface sits in a neighbouring chapter; the book keeps the survey’s mapping and cross-links them. 2026-10-29T10-45-00Z_investigation_ephemeral_live_data_retention (2026-10-29) investigates ephemeral live data against the chained event graph: retention and intermittent signing. 2026-10-30T19-35-00Z_investigation_boards_model (2026-10-30) sketches the boards model on ID identity. 2026-10-31T18-03-36Z_investigation_native_tier_tradeoffs (2026-10-31) investigates the native tier versus Wasm: fuel, trust, and when each is right. 2026-11-01T17-52-12Z_feature_stable_note_revisions (2026-11-01) designs stable note identity and the revision graph. 2026-11-08T08-19-40Z_design_id_knowledge_sharing_permissions (2026-11-08) designs knowledge-layer sharing and permissions. Two input records sit here by survey mapping: 2026-10-14T20-10-00Z_feature_world_keyboard_parity (2026-10-14, browser and SSH keyboard parity for world programs) and 2026-11-01_design_id787.md (2026-11-01, the kitty keyboard protocol on the raw input path, #787), plus 2026-11-01T16-06-00Z_research_in_session_command_toggle (2026-11-01, the in-session command toggle). Their design home in the book’s argument is Design: shells and client surfaces.

What exists today

Grounded in the code surveys, not the design records:

  • The directory ships as an append-only journal: directory.jsonl, one JSON entry per line, replayed through the same apply path as live changes, with 17 entry kinds covering account signup, keying, verification, key add and remove, email confirm and remove, group create, update, visibility and delete, member set, tier set, and the friend request, accept, remove and removal-noted kinds. Levels are access, read, write, manage, moderator and admin; tiers are anonymous, registered and verified. Account secrets enter the journal only as SHA-256 digests.
  • Signed artifacts ship in a legacy profile with a pinned format: signed bytes are compact JSON under the profile name id-artifact-serde-json/v1, hashed with SHA-256 and signed with Ed25519, in four kinds (friend_remove, home_declared, document, tag). Test vectors for the profile ship in pkgs/id/test-vectors/.
  • Keysets ship as JSONL files (.id-keyset.jsonl and .id-keyset-client.jsonl), invites carry the magic string IDINV at version 2, and the key envelope carries the magic string IDKEY.
  • Server provisioning ships in the server config: users and groups can be declared in TOML and are provisioned at startup, idempotently, with group member roles pull, read, write, manage and admin.
  • Still design only, with no shipped counterpart verified in the surveys: guardian social recovery (#2382) as a running flow, the cross-signed delegation ceremony of 2026-11-21, and moderation packs as a distributed format. The surveys verify the journal, artifact and keyset machinery; the recovery and governance layers on top of it remain design. Individual record-to-code correspondence beyond the items above is unverified in the survey material.

Design: sync, replication and FileOps

This chapter covers 39 design records: how ID nodes synchronize directories, events and journals; how replication is authorized and bounded; and the FileOps design that gives file operations one naming and ownership model. It describes the system as designed in the programme’s design archive. The final section states what runs today.

The transport threads run under #5671 (transport fallback) and #5672 (storage decomposition), with children that include #5793 (rendezvous), #5800 (partial replication) and #5807 (Redis-to-SQLite export). The federation thread is #9106 Part B, with the discovery and registry design under #6287 and the federation cluster #9129–#9148.

Directory sync and the first transport design

The earliest sync record is 2026-03-22T00-00-00Z_feature_peer-discovery (2026-03-22): peer discovery via iroh-gossip plus a distributed topic tracker. 2026-10-10T02-39-03Z_design_directory_sync (2026-10-10) designs directory sync proper: sessions, friend envelopes, and replication — the directory of Design: identity, directory, groups and delegation moves between nodes inside signed friend envelopes over sync sessions. 2026-10-10T06-00-00Z_research_identity_capabilities (2026-10-10), the research record on identity, capabilities, petnames and transport, is the shared research base for both chapters.

Two small records fix connection behaviour. 2026-10-11T11-08-42Z_feature_n0_relay_default (2026-10-11) designs n0 relays by default: one endpoint policy and dial timeouts. 2026-10-11T04-48-13Z_feature_takeover_idle_connections (2026-10-11) designs takeover passing idle keep-alive connections to the successor, so a restarted process inherits live connections instead of dropping them. Discovery is bounded and authenticated in 2026-11-02T08-13-35Z_design_peer-announcement-authentication (2026-11-02): authenticated peer announcements and bounded discovery.

The /id-sync/1 split and the range-store seam

Two records from 2026-10-29 restructure the sync wire:

  • 2026-10-29T16-21-00Z_design_id_sync_alpn_split (2026-10-29) designs one /id-sync/1 handshake, and records why serve’s range flights moved off the older arrangement: sync negotiation is one ALPN handshake, with range transfer as a method inside it.
  • 2026-10-29T16-57-03Z_design_id_sync_range_store_seam (2026-10-29) designs wiring SyncMethod::Range under the /id-sync/1 handshake through a per-call lock store seam: each range call locks its store slice for the duration of the call.

The wire format decisions that complete the picture are 2026-11-16_decision_id5808_postcard_wire_schema_v1.md (2026-11-16), the postcard wire schema v1 (envelope, discriminators and golden vectors), 2026-11-09_decision_id5810_carrier_framing.md (2026-11-09), framing and fragmentation across ID carrier classes, 2026-11-09_decision_id5908_payload_boundary.md (2026-11-09), the payload boundary decision procedure (decompose versus attach), and 2026-11-10_decision_id5809_versioning_negotiation.md (2026-11-10), versioning, negotiation and forward-compatibility policy for the ID wire format. 2026-11-16T10-40-00Z_design_id5756_multiplexed_streams_seam.md (2026-11-16) records the seam for multiplexed persistent streams over one tunnel (#5756).

Journal replication, writer sets and partial replication

Journal replication is F12.13 under Phase 12 (#534). The design record is 2026-11-01_design_id806.md (2026-11-01): journal replication as read replicas over a signed stream. The research package behind it is 2026-11-10T21-50-00Z_research_id806_d1-031-journal-replication (2026-11-10, item D1-031). Two records handle the hard cases: 2026-11-03T14-55-00Z_design_id4630_oversized_replication_entries.md (2026-11-03) designs replicating a journal whose Checkpoint entry exceeds the payload bound (#4630), and 2026-11-23T00-24-00Z_design_journal_ack_modes (2026-11-23) designs selectable journal acknowledgement modes for world input. 2026-11-01_design_id2818.md (2026-11-01) designs the journaled region-seam handoff for ID worlds, the point where a world’s journal moves between regions; the residency meaning of a region is covered in Design: residency, jurisdiction and boundaries. 2026-11-01T17-30-12Z_design_host_event_export (2026-11-01) designs host-event journal export for world fixtures, so a recorded journal can be replayed as a test fixture.

Writer sets decide whose events a view includes. 2026-10-30T13-15-00Z_design_id_writer_set_view_projection (2026-10-30) designs writer-set objects, view projection, and the discovery query (#5545’s thread: writer-set view projection and discovery query). 2026-11-08T11-10-00Z_design_id_writer_sets_v2 (2026-11-08) designs writer sets v2: view-as-object, set algebra, federation, and discovery v2. The trust model that consumes writer sets (accept-all ingest, writer-set views) is in Design: identity, directory, groups and delegation.

Partial replication is designed in 2026-11-16T10-39-25Z_design_id5800_partial_replication_protocol (2026-11-16): subset snapshot, scoped updates, existence privacy and dangling references (#5800). A node can hold a subset without learning what it does not hold, and references to unheld objects are a designed state, not an error. Replication is authorized, not open: 2026-11-03T02-34-54Z_security_world_replication_authorization (2026-11-03) is the security record for world replication authorization.

Relays, fallback and rendezvous

The fallback ladder is a designed sequence, each rung with its own record:

  • 2026-11-01_design_id785.md (2026-11-01) designs the UDP-denied SSH fallback for id (#785, Phase 13): when UDP is denied, sync falls back to an SSH-carried path.
  • 2026-11-10_rendezvous_discovery_udp_denied_design.md (2026-11-10) decides rendezvous and discovery for UDP-denied clients (#5793’s thread).
  • 2026-11-10T19-55-00Z_design_id5796_connect_proxy_traversal.md (2026-11-10) designs HTTP CONNECT proxy traversal for ID.
  • 2026-11-05T13-38-00Z_design_id5791_transport_negotiation.md (2026-11-05) designs transport negotiation and fallback ordering: the ladder has a stated order, negotiated rather than tried at random.
  • 2026-11-08T11-08-53Z_design_id5813_relay_proxy_protocol (2026-11-08) designs the ID relay and proxy protocol, and 2026-11-14T13-20-00Z_design_id5795_relay_trust (2026-11-14) decides the relay trust model and broker authorization (#5795).
  • 2026-10-29T11-05-00Z_investigation_multi_hop_relay_and_p2p_media (2026-10-29) investigates multi-hop relay and peer-to-peer media paths.
  • 2026-11-01_design_id2036.md (2026-11-01) designs the ID messaging and relay protocol v1 (#2036, a sub-epic of #2056 and one of its two open items at charter time).

Discovery and federation close the section: 2026-11-16_design_id6287_discovery_registry_federation_v1.md (2026-11-16) designs discovery, registry and federation v1 (#6287), and 2026-11-08T09-10-14Z_design_id5899_provider_discovery_negotiation (2026-11-08) designs provider discovery and negotiation protocols (#5899), cross-linked from Design: capabilities and providers.

FileOps: naming, ownership and save reservations

FileOps is the design that gives every file operation one implementation and one naming model. The design lineage is tracked as #4766, with the audit under #4767. The full record-by-record text of the #4766 lineage could not be re-read for this chapter (the laptop checkout was unreachable during drafting); the naming and ownership rules below are stated from the shipped implementation as recorded in the web and configuration survey, and the #4766/#4767 correspondence is marked unverified beyond the commission’s own statement of it.

The rules as implemented, which the design fixes:

  • A file is a name pointing at an immutable blob hash, plus tag-store metadata. The name is an iroh-blobs tag; the bytes never change under a name — a new write is a new blob and a re-pointed name.
  • Rename and copy preserve history as archives. The archive name is {name}.archive.{unix-ts}, with a literal example: a file named notes.txt renamed at Unix time 1700000000 leaves an archive named notes.txt.archive.1700000000. On a same-second collision the timestamp suffix is bumped by 1 until the name is free, claimed under an in-process lock (#1612/#2462).
  • The archive namespace is reserved at the writer: a user file name matching {stem}.archive.{digits}, where the digits must fit in a u64, is refused with ReservedArchiveName. A non-numeric look-alike such as a.archive.notes stays a valid user file name.
  • Ownership is explicit metadata. The keys are archive.rename and archive.replace on the live name (naming the archives it owns) and archive.owner on the archive (naming its owner). Archives are dropped only with their owner; there is no per-archive delete. The identity keys name, file and path are refreshed on rename and copy, and the origin key is stamped at first write (#4973) — the shipped form of the listing-provenance design in Design: foundations — objects, graph and the file core.
  • Delete is a hard delete of name, metadata and owned archives; blob bytes survive until garbage collection. The web layer’s soft-delete and restore pair is built on top of FileOps, not inside it.

Concurrent saves are handled in the design by 2026-11-02T07-00-00Z_design_save_reservations (2026-11-02): save reservations give in-flight exclusion for same-file saves, so two writers of one file serialize by reservation instead of racing the store.

Three records surveyed into this chapter belong to adjacent surfaces and are cross-linked, not re-argued: 2026-11-08T05-48-47Z_design_input_event_model (2026-11-08, the input event model for relayed apps), 2026-11-08_design_id5862.md (2026-11-08, board subscription, discovery and feed integration), 2026-10-30T19-45-00Z_investigation_playable_posts (2026-10-30, playable posts with forkable succession saves), and 2026-11-12_design_id9004.md (2026-11-12, Joplin continuous sync as a target/plugin bridge against the #5848 baseline). The multi-device knowledge-layer sync design, 2026-11-09_design_id5838.md (2026-11-09) — local-first sync, conflicts, offline behaviour, end-to-end encryption and attachments — is the knowledge layer’s consumer of this chapter’s machinery.

The walk skeleton as the design’s first proof

Epic #9106’s design is demonstrated, not only described. The demonstration path is the walking skeleton: the record 2026-11-22T16-13-20Z_design_id-walking-skeleton is surveyed into the roadmap chapter, and the shipped form is the id walk command family. The skeleton walks the whole stack in miniature: a node directory holds signed records, writers append with named parents, two writers produce a conflict, heads and conflict reports are computed, and two nodes sync. It is the first proof that the #9106 primitives — content-addressed records, signed authorship, head tracking, conflict reporting and peer sync — compose into a working path. The design chapters treat it as the reference instance of the sync design: where a design rule in this chapter has a walk counterpart, the walk counterpart is the test of the rule.

What exists today

Grounded in the code surveys, not the design records:

  • FileOps ships as a single implementation: crates/id-sync/src/fileops.rs is the one put, rename, copy and delete implementation used by the CLI, the REPL, the meta protocol and the web UI, with the archive naming and ownership rules stated above, verified against the code in the web survey.
  • The walk skeleton ships and is not feature-gated: id walk provides init, write, read, reports, serve and sync. Writers in the skeleton are demo keys derived from the writer name (--as accepts the skeleton’s toy writer names); reading an address the node does not hold is an error, not a fetch; one process may hold a node directory at a time.
  • The federation record store ships in crates/id-sync with named slices covering key lifecycle and revocation, replay guard, signature suites, signer binding, rejection events, conflict reports, sync scope, anti-entropy, peer priority, fanout budget, query grants and privacy, signed receipts, request identity, result dedup, loop inform, routing state, topology probe, takeover response, peer classes and the ingest gate. The envelope ALPN is /id-envelope/1.
  • Ingest outcomes in the shipped event store are accepted, duplicate, fork, waiting and refused — the same five outcomes the hosted bridge returns, by design.
  • Still design only, with no shipped counterpart verified in the surveys: the full partial-replication protocol of #5800 (subset snapshot with existence privacy) and the multi-hop relay path as a general facility. Their record-level design is complete in the archive; their shipped status is unverified in the survey material.

Design: residency, jurisdiction and boundaries

This chapter covers 11 design records, the smallest design theme in the book. The survey keeps it as its own chapter rather than dissolving it into the hosted-editions chapter, for a stated reason: residency is a named programme thread with its own blocker chain, #3399 → #3400–#3404. It describes the system as designed in the programme’s design archive. The final section states what runs today, including the one part of this design that is written, landed code with no surface wired to it yet.

The framework: declarations, evidence, enforcement

The framework record is 2026-11-08_design_id5683.md (2026-11-08): the residency and boundaries framework — declarations, evidence, and an enforcement skeleton. The design’s three-part structure is the chapter’s structure:

  1. A declaration states where data of a given class may reside and which boundaries it may cross.
  2. Evidence states the facts a verifier can check: where a store is, where a request was routed, which jurisdiction a node claims and can prove.
  3. Enforcement acts on declarations plus evidence: admit, route, restrict or refuse.

The evidence model has its own decision record: 2026-11-09_design_id5876_residency_evidence_model.md (2026-11-09), the residency evidence model for ID. The enforcement inputs are designed in 2026-11-17T21-55-00Z_design_id8851_boundary_inputs.md (2026-11-17): boundary enforcement inputs — declaration residence, evidence sources, and the verifier (#8851). A boundary decision in this design is a function of a stored declaration and named evidence sources, checked by a named verifier; it is not an operator’s judgement call at request time.

The audit side is designed in 2026-11-08T09-15-00Z_design_boundary_audit_appeals.md (2026-11-08): boundary audit and appeals UX — a boundary refusal produces an audit record, and the person refused has an appeals path with a designed interface. The sanctions boundary is a data model, decided in 2026-11-10T19-52-00Z_design_id_sanctions_boundary (2026-11-10): the sanctions boundary data model, decision record for #5878. Sanctions enter the design as data with a model, not as a hard-coded list in a request path.

Jurisdiction-aware stores and partitioned worlds

Two records of 2026-11-01, plus a third under a plainer name, design the hosted store side:

  • 2026-11-01_design_id2283.md (2026-11-01): jurisdiction-aware per-user hosted stores.
  • 2026-11-01_jurisdiction_aware_user_store_design.md (2026-11-01): jurisdiction-aware hosted user stores — a second record on the same subject, filed without the issue-number naming of the first.
  • 2026-11-01_design_id3397.md (2026-11-01): jurisdiction-partitioned hosted worlds and world blobs — a hosted world and its blobs reside in one jurisdiction partition, as a property of the world, not of each request.

The platform mechanism underneath the store design is investigated in 2026-10-29T11-43-02Z_investigation_do_jurisdiction_pinning (2026-10-29): Durable Object jurisdiction and data-location pinning for per-user stores — whether the hosted platform can pin a per-user object to a jurisdiction at all, which the store design depends on.

2026-11-01_design_id3398.md (2026-11-01) extends boundaries beyond the hosted store: residency boundaries for the native bridge, federation and relays. A boundary in this design applies to the bridge between hosted and native nodes, to federation traffic, and to relays, not only to data at rest. 2026-11-01_investigation_shared_world_residency.md (2026-11-01) investigates the hardest case: shared-world residency and federation — a world with participants in more than one jurisdiction has a residency question that no single-partition rule answers, and the record investigates the options instead of deciding one.

The hosted edition that consumes these designs is covered in Design: hosted and serverless editions; the sync machinery that moves data across the boundaries is in Design: sync, replication and FileOps.

The #3399 → #3404 chain

The jurisdiction chain is tracked as #3399 → #3400–#3404. Within the chain, #3404 is the fenced jurisdiction migration control plane: the component that migrates data between jurisdictions under the declaration and evidence rules above, with fencing so that a migration in progress cannot be raced by ordinary writes.

The status of #3404, stated plainly as of 2026-11-23: the migration control plane core has landed. The complete slice — migration_control.rs in id-core, 1,202 lines with 17 tests, plus 3 wiring edits — reached main on 2026-11-23 via PR #13347, after two sessions ended without landing it, a successor lane’s transplant attempt tripped the platform execution-risk flag, and Drew’s approval naming #3404 cleared the hold. The landed code is the core only: no CLI command and no hosted surface invokes it, and #3404 remains open for the hosted wiring (#3399/#3400/#3402), so this chapter does not describe jurisdiction migration as something an operator can run. The rest of the chain’s record-level detail (#3400–#3403) is unverified in the survey material beyond the chain’s existence and #3404’s state.

What exists today

Grounded in the code and configuration surveys, not the design records:

  • Boundary configuration ships in the server config: the TOML server config carries a [residency] table and [[boundaries]] tables, with their forms owned by crates/id-cli/src/server_config/boundaries.rs (#8851). The design’s declaration side therefore has a shipped configuration surface.
  • Boundary cryptography ships as named domains: the boundary evidence domain is id.boundary.evidence.v1 and the boundary declaration hash domain is id.boundary.declaration.v1.
  • The hosted worker enforces jurisdiction at routing, in local form: the hosted scaffold routes each user only through the jurisdiction-restricted Durable Object namespace, objects are named by binding_id (32 lowercase hex characters, never an email or provider subject), there is no unrestricted fallback, and every UserDO route first checks that the runtime jurisdiction matches the jurisdiction bound immutably by the first routed request. Because local workerd does not implement jurisdiction restrictions, the scaffold fails closed locally with 503 jurisdiction_unavailable for every fully valid request, by design.
  • Deployment of that enforcement is gated: the hosted worker’s config states that deployment and the real-account jurisdiction canary are gated on #2285 and #3403.
  • Landed as library code but not wired to any surface: the #3404 migration control plane core, as stated above. The remainder of the residency framework — declarations driving automated enforcement across federation and relays, and the audit-and-appeals interface — is design, with the records cited in this chapter as its complete statement in the archive.

Design: hosted and serverless editions

This chapter covers 30 design records: the design for running ID hosted — a Cloudflare Workers and Durable Object edition, per-user stores, serverless storage contracts, and the adapters that let foreign stores and self-hosted tiers stand behind the same interfaces. It describes the system as designed in the programme’s design archive. The final section states what runs today.

The programme trackers are #9078 (the hosted-editions programme), #2046 (the serverless edition, a sub-epic of #2056), #5681 (serverless storage), #5672 (storage decomposition) and #6283 (hosted worlds). The #9078 intake record covers components A (PM service), C (fleet tool), E (hosted tenancy, #9083), F (content-addressed media, #9084) and I (the self-hosted tier, #9087); components A and C are not ID, and this chapter covers the ID service and components E, F and I.

Fitting ID onto Cloudflare Workers

The fit investigation is 2026-10-28T23-34-14Z_investigation_cloudflare_workers_fit (2026-10-28): fitting the ID platform onto Cloudflare Workers. The edition design itself is 2026-11-01_design_id2046.md (2026-11-01): the ID serverless edition v1 on Cloudflare Workers (#2046). An earlier, narrower record, 2026-10-14T10-18-19Z_design_p7_2_cloudflare_workers.md (2026-10-14), designs the P7.2 Cloudflare Workers pkarr option — the first point where the programme put a piece of ID’s discovery layer on Workers.

The intake record for the whole programme is 2026-11-12T23-04-00Z_design_hosted-editions-workers (2026-11-12): hosted editions as workable Cloudflare Workers equivalents for the PM service, the ID service and the fleet tool. For ID, the design question the intake poses is equivalence: a hosted ID service that native nodes treat as a peer, not a reduced web front end.

Two investigations define the seams. 2026-10-29T11-27-00Z_investigation_bridge_semantics_hosted_native (2026-10-29) investigates bridge semantics: the hosted (HTTPS/WebSocket) edition syncing with native Iroh nodes. The bridge that investigation leads to is recorded as built in 2026-11-23T05-00-00Z_design_bridge_v1_implementation (2026-11-23): the hosted signed-object bridge v1, implementation record for #3818. 2026-10-29T11-28-18Z_investigation_key_recovery_hosted (2026-10-29) investigates key recovery for hosted ID users: Google SSO loss versus the ID keypair — the hosted account credential and the identity key are different objects, and losing the first must not lose the second. Provisioning is designed in 2026-10-30T22-45-00Z_design_hosted_provisioning_sso_binding.md (2026-10-30): hosted provisioning plus SSO-to-ID binding, the ceremony that binds a hosted account to an ID key.

Hosted worlds are designed in 2026-11-16_design_id6283_hosted_worlds_v1.md (2026-11-16): hosted worlds and always-on hosting, v1 (#6283). The residency rules a hosted world lives under are in Design: residency, jurisdiction and boundaries.

Serverless storage: the #5681 synthesis and its contracts

The parent synthesis for serverless storage is 2026-11-10_decision_id5681_serverless_storage.md (2026-11-10): the decision record for the serverless edition storage programme (#5681). The contracts under it:

  • 2026-11-17_decision_id5863_storage_contract.md (2026-11-17) decides the serverless storage contract: journal, world state and indexes as three named stores with one contract each.
  • 2026-11-17_decision_id5864_d1_journal_fit.md (2026-11-17) designs the D1 journal fit: ordering, sessions and replication of the signed journal against Cloudflare D1.
  • 2026-11-10_design_id5865.md (2026-11-10) designs the Turso/libSQL journal fit: how libSQL replication composes with the signed journal.
  • 2026-11-08_decision_id5868_cost_limits_guardrails.md (2026-11-08) decides cost and limits guardrails for serverless storage.
  • 2026-11-08_design_id5866.md (2026-11-08) designs local-dev parity for the serverless edition: the local development form runs the same contracts as the deployed form.
  • 2026-11-08_design_id5869.md (2026-11-08) designs backup, recovery and exit for serverless storage: a hosted user can leave with their data, as a designed path.

The staged store designs under #5672 decompose the store by role. 2026-11-08_design_id5824.md (2026-11-08) is Stage A: a Redis hot store with a regular store as the system of record. 2026-11-11T00-16-00Z_design_id5807_redis_sqlite_export (2026-11-11) designs the Redis-to-SQLite export and the query-Redis-get-SQLite path (#5807). Backend selection and migration between these stages is decided in 2026-11-12_decision_id5867_backend_migration.md (2026-11-12), the backend selection and migration decision for #5867.

Hosted tenancy is designed in 2026-11-17T16-55-00Z_design_hosted-tenancy-architecture (2026-11-17), component E of #9078: per-user Turso databases plus a central tenancy database (#9083’s architecture record).

Adapters: foreign stores, browsers and the self-hosted tier

  • 2026-11-08_design_id5803.md (2026-11-08) designs the shared foreign data-store adapter contract for ID: one contract that foreign stores implement to stand behind ID’s store ports (the port discipline itself is in Design: foundations — objects, graph and the file core).
  • 2026-11-08_design_id5804.md (2026-11-08) designs the IndexedDB adapter: origin-scoped addressing, live versus materialized reads, structured-clone type mapping, and storage limits and eviction — the browser’s store as an ID store.
  • 2026-11-21T21-40-00Z_design_self_hosted-tier-adapters (2026-11-21) designs the self-hosted tier (component I, #9087): storage, transport and placement adapter design, so a self-hosted node and the hosted edition differ by adapters, not by protocol.
  • 2026-11-08T23-22-53Z_design_id_adapter-conformance (2026-11-08) designs the adapter conformance harness and interop matrix CI: an adapter is admitted by passing the harness, and the matrix is the record of which adapters pass.
  • 2026-11-14T13-10-00Z_design_id5812_adapter_record.md (2026-11-14) is the adapter decision record for WebRTC, TCP/TLS and local IPC (#5812).
  • 2026-11-09_design_id5815_security_binding.md (2026-11-09) reviews the security binding across adapters and relays.

Transport into the hosted edition has its own records: 2026-11-05T15-10-00Z_design_cloudflare_workers_rendezvous_relay.md (2026-11-05) designs the Cloudflare Workers rendezvous/relay component (#5794), and 2026-11-08T09-45-00Z_design_id5811_wss_https_adapter.md (2026-11-08) designs the WebSocket/WSS plus HTTPS fallback adapter for browsers and restrictive networks. The sync and fallback design behind both is in Design: sync, replication and FileOps. The media plane is designed in 2026-11-23T03-04-00Z_design_content-addressed-media-data-plane (2026-11-23): the content-addressed media and data plane, reference-based access and garbage collection (component F, #9084).

One record is surveyed here at the chapter’s edge: 2026-11-09_design_id5783.md (2026-11-09) designs the ESP32 hardware platform line — boards, provisioning, firmware lifecycle, over-the-air updates and power. Its book home in the argument is the shells and hardware chapter, Design: shells and client surfaces.

The federation cluster behind the hosted edition

The hosted edition federates, and the federation design cluster is #9117/#9141/#9144 inside #9129–#9148. The three anchor records are surveyed into neighbouring chapters and cross-linked here because the hosted edition is their largest consumer: the id:// URI scheme (#9117) in Design: foundations — objects, graph and the file core, peer trust classes (#9141) in Design: identity, directory, groups and delegation, and federated query fan-out (#9144, 2026-11-17T15-40-00Z_design_id_federated_query_fanout, 2026-11-17) in the shells chapter. A hosted node in this design is one federation peer among others, addressed by id://, trusted by class, and queried by fan-out under the fan-out budget the configuration contract enforces.

The hosted-worker scaffold as the first step

The design’s first concrete step is the hosted-worker scaffold in pkgs/id/hosted-worker. It is a scaffold: the front door, the per-user Durable Object, the blob store binding and the signed-object bridge exist as code and tests, under a local-only configuration. The scaffold’s own config header states the limit in plain terms: the config is for local development and tests, and no account-level deployment, production binding or billable resource is authorized by the package. Deployment and the real-account jurisdiction canary are gated on #2285 and #3403 — the second gate is part of the jurisdiction chain covered in Design: residency, jurisdiction and boundaries.

What exists today

Grounded in the web and configuration survey, not the design records:

  • The hosted worker exists as a local-only scaffold, not a deployed service. Its front door consumes an already-authenticated binding context (the binding ceremony itself is native code, pkgs/id/src/hosted_binding.rs), strips client-supplied internal headers, re-sets them internally, enforces a front-door body limit (maximum body 100 MiB, from the USER_CEILING_BYTES binding with a 100 MiB cap), and forwards to the per-user Durable Object through the jurisdiction-restricted namespace only.
  • The per-user Durable Object (UserDO, SQLite schema version 3) implements 15 method routes: usage, export, state, blob put/get/delete (content-addressed by SHA-256 hex, deduplicated across users with per-user reference rows in R2), KV put/get/delete (keys match [A-Za-z0-9._-]{1,128}), and the bridge family — challenge, heads, push, pull, export and a WebSocket session. The bridge store holds signed objects and fork evidence; it assigns no order, re-signs nothing, and serves no authoritative snapshot. Bridge push outcomes are accepted, duplicate, fork, waiting and refused.
  • The test harness binding fixes one concrete ceiling: USER_CEILING_BYTES = "1073741824" (1 GiB) in the test configuration. In the application configuration the variable is optional: absent means no ceiling, and a malformed value fails writes closed.
  • The world-on-Worker proof exists as worker-poc: one example world runs unmodified in a Worker isolate with journal equality against the native wasmtime host proven (2026-11-01). The hosted loader refuses manifests with portability=native and manifests declaring more than 64 MB of memory up front. worker-poc is a proof of concept for #2271, not a production path.
  • The native side of the edition ships in the root crate: hosted_binding, hosted_export and hosted_ingest modules, plus a foreign libSQL adapter module (foreign_libsql) that resolves credential references of the form env:<VAR> — the shipped beginning of the foreign-store adapter design.
  • Still design only: the deployed hosted edition itself, hosted tenancy on per-user Turso databases as a running service, the Redis hot-store stage, and the IndexedDB adapter as a shipped store. The scaffold, the bridge and the proofs of concept are real; the edition as a service is not deployed, and no record or survey in the book’s sources states otherwise.

Design: shells and client surfaces

This chapter is design. It describes the shell and client-surface system as designed in the programme’s design archive: 43 records homed here in the survey of the archive for this book (tracking issue #13332; programme tracker #13240). A shell is a client program that speaks the shell contract to a world host, renders the host’s frames, and sends the client’s frames back. The design rule that runs through all 43 records is that shells differ in presentation and input, and do not differ in authority: every shell speaks the same contract, and no shell gets a private frame vocabulary. Where a behaviour in this chapter has not shipped, the text says so; the final section states what exists today.

Related chapters: Design: worlds and the guest runtime, Design: capabilities and providers, Shells: terminal, web, native and hardware.

The shell contract is the centre of the design

The contract of record is 2026-10-25T05-54-40Z_reference_shell_contract (2026-10-25), the prose form of the machine-readable contract in pkgs/id/contract/shell-contract.v1.json: contract name id-shell, version 1, revision 15. The design fixes these values:

  • Protocol: ALPN /id-world/1.
  • Transports: three — an iroh QUIC stream, WebSocket at /ws/world, and SSH exec channel id-world/1.
  • Maximum frame size: 1 MiB.
  • Session phases: four — opening, query, install, joined.
  • Frame classes: six — event, ephemeral, query, control, admin, delegation.
  • Client and server vocabularies covering join, records, documents, caps, invite, directory, list_worlds, create_world, isolation, cross-world and file-scope admin frames, and compile/install frames.

Conformance is a suite, not an opinion. pkgs/id/contract/shell-suite.v1.json names four shells — terminal, browser, native, hardware — and states, for each shell, the frame sets it presents and sends, its declared providers, and its workflow. Only the native shell declares a provider in the suite: client.file.read. Two golden session transcripts pin the expected exchange: sessions/terminal.jsonl with 5 frames and sessions/native.jsonl with 7 frames, each running join, snapshot, resize, view, with the native transcript also carrying scene and audio surface payloads. A shell that fails the suite does not join a world; the agents design in Design: agents in worlds and the MCP bridge adopts the same rule for agent clients.

The four shell lineages

Terminal

The terminal lineage starts before the contract existed. 2026-04-01T00-00-00Z_feature_image_upload (2026-04-01) covers paste, drag-drop and toolbar insert for images in the early editor surface. The October 2026 records build the world-facing terminal: 2026-10-15T16-00-00Z_feature_world_viewport_and_paste (per-session viewport and paste policy), 2026-10-15T16-30-00Z_feature_terminal_buffer_capture (a terminal buffer capture interface), and 2026-10-16T13-00-00Z_feature_world_apps_structured_migration with 2026-10-16T14-00-00Z_feature_screen_render_alignment, which move world apps onto the structured Screen presentation instead of raw text.

Input has its own records. 2026-10-24T20-18-37Z_decision_ssh_input_modes (2026-10-24) fixes SSH input: raw mode is the default, cmd: selects line mode, and a username grammar names the target. 2026-11-02T_reference_kitty_disambiguate_v1.md is the reference for the kitty keyboard disambiguation profile, and the Phase 13 record for the kitty protocol itself is homed with the identity records and cross-linked from here. Output safety is a terminal problem first: 2026-11-01_design_id3455.md (2026-11-01) states the contract that a value cannot act on the terminal — one shared Unicode format-character (category Cf) set for all plain output in pkgs/id, with row renderers escaping, sanitizers stripping only where their output contract calls for stripping, and validators refusing only where their contract calls for refusal. 2026-11-08_design_id5785.md extends the same line past plain text: markup contexts, safe-plain as a user choice, ingest without evaluation, and a stated disposition for ANSI and OSC sequences. 2026-11-08_design_id5873.md designs terminal participation in object discussions, so the terminal is a discussion surface and not only a world surface.

Browser

The browser shell renders the same Screen documents as DOM. 2026-10-16T19-00-00Z_feature_guest_reflow gives guests a layout entry point so a program renders against the actual viewport instead of a fixed grid, and 2026-10-16T19-30-00Z_feature_screen_widgets adds screen widgets and the RocText library. The boards design, 2026-11-01_design_id2054.md, specifies signed boards with portable themes and playable posts as a browser-first surface. The web rendering decision for the semantic pipeline is 2026-11-09_decision_id5851_assertion_tailwind_mapping.md: a style assertion maps to Tailwind classes on the web target. The shipped web UI itself — the file browser and collaborative editor — is documented in The web UI: pages and HTTP API; this chapter covers only its place in the shell design: it is one shell among four, bound by the same contract when it joins a world.

Native

The native reference shell is F13.6, designed in 2026-11-01_design_id788.md (2026-11-01): a desktop client that connects to a world host over the session protocol, renders the host’s view frames, and emits only the client frames the contract already names — input, paste, resize, chat. It adds no frame kinds and needs no host change. 2026-11-08_design_id5781.md designs the deeper Bevy incorporation: ID worlds as Bevy applications, with the journal as the only authority and the Bevy world as a materialized projection of journal positions; a Bevy application never writes world state directly, and every mutation becomes an intent submitted to the world’s append gate. The native-rendering decisions sit beside it: 2026-11-08_decision_id5852_native_rendering_os_standard_controls.md (a semantic assertion renders as an OS-standard control on native targets) and 2026-11-08_decision_id5853_custom_gui_rendering_overrides.md (custom GUI rendering is a first-class override, not a fork of the document).

Hardware and mobile

2026-11-10T20-40-00Z_design_more_shells_v1 (2026-11-10) is the first-iteration design for the remaining shells: mobile, native and hardware in one ladder. Its hardware slice reduces the contract to the subset that fits an ESP32-class device: presence, journal-head state in compressed form, and confirm/act through form results. Rich rendering, free text and world hosting are excluded by name. 2026-11-08T22-06-00Z_design_id_android_client (2026-11-08) designs a native Android client. 2026-11-23T03-17-14Z_design_more_shells_v2 (2026-11-23) is an outline only — it states that no implementation is landed or claimed by the record — and scopes the next rung: native and TUI completion, with a hardware-shell rung (#6298) and a third-party-shells rung (#6299) named as siblings.

Presentation: one document, many renderers

The presentation design separates what a program means from how a shell draws it.

  • 2026-10-31T17-47-20Z_design_world_presentation_and_fuel (2026-10-31) records the current model of world presentation, rendering and fuel together: presentation work is guest work and is charged against the guest’s fuel budget.
  • 2026-11-08_decision_id5849_semantic_markup_vocabulary_v1.md (2026-11-08, from #5679) fixes the semantic markup vocabulary: the element set and the authoring syntax that the rendering decisions consume.
  • 2026-11-08_decision_id5854_per_target_composition.md decides per-target composition: themes, overrides, assets and conditional blocks are selected per target from one source document.
  • 2026-11-08_decision_id5855_rendering_pipeline_conformance.md decides the pipeline split — compile-time and runtime stages — with per-target expected-output tests and author tooling and linting.
  • 2026-11-17_design_id6010_semantic_cell_tag_model.md (2026-11-17) states the presentation model in one line: one tagged state, many renderers — a semantic cell/tag model in which each renderer consumes the same tagged state.
  • 2026-11-10_design_id5858.md decides the portable theme format and its precedence rules.
  • 2026-11-08_design_id6012_visual_feature_cost_ranking.md ranks visual features by cost, so a shell with a small budget can drop features in a designed order instead of failing at random.
  • 2026-11-08_decision_id5910_kdl_presentation_surfaces.md and 2026-11-14_decision_id5907_triple_decomposition.md cover the KDL presentation surfaces — export, hand upload, agent statements — and the rules for decomposing KDL statements into triples.

The fallback rule is uniform across the design and the shipped shells: a shell without a renderer for a surface keeps that surface’s text projection. Scene, audio and widget surfaces degrade to text; they never block the session.

Query and client parity

Three records make parity a design requirement rather than a hope. 2026-11-08T06-45-00Z_design_id_query_local_remote_v1 designs querying local and remote ID servers under one v1 model. 2026-11-08_design_id5820.md (2026-11-08) decides that the scripting/API front door, the agent front door and the CLI front door expose one query model, and that parity between the front doors is proven, not asserted; a front-door convenience that would fork the parent query decisions (#5675) is rejected in the record rather than worked around. 2026-11-10_decision_id5818_remote_filtered_query.md decides server-side filtered remote query execution, and 2026-11-17T15-40-00Z_design_id_federated_query_fanout (#9144, 2026-11-17) designs fan-out across federated peers. 2026-11-09T01-10-00Z_design_id_search_ranking is the decision record for personalized search ranking for notes, homed here by the survey and cross-linked from Design: the knowledge layer.

Sessions, topology and program-facing surfaces

2026-11-01T17-54-35Z_design_id_concurrent_world_sessions (F13.8) designs the client coordinator for concurrent world sessions: one client holding several world sessions at once. Its sibling, 2026-11-01_design_id790.md, designs the multi-server and multi-client topology those sessions run in. 2026-11-08T08-10-00Z_design_id5782_graphical_client_tooling.md is the v1 design for the graphical client and tooling surface. Three records cover how programs reach shells: 2026-11-14T13-50-00Z_design_id_roc_library_imports (Roc library imports for worlds — platform-requirement representation, subset checking, provenance, import errors), 2026-11-16T13-00-00Z_design_id5964_dynamic_user_functions (dynamic user functions — interface contract, compile pipeline, v1 placement), and 2026-11-08T10-26-00Z_design_id_per_user_function_mapping (per-user function mapping — bot battles, strategy hot-switching, human and AI partner composition). 2026-11-08T10-26-00Z_design_id5996_hot_swap_decision decides the v1 hot-swap mechanism among its alternatives.

What exists today

Grounding, from the code and contract surveys for this book (checkout 1ccb4a19457, 2026-11-23):

  • Shipped: the machine-readable shell contract in pkgs/id/contract/ at revision 15, with the four-shell conformance suite and the two golden transcripts. The contract is the design’s centre and it exists as data, not only as prose.
  • Shipped: the terminal and browser paths of the main id program, including the web UI (file browser, ProseMirror collaborative editor) documented in The web UI: pages and HTTP API.
  • Shipped in part: the native shell crate id-native-shell. Steps 1 and 2 of design #788 are in the code — the isolated package, identity and connection bootstrap, contract frame builders, view fallback, the transcript fixture checked against the contract, the window and render plugin set, and a live session loop. It is a workspace member but not a default member, so a plain build of id never acquires its Bevy dependencies. The full design in 2026-11-08_design_id5781.md — worlds hosted inside Bevy applications — is design only; the shipped shell is a presenter client.
  • Shipped as a spike: the hardware shell crate id-hw-shell, complete at its stated subset (presence, journal head, confirm/act; only join and form_result client frames; a form requiring free text is refused). It is transport-free frame-building and folding code, not a running device firmware.
  • Still design: the Android client (2026-11-08T22-06-00Z_design_id_android_client), the more-shells v2 completion rung (2026-11-23T03-17-14Z_design_more_shells_v2, outline only by its own statement), third-party shells (#6299), the semantic rendering pipeline as a complete system (id-render exists as a crate with its own test suites; the five November 2026 decisions describe the target pipeline, and this chapter does not claim every decision is implemented — that claim is unverified from the records read for this chapter), and federated query fan-out (#9144).

Design: agents in worlds and the MCP bridge

This chapter is design. It describes the agents-in-worlds programme as designed in six records: the four-generation outline series #6300–#6303 and the two #10662 registry records. Six records is the smallest theme in the archive survey for this book, and it is kept as its own chapter because it is the programme’s entire MCP surface. The final section states what exists today, and the distinction matters in this chapter more than in any other: the shipped MCP bridge is a translator and policy library only. It has no server and no transport. The live MCP client surface — an agent process connecting over MCP to a bridge that holds a world session — is forward design in this chapter, not shipped behaviour.

Related chapters: Design: shells and client surfaces, Design: capabilities and providers, The MCP bridge, Agents in worlds: the MCP bridge and policy.

Governing principles

All four generations restate the Phase 14 principles from #1240, recorded in §1 of the v1 design, 2026-11-09_design_id6300_agents_in_worlds_v1.md (2026-11-09):

  1. Local-first always. The bridge runs wherever the agent runs, including a laptop talking to a local world. No cloud component is required for any v1 flow.
  2. Hostable by anyone at any scale. The hosted edge is an optional transport front for the same bridge, not a different product.
  3. Peer-to-peer behaviour is identical to hosted behaviour. Authority, ceilings, quota and audit are properties of the world and the agent’s delegation, never of the transport. Iroh (peer-to-peer) and HTTP/MCP (hosted edge) carry the same frames and enforce the same rules.
  4. The hosted instance is the public backstop, never a requirement. A world that cannot be reached through the hosted instance still works end-to-end peer-to-peer.

Each later generation adds one consequence of the same principles: v2 states that roles, quotas and review are properties of the world and the delegation; v3 states that collaboration is a property of world state; v4 states that hosting is a deployment shape, never a capability tier.

Generation 1 — one agent, one world, one session (#6300)

The v1 design scopes itself in one sentence: exactly one agent, one world, one session at a time — joining as an MCP-bridge client, reading screens, posting chat, and performing one bounded program interaction, under a capability ceiling with a full audit log. Multi-agent, citizenship and hosted services are out of scope and gated behind v1.

The shape has three parts:

  • The owner issues a short-lived, attenuated delegation to the agent’s own key. Agent identity is its own Ed25519 key; on iroh the endpoint ID is the public key. There is no separate identity system. Delegation is UCAN-style: attenuated from owner to agent key, verifiable offline, short-lived and renewable, with revocation latency bounded by token lifetime. OAuth 2.1 applies only at the hosted HTTP edge; the world role, not the transport token, is the authority of record.
  • The bridge is a translator, not an authority. It maps MCP tool calls to named client frames of the shell contract (id-shell, ALPN /id-world/1) and renders server frames back as tool results. It holds no credentials of its own and no authority beyond the agent’s delegation. There is no token passthrough.
  • The policy point sits in the world host, outside the agent’s execution environment. Every frame the agent causes is checked in a fixed order: capability ceiling, then quota charge, then audit. The ceiling is set at role grant and enforced by the host policy layer, never by the model and never by tool annotations.

Four v1 mechanisms carry into every later generation:

  • Semantic screen access. Agents receive semantic diffs and region subscriptions, not a raw frame stream. Input frames carry the screen revision they were decided against; the host rejects stale-decision input.
  • The conformance floor. The shell conformance suite is the agent’s safety floor: no input rights without passing it. The suite is the one defined in Design: shells and client surfaces.
  • Pinned tool definitions. Tools are authority-checked world commands only. Tool definitions are pinned at session start and hash-checked; a changed definition set is treated as poisoning and ends the session.
  • Five non-tools, accepted unmodified from the entry research: capability minting, widening or delegation; raw credential access and token passthrough; audit-log mutation and quota adjustment; bulk export and existence probing; arbitrary shell or code execution in the host.

Quota in v1 is a per-action charge against a per-session budget. Exhaustion parks the agent with a first-class world event — the event text is agent parked, quota exhausted — and never fails silently. Audit is one signed, hash-chained event per action, refusals included, with periodic owner-readable summaries.

Spike steps for v1 are filed as #7913–#7917; the bridge spike work is tracked in #7916 and #13202.

Generation 2 — agents as citizens (#6301)

2026-11-10_design_id6301_agents_as_citizens_v2_outline.md (2026-11-10) covers what changes when a world has citizens: configured roles, several agents at once, quotas that outlive a session, and an owner who reviews what their agents did. It takes v1’s mechanisms as given.

  • Roles become world-owned configuration objects. A role definition — capability ceiling, quota class, delegation-lifetime bounds, review policy — lives in the world’s configuration, is versioned with it, and is editable by the world owner through the same surface that edits every other world setting. No role exists only as a string in a token scope.
  • Grants are explicit world state: this agent key holds this role in this world, granted by this owner, at this time. Grants are enumerable by the owner and revocable independently of delegation expiry. Role changes are audited world events, and a changed ceiling applies at the next frame check, not at the next join.
  • Starter roles ship as ordinary definitions a world can copy and edit: observer, participant, and an archivist-class editor are the examples the outline names. They are defaults, not a privileged tier.
  • Several agents hold sessions in one world concurrently, each under its own role, ceiling and quota. The policy point checks per agent and per frame, keyed by (agent, role). A world may cap concurrent agents per role; a refused join is audited with the reason.
  • Quota becomes a per-(agent, world) ledger. Budgets are granted with the role, replenish on the role’s stated cadence, and persist across sessions. A citizen cannot reset its budget by rejoining. V1’s per-session budget is explicitly replaceable by the F12.10 quota work in #1067.
  • No inter-agent delegation and no direct agent channel are introduced. What one agent may do about another agent is limited to world actions under its own role. V2 follow-up steps are filed as #8299–#8303.

Generation 3 — shared agent worlds (#6302)

2026-11-14_design_id6302_shared_agent_worlds_v3_outline.md (2026-11-14) covers agents collaborating. Its rules:

  • Every coordination act is a world action. Claiming work, handing it off, commenting on it and editing a shared artifact are ordinary world operations under the acting agent’s role ceiling, charged to its quota ledger and written to the audit log. There is no coordination surface a host cannot audit, replay and render for owners.
  • No new authority flows between agents. A post on a board cannot widen another agent’s ceiling. A handoff transfers a task reference, never a delegation; the receiving agent acts under its own role or not at all.
  • World chat remains the only conversational surface, under the same frames as every shell.
  • A task board is a world-owned object, configured like a role: its columns and states, which roles may create, claim, move and close items, and its visibility are world configuration. An item carries title and body, state, creator, current claim holder (agent and role), a claim epoch, and its full history as audit events. Closing an item is its own capability, separate from claiming it.
  • Shared documents carry provenance from the audit log. Worlds whose population is mostly agents, with human visitors, use the same rules; the outline introduces no agent-only world class.

V3 implementation steps are filed as #10049–#10054. The outline itself records that #6302 stays open because those step sub-issues are open, not because the design is unwritten.

Generation 4 — hosted agent services (#6303)

2026-11-16_design_id6303_hosted_agent_services_v4_outline.md (2026-11-16) covers the always-on, hosted agent: listed in a registry, hired or attached to worlds, and run by a hosting substrate under the public-server trust model. Its central rule is stated in §1: a hosted agent holds exactly the agent key, role ceiling and quota ledger it would hold on its owner’s machine. The host can run its process; the host cannot widen its authority, read its sealed state, or act in its name beyond the delegations the agent’s owner issued.

  • A listing is a signed, versioned record: the agent program’s identity (the public half of its agent key), a program manifest, the roles it is willing to be hired under, its operator, and its availability terms — always-on, scheduled, or on-demand wake.
  • Listings are discoverable, not endorsed. The registry is an index with provenance — who listed the program, when, under which operator — and the listing’s history (worlds served, claims completed, claims expired, review outcomes, all as audit references) is the evidence a hiring owner makes the trust call from.
  • Suspension is by the listing’s operator or its owner, at any time; suspension stops new hires and starts a drain of existing work. A registry operator can delist for abuse; delisting is an audited, public act with the evidence attached, never a silent removal.
  • Hiring is a world action by the world owner. It names the listing, an ordinary v2 role for the agent to hold, and the quota class and ledger the agent’s actions charge. Hiring creates no special role class.
  • There is no central registry monopoly: the registry protocol is one protocol that federated and per-community registries also speak.

The v4 breakdown is four steps: #10662 (listing record and registry protocol), #10663 (hire and attach), #10664 (presence, wake and drain), #10665 (host trust spike). The plan of record for the Phase 14 programme that contains all four generations is epic #6312, under core topic #6280.

The registry records (#10662)

Two records settle the registry’s record family. 2026-11-20T13-35-00Z_design_id10662_hosted_agent_service_listing (2026-11-20) is the design proposal for v4 step 1, and 2026-11-23T12-46-33Z_design_id10662_listing_record (2026-11-23) is the decision record that settles it: the listing’s exact fields, its signing and versioning, the suspension and delisting records, and the query shape worlds use to find candidates. The 2026-11-23 record designs records and a query protocol only — no registry implementation, no hire mechanics (#10663), no runtime contract (#10664).

Fixed points from the decision record:

  • Identity values: an Ed25519 public key is 32 bytes and a signature is 64 bytes. Signed records in this family are wire-stable: a magic and version header, the body as postcard, then the signature; the signature covers the body bytes behind a domain tag so it cannot be replayed over another message kind.
  • A listing is not a bundle listing. The existing program registry serves bundle records — author, name, version, payload hash. A hosted listing references an immutable program release by that tuple; it does not re-publish the release’s bytes, and removing one listing does not mutate, delete or withdraw the bundle or any other listing backed by the same bundle.
  • Versioning: each revision binds its exact predecessor; an identical replay is accepted idempotently; an older revision is rejected as a replacement for a known head; two different records claiming the same identity and revision are unresolved, not resolved by timestamp. A suspended or delisted listing is not reactivated by publishing a new revision.
  • Lifecycle events are append-only, authenticated and scoped: suspension applies to the listing identity; delisting is scoped to the registry that issued it, carries a reason class and a safe evidence reference, and does not delete history or the underlying artifact.
  • The discovery query is bounded: optional role selector, required advertised surfaces, availability mode, an artifact or agent selector, a bounded page size and an opaque continuation cursor tied to the endpoint, query and snapshot. A result returns verified current listings only; an unresolved proof, history or freshness state excludes a listing from candidates and is reported as an incomplete result, distinct from a verified empty page.
  • Role vocabulary: listings speak the starter role names accepted by WorldScopes::from_role in id-caps — spectator, observer, player, guest, delegator, builder, moderator. A world that renames its roles maps its names onto that vocabulary.

The forward design: a live MCP client surface

The four generations describe an agent that connects, joins and acts. Connecting requires three pieces the design names and the shipped code does not contain: an MCP server endpoint (stdio or HTTP) that accepts a client connection, a transport that carries MCP messages to the bridge, and session management that binds one MCP session to one bridge session and one world session. In the design, that surface inherits every v1 rule unchanged: the server is a front for the translator, the policy point stays in the world host, tool definitions are pinned and hash-checked at session start, and the hosted edge variant of the same surface adds OAuth 2.1 at the edge only. Any implementation of this surface is #6300-series work; the records do not describe it as built, and neither does this chapter.

What exists today

Grounding, from the web/MCP survey for this book (checkout 1ccb4a19457, 2026-11-23):

  • Shipped: a library-level translator and policy point in crates/id-caps/src/mcp_bridge.rs and crates/id-caps/src/mcp_policy.rs, exercised by pkgs/id/tests/mcp_bridge_e2e.rs and pkgs/id/tests/mcp_spike_e2e.rs. The translator is authority-free: it converts one MCP tool call into a shell-contract client frame (JSON), a locally rendered answer from observed server frames, or a session close. It holds no credentials; the only secret-named value it touches is the agent’s own join capability, passed through into the join frame — the value itself is never printed in this book, only its name.
  • Shipped: 8 v1 tools in a pinned order — world.join, world.leave, screen.read, screen.subscribe, object.inspect, program.invoke, chat.post, presence.set. One listed tool is refused in v1: presence.set always returns the no-frame-mapping error, because presence is the join itself and no presence frame exists. Five names are forbidden as tools, matching the v1 design’s five non-tools: capability.mint, credential.read, audit.mutate, world.export, host.exec. The full tool table is in The MCP bridge.
  • Shipped: the policy layer. A policy session wraps a bridge session and enforces, in order, the capability-ceiling check, a quota charge before execution, and exactly one hash-chained, journal-key-signed audit event per action, refusals included. It enforces the stale-decision rule on screen_revision and per-tool sliding-window rate limits. Quota exhaustion parks the agent with the world event whose kind is agent_parked and reason quota_exhausted. world.leave is never refused by ceiling or quota and is charged nothing, but it is audited.
  • Not shipped: any MCP server binary, any stdio or HTTP MCP transport, and any JSON-RPC tools/list implementation in pkgs/id. There is no ID or world MCP entry in the mcpx configuration; the only remote MCP entry there is Atlas Search. There is no gate-token environment variable for the ID MCP bridge.
  • Still design: v2 citizenship as world configuration, v3 shared agent worlds, v4 hosted services, and the #10662 registry as a running service. The two #10662 records are a settled record design (2026-11-23) with no registry implementation claimed in them.

Design: currency, tokens and metering

This chapter is design. It describes the currency, token and metering system as designed in 26 records homed here in the archive survey for this book, plus the receipt contract (#3231, audit #3232) whose records are homed with the identity records and cross-linked here because every anchored currency operation depends on it. The design has three layers that the records keep separate: graph-native tokens, whose balances are derived by folding signed graph events; ledger-anchored currencies, whose balance truth lives in TigerBeetle behind a gateway; and metering, which prices computation and function use without being a currency itself. The final section states what exists today.

Related chapters: Design: foundations — objects, graph and the file core, Design: capabilities and providers, Currency, tokens and metering.

Currencies v1 (#2043)

The governing record is 2026-11-01_design_id2043.md (2026-11-01), the currencies v1 design under epic #2056, with Drew’s 2026-11-08 policy rulings folded in. Its decision, in five parts:

  1. A currency is a signed graph definition whose stable identity is the pair (issuer public key, definition event/hash). Name and symbol are labels, not identity.
  2. Each definition selects exactly one binding: graph-native (offline, peer-to-peer, balances derived by folding events) or ledger-anchored (online, gateway-mediated, TigerBeetle holds balance truth).
  3. The graph is the authorization and audit record for anchored operations. The control plane is a rebuildable operational index. TigerBeetle is the balance authority. Graph-native transfers are claims: conflicts and double-spends can be detected, and the design states plainly that they cannot be prevented offline.
  4. Real-service purchases use the pending-hold lifecycle and only anchored currencies. A payment receipt records an effect; a receipt is never itself a balance movement.
  5. Anchored conversions use one signed, directional rate authorisation, a short-lived event-pinned quote, and one atomically linked TigerBeetle batch. A posted conversion is corrected by a new compensating conversion, never edited.

The public naming is decided in the same record: the neutral label is “units”, naming three currencies — units, pending units, revoked units. 2026-11-08T14-05-49Z_design_id2043_extension.md (2026-11-08) extends the v1 design for the token rulings of 2026-11-08. The wire format underneath the graph-native side is 2026-10-30T13-25-00Z_design_graph_token_formats_snapshot_anchoring.md (graph token object formats and snapshot anchoring), and the issuance analysis is 2026-10-30T19-18-00Z_investigation_token_issuance_id_graph (per-ID issuance, issuer snapshots, authorized conversion rates). 2026-11-07T03-55-49Z_feature_graph_currency_contracts (2026-11-07) is the implementation-slice record for the graph-native contracts under #5522: immutable definitions and the three primary value events — issue, transfer, burn. Its own status line states that it is not a claim that currencies v1 is complete.

An example with invented data: a definition event by issuer key issuer-example defines a currency labelled test units with a graph-native binding. A transfer event moves 50 units from account alice-example to account bob-example. Any node that folds the definition, the issuance and the transfer derives the same two balances; no server is consulted, and a second conflicting transfer of the same units is detectable in the fold, not prevented at the moment of signing.

The receipt contract (#3231) and its audit (#3232)

Anchored operations and graph artifacts share one validity question, settled by 2026-11-01_design_id3231.md (2026-11-01): what does it mean for a signed artifact to be valid when it arrives, and where is that contract enforced? The record’s decision: a known-kind artifact is acceptable on receipt only when it satisfies the structural rules that the crate’s supported producers are meant to create. Signature authenticity, chain position and unknown-kind forward compatibility stay distinct from known-kind body validation. Receipt must not rewrite signed bytes to make them pass. Unknown kinds may be stored; they are never applied. The record’s status line states that implementation is represented by the origin issues it lists and that none is implemented by the record itself.

The Phase 3 audit of that contract is 2026-11-04_audit_id3232_receipt_validation.md (2026-11-04), the receipt-validation audit for pkgs/id artifacts under #3232. The two records together are the receipt contract the currency design cites: a currency definition, a rate authorisation and a grant are each signed artifacts, and each is judged at receipt by the #3231 rules, not by the producer’s intent. The signing-side counterpart — sign only what receipt would accept — is designed in the identity records and stated in the facade library header; it is cross-linked from Design: identity, directory, groups and delegation.

Conversion and RateAuthorisation (#2063, #2290)

2026-11-01_design_id2063.md designs the conversion engine: linked transfer pairs and rate authorisation. 2026-11-01_design_id2290.md designs the authorisation itself as a signed ID-graph object: a currency.rate_authorisation event, signed and directional, that names the pair of currencies, the rate and the authority under which a conversion may post. A conversion then runs as one atomically linked TigerBeetle batch — the debit leg and the credit leg post together or not at all — pinned to a short-lived quote that references the authorisation event. 2026-11-05_design_id5828.md (2026-11-05) carries conversion and RateAuthorisation across the staged backends of #5676 (Redis, multi-Turso, TigerBeetle), so the contract survives each backend change.

The TigerBeetle line

Four records work out the anchored backend:

  • 2026-10-28T23-34-15Z_investigation_tigerbeetle_currency_backend (2026-10-28): the investigation of TigerBeetle as the accounting backend for dynamic ID currencies.
  • 2026-10-29T11-57-00Z_investigation_tigerbeetle_cluster_topology (2026-10-29): the cluster topology decision — 3 replicas against 6, site placement, commit latency.
  • 2026-11-03T20-36-00Z_design_tigerbeetle_ledger_binding (2026-11-03): the LedgerBackend binding, tb_ledger, that connects the currency port to a TigerBeetle cluster.
  • 2026-11-14T06-22-00Z_poc_currency_gateway_boundary_results (2026-11-14): proof-of-concept results for the currency gateway boundary, #2298.

Two boundary records keep the anchored service in its place. 2026-10-29T12-20-00Z_design_currency_centralised_exception designs currency as the centralised exception: the hosted edition’s one centralised service boundary is the currency service, and the record draws that boundary. 2026-10-29T12-42-21Z_design_currency_control_plane designs the control plane — registry, account factory, gateway. The registry is the authority for which u32 means what: TigerBeetle ledgers are bare non-zero u32 values, and name, symbol, scale, issuer, supply policy and status live in the registry. The ratified split of the ledger number space is 0x00000001 to 0x000FFFFF for tenancy and system ledgers, and 0x00100000 upward for currencies; ledger 0 is never allocated.

Grants, holds and refunds

Real-service value moves through grants, designed in three records. 2026-10-30T11-55-00Z_design_grant_lifecycle.md is the grant lifecycle implementation specification: pending holds, a fingerprint registry, clawback and shortfall handling, and revocation policy. 2026-10-29T12-10-00Z_design_refundable_grants_pending_transfers designs refundable grants via pending transfers — premium tokens that survive a refund, because the value sits in a pending transfer that a refund can void instead of a posted transfer that a refund would have to reverse. The v1 design binds the two together: purchases use pending holds, and only for anchored currencies.

Scaling stages and the backend port

The staged path from the first backend to TigerBeetle is four records:

  • 2026-11-14_design_id5823.md (2026-11-14): the currency backend port and its invariant test-suite contract — one port, with the invariants every backend must pass stated as tests.
  • 2026-11-16_design_id5825.md: currency autoscaling — a stateless front end, hot-account mitigations, scaling triggers.
  • 2026-11-16_design_id5826.md: Stage B — multi-Turso sharding by currency.
  • 2026-11-16_design_id5827.md: Stage C — the TigerBeetle adapter and the B-to-C cutover. One currency is one ledger: u32. The cutover migrates one currency at a time: readiness, a shadow dual-run with a zero-divergence ledger comparison, then freeze, saga drain, fence, copy and verify, directory flip, and retirement of the Stage B copy as read-only audit.

2026-11-08_design_id5829.md designs the load and correctness verification programme those stages must pass: property tests, crash injection, and per-stage performance envelopes. 2026-11-08_decision_id5906_kdl_json_contract.md is the decision record for the KDL-to-JSON canonical conversion and round-trip contract used by currency configuration surfaces.

One survey classification note: the survey homes 2026-03-21T05-47-48Z_feature_content_modes (content modes, format conversion and media viewing, 2026-03-21) in this theme. It belongs to the file core’s format-conversion history, not to currency conversion; the full index in Roadmap, issue map and the design-record index keeps the survey’s mapping and this chapter does not cite it as a currency record.

Metering

Metering is priced computation, designed separately from currency so that a host can charge for function use without issuing money.

  • 2026-11-09T00-10-25Z_research_id5966_gas_timeouts_multithreading (2026-11-09): research on per-function gas metering, timeouts and multithreading for user functions.
  • 2026-11-10T03-10-00Z_design_id_two_level_metering (2026-11-10): the two-level metering design — a burst bucket plus a hard per-tick ceiling, per function. The burst bucket absorbs short spikes; the ceiling is the value no single tick may exceed.
  • 2026-11-11_design_id6016_metering_record_flow.md (2026-11-11): the per-function metering record and its flow — the record’s fields and its route, designed for the case where servers charge by function class.

World execution already has one metering value in force in the shipped runtime, stated here because the metering design builds on it: the default guest fuel budget is 10,000,000 fuel per call, and the world CLI defaults include --world-fuel with default 10000000, --world-memory-mib with default 16, and --world-total-memory-mib with default 64. Fuel is the unit the two-level design meters at the function level; the per-function records of #6016 are the design for accounting that fuel to a function class. The interaction between metering records and currency — a host converting metered use into an anchored charge — is not settled in any record read for this chapter; that claim is unverified and no record is cited for it.

What exists today

Grounding, from the library and web surveys for this book (checkout 1ccb4a19457, 2026-11-23):

  • Shipped: the id-currency-registry crate — the control-plane registry of the design, built as F1/F2 of #2062 (#2317, #2318). It contains the Postgres schema and migrations for ledger allocation, currency, currency issuer and account, the monotonic never-recycled ledger-u32 allocator, the account factory, and an in-memory store that enforces the same constraints as the Postgres migration. Its only production dependent is the facade.
  • Shipped as proof of concept: the facade’s currency and currency_poc modules and the gateway PoC that composes the registry (src/currency/gateway_poc.rs, #2321), plus the optional currency-poc-tb feature, which pulls in the official TigerBeetle Rust client for the #2289 live-cluster PoC. A hosted-edition currency gateway PoC also exists in the Worker code (src/currency/, #2298) and its own text states it is not the permanent currency service: it is an in-process TigerBeetle-style ledger stub with gateway-signed operations.
  • Shipped as a contract slice: the graph-native currency event contracts of 2026-11-07T03-55-49Z_feature_graph_currency_contracts — definitions, issue, transfer, burn — under #5522.
  • Still design: currencies v1 as a complete system. The v1 record is a design recommendation with policy rulings, not an implementation claim; the conversion engine as a running service, the staged backends B and C as production deployments, per-function metering records (#6016) and two-level metering as a charging system (#5966 research, 2026-11-10 design) have no shipped implementation named in the records read for this chapter.

Design: the knowledge layer

This chapter is design. It describes the knowledge layer as designed in the records of programme #5678 and its neighbours. The archive survey for this book homes 57 records in the combined knowledge-layer and first-apps theme; this chapter carries 31 of them — the records about notes, documents, tags, links, import, export, search and the knowledge programming model, including the worlds-adjacent library and programming-model work filed under the #5955 worlds programme. The other 26 records — the concrete first applications and the program ecosystem ladder — are in Design: first apps and the ecosystem. The split is stated in full in Roadmap, issue map and the design-record index, where every one of the 57 records is listed exactly once.

Related chapters: Design: first apps and the ecosystem, The file core: content addressing, names and tags.

The governing record is 2026-11-01_design_id2048.md (2026-11-01), the Zettelkasten layer design under epic #2056: multiplayer docs and wiki on ID. The decision it takes: a note is a stable logical object, its content is a sequence of signed immutable revisions, and its links are typed references — not filenames and not generic tags. The record rejects the two simpler options with reasons stated in the record: a document.put event cannot be the note, because the event ID changes on every save, so history does not group successive puts into one lineage and links cannot survive edits or renames; and filenames plus generic tags cannot define the note graph, because filenames are mutable locators and tag claims are signed observed-remove claims, not typed directed edges.

The substrate the design builds on is stated in the same record: signed, hash-identified events with a generic kind and a causal after frontier; document content as blobs; aliases as claims that are never silently selected when contested. Resolution follows the #2047 rule the record adopts: resolve within the viewer’s configured stores, show provenance and ties, and persist the stable target ID plus the chosen surface form.

Three boundary statements in the #2048 record constrain everything built on it:

  • Live ProseMirror collaboration is transient server state, keyed by filename, held in memory. Save persists a document blob and a signed put; live steps are not durable graph events. The design reuses the live transport and does not treat it as a replicated conflict-resolution model.
  • A writer-set view is not a read access-control list. Valid events are stored; a view counts only its configured writer set. Shared use of the knowledge layer waits on a real event and blob access policy, which the record states the current sync wiring does not provide.
  • Search at the design baseline covers tag metadata and excludes full-text search. The knowledge layer’s search design starts from that baseline, not from a full-text index.

Supporting records: 2026-11-01T16-05-00Z_design_documents_session_frames (documents as a session frame pair, for web and CLI parity), 2026-11-02T04-52-00Z_feature_note_link_backlink_projection (note links and the head-based backlink projection — backlinks are a projection of the link graph at a head, not stored data), and 2026-11-09T03-57-04Z_design_id_edit_fork_graph (the edit/fork graph for notes: forks are first-class graph objects with provenance, not copies).

The #5678 programme cluster

Programme #5678 is the knowledge-layer programme. Its parentage shows in the records: #5842 (AI over notes) names #5678 as parent, and the cluster records #5843–#5848 and #6435 decompose it.

  • knowledge-layer-extensibility-5843.md (undated in the archive; issue #5843): the extensibility cluster decision record — how the knowledge layer grows new object types and behaviours without changing the core model.
  • knowledge-layer-attachments-media-5844.md (issue #5844): the attachments and media cluster — how media attaches to knowledge objects.
  • knowledge-layer-feature-matrix-6435.md (issue #6435, observation date 2026-11-08): the feature matrix investigation. Its method is part of the design record: every cell carries an evidence type (primary, hands-on, secondary), product facts were observed from vendor documentation on 2026-11-08, unknowns are recorded as unknown with the gap named, and nothing is inferred from a competitor’s category. One product in scope, Open Knowledge, is recorded as an explicit identity blocker: identity unconfirmed, most plausible candidate noted as unverified.
  • 2026-11-10T20-12-00Z_design_id_content_model (2026-11-10, cluster record for #5839): the content model decisions the importers and views consume.
  • 2026-11-08_design_id5837.md: the knowledge graph view cluster — local and global views, edges, filters, scale and live behaviour.
  • 2026-11-08_design_id5832.md: multiplayer edit sessions — user experience, lifecycle and participation (issue #5832).
  • 2026-11-08T11-06-39Z_design_id_draft_approval_flow: draft approval queues, outcomes, and rejected-draft forks — a rejected draft becomes a fork, not a deletion.
  • 2026-11-08_decision_id5874_thread_resolution.md: thread resolution and the discussion-to-edit loop — resolved-into links and change proposals connect a discussion thread to the edit it produced.
  • 2026-11-08_design_id5830.md: the note-to-board sharing model — embedded live references, version semantics, reply anchoring, backlinks, and the cross-server case.
  • 2026-03-23T12-00-00Z_feature_metadata_tags (2026-03-23): the metadata tag system, the earliest record in this chapter and the tag substrate the #2048 design builds on.

Sharing and permissions for the layer are designed in 2026-11-08T08-19-40Z_design_id_knowledge_sharing_permissions, homed with the identity records in the survey and cross-linked here; its read-authority default is the one the AI record below inherits.

Importers: five products, one object model

Every importer design targets the #2048 object model, so imported content lands as stable notes with revisions and typed links, not as files in a folder:

  • 2026-11-08_design_id5845.md — Obsidian importer (#5845).
  • 2026-11-08_design_id5846.md — Evernote importer (#5846).
  • 2026-11-08_design_id5847.md — Logseq importer (#5847).
  • 2026-11-08_design_id5848.md — Joplin importer (#5848). Continuous sync for Joplin is a separate design, 2026-11-12_design_id9004.md, homed with the sync records.
  • 2026-11-08T08-53-12Z_design_onenote_importer — OneNote importer.
  • 2026-11-10_design_id6436.md — Notion importer (#6436). A shipped importer crate exists for Notion; its state is in the grounding section below.

The reverse direction is 2026-11-08_design_id6439_knowledge-interchange-and-export.md: knowledge-layer interchange and full-fidelity export. Export is a design requirement of the layer, not an afterthought: the export must carry the graph — revisions, links, provenance — at full fidelity.

Query, search and AI over notes

  • 2026-11-09_design_id5821.md: ID queries — result shaping and cursor pagination, a decision record. Query results are shaped server-side and paged by stable cursors.
  • 2026-11-08T00-45-00Z_design_id_recommendations (2026-11-08): recommendations across all object types, v1 design. Recommendations are a knowledge-layer service over the whole graph, not a per-app feature.
  • Personalized search ranking for notes is decided in 2026-11-09T01-10-00Z_design_id_search_ranking, homed with the shell records in the survey and cross-linked here and in Design: shells and client surfaces.
  • 2026-11-10T21-45-00Z_design_ai_over_notes (2026-11-10, issue #5842, parent #5678): AI over notes — source-grounded question answering over a user’s note corpus, summarisation, citation back to source, and generated audio overviews as a named possibility. The record inherits the parent programme’s read-authority ruling verbatim: the default is public read; the owner may grant read to any number of groups and/or users; and the resolution order is object, then user default, then server config, then public — an object’s own read setting wins, else the owner’s user-level default, else server configuration, else public. The parent’s binding corollary, quoted in the record: AI indexing and search must never expose content to a reader the resolution order would deny. The design applies it by treating the model as a reader, not a principal: an AI feature holds no read authority of its own; for each question the system computes the asker’s read set, and retrieval, ranking, generation context and citations operate strictly inside that set. Filtering runs before ranking — the record states that rank-then-filter leaks through result counts, phrasing, timing and near-miss snippets — and every factual claim in an answer cites the note it came from.

Two records place agent notes, which is knowledge-layer policy for the programme’s own agents: 2026-11-08T13-55-51Z_design_agent_note_placement (where agent notes live — scratch, memory, repo, Zettelkasten, or ID graph) and 2026-11-10T20-00-00Z_design_agent_note_placement.md (the placement rule for zettel against repo against ID graph, 2026-11-10).

The worlds-adjacent programming model (#5955 cluster)

The #5955 worlds programme filed a cluster of records that the survey homes in this theme; they define how libraries and user code behave as knowledge the platform carries:

  • 2026-11-05_design_id5965.md (2026-11-05): compile economics — compiled-world and DLL caching, compile-cost penalties, premium gating.
  • 2026-11-05_design_id5997.md (2026-11-05): effect-language borrowings — which Koka and Unison properties ID tooling emulates, approximates, or skips. The record’s three-way disposition (emulate, approximate, skip) is the design output.
  • 2026-11-08T17-23-00Z_design_id5963_programming_model: the programming model — explicit platform contexts for pure libraries.
  • 2026-11-08_design_id5969.md: library typing and upload taxonomy — subtypes, entity attachment, DLL against compile-in, libraries by URL.
  • 2026-11-11_roc_library_evidence_5995.md (2026-11-11): Roc shared-library outputs and host loading, evidence for #5995 — the measured base the library-import design in Design: shells and client surfaces consumes.

What exists today

Grounding, from the surveys for this book (checkout 1ccb4a19457, 2026-11-23):

  • Shipped: the substrate the design builds on — signed document events, blob-backed content, tag claims, aliases, the web collaborative editor with transient live sessions and signed saves, and tag-metadata search. The #2048 record itself documents this baseline from the code.
  • Shipped: one importer crate, id-import-notion, with a recorded-inventory integration test suite. It is a default workspace member with no dependents. The other five importer designs (Obsidian, Evernote, Logseq, Joplin, OneNote) have no shipped crate named in the surveys; treating any of them as built is unverified.
  • Shipped in the file core: the did-it tracker module in the facade (didit) and the boards module (boards) — application modules, not the knowledge layer of this design.
  • Still design: the knowledge layer as designed — stable logical notes with signed revision lineages as the note model (the #2048 record states implementation is split across #3814, #3816 and #3819 and includes no implementation), typed link and backlink projections as the link system, the #5678 cluster behaviours, full-fidelity interchange and export (#6439), recommendations as a graph service, and AI over notes (#5842, a design record whose status is draft). None of these is presented in this chapter as working today.

Design: first apps and the ecosystem

This chapter is design. It describes the first applications built on ID and the program ecosystem that distributes them, as designed in 26 of the 57 records the archive survey homes in the combined knowledge-layer and first-apps theme; the other 31 records are in Design: the knowledge layer. The chapter runs in the order the programme ran: the first app (sticky notes and the did-it tracker, #2031), the first application families (chat, boards, match play), the shipped Roc guest apps that are the platform’s working first apps, and then the ecosystem ladder #6278 — share and fork (#6291), gallery and updates (#6293), the public gallery (#6294), and creator tooling (#6308). The final section states what exists today.

Related chapters: Design: the knowledge layer, Design: worlds and the guest runtime, Gallery, match-audit and walk.

The first app: sticky notes and the did-it tracker (#2031)

2026-11-01_design_id2031.md (2026-11-01) is the design for the first ID app. Its acceptance bar is stated in the record: identities A and B exchange notes and did-it events; A’s view excludes C’s claims but leaves them retrievable on demand; and no permanent feature is built on an unreviewed proof of concept. The recommendation: build the proof of concept on reusable event and projection behaviour, not on an app-only event model — first make arbitrary committed event bodies durable and transferable, then land the did-it schema and evaluator and the writer-set projection as independently testable library slices, then compose those with existing document and blob events in an example. The record names a prerequisite the original follow-up issues missed: generic application bodies were validated at ingest but not persisted for later retrieval or range-synced, so a body-persistence slice must land before the app slices (#3788 did-it model and evaluator, #3789 writer-set projection, #3790 example proof of concept).

The did-it data model has its own investigation: 2026-10-29T13-04-50Z_investigation_didit_tracker_data_model (2026-10-29). The sticky-notes half of the first app is a knowledge object; its note model is the one designed in Design: the knowledge layer.

The first application families

  • Chat. 2026-11-01_design_id2051.md designs ID chat v1. 2026-10-30T19-40-00Z_investigation_irc_first_chat_on_id (2026-10-30) is the IRC-first investigation beneath it: channels, graph-linked objects, presence. 2026-11-09T01-27-00Z_design_chat_anchor_data_model designs the chat anchor data model — typed links and durable part selectors, so a chat message can anchor to a part of another object and the anchor survives edits.
  • Boards and posts. 2026-11-08T13-45-00Z_design_id5857_curated_board_submissions designs curated-board submissions — intake queues, intake roles, notifications. 2026-11-08_design_id5856.md decides the post-to-board flow and post semantics. 2026-11-08_design_id5859.md decides live-object embeds in playable posts. The boards surface design itself (signed boards, portable themes, playable posts) is 2026-11-01_design_id2054.md, homed with the shell records.
  • Match play. 2026-11-01_design_id2039.md designs match attestation and audit v1 — one of the two sub-issues of epic #2056 still open at the investigation charter’s writing. 2026-10-29T10-54-33Z_investigation_match_audit_netcode_replay investigates the match audit netcode: log format, replay validation, cheating signals. 2026-10-30T19-20-40Z_investigation_match_result_attestation investigates match-result attestation: mutual concession, witness adjudication, offline play.
  • Early surfaces. 2026-03-20T05-30-00Z_feature_collaborative_cursor_enhancements (2026-03-20) and 2026-03-23T00:00:00Z_feature_file_list_ui (2026-03-23) are the earliest records in this theme — collaborative cursors and the file list UI of the pre-worlds editor generation. 2026-04-01T00-00-00Z_feature_multi_instance covers multi-instance support for id. 2026-10-17T09-00-00Z_feature_world_fixtures designs session recording to replayable fixtures, the testing base the app designs rely on.
  • Games and assets. 2026-11-08T09-14-46Z_research_id5988_prior_art_bot_games_programmable_worlds is the prior-art research on scripted-bot battle games and user-programmable worlds. 2026-11-06T00-50-21Z_design_dynamic_world_tick_cost designs the dynamic-world per-tick cost model and the bot-battle benchmark. 2026-11-08T00-57-08Z_design_shader_asset_format designs the shader asset format v1. 2026-10-16T15-00-00Z_feature_roc_grid is the RocGrid record — a bounds-checked grid library for world programs, the library the grid guest app demonstrates.

The shipped first apps: the 9 Roc guest apps

The platform’s working first apps are the 9 deployable Roc guest apps in pkgs/id/examples/, plus the one packaged app. They run on the shared Plaza platform (examples/roc-world/), whose guest shape is fixed: every app provides init, update, view, layout, records, wants, snapshot and restore; guests are compiled to import-free Wasm modules with no WASI, no filesystem, network, clock or randomness imports; all effects go through the capability protocol, with requests answered as participant-0 events and refusals returned as events with stable error codes (cap_denied, unknown_cap, bad_args, failed, actor_denied, outside_ceiling, result_too_large). The full platform treatment is in Design: worlds and the guest runtime.

AppLocationWhat it is
tic-tac-toeapps/tic-tac-toe/The sole packaged app (app.toml plus program/main.roc): two-player tic-tac-toe, digit 0–8 moves, ply parity picks X or O, records publish board, plays and winner.
loungeexamples/lounge/Capability-system demo: subscribes to players and time.tick:5000, greets arrivals through chat.say requests, counts refusals, polls time.now.
roc-counterexamples/roc-counter/Tiny pure counter world: guests send inc, all see the count, demonstrates records mirroring and the Screen presentation.
roc-text-counterexamples/roc-text-counter/The no-Screen legacy-text twin of roc-counter; keeps the plain-text presentation path covered (#3181).
roc-chatexamples/roc-chat/Minimal chat client on RocCap with chat.say and chat.history; typing hist shows the newest 8 lines.
roc-gridexamples/roc-grid/RocGrid demo: a 4×3 byte grid, set claims the centre cell, bounds-checked reads with fallback.
roc-screenexamples/roc-screen/Screen and Key demo: a bordered-box counter screen document; presenters render the structured grid.
territoryexamples/territory/Multiplayer territory game: at most 8 seated players on a 16×8 grid, adjacency-only claiming, seats persist across leave, rejoin and restart.
roc-cap-demoexamples/roc-cap-demo/Library-import worked example (#5957): a capability-dependent Roc library over records.read, with two compile-must-fail negative tests.

Two neighbouring directories are not apps: examples/roc-world/ is the shared platform package, and examples/roc-import-policy/ is a compile-fixture matrix for the import gate. The Rust twins (examples/rust-counter/, examples/rust-world/) are the F12.8 guest SDK and its counter example, not Roc apps. examples/first-app-poc/ is a README only: the sticky-notes and did-it proof of concept of #2031, whose executable artifact is the Rust integration test tests/first_app_poc.rs, by design.

The ecosystem ladder (#6278)

The program ecosystem core topic is #6278. Its first-pass record, 2026-11-10T21-24-00Z_design_id_program_ecosystem (2026-11-10), settles the vocabulary and the load-bearing decisions the ladder steps share (decisions D1–D6, invariants 1–7), and states the rule of the ladder: a step that needs a different answer amends the core record first; no step silently forks a decision. Its principles are the #1240 principles restated as constraints: local-first always, with a hosted version intended; anything built must be completely usable by others hosting a small or large server themselves; peer-to-peer-hosted worlds and data behave the same as on a large hosted public server, with differences only in backend scale elements and access controls, never in protocol behaviour; the hosted instance is a public backstop, not a requirement.

v1 — share and fork (#6291)

2026-11-11T05-01-15Z_design_id_program_ecosystem_v1 (2026-11-11) scopes v1 to four operations: export a program as one signed bundle file; import a bundle into a world (sideload, fully offline); fork a held bundle with structural attribution; export a world as a template-world package file and import it as a new world. Out of scope for v1, by name: the gallery and registry, channel and update-policy user experience, the hosted public gallery, and federation. V1 builds beside the F12.2 world fork, template and provenance implementation and reuses it.

2026-11-11T05-24-00Z_design_id_program_ecosystem_v2 (2026-11-11) refines D6 and D4 for its slice: the gallery as a registry in depth — the registry record, the publish, unpublish, list and fetch operations, the three publishing paths, and the line between validity and admission; template packages as registry records; and update channels with the update flow into worlds that installed earlier versions.

2026-11-14T13-33-00Z_design_id_program_ecosystem_v3 (2026-11-14) designs the operated instance: the hosted public gallery on the main public endpoint — categories, search, featured collections, author pages keyed by public key — plus the curation posture, abuse handling and scale elements v2 deferred to it. Out of scope, by name: federation and lineage-aware discovery at scale (v4, #6295), payments, and browsing accounts or logins — identity is keys. All operator policy in v3 is layered on the D6 registry design, never in the protocol.

Creator tooling (#6308) and network defaults

2026-11-18_design_id6308_creator_owner_basics_v1.md (2026-11-18) designs creator tooling and insight — owner basics v1 for #6308, a child of #6278. 2026-11-14T19-05-00Z_design_id_build_defaults designs the build-time defaults file for ID network defaults, and 2026-11-09T04-43-05Z_design_id5788_build_variants.md is the design record for feature-leveled build variants — the distribution mechanics the ecosystem’s packages are built under.

An example with invented data, following the v1 design: a creator exports the program counter-example as one signed bundle file, sends the file to a friend by any channel, and the friend imports it into their own world offline. The import verifies the bundle’s signature and manifest; a fork of the imported bundle carries structural attribution back to the original. No gallery, account or network service participates in any step of that flow.

What exists today

Grounding, from the library survey for this book (checkout 1ccb4a19457, 2026-11-23):

  • Shipped: the 9 Roc guest apps and the packaged tic-tac-toe app listed in the table above, with checked-in Wasm artifacts beside most apps so host conformance suites run without a Roc toolchain. These are the first apps in the literal sense: working guest programs on the shipped Plaza platform.
  • Shipped: the program-side machinery the ecosystem designs build on — the program registry and gallery surface named in the CLI (gallery, publish, unpublish, publications command families exist in the shipped CLI table), and the bundle record path the #10662 listing design distinguishes itself from: author-signed bundle records with author, name, version and payload hash, fetched by content hash and verified on the bundle path.
  • Shipped as a proof of concept only: the first app of #2031 — sticky notes plus did-it — exists as the integration test tests/first_app_poc.rs and a README in examples/first-app-poc/. It is not a packaged application.
  • Still design: the ecosystem ladder as designed — signed bundle export/import/fork as the v1 user flow (#6291 is a design record; the record states no implementation code is in it), the gallery as a registry with update channels (#6293, design only), the hosted public gallery as an operated instance (#6294, design only), and creator tooling (#6308, design only). The chat v1, boards and match-attestation designs are likewise design records; the shipped chat and boards functionality in the id program is the earlier application surface documented in the reference chapters, not an implementation of these v1 designs — the records themselves make no completion claim, and this chapter makes none for them.

Design: scale, performance and adversarial hardening

This chapter is design, plus the measured findings the scale programme recorded. It covers 24 records homed here in the archive survey: the per-world resource and budget records, the #5685 denial-of-service and benchmark programme (#5891–#5897), the spill and sharding line, the waiting-pool bound, and the #6304 scale programme’s stress design with its first measured limits. Measured values are cited as recorded findings with their dates and sources; they are findings from the programme’s records, not live measurements taken for this book. The final section separates what shipped from what is still design.

Related chapters: Design: worlds and the guest runtime, Design: hosted and serverless editions.

Budgets first: resource profiles and per-call metrics

The scale design starts by making every cost bounded and named.

  • 2026-10-16T10-00-00Z_feature_world_resource_profile and 2026-10-16T10-30-00Z_feature_durable_world_resource_profiles (2026-10-16): per-world resource profiles, and the durable form of those profiles, so a world’s limits survive restart.
  • 2026-10-17T15-30-00Z_feature_world_perf_budgets (2026-10-17): per-call resource metrics and performance budgets.
  • 2026-10-17T16-30-00Z_fix_territory_view_fuel (2026-10-17): the fix record for territory’s view running out of fuel with six or more seats — the incident that made frame cost a measured quantity instead of an estimate.
  • 2026-10-27T00-00-00Z_baseline_bytes_per_frame.md (2026-10-27, F11.9): the bytes-per-frame baseline table.
  • 2026-11-01_design_id557.md (2026-11-01, F12.12, issue #557): a per-world memory budget and many-world scale. The design recommends one finite total per-world memory budget as a deterministic logical-charge ceiling for allocations owned by one world — explicitly not an RSS guarantee, since allocator metadata, fragmentation, thread stacks and process-shared caches sit outside per-world accounting. Its measurement target is stated in the record: 1,000 idle durable worlds plus 100 active worlds at 20 events per second each, with p99 command latency below 50 ms and no state loss through eviction, checkpoint and reopen.
  • 2026-11-09T05-15-00Z_design_id_server_invariants: server-side invariants — budgets, observability, exploit resistance, failure containment.
  • 2026-11-10_design_id6002_cooperative_timeout_contract.md: the cooperative timeout contract — invocation budget, checkpoint convention, hard-kill outcomes.
  • 2026-11-08_design_id5779.md: deterministic testing across time, replay, corpus and soak — the testing design the scale runs depend on, with the testing architecture reference 2026-03-29T00-00-00Z_reference_testing_architecture (2026-03-29) as its base.

The shipped runtime defaults that these budgets operate on, from the CLI survey for this book: guest fuel budget 10,000,000 per call; world memory 16 MiB; total world memory 64 MiB; native memory 256 MiB; native CPU 10 seconds; native deadline 10,000 ms.

The #5685 programme: one generator, honest and adversarial

Programme #5685 is the DoS suite and performance benchmark programme under epic #2056. Its structural decision, repeated in each child record, is that honest benchmarks and adversarial profiles run through one shared load and workload generator, one baseline, and one measurement contract — so an adversarial result and a benchmark result are comparable by construction. The children:

  • #5891 — the shared workload generator: 2026-11-08T11-27-00Z_design_shared_workload_generator (2026-11-08). One generator drives both honest workloads and adversarial profiles against the interface surfaces. The record’s verified baseline: the existing bench harness has five workloads (guest_replay, journal_append_fsync, checkpoint_compaction, session_fanout, many_worlds) and no unified generator exists yet; nothing drives one workload definition against more than one interface surface, and nothing generates adversarial traffic at all.
  • #5892 — the DoS scenario catalogue per interface: 2026-11-08_decision_id5892_dos_scenario_catalogue.md (2026-11-08). For each transport and interface surface, the catalogue defines scenario name, interfaces, load profile, pass/fail criteria and recovery assertions. Its bounded fixture profile, as consumed by the CI tiering record: fixed seed, a 30-second attack phase, a 30-second recovery window, 128 offered operations per second open-loop, and a 1 valid operation per second canary.
  • #5893 — CI tiering: 2026-11-16T09-52-00Z_design_ci_tiering_adversarial_benchmark_suites (2026-11-16). The tier structure for both suites, each tier’s time budget, what gates and what merely reports, and environment guards that keep every tier off shared or production targets. Its verified input state: the bench workflow runs on push to main and manual dispatch only, with a 60-minute timeout, and is explicitly non-blocking; adversarial coverage exists as an in-process refusal suite (pkgs/id/tests/world_dos.rs), not as a tiered load workflow. The generator’s three target surfaces are InProcess, LocalSocket and Iroh.
  • #5894 — the standard server baseline: 2026-11-08T09-55-28Z_design_standard_server_baseline (2026-11-08). The reference environment, baseline workload suite, scales and baseline versioning that every #5685 measurement cites. Its adopted rules from the earlier F11.8 baseline: numbers are comparable only on the same machine class; a unit change makes a benchmark incomparable rather than silently comparable; a flag on a different machine class is a prompt to investigate on the reference machine, not proof of a regression.
  • #5895 — scaling comparisons, and #5896 — the per-interface matrix: named as siblings in the #5891, #5893 and #5894 records; their own design records are not among the 24 records homed in this chapter, and this chapter makes no claim about their contents.
  • #5897 — regression gates: 2026-11-08T23-45-30Z_design_id5897_regression_gates (2026-11-08). Benchmark regression gates, waivers and result retention: pass/fail expressed as server behaviour under defined load profiles, recovery within a stated number of seconds after load stops.

Comms abuse is the application-level half of the same programme: 2026-10-29T10-55-00Z_investigation_comms_abuse_controls (blocks, rate limits and per-counterparty budgets) and 2026-11-01_design_id2033.md (abuse-control primitives v1 for ID comms). 2026-11-08T23-05-00Z_design_id5797_latency_budget_measurement.md designs the per-fallback-tier latency budget and measurement plan, so each transport fallback tier carries its own latency budget instead of inheriting the fastest tier’s numbers.

One shipped bound: the waiting pool total cap

2026-10-31T04-00-00Z_design_waiting_pool_total_cap (2026-10-31, issue #1567) is the chapter’s clearest shipped hardening record; its status line reads “implemented”. The problem: an event waits in the waiting pool when a dependency has not arrived, held in memory and mirrored to disk. The existing limits were per-author (default 256 waiting events) and maximum age (default 7 days). Author keys are self-certifying 32-byte Ed25519 public keys, generated at zero cost, so a per-author cap bounds nothing against a Sybil flood. The fix adds a pool-wide total cap: DEFAULT_TOTAL is 32 * DEFAULT_PER_AUTHOR, which is 8,192 events. The record is the pattern the rest of the adversarial design follows: find the resource an attacker can multiply for free, and put the bound on the total, not on the identity.

Hot worlds: sharding, spill and leases

Three designs handle a world that outgrows one host, and they disagree in method on purpose — each is a different answer to a different limit:

  • 2026-10-30T19-35-00Z_investigation_hot_world_sharding (2026-10-30): the sharding investigation — when one world outgrows one Durable Object.
  • 2026-11-01_design_id2819.md (2026-11-01, under parent #2059): the native-spill write lease protocol v1. One authoritative journal and one append gate per world; the Durable Object is sole lease grantor and append authority; epoch fencing at the append linearization point; no local commits by a native node; fail-closed recovery.
  • 2026-11-08_design_id5787.md (2026-11-08): Spill v2 — native spill pools, lease failover and multi-holder fencing. Its recommendation is stated in one line: honest v2 is failover plus read replicas plus a pool of eligible holders; it is not write scaling. At every instant a world still has exactly one holder and one epoch chain. Concurrent multi-writer spill is rejected in the record, with the reason: the append gate is the write bottleneck by design — every accepted mutation is serialized, epoch-checked and synced by the single append gate — so adding holders adds contenders, not throughput. If write scaling is ever proven necessary, the record states it arrives as world splitting under the region and shard designs, not as parallel holders of one journal.
  • 2026-11-12T19-35-00Z_feature_world_lease_handoff_actor_boundary (2026-11-12): world lease handoff at the actor boundary, the feature record that puts the lease transfer at the world’s actor edge.

The #6304 scale programme and its first measured limits

The scale programme is #6304, under Phase 14 core topic #6281, with plan of record epic #6312 and v2 (growth policy and the degradation ladder) filed as #6305 behind it. Its v1 design record is 2026-11-23T07-53-00Z_design_scale_perf_stress_v1 (2026-11-23): how large worlds are generated, what is measured, and what the first measured limits are. The generator extends the existing bench harness instead of building a second one: deterministic (fixed seed; same seed and same tier produce the same worlds, byte for byte in event content), manifest-verified (expected event counts and final state hash per measured world, so a fast-but-wrong run cannot pass as a result), and run as profiles of the existing bench binary. Implementation issues: #13083 (generator), #13084 (join time), #13085 (frame cost), #13086 (memory), #13087 (the 10x run), #13088 (the 100x run).

The tier table, from the record:

Axis1x10x100x
Idle worlds1,00010,000100,000
Active worlds1001,00010,000
Single-world history (events)10,000100,0001,000,000
Members on the hot world323203,200

A tier is a measurement target, not a promise; the record states that a run hitting a wall — out-of-memory, eviction storm, p99 blowup, fuel exhaustion — is a result, and the wall is recorded as that tier’s measured limit.

The first measured limits, as recorded in the 2026-11-23 record from the committed baselines and the #13085/#13086 profiles on the reference laptop (Ryzen 7 7840U, 16 threads, 123 GB RAM, NixOS):

  • Frame cost is flat. A Territory-class guest frame at 2 seats costs view 958,616 fuel and layout 958,683 fuel at 10,000 applied events, at 100,000 applied events, and at 1,000,000 applied events — the same fuel at all three sizes, with wall time between about 126 µs and 148 µs. No size comes near the 10,000,000 fuel default budget. Recorded by the #13085 frame_cost profile, 2026-11-23.
  • Resident memory per world is in the 18–22 KB band, blended. The record’s stress_mem rows (#13086, median of 5 runs): 21,834 bytes per world blended at the 1x tier (1,101 worlds held, 28.56 MiB total RSS; idle 11,350 bytes per world; active at 100 events 93,593 bytes per world) and 18,320 bytes per world blended at the 10x tier (11,001 worlds held, 197.90 MiB total RSS; idle 9,334 bytes per world; active 87,945 bytes per world). The investigation programme’s summary of the same findings states the band as about 18–22 KB per world blended at 1x and 10x.
  • Compaction memory spike: 5.59 MiB over pre-operation RSS at a 2,000-entry journal; 89.34 MiB at a 100,000-entry journal (#13086).
  • The durable-append ceiling is the constraint behind the rest. Journal append plus fsync measures 5,180 µs median per append in the committed baseline, which derives an unbatched per-world ceiling of about 193 appends per second. Demand at 1x fleet scale is 100 active worlds at 20 events per second, which is 2,000 appends per second host-wide. Group-commit batching is scoped as #8239; the growth policy around the ceiling is #6305 work.
  • Two measured target misses, recorded as misses: many-worlds command p99 of 4,549 ms against the 50 ms target (#557; a later run recorded 5,650 ms), and a fuel_spin_isolation ratio of about 3.8–3.9 against the 1.10 target (#1067 line, 2026-11-22). Both trace, in the record’s analysis, to durable-append and scheduling contention under concurrent load, not to raw compute.
  • Codified limits the generator found: journal size cap 64 MiB per world journal; session checkpoint interval 2,000 ms by default; documents 64 KiB each and 512 list items; compile inputs 8 files and 256 KiB total; SSH surface 64 connections and 16 tunnel streams; per-world caps on entities and programs: none codified — recorded as a gap.

The open tension: 256 participants against 320 and 3,200

The tier table asks for a hot world with 320 members at 10x and 3,200 at 100x. The codified participant cap is 256: WorldLimits::default().participants in crates/id-worlds/src/world/mod.rs. The #13083 generator found the wall during restore verification — the 10x tier’s 320-member hot world is refused — and the generator caps the hot world at 256 and records the wall in its manifest. The tension is open: either the cap rises, or the tier targets fall, and the 10x run (#13087) and the 100x run (#13088) inherit the decision. This chapter records the tension as the programme recorded it on 2026-11-23; it does not resolve it.

What exists today

Grounding:

  • Shipped: the waiting-pool total cap (record status “implemented”, 2026-10-31; total default 8,192 events). Shipped: the bench harness and its committed baselines (benches/world_bench.rs, benches/BASELINES.md, benches/baseline.txt), the in-process adversarial refusal suite (pkgs/id/tests/world_dos.rs), and the codified limits listed above, each cited to its source location in the 2026-11-23 record.
  • Measured and closed as measurement issues: #13083 (the seeded stress generator; tiers quick, 1x, 10x, 100x, manifest with expected state hashes, restore-verified) and #13085 (frame cost against state size, flat at 958,616 fuel), per the investigation programme’s state record of 2026-11-23. #13086 (memory) was in progress in that record; #13084 (join-time benches) was flag-held; #13087 (first 10x run) was open, blocked on #13084 and #13086; #13088 (100x feasibility) follows #13087. Those statuses are the investigation record’s, dated 2026-11-23, and are not re-verified live for this chapter.
  • Still design: the #5685 programme as a tiered CI system (the tiering record’s own verified input is that the bench workflow is non-blocking and the adversarial suite is a unit-tier test file), Spill v2 (a decision-ready proposal; the record states no protocol code is implemented in it), hot-world sharding as a mechanism, the #6305 growth policy and degradation ladder, and any resolution of the 256-participant tension.

Roadmap, issue map and the design-record index

This chapter is the programme record for the ID book (tracking issue #13332). It states the roadmap as the design archive records it, maps the epics and trackers the records name, and then gives the full design-record index: all 408 ID design records in the repo-root doc/ archive, each mapped to exactly one design chapter of this book. The index is the coverage proof for the design-record dimension of the book. Counts in this chapter come from the archive survey for this book, verified in the tree at checkout 1ccb4a19457 on 2026-11-23: the archive holds 570 top-level entries and 2,917 paths in total; 408 entries are ID-programme records; 162 entries belong to other programmes (Atlas, Fleet, the PM stack, the home cluster) or are standing non-record material, and are excluded from the index.

The roadmap in phases

The archive’s own phase records are the roadmap’s spine. Twenty records are homed in this chapter: the phase records, the remaining-work record, the platform-completion brief, the programme essay answers, the Phase 12 exit audits, the walking-skeleton record, and the investigation charter that commissioned this book.

  • Phases 0–8 (2026-10-11 to 2026-10-13): 2026-10-11T19-04-32Z_phase_0_baseline (baseline, toolchain, dependencies), 2026-10-11T22-25-52Z_phase_1_events_storage (events, storage, crash safety, the identity store), 2026-10-12T04-03-47Z_phase_2_membership (membership, auth frontier, delegation), 2026-10-12T08-58-59Z_phase_3_sync_relays (sync, blobs, relays), 2026-10-12T14-33-36Z_phase_4_groups_encryption (groups, encryption, history), 2026-10-12T14-33-36Z_phase_5_tags_documents (tags, documents, search), 2026-10-12T19-11-31Z_phase_6_invites_pull_cli (invites, pull, the CLI), 2026-10-12T21-22-53Z_phase_7_connectivity (connectivity for later servers), 2026-10-13T23-44-27Z_phase_8_open_design_items (open design items, retention, multi-device, views).
  • 2026-10-11T11-08-42Z_design_remaining_work (2026-10-11): the design remainder — decisions, open questions and status — a bundle record of 745 files including the task breakdowns and research harnesses.
  • 2026-10-14T_platform_completion (2026-10-14): the platform completion acceptance brief.
  • 2026-10-22T15-25-00Z_handoff_research_workflow_pipeline (2026-10-22): the research-to-delivery pipeline and platform backlog handoff.
  • Phase 12 (#534): the platform-flexibility phase, items F12.1–F12.17. Its design record is 2026-11-01_design_id534.md; its research package is 2026-11-03T00-05-09Z_research_phase-12-package-534 (18 files). Children named in the records include #807 (manifest), #835 (roles v2 and moderator wiring), #1061 (provider registry), #1062 (first providers), #1063 (audit log), #1064 (ABI), #1065 (guest SDKs), #1066 (program upgrade), #1067 (fair scheduling and quotas), #1068 (portals) and #1069 (module trust). Exit evidence: 2026-11-22T07-05-00Z_phase_id_phase12_exit_audit and its re-run 2026-11-22T14-45-14Z_phase_id_phase12_exit_audit_rerun (both 2026-11-22), plus 2026-11-23T02-02-09Z_reference_authority_boundary_audit (the authority-boundary audit, Phase 12 exit criterion 9).
  • Phase 13 (F13.x): the shell and client phase. Records named in the survey: #785 (UDP-denied SSH fallback), #786 (presentation tiers), #787 (kitty keyboard), #788 (native reference shell), #789 and #5532 (client capability providers), #790 (topology — closed and implemented per the essay-answers record). Phase 14 is the next-horizons phase that contains the #6278 ecosystem, #6300–#6303 agents, #6304 scale and more-shells topics, under core-topic parent #6280 and plan of record #6312 where the records state them.
  • 2026-11-04_id-program-essay-answers.md (2026-11-04): answers to Drew’s 2026-11-04 ID programme questions — the programme’s own statement of where things stand at that date.
  • 2026-11-22T16-13-20Z_design_id-walking-skeleton (2026-11-22): the walking skeleton for #9106 — the path through the 126 rows.
  • 2026-11-23T12-06-42Z_design_id_program_investigation_prompt (2026-11-23): the charter record of #13240, the full-investigation, design-completion and build-out programme that commissioned this book. It defines ID, in one sentence, as a local-first, federated, capability-based application platform — the definition this book uses.

The issue map: epics and trackers

Every epic and tracker below is named inside the design records, per the archive survey. Issue states are given only where a record states them, with the record’s date.

The core epic: #2056

#2056 is the core ID programme epic: core build, first apps, comms, currency, hosting, notes, chat, boards. Most design records state “Programme: epic #2056” in their headers. At the #13240 charter’s writing (2026-11-23), 27 of its 29 sub-issues were closed; the two open sub-issues were #2036 (messaging and relay protocol v1) and #2039 (match attestation and audit). Sub-epics that function as epics in the records: #2036 (messaging/relay), #2039 (match attestation), #2043 (currencies), #2046 (serverless edition), #2048 (the Zettelkasten layer), #2059 (native spill, parent of #2819).

Federation and primitives: #9106

#9106 covers extensible primitives, federation and namespaces: Part A (core), Part B (federation and trust), Part C (Atlas-facing, which is #9109: storage economics, ID search, recommendations). The shipped id walk skeleton is #9106’s demonstration path. The related store-conformance thread is #9110 (the port contract; slices #10191 and #10213; adoption call #9082). The federation cluster runs #9129–#9148 and includes #9117 (the id:// URI scheme), #9141 (peer trust classes) and #9144 (federated query fan-out).

The programme trackers

TrackerProgrammeWhere it is treated in this book
#5678Knowledge layer (parent of #5842 and the #5843–#5848 / #6435 cluster)Design: the knowledge layer
#5685DoS suite and performance benchmark programme (children #5891–#5897)Design: scale, performance and adversarial hardening
#5686Provider model (children include #5898, #5899, #5900, #5902, #5904, #5905)Design: capabilities and providers
#5671 / #5672Transport fallback and storage decomposition (children include #5793, #5800, #5807)Design: sync, replication and FileOps, Design: hosted and serverless editions
#5955Worlds design programme (Roc libraries, dynamic user functions, presentation assets; children include #5973, #5985, #5986, #6006)Design: worlds and the guest runtime, Design: the knowledge layer
#6278Program ecosystem (children #6291, #6293, #6294, #6308)Design: first apps and the ecosystem
#6300–#6303Agents in worlds, the MCP bridge series (under core topic #6280; registry step #10662)Design: agents in worlds and the MCP bridge
#6304Scale programme (measurements #13083–#13088; v2 is #6305)Design: scale, performance and adversarial hardening
#9078Hosted editions programme (components E #9083, F #9084, I #9087 are the ID parts; components A and C are not ID)Design: hosted and serverless editions
#3399 → #3400–#3404The jurisdiction chain. The #3404 slice (fenced jurisdiction migration control plane) was the charter record’s flag-held landing; its core landed on main on 2026-11-23 (PR #13347) and the issue stays open on the hosted wiring.Design: residency, jurisdiction and boundaries
#3231 / #3232One receipt contract, and its Phase 3 auditDesign: currency, tokens and metering, Design: identity, directory, groups and delegation
#2898Reconstruction is admissionDesign: capabilities and providers
#5545Writer-set view projection and discovery queryDesign: sync, replication and FileOps
#13240The full-investigation and build-out programme that commissioned this bookThis chapter
#13332This bookThis chapter

Early threads named in the records: #1793 (tags provenance and listing origin; children include #4973), #2259 (friendly-name references), #2343 and #2344 (MQTT device bridge, speech capabilities), #2380 and #2382 (keyset authorization log, guardian recovery).

Sibling programme trackers, named in the archive’s own map so the roadmap can point sideways: #13241 (Atlas, under epic #8983), #13264 (mcpx, under #8993), #13272 (Fleet). Those programmes have their own books and are not treated here.

How the index is built

The index below transforms the archive survey’s inventory table. Rules:

  • One row per record; every record is listed exactly once; 408 rows in total.
  • The chapter column of the survey becomes the book chapter, with one stated change: the survey’s combined theme “Knowledge layer & first apps” (57 records) is split by this book into Design: the knowledge layer (31 records: notes, documents, tags, links, import, export, query, recommendations, AI over notes, and the worlds-adjacent programming-model and library records) and Design: first apps and the ecosystem (26 records: the first app, chat, boards, match play, games, and the #6278 ecosystem ladder). 31 + 26 = 57; no record changes any other survey assignment.
  • Record names are the doc/ folder or file names, copied exactly. Dates are the record’s date in the survey; three records carry no date in the archive (2026-10-14T_platform_completion, 2026-11-04_id-program-essay-answers.md, and the three undated knowledge-layer records) and show —.
  • Subjects are each record’s own first heading, as extracted in the survey.
  • Three records are bundles counted once each: 2026-10-11T03-44-33Z_design_groups_events_delegation (407 files), 2026-10-11T11-08-42Z_design_remaining_work (745 files) and 2026-11-13T03-40-00Z_design_id-atlas-summit (104 files). The remaining 405 records are single files or small folders.

Per-chapter counts: foundations 32; worlds and the guest runtime 20; capabilities and providers 44; identity, directory, groups and delegation 56; sync, replication and FileOps 39; residency, jurisdiction and boundaries 11; hosted and serverless editions 30; shells and client surfaces 43; agents in worlds and the MCP bridge 6; currency, tokens and metering 26; the knowledge layer 31; first apps and the ecosystem 26; scale, performance and adversarial hardening 24; this roadmap chapter 20. Total: 408.

What exists today

Grounding for this chapter is the archive itself. The 408 records exist as files in doc/ at the surveyed checkout; the phase records, exit audits and essay answers are records of work and decisions, and each record’s own status line governs what it claims — a design record is not an implementation, and the index above does not promote any record’s status. The book itself (#13332) is the live item: at the time of writing, its chapters are being written from the four surveys, and the disagreements the surveys numbered (CLI-1 to CLI-14, LIB-1 to LIB-15, WEB-1 to WEB-15, DES-1 to DES-12; 56 in total) are filed for grouping after the book merges, per the book skeleton. Open programme items named by the records and still open at their records’ dates include #2036 and #2039 (under #2056), the #3404 landing (flag-held), the #6304 chain #13087 and #13088, and the v4 agent steps #10663, #10664 and #10665. Their live state on 2026-11-23 beyond what the records state is unverified in this chapter.

The design-record index

Design: foundations — objects, graph and the file core — 32 records

#Record (doc/ entry)DateSubject (record’s own first heading)
572026-10-17T15-00-00Z_architecture_next_stage_platform2026-10-17Next stage of the platform: foundations, then flexibility
812026-10-29T12-50-36Z_design_id_app_packaging2026-10-29Design: ID app packaging — app manifest, folder layout, TUI/web parity
882026-10-30T13-25-00Z_design_friendly_name_references.md2026-10-30Design: friendly-name reference resolution — local store (spec for the #2259 PoC)
932026-10-30T19-28-00Z_investigation_bittorrent_chunk_retrieval_for_graph_objects2026-10-30Investigation: BitTorrent-Style Chunk Retrieval for Graph Objects (LIST 14b)
1032026-11-01T15-42-00Z_architecture_id_crate_split2026-11-01pkgs/id crate split: Phase 1 architecture
1072026-11-01T16-53-00Z_design_id_crate_split2026-11-01pkgs/id crate split: a workspace of importable crates
1232026-11-01_design_id2146.md2026-11-01Design: programs as websites in id serve
1242026-11-01_design_id2240.md2026-11-01Design: session header + segment checkpoint event kind
1252026-11-01_design_id2259.md2026-11-01Design: local friendly-name reference resolution (#2259)
1392026-11-01_design_id560.md2026-11-01Design: F12.18 denial-of-service suite in CI
1462026-11-01_design_id805.md2026-11-01Design: F12.11 delta and binary frames
1572026-11-02T11-47-29Z_design_web_listeners2026-11-02Web listener bindings for id serve
1662026-11-04T05-11-11Z_feature_structured_logging2026-11-04Structured operational logging for id — design record
1692026-11-04T10-46-17Z_design_listing_origin_and_upload_time2026-11-04File listing provenance: origin node and upload time in List
1702026-11-04T15-33-00Z_design_friendly_name_fanout.md2026-11-04Design: friendly-name reference resolution v2 — cross-store fan-out (first slice)
1712026-11-04T21-50-26Z_feature_dynamic_publications_runtime2026-11-04Dynamic publication runtime apply and operator CLI
1872026-11-07T04-33-34Z_architecture_secure_public_web_routers2026-11-07Secure public web router constructors
2012026-11-08T09-12-27Z_design_id-self-hosting-interop-stance2026-11-08Self-hosting and interop stance
2112026-11-08T10-28-00Z_design_id6009_public_domain_normalization2026-11-08Public-domain storage normalization — CC0-1.0 for content, 0BSD for code
2182026-11-08T13-20-00Z_research_id6014_ocapn_captp_watch2026-11-08Watch record: OCapN / CapTP stability and the CapTP bridge spike (issue #6014)
2292026-11-08T23-17-06Z_design_id_setup_ceremony2026-11-08Native ID creation & setup ceremony — decision record
2832026-11-09T07-20-00Z_design_atlas_id_publication2026-11-09Atlas → ID-graph publication format: corpus objects + provenance/lineage relations as ID-graph objects
2842026-11-09_audit_3068-phase3-closing.md2026-11-09Phase 3 closing audit — parsed-shape contract (#3068 / #3069)
3212026-11-11T03-19-54Z_refactor_markdown_module_split2026-11-11Refactor record: split of pkgs/id/src/web/markdown.rs (#4704)
3372026-11-13T00-41-00Z_design_id-atlas-primitives-federation-namespaces2026-11-13Design (proto): ID/Atlas extensible primitives, federation, namespaces
3382026-11-13T03-40-00Z_design_id-atlas-summit2026-11-13Summit decisions, defaults and owner questions
3412026-11-13T10-15-00Z_design_scaling_technique_comparisons2026-11-13Scaling-technique comparisons — design decision record
3592026-11-16_decision_id5753_kdl_fork_section5.md2026-11-16Decision record — KDL fork, #5753 §5 design pass (payload grammar, extension marking, serde shape)
3692026-11-17T04-55-00Z_design_id9117_id_uri_scheme.md2026-11-17Design — the id:// URI scheme and per-namespace handlers/encodings (#9117)
3742026-11-17T22-00-00Z_design_id9114_related_path_links.md2026-11-17Design — related path links in hash.metadata (#9114, S3.21–S3.22)
3782026-11-17_design_id9127_append_list_user_attributes.md2026-11-17Status: design record for issue #9127, written 2026-11-17.
4052026-11-23_design_id9128_social_app_reference_model.md2026-11-23Status: design record for issue #9128, written 2026-11-23.

Design: worlds and the guest runtime — 20 records

#Record (doc/ entry)DateSubject (record’s own first heading)
92026-10-07T00-20-00Z_architecture_roc_worlds2026-10-07Roc-Defined Multiplayer Worlds
132026-10-10T03-56-25Z_feature_world_isolation2026-10-10World isolation modes
152026-10-10T04-59-57Z_feature_cross_world_access2026-10-10Cross-world access: writes, force, and file scope
322026-10-14T19-39-30Z_architecture_portable_world_surfaces2026-10-14Portable world surfaces and controlled execution profiles
332026-10-14T20-00-05Z_feature_source_only_world_installs2026-10-14Source-only world module installation
362026-10-15T09-27-28Z_feature_roc_json2026-10-15Pure-Roc JSON for portable world programs
392026-10-16T09-00-00Z_feature_world_module_provenance2026-10-16Observed world module provenance
402026-10-16T09-30-00Z_feature_world_module_provenance2026-10-16World module build provenance
512026-10-16T18-30-00Z_feature_world_authoring_cli2026-10-16Authoring CLI: id world new and id world stats
562026-10-17T10-00-00Z_feature_scheduled_events2026-10-17Scheduled events: a world can ask for one fire at a set time
602026-10-18T00-00-00Z_reference_platform_state2026-10-18Platform world: current state, findings, and open work
622026-10-18T18-40-00Z_report_platform_world_state2026-10-18Platform world: state report
962026-10-30T19-36-00Z_investigation_world_vm_wasm_portability2026-10-30World-VM Wasm portability audit — what of the worlds runtime runs inside a Worker
1062026-11-01T16-09-48Z_feature_world_json_transcript2026-11-01id world join --command-mode --json transcript
1382026-11-01_design_id558.md2026-11-01Design: id world dev authoring loop
1522026-11-02T00-53-51Z_feature_world_host_view2026-11-02Authenticated, read-only world host view
1612026-11-03T01-31-11Z_design_recurring_cross_world_schedules2026-11-03Recurring and cross-world scheduled events
1762026-11-05T15-08-16Z_research_id5986_agpl_gpl_hosting2026-11-05AGPL/GPL hosting: inspectable worlds, uploads, and self-hosting
1992026-11-08T09-10-00Z_research_worlds_conversation_archaeology2026-11-08Conversation archaeology: prior Drew discussions of Second Life and programmable worlds, tied into the worlds program
3682026-11-16_id_world_dev_authoring.md2026-11-16Authoring Roc worlds with id world dev

Design: capabilities and providers — 44 records

#Record (doc/ entry)DateSubject (record’s own first heading)
102026-10-09T09-59-07Z_design_attenuated_capabilities2026-10-09Attenuated capabilities for world access
432026-10-16T11-00-00Z_feature_world_capability_ceilings2026-10-16World capability ceilings
442026-10-16T12-00-00Z_feature_world_cli_controls2026-10-16World Operator CLI Controls for Capability Ceilings and Resource Profiles
482026-10-16T16-00-00Z_feature_roc_cap2026-10-16RocCap: shared request bookkeeping for the capability protocol
502026-10-16T18-00-00Z_feature_records_readback2026-10-16Records readback: a records.read capability
652026-10-25T05-37-57Z_design_client_capability_providers2026-10-25Client-side capability providers under the ceiling model (F13.7)
832026-10-29T14-05-00Z_investigation_capability_taxonomy2026-10-29Capability taxonomy v0 — interface specialization across web, ESP32/MQTT and text/audio
1112026-11-01T20-45-00Z_feature_admin_audit2026-11-01F12.6 slice 1: administrative and provider-use audit
1122026-11-01_design_id2028.md2026-11-01Design: ID core v1 — app model and minimum capabilities
1312026-11-01_design_id2898.md2026-11-01Design: reconstruction is admission in pkgs/id
1412026-11-01_design_id786.md2026-11-01Design: F13.4 presentation capability tiers with in-band terminal detection
1442026-11-01_design_id789.md2026-11-01Design: Phase 13 F13.7 client-side capability providers
1632026-11-03T10-06-40Z_architecture_provider_registry_slice12026-11-03F12.4 Provider Registry — Slice 1
1682026-11-04T06-40-00Z_feature_loc-capability.md2026-11-04loc.* — location capabilities with an accuracy ceiling and per-use consent
1792026-11-05T17-24-09Z_design_id_license_detection_pipeline2026-11-05Design: upload-time license detection pipeline
1842026-11-06_decision_id_tagging_triples.md2026-11-06Decision: ID tag claims as atomic-triple projections
1852026-11-06_design_id5985.md2026-11-06Design: license combination checker — combination events, v1 incompatibility rules, override vs exception-request flows, audit records
1902026-11-08T01-10-24Z_design_id_capability_certification_exceptions2026-11-08Design: capability-certification exception policy
1922026-11-08T06-25-00Z_design_tag_scope2026-11-08Tag scope: local-only vs shared claims (#1793)
1982026-11-08T09-10-00Z_design_embedded_providers_decision.md2026-11-08Decision record: embedded providers — engine & smartphone instantiation of the #5686 provider model
2042026-11-08T09-15-00Z_design_id_capability_model2026-11-08Design: the capability model — requested vs discovered-used sets, registry schema, custom-compiled platforms
2082026-11-08T10-12-00Z_design_id_capability_diff_semantics2026-11-08Capability-change diff semantics — user-meaningful classes and re-approval triggers
2122026-11-08T10-40-00Z_design_id_capability_observability2026-11-08Design: capability observability — who can see which capability facts, where
2242026-11-08T17-12-39Z_design_id_package_import_policy2026-11-08Design: pure-package imports and package classes across capability tiers
2402026-11-08_decision_id5904_offline_degraded_providers.md2026-11-08Decision: offline & degraded operation for capability providers
2422026-11-08_decision_id5909_sql_pgq_capability.md2026-11-08Decision: SQL/PGQ capability boundary for ID triples
2712026-11-08_design_id6015.md2026-11-08Design: land/parcel capability domains — per-parcel policy granularity without tokenized land
2792026-11-09T05-00-00Z_feature_mqtt_device_bridge_id_device_v12026-11-09id.device.v1 MQTT device bridge — schema and PoC (#2343)
2822026-11-09T06-25-00Z_research_id5989_prior_art_capability_systems2026-11-09Research: prior art — capability systems, OCAP, Spritely Goblins/OCapN, CRDT shared worlds
3132026-11-10_design_id5977_license_taxonomy.md2026-11-10Design: license taxonomy & classifier — the enumerated set, the warning ladder, and the tag format
3202026-11-11T02-55-00Z_design_used-capability-derivation2026-11-11Used-capability derivation tool — spec
3242026-11-11T08-50-24Z_design_used_capability_derivation2026-11-11Design: used-capability derivation tool — static call-graph scan producing the registry used-set (#5998)
3262026-11-11_decision_id5817_sensitivity_classification.md2026-11-11Decision: sensitivity classification model for ID table queries (#5817)
3402026-11-13T09-26-00Z_design_pool_effort_system2026-11-13Brief supplement — capabilities: per-capability routing, failover, and pools as models
3532026-11-16T09-03-20Z_decision_id5902_terminal_website_host_providers.md2026-11-16Decision record: host providers — terminal & website instantiation of the #5686 provider model
3802026-11-17_runbook_id5532_f13-7_client_file_read_rollout.md2026-11-17F13.7 rollout runbook — client.file.read, the first client-side capability provider
3822026-11-20T07-30-11Z_feature_speech-capabilities.md2026-11-20speech.* — conversational audio capabilities
3892026-11-22_design_id1062-blob-provider.md2026-11-22F12.5 blob provider — design for the second slice of #1062
3902026-11-22_design_id1062-http-fetch-provider.md2026-11-22F12.5 http.fetch provider — design for the third slice of #1062
3912026-11-22_design_id1062-kv-provider.md2026-11-22F12.5 kv provider — design for the first slice of #1062
3922026-11-22_design_id1062-notify-provider.md2026-11-22F12.5 notify provider — design for the fourth slice of #1062
3932026-11-22_design_id1067-admission.md2026-11-22F12.10 guest-burn admission — design for the second slice of #1067
4002026-11-23T07-06-00Z_design_id_capability_class_assignments2026-11-23Capability classes for the post-#5999 registrations — assignment design pass
4042026-11-23_design_id1067-account-quotas.md2026-11-23F12.10 per-account quotas — design for the ownership slice of #1067

Design: identity, directory, groups and delegation — 56 records

#Record (doc/ entry)DateSubject (record’s own first heading)
112026-10-09T12-00-00Z_feature_directory_accounts_groups2026-10-09Accounts, groups, contacts and delegation
142026-10-10T04-58-36Z_design_signed_artifacts2026-10-10Signed artifacts, home servers, and cross-world access
172026-10-10T07-00-00Z_feature_petnames_invites2026-10-10Petnames and invite links
182026-10-11T03-44-33Z_design_groups_events_delegation2026-10-11Events, groups, delegation, removal, and history
342026-10-14T20-10-00Z_feature_world_keyboard_parity2026-10-14Browser and SSH keyboard parity for world programs
492026-10-16T17-00-00Z_feature_chat_history2026-10-16Server-observed chat history and grantable platform modules
542026-10-17T08-00-00Z_feature_world_roles_directory2026-10-17Worlds as places, first slice: role-scoped invites and a machine-readable world list
612026-10-18T04-00-00Z_fix_world_chat_visibility2026-10-18Fix: world chat is visible only to participants who may chat or read history
702026-10-29T10-45-00Z_investigation_ephemeral_live_data_retention2026-10-29Ephemeral live data vs the chained event graph — retention and intermittent signing — investigation
902026-10-30T19-11-04Z_investigation_trust_visibility_model2026-10-30Investigation: the ID trust/visibility model — accept-all ingest, writer-set views
942026-10-30T19-35-00Z_investigation_boards_model2026-10-30ID boards — a modern phpBB on ID identity: board model sketch
1022026-10-31T18-03-36Z_investigation_native_tier_tradeoffs2026-10-31Investigation: the native tier vs WASM — fuel, trust, and when each is right
1052026-11-01T16-06-00Z_research_in_session_command_toggle2026-11-01D1-045 — In-session command toggle (prefix key + visible mode indicator)
1092026-11-01T17-52-12Z_feature_stable_note_revisions2026-11-01Stable note identity and revision graph
1282026-11-01_design_id2804.md2026-11-01Design: Issuer key rotation and compromise recovery
1322026-11-01_design_id3231.md2026-11-01Design: one receipt contract for pkgs/id artifacts
1422026-11-01_design_id787.md2026-11-01Design: kitty keyboard protocol on the raw input path
1482026-11-01_design_id835.md2026-11-01Design: builder and moderator authority through world-session frames
1512026-11-02T00-31-45Z_design_module_trust2026-11-02Design: module trust — admin trust list and install-time signature check
1532026-11-02T04-44-00Z_design_group_remove_modes2026-11-02Explicit group removal modes
1582026-11-02T12-47-00Z_design_petname_unicode_confusable_skeleton2026-11-02Petname anti-mimicry: Unicode UTS #39 confusable skeleton
1672026-11-04T06-07-11Z_feature_local_key_envelope2026-11-04Local passphrase-wrapped identity key envelope
1722026-11-04_audit_id3232_receipt_validation.md2026-11-04Receipt-validation audit for pkgs/id artifacts (#3232)
1742026-11-05T13-36-21Z_design_threat_list_feed_protocol2026-11-05Design: shared threat-list feed protocol — versioned, signed, subscribable feeds with local override lists
1772026-11-05T15-10-00Z_architecture_legacy_artifact_receive_cutoff2026-11-05Legacy artifact receive cutoff
1952026-11-08T08-19-40Z_design_id_knowledge_sharing_permissions2026-11-08Design: Knowledge-layer sharing and permissions
1972026-11-08T09-06-08Z_design_id_permission_ux2026-11-08Design: Permission UX for worlds — pre-connect disclosure, grant modes, and memory
2072026-11-08T10-03-00Z_design_id_recovery_codes2026-11-08ID recovery codes (custody variant c) — decision record
2172026-11-08T12-50-00Z_design_id6004_lambdamoo_governance_arc2026-11-08Design note: reserved admin authority — what LambdaMOO’s governance arc says id must keep off the ballot
2202026-11-08T13-45-00Z_design_id_world_governance2026-11-08Design: world governance — moderation-as-library, per-world parameterization, pre-approval
2232026-11-08T15-20-00Z_design_sign-request-nonce-domain.md2026-11-08sign_request nonce domain — fallible signing contract (2026-11-08)
2262026-11-08T19-52-00Z_feature_groups_page2026-11-08Local groups and grants page at /groups — design record
2632026-11-08_design_id5861.md2026-11-08Design: board moderation hooks
2672026-11-08_design_id5871.md2026-11-08Design: talk-page semantics — lifecycle, permissions, and binding authority
2742026-11-09T00-16-56Z_decision_id5900_provider_capability_grants.md2026-11-09Decision: capability grants for providers — grant shape, sensitivity classes, approval flows
2802026-11-09T05-06-00Z_decision_id5801_encrypted_shares_key_distribution.md2026-11-09Decision: encrypted shares & key distribution — share shape, key holders, rotation, recipient proofs
2872026-11-09_decision_id5905_provider_security_model.md2026-11-09Decision: provider security model — identity, admission, impersonation, rogue providers, bridge compromise, capability confusion, ceiling-composition
2942026-11-09_design_id6005_moderation_pack_format.md2026-11-09Design: moderation pack format — data-only packs with a static policy core, feed subscriptions, and per-world parameters
3022026-11-10T21-05-00Z_design_id6007_moderation_presets2026-11-10Moderation preset tiers: named presets that compile to concrete rules
3112026-11-10_design_id5881_stepup_escrow.md2026-11-10Design: 2FA step-up gates & org-escrowed credential proxying (id)
3122026-11-10_design_id5887.md2026-11-10Design: user-held keys — key custody variant (b) for id
3192026-11-11T00-18-00Z_decision_id5898_provider_declaration_model.md2026-11-11Decision: provider declaration model — manifest contents, signing, versioning, dynamic vs static capabilities
3252026-11-11T19-15-00Z_design_block_lookup2026-11-11Design: block-list lookups that can say “the lookup failed” (#8750)
3272026-11-11_design_id5984_licensing_policy.md2026-11-11Design: licensing policy — server ToS uploader grant, account-creation defaults, admin license policies
3302026-11-12T19-10-07Z_design_keyset_authorization_log2026-11-12ADR: keyset / authorization log for id identity (#2380)
3322026-11-12T20-58-00Z_research_id_permission_precedents2026-11-12Research: Permission-prompt precedents — how platforms present, remember, and revoke capability grants
3332026-11-12T22-55-00Z_design_seed_phrase_recovery2026-11-12Seed-phrase export/restore for the identity key
3392026-11-13T09-00-00Z_design_blob_gate_authorization_wiring.md2026-11-13Design: blob gate authorization wiring in id serve (#173)
3422026-11-13_design_id5886.md2026-11-13Design: service-held keys — key custody variant (a) for id
3482026-11-14T18-50-00Z_design_id_invite_delegation2026-11-14Design: generic invite delegation — encoding, depth, leakage, and group live-set semantics
3572026-11-16T11-00-00Z_design_guardian_recovery2026-11-16Design: guardian social recovery — record formats, successor-key authority, threshold signing (#2382)
3612026-11-16_decision_id5819_owner_override_mechanics.md2026-11-16Decision: owner override mechanics & the encryption boundary (#5819)
3702026-11-17T05-15-00Z_design_id9141_peer_trust_classes.md2026-11-17Design (#9141): peer trust classes + signed-data acceptance rule
3792026-11-17_design_id_sign_time_refusal.md2026-11-17Sign only what receipt would accept — the sign-time refusal contract for pkgs/id
3842026-11-21T04-30-00Z_design_id_delegation_cross_signing_ceremony2026-11-21Design: delegation, transfer, and cross-signed identity ceremony
3992026-11-23T05-02-30Z_design_id_capability_change_notices2026-11-23Design: capability-change notices on reconnect — presentation, choices, re-baselining, invite pinning

Design: sync, replication and FileOps — 39 records

#Record (doc/ entry)DateSubject (record’s own first heading)
32026-03-22T00-00-00Z_feature_peer-discovery2026-03-22Peer Discovery via iroh-gossip + distributed-topic-tracker
122026-10-10T02-39-03Z_design_directory_sync2026-10-10Directory sync: sessions, friend envelopes, and replication
162026-10-10T06-00-00Z_research_identity_capabilities2026-10-10Research: identity, capabilities, petnames, transport
192026-10-11T04-48-13Z_feature_takeover_idle_connections2026-10-11Takeover passes idle keep-alive connections to the successor
212026-10-11T11-08-42Z_feature_n0_relay_default2026-10-11n0 relays by default: one endpoint policy and dial timeouts
732026-10-29T11-05-00Z_investigation_multi_hop_relay_and_p2p_media2026-10-29Multi-hop relay and P2P media paths — investigation
842026-10-29T16-21-00Z_design_id_sync_alpn_split2026-10-29One /id-sync/1 handshake, and why serve’s range flights moved to
852026-10-29T16-57-03Z_design_id_sync_range_store_seam2026-10-29Wiring SyncMethod::Range under the /id-sync/1 handshake: the per-call lock store seam
872026-10-30T13-15-00Z_design_id_writer_set_view_projection2026-10-30Design: writer-set objects, view projection, and the discovery query for pkgs/id
982026-10-30T19-45-00Z_investigation_playable_posts2026-10-30Embedded playable posts — HTML5 mini-games, async challenges, forkable succession saves
1082026-11-01T17-30-12Z_design_host_event_export2026-11-01Host-event journal export for world fixtures
1152026-11-01_design_id2036.md2026-11-01Design: ID messaging and relay protocol v1
1292026-11-01_design_id2818.md2026-11-01Design: Journaled region-seam handoff for ID worlds
1402026-11-01_design_id785.md2026-11-01Design: UDP-denied SSH fallback for id
1472026-11-01_design_id806.md2026-11-01Design: F12.13 journal replication (read replicas over a signed stream)
1552026-11-02T07-00-00Z_design_save_reservations2026-11-02Save reservations: in-flight exclusion for same-file saves
1562026-11-02T08-13-35Z_design_peer-announcement-authentication2026-11-02Authenticated peer announcements and bounded discovery
1622026-11-03T02-34-54Z_security_world_replication_authorization2026-11-03World replication authorization
1642026-11-03T14-55-00Z_design_id4630_oversized_replication_entries.md2026-11-03Design: replicating a journal whose Checkpoint entry exceeds the payload bound
1752026-11-05T13-38-00Z_design_id5791_transport_negotiation.md2026-11-05Design: transport negotiation & fallback ordering for ID
1912026-11-08T05-48-47Z_design_input_event_model2026-11-08Input event model for relayed apps (touch, mouse, hover)
2002026-11-08T09-10-14Z_design_id5899_provider_discovery_negotiation2026-11-08Provider discovery & negotiation protocols — decision record
2142026-11-08T11-08-53Z_design_id5813_relay_proxy_protocol2026-11-08Design: ID relay and proxy protocol
2152026-11-08T11-10-00Z_design_id_writer_sets_v22026-11-08Design: writer sets v2 — view-as-object, set algebra, federation, discovery v2
2642026-11-08_design_id5862.md2026-11-08Design decision record: board subscription, discovery & feed integration
2852026-11-09_decision_id5810_carrier_framing.md2026-11-09Decision: framing and fragmentation across ID carrier classes
2882026-11-09_decision_id5908_payload_boundary.md2026-11-09Decision: the payload boundary — decompose-vs-attach decision procedure
2922026-11-09_design_id5838.md2026-11-09Design: multi-device sync cluster — knowledge layer (local-first sync, conflicts, offline, E2EE, attachments)
2982026-11-10T19-55-00Z_design_id5796_connect_proxy_traversal.md2026-11-10Design: HTTP CONNECT proxy traversal for ID
3052026-11-10T21-50-00Z_research_id806_d1-031-journal-replication2026-11-10D1-031 — F12.13 journal replication to signed read replicas: research package
3072026-11-10_decision_id5809_versioning_negotiation.md2026-11-10Decision: versioning, negotiation & forward-compatibility policy for the ID wire format
3172026-11-10_rendezvous_discovery_udp_denied_design.md2026-11-10Decision record: rendezvous & discovery for UDP-denied clients
3362026-11-12_design_id9004.md2026-11-12Design: Joplin continuous sync — target/plugin bridge against the #5848 baseline
3452026-11-14T13-20-00Z_design_id5795_relay_trust2026-11-14Relay trust model & broker authorization — decision record (#5795)
3552026-11-16T10-39-25Z_design_id5800_partial_replication_protocol2026-11-16Partial replication protocol — subset snapshot, scoped updates, existence privacy, dangling references
3562026-11-16T10-40-00Z_design_id5756_multiplexed_streams_seam.md2026-11-16Seam record — multiplexed persistent streams over one tunnel (#5756)
3602026-11-16_decision_id5808_postcard_wire_schema_v1.md2026-11-16Decision: postcard wire schema v1 — envelope, discriminators, and golden vectors
3662026-11-16_design_id6287_discovery_registry_federation_v1.md2026-11-16Discovery, registry & federation — v1 design (#6287)
3942026-11-23T00-24-00Z_design_journal_ack_modes2026-11-23Selectable journal acknowledgement modes for world input

Design: residency, jurisdiction and boundaries — 11 records

#Record (doc/ entry)DateSubject (record’s own first heading)
762026-10-29T11-43-02Z_investigation_do_jurisdiction_pinning2026-10-29Investigation: Durable Object jurisdiction / data-location pinning for per-user stores
1262026-11-01_design_id2283.md2026-11-01Design: jurisdiction-aware per-user hosted stores
1332026-11-01_design_id3397.md2026-11-01Design: jurisdiction-partitioned hosted worlds and world blobs
1342026-11-01_design_id3398.md2026-11-01Design: residency boundaries for native bridge, federation and relays
1492026-11-01_investigation_shared_world_residency.md2026-11-01Investigation: shared-world residency and federation
1502026-11-01_jurisdiction_aware_user_store_design.md2026-11-01Design: jurisdiction-aware hosted user stores
2032026-11-08T09-15-00Z_design_boundary_audit_appeals.md2026-11-08Design decision record: boundary audit & appeals UX (id)
2442026-11-08_design_id5683.md2026-11-08Design: residency & boundaries framework — declarations, evidence, and enforcement skeleton
2932026-11-09_design_id5876_residency_evidence_model.md2026-11-09Design decision record: residency evidence model (id)
2972026-11-10T19-52-00Z_design_id_sanctions_boundary2026-11-10Sanctions boundary data model — decision record for #5878
3732026-11-17T21-55-00Z_design_id8851_boundary_inputs.md2026-11-17Design: boundary enforcement inputs — declaration residence, evidence sources, verifier (#8851)

Design: hosted and serverless editions — 30 records

#Record (doc/ entry)DateSubject (record’s own first heading)
312026-10-14T10-18-19Z_design_p7_2_cloudflare_workers.md2026-10-14P7.2 design: Cloudflare Workers pkarr option
682026-10-28T23-34-14Z_investigation_cloudflare_workers_fit2026-10-28Investigation: Fitting the ID Platform onto Cloudflare Workers
742026-10-29T11-27-00Z_investigation_bridge_semantics_hosted_native2026-10-29Investigation: Bridge Semantics — Hosted (HTTPS/WS) Edition Syncing with Native Iroh Nodes
752026-10-29T11-28-18Z_investigation_key_recovery_hosted2026-10-29Key recovery for hosted ID users — Google SSO loss vs the ID keypair
992026-10-30T22-45-00Z_design_hosted_provisioning_sso_binding.md2026-10-30Design spec: hosted provisioning + SSO→ID binding
1182026-11-01_design_id2046.md2026-11-01Design: ID serverless edition v1 on Cloudflare Workers
1782026-11-05T15-10-00Z_design_cloudflare_workers_rendezvous_relay.md2026-11-05Design: Cloudflare Workers rendezvous/relay component (for #5794)
2052026-11-08T09-45-00Z_design_id5811_wss_https_adapter.md2026-11-08Design: adapter — WebSocket/WSS + HTTPS fallback (browser / restrictive-network path)
2302026-11-08T23-22-53Z_design_id_adapter-conformance2026-11-08Design: adapter conformance harness & interop matrix CI
2372026-11-08_decision_id5868_cost_limits_guardrails.md2026-11-08Decision: cost & limits guardrails for serverless storage
2492026-11-08_design_id5803.md2026-11-08Design: shared foreign data-store adapter contract for ID
2502026-11-08_design_id5804.md2026-11-08Design: IndexedDB adapter for ID — origin-scoped addressing, live vs materialized reads, structured-clone type mapping, storage limits & eviction
2522026-11-08_design_id5824.md2026-11-08Design record — id5824: Stage A — Redis hot store + regular-store system of record
2652026-11-08_design_id5866.md2026-11-08Design: local-dev parity for the serverless edition
2662026-11-08_design_id5869.md2026-11-08Design: backup, recovery & exit for serverless storage
2892026-11-09_design_id5783.md2026-11-09Design: ESP32 hardware platform line — boards, provisioning, firmware lifecycle, OTA, power
2902026-11-09_design_id5815_security_binding.md2026-11-09Design: security binding review across adapters & relays
3062026-11-10_decision_id5681_serverless_storage.md2026-11-10Decision: serverless edition storage — parent synthesis for #5681
3102026-11-10_design_id5865.md2026-11-10Design: Turso/libSQL journal fit — how libSQL replication composes with the signed journal
3182026-11-11T00-16-00Z_design_id5807_redis_sqlite_export2026-11-11Design: Redis→SQLite export + query-Redis-get-SQLite (from #5672)
3342026-11-12T23-04-00Z_design_hosted-editions-workers2026-11-12Design intake — hosted editions: PM service, ID service, and fleet tool as workable Cloudflare Workers equivalents
3352026-11-12_decision_id5867_backend_migration.md2026-11-12Decision: backend selection and migration for #5867
3442026-11-14T13-10-00Z_design_id5812_adapter_record.md2026-11-14Adapter decision record — WebRTC, TCP/TLS, local IPC (#5812)
3652026-11-16_design_id6283_hosted_worlds_v1.md2026-11-16Hosted worlds & always-on hosting — v1 design (#6283)
3722026-11-17T16-55-00Z_design_hosted-tenancy-architecture2026-11-17Design (component E): hosted tenancy architecture — per-user Turso databases + a central tenancy DB
3752026-11-17_decision_id5863_storage_contract.md2026-11-17Decision: the serverless storage contract (journal, world state, indexes)
3762026-11-17_decision_id5864_d1_journal_fit.md2026-11-17Design: D1 journal fit — ordering, sessions, and replication against the signed journal
3852026-11-21T21-40-00Z_design_self_hosted-tier-adapters2026-11-21Self-hosted tier: storage, transport, and placement adapter design
3962026-11-23T03-04-00Z_design_content-addressed-media-data-plane2026-11-23Content-addressed media/data plane: reference-based access and GC (component F)
3982026-11-23T05-00-00Z_design_bridge_v1_implementation2026-11-23The hosted signed-object bridge v1 — implementation record (#3818)

Design: shells and client surfaces — 43 records

#Record (doc/ entry)DateSubject (record’s own first heading)
72026-04-01T00-00-00Z_feature_image_upload2026-04-01Image Upload: Paste, Drag-Drop, and Toolbar Insert
372026-10-15T16-00-00Z_feature_world_viewport_and_paste2026-10-15Per-session world viewport and paste policy
382026-10-15T16-30-00Z_feature_terminal_buffer_capture2026-10-15Terminal buffer capture interface
452026-10-16T13-00-00Z_feature_world_apps_structured_migration2026-10-16Structured World Apps Migration to RocJson and Screen
462026-10-16T14-00-00Z_feature_screen_render_alignment2026-10-16Portable Screen Rendering for Territory and a Host Allocator Alignment Fix
522026-10-16T19-00-00Z_feature_guest_reflow2026-10-16Guest-aware reflow: a layout entry point
532026-10-16T19-30-00Z_feature_screen_widgets2026-10-16Screen widgets and RocText
642026-10-24T20-18-37Z_decision_ssh_input_modes2026-10-24SSH input modes: raw by default, cmd: line mode, and the username grammar
662026-10-25T05-54-40Z_reference_shell_contract2026-10-25The id shell contract, version 1
1012026-10-31T17-47-20Z_design_world_presentation_and_fuel2026-10-31World presentation, rendering, and fuel: the current model
1102026-11-01T17-54-35Z_design_id_concurrent_world_sessions2026-11-01F13.8 concurrent world sessions: client coordinator
1212026-11-01_design_id2054.md2026-11-01Design: ID boards v1 — signed boards, portable themes, and playable posts
1352026-11-01_design_id3455.md2026-11-01Design: a value cannot act on the terminal — one Cf contract for pkgs/id plain output
1432026-11-01_design_id788.md2026-11-01Design: Native reference shell for id (F13.6)
1452026-11-01_design_id790.md2026-11-01Design: F13.8 multi-server and multi-client topology
1592026-11-02T_reference_kitty_disambiguate_v1.md—kitty-disambiguate-v1 profile reference
1932026-11-08T06-45-00Z_design_id_query_local_remote_v12026-11-08Querying local and remote ID servers — v1 design
1942026-11-08T08-10-00Z_design_id5782_graphical_client_tooling.md2026-11-08Graphical client & tooling surface — v1 design
2092026-11-08T10-26-00Z_design_id5996_hot_swap_decision2026-11-08Design: hot-swap alternatives — decision record for the v1 mechanism
2102026-11-08T10-26-00Z_design_id_per_user_function_mapping2026-11-08Design: per-user function mapping — bot battles, strategy hot-switching, human+AI-partner composition
2272026-11-08T22-06-00Z_design_id_android_client2026-11-08Design: a native Android client for ID
2322026-11-08_decision_id5849_semantic_markup_vocabulary_v1.md2026-11-08Decision: semantic markup vocabulary v1 — element set and authoring syntax
2332026-11-08_decision_id5852_native_rendering_os_standard_controls.md2026-11-08Decision: native rendering — assertion → OS-standard controls
2342026-11-08_decision_id5853_custom_gui_rendering_overrides.md2026-11-08Decision: custom GUI rendering as first-class overrides
2352026-11-08_decision_id5854_per_target_composition.md2026-11-08Decision: per-target composition — themes, overrides, assets, conditional blocks
2362026-11-08_decision_id5855_rendering_pipeline_conformance.md2026-11-08Decision: rendering pipeline & conformance suite — compile/runtime split, per-target expected-output tests, author tooling/linting
2432026-11-08_decision_id5910_kdl_presentation_surfaces.md2026-11-08Decision: KDL presentation surfaces — export, hand upload, agent statements
2462026-11-08_design_id5781.md2026-11-08Design: Bevy incorporation — ID worlds as Bevy applications
2472026-11-08_design_id5785.md2026-11-08Design: output safety beyond plain text — markup contexts, safe-plain as a user choice, ingest without evaluation, and the ANSI/OSC disposition
2512026-11-08_design_id5820.md2026-11-08Design: client surfaces parity — scripting/API, agent, and CLI front doors over one query model
2682026-11-08_design_id5873.md2026-11-08Design: terminal participation in object discussions
2702026-11-08_design_id6012_visual_feature_cost_ranking.md2026-11-08Design: visual-feature cost ranking
2752026-11-09T01-10-00Z_design_id_search_ranking2026-11-09Personalized search ranking for notes — decision record
2862026-11-09_decision_id5851_assertion_tailwind_mapping.md2026-11-09Decision: web rendering — assertion → Tailwind mapping
3012026-11-10T20-40-00Z_design_more_shells_v12026-11-10More shells v1 — first-iteration design (mobile, native, hardware)
3082026-11-10_decision_id5818_remote_filtered_query.md2026-11-10Decision: server-side filtered remote query execution
3092026-11-10_design_id5858.md2026-11-10Design decision record: portable theme format & precedence
3472026-11-14T13-50-00Z_design_id_roc_library_imports2026-11-14Design: Roc library imports for worlds — platform-requirement representation, subset checking, provenance, and import errors
3502026-11-14_decision_id5907_triple_decomposition.md2026-11-14Decision: triple decomposition rules for KDL statements
3582026-11-16T13-00-00Z_design_id5964_dynamic_user_functions2026-11-16Design: dynamic user functions — interface contract, compile pipeline, and v1 placement
3712026-11-17T15-40-00Z_design_id_federated_query_fanout2026-11-17Federated query fan-out — design record (#9144)
3772026-11-17_design_id6010_semantic_cell_tag_model.md2026-11-17Design: semantic cell/tag presentation model — one tagged state, many renderers
3972026-11-23T03-17-14Z_design_more_shells_v22026-11-23More shells v2 — outline: native & TUI completion

Design: agents in worlds and the MCP bridge — 6 records

#Record (doc/ entry)DateSubject (record’s own first heading)
2952026-11-09_design_id6300_agents_in_worlds_v1.md2026-11-09Agents in worlds (MCP bridge) — v1 design + spike plan (#6300)
3152026-11-10_design_id6301_agents_as_citizens_v2_outline.md2026-11-10Agents in worlds (MCP bridge) — v2 outline: agents as citizens (#6301)
3522026-11-14_design_id6302_shared_agent_worlds_v3_outline.md2026-11-14Agents in worlds (MCP bridge) — v3 outline: shared agent worlds (#6302)
3672026-11-16_design_id6303_hosted_agent_services_v4_outline.md2026-11-16Agents in worlds (MCP bridge) — v4 outline: hosted agent services (#6303)
3832026-11-20T13-35-00Z_design_id10662_hosted_agent_service_listing2026-11-20Hosted agent service listings: design record for v4 step 1
4032026-11-23T12-46-33Z_design_id10662_listing_record2026-11-23Listing record + registry protocol — the v4 registry’s record family, signing, versioning, suspension/delisting, and discovery query

Design: currency, tokens and metering — 26 records

#Record (doc/ entry)DateSubject (record’s own first heading)
22026-03-21T05-47-48Z_feature_content_modes2026-03-21Content Modes, Format Conversion & Media Viewing
692026-10-28T23-34-15Z_investigation_tigerbeetle_currency_backend2026-10-28TigerBeetle as the accounting backend for dynamic ID currencies — investigation
772026-10-29T11-57-00Z_investigation_tigerbeetle_cluster_topology2026-10-29TigerBeetle cluster topology decision — 3 vs 6 replicas, site placement, commit latency
782026-10-29T12-10-00Z_design_refundable_grants_pending_transfers2026-10-29Refundable grants via pending transfers — premium tokens that survive a refund
792026-10-29T12-20-00Z_design_currency_centralised_exception2026-10-29Design: currency as the centralised exception — the hosted edition’s boundary to the currency service
802026-10-29T12-42-21Z_design_currency_control_plane2026-10-29Currency control plane — design: registry, account factory, gateway
862026-10-30T11-55-00Z_design_grant_lifecycle.md2026-10-30Grant lifecycle implementation spec — pending holds, fingerprint registry, clawback/shortfall, revocation policy
892026-10-30T13-25-00Z_design_graph_token_formats_snapshot_anchoring.md2026-10-30Design: graph token object formats + snapshot anchoring
912026-10-30T19-18-00Z_investigation_token_issuance_id_graph2026-10-30Token issuance in the ID graph — investigation: per-ID issuance, issuer snapshots, authorized conversion rates
1172026-11-01_design_id2043.md2026-11-01Design: ID currencies v1
1222026-11-01_design_id2063.md2026-11-01Design: ID conversion engine — linked transfer pairs and rate authorisation
1272026-11-01_design_id2290.md2026-11-01Design: RateAuthorisation as a signed ID-graph object
1652026-11-03T20-36-00Z_design_tigerbeetle_ledger_binding2026-11-03Design: TigerBeetle LedgerBackend binding (tb_ledger)
1802026-11-05_design_id5828.md2026-11-05Design: conversion & RateAuthorisation across the #5676 currency stages
1862026-11-07T03-55-49Z_feature_graph_currency_contracts2026-11-07Graph-native currency event contracts
2222026-11-08T14-05-49Z_design_id2043_extension.md2026-11-08Design: ID tokens v1 — extension for Drew’s 2026-11-08 rulings
2412026-11-08_decision_id5906_kdl_json_contract.md2026-11-08Decision: KDL ⇄ JSON canonical conversion and round-trip contract
2532026-11-08_design_id5829.md2026-11-08Design: currency load & correctness verification programme
2732026-11-09T00-10-25Z_research_id5966_gas_timeouts_multithreading2026-11-09Research: per-function gas metering, timeouts, and multithreading for user functions
2962026-11-10T03-10-00Z_design_id_two_level_metering2026-11-10Design: two-level metering — burst bucket + hard per-tick ceiling, per function
3282026-11-11_design_id6016_metering_record_flow.md2026-11-11Design: per-function metering record shape and flow — where metering data goes if servers charge by function class
3432026-11-14T06-22-00Z_poc_currency_gateway_boundary_results2026-11-14PoC results — currency gateway boundary (#2298)
3512026-11-14_design_id5823.md2026-11-14Design record — id5823: currency backend port + invariant test-suite contract
3622026-11-16_design_id5825.md2026-11-16Design record — id5825: currency autoscaling — stateless front-end, hot-account mitigations, scaling triggers
3632026-11-16_design_id5826.md2026-11-16Design record — id5826: Stage B — multi-Turso sharding by currency
3642026-11-16_design_id5827.md2026-11-16Design record — id5827: Stage C — TigerBeetle adapter + B→C cutover

Design: the knowledge layer — 31 records

#Record (doc/ entry)DateSubject (record’s own first heading)
52026-03-23T12-00-00Z_feature_metadata_tags2026-03-23Metadata Tag System
1042026-11-01T16-05-00Z_design_documents_session_frames2026-11-01D1-040 — Documents as a session frame pair (web/CLI parity)
1192026-11-01_design_id2048.md2026-11-01Design: Zettelkasten layer — multiplayer docs/wiki on ID
1542026-11-02T04-52-00Z_feature_note_link_backlink_projection2026-11-02Note links and the head-based backlink projection
1812026-11-05_design_id5965.md2026-11-05Design: compile economics — compiled-world/DLL caching, compile-cost penalties, premium gating
1822026-11-05_design_id5997.md2026-11-05Design: effect-language borrowings — which Koka/Unison properties id tooling emulates, approximates, or skips
1882026-11-08T00-45-00Z_design_id_recommendations2026-11-08ID recommendations across all object types — v1 design
1962026-11-08T08-53-12Z_design_onenote_importer2026-11-08Design: OneNote import into the ID knowledge layer
2132026-11-08T11-06-39Z_design_id_draft_approval_flow2026-11-08Design: Draft approval queues, outcomes, and rejected-draft forks
2212026-11-08T13-55-51Z_design_agent_note_placement2026-11-08Design: where agent notes live — scratch, memory, repo, Zettelkasten, or ID graph
2252026-11-08T17-23-00Z_design_id5963_programming_model2026-11-08Design: explicit platform contexts for pure libraries
2382026-11-08_decision_id5874_thread_resolution.md2026-11-08Decision: thread resolution and the discussion→edit loop (resolved-into links and change proposals)
2542026-11-08_design_id5830.md2026-11-08Design: note→board sharing model — embedded live references, version semantics, reply anchoring, backlinks, cross-server case
2552026-11-08_design_id5832.md2026-11-08Design: multiplayer edit sessions — UX, lifecycle, and participation (issue #5832)
2562026-11-08_design_id5837.md2026-11-08Design: knowledge graph view cluster — local/global, edges, filters, scale, live behaviour
2572026-11-08_design_id5845.md2026-11-08Obsidian importer — design record for the #2048 object model
2582026-11-08_design_id5846.md2026-11-08Design: Evernote importer into the #2048 object model
2592026-11-08_design_id5847.md2026-11-08Design: importer design — Logseq into the #2048 object model
2602026-11-08_design_id5848.md2026-11-08Design: importer design — Joplin into the #2048 object model
2692026-11-08_design_id5969.md2026-11-08Design: library typing & upload taxonomy — subtypes, entity attachment, DLL vs compile-in, libraries by URL
2722026-11-08_design_id6439_knowledge-interchange-and-export.md2026-11-08Design: ID knowledge-layer interchange and full-fidelity export
2772026-11-09T03-57-04Z_design_id_edit_fork_graph2026-11-09Edit/fork graph for notes — decision record
2912026-11-09_design_id5821.md2026-11-09ID queries: result shaping & cursor pagination — decision record
2992026-11-10T20-00-00Z_design_agent_note_placement.md2026-11-10Design: where agent notes live — placement rule for zettel vs repo vs ID graph
3002026-11-10T20-12-00Z_design_id_content_model2026-11-10Content model cluster — decision record for #5839
3042026-11-10T21-45-00Z_design_ai_over_notes2026-11-10AI-over-notes: source-grounded Q&A, citations, and read-authority
3162026-11-10_design_id6436.md2026-11-10Design: importer design — Notion into the #2048 object model
3292026-11-11_roc_library_evidence_5995.md2026-11-11Roc shared-library outputs and host loading: evidence for #5995
406knowledge-layer-attachments-media-5844.md—Knowledge layer — attachments & media cluster decision record (#5844)
407knowledge-layer-extensibility-5843.md—Knowledge layer — extensibility cluster decision record (#5843)
408knowledge-layer-feature-matrix-6435.md—Knowledge-layer feature matrix — issue #6435 (program #5678)

Design: first apps and the ecosystem — 26 records

#Record (doc/ entry)DateSubject (record’s own first heading)
12026-03-20T05-30-00Z_feature_collaborative_cursor_enhancements2026-03-20Collaborative Cursor Enhancements
42026-03-23T00:00:00Z_feature_file_list_ui2026-03-23File List UI Improvements
82026-04-01T00-00-00Z_feature_multi_instance2026-04-01Multi-Instance Support for id
472026-10-16T15-00-00Z_feature_roc_grid2026-10-16RocGrid: a bounds-checked grid library for world programs
552026-10-17T09-00-00Z_feature_world_fixtures2026-10-17Session recording to replayable fixtures
712026-10-29T10-54-33Z_investigation_match_audit_netcode_replay2026-10-29Match audit — netcode log format, replay validation, and cheating signals — investigation
822026-10-29T13-04-50Z_investigation_didit_tracker_data_model2026-10-29Investigation: the did-it tracker data model
922026-10-30T19-20-40Z_investigation_match_result_attestation2026-10-30Match-result attestation — mutual concession, witness adjudication, offline play — investigation
972026-10-30T19-40-00Z_investigation_irc_first_chat_on_id2026-10-30IRC-first chat on ID — channels, graph-linked objects, presence
1132026-11-01_design_id2031.md2026-11-01Design: the first ID app — sticky notes + did-it tracker
1162026-11-01_design_id2039.md2026-11-01Design: match attestation + audit v1
1202026-11-01_design_id2051.md2026-11-01Design: ID chat v1
1832026-11-06T00-50-21Z_design_dynamic_world_tick_cost2026-11-06Dynamic-world per-tick cost model and bot-battle benchmark
1892026-11-08T00-57-08Z_design_shader_asset_format2026-11-08ID shader asset format — v1 design
2022026-11-08T09-14-46Z_research_id5988_prior_art_bot_games_programmable_worlds2026-11-08Research: prior art — scripted-bot battle games and user-programmable worlds
2192026-11-08T13-45-00Z_design_id5857_curated_board_submissions2026-11-08Design decision record: curated-board submissions — intake queues, intake roles, notifications
2612026-11-08_design_id5856.md2026-11-08Design decision record: post-to-board flow & post semantics
2622026-11-08_design_id5859.md2026-11-08Decision record: live-object embeds in playable posts
2762026-11-09T01-27-00Z_design_chat_anchor_data_model2026-11-09Chat anchor data model: typed links and durable part selectors
2782026-11-09T04-43-05Z_design_id5788_build_variants.md2026-11-09Feature-leveled build variants — design record
3032026-11-10T21-24-00Z_design_id_program_ecosystem2026-11-10Program ecosystem (share, fork, gallery) — first-pass research + design for #6278
3222026-11-11T05-01-15Z_design_id_program_ecosystem_v12026-11-11Program ecosystem — v1 design: share/fork basics for #6291
3232026-11-11T05-24-00Z_design_id_program_ecosystem_v22026-11-11Program ecosystem — v2 design: gallery & updates for #6293
3462026-11-14T13-33-00Z_design_id_program_ecosystem_v32026-11-14Program ecosystem — v3 design: the public gallery for #6294
3492026-11-14T19-05-00Z_design_id_build_defaults2026-11-14Design: build-time defaults file for id network defaults
3812026-11-18_design_id6308_creator_owner_basics_v1.md2026-11-18Creator tooling & insight — owner basics v1 design (#6308)

Design: scale, performance and adversarial hardening — 24 records

#Record (doc/ entry)DateSubject (record’s own first heading)
62026-03-29T00-00-00Z_reference_testing_architecture2026-03-29Testing Architecture
412026-10-16T10-00-00Z_feature_world_resource_profile2026-10-16Per-world resource profiles
422026-10-16T10-30-00Z_feature_durable_world_resource_profiles2026-10-16Durable per-world resource profiles
582026-10-17T15-30-00Z_feature_world_perf_budgets2026-10-17Per-call resource metrics and performance budgets
592026-10-17T16-30-00Z_fix_territory_view_fuel2026-10-17Fix: territory’s view ran out of fuel with six or more seats
672026-10-27T00-00-00Z_baseline_bytes_per_frame.md2026-10-27F11.9 — Bytes-per-frame baseline table
722026-10-29T10-55-00Z_investigation_comms_abuse_controls2026-10-29Comms abuse controls for ID — blocks, rate limits and per-counterparty budgets
952026-10-30T19-35-00Z_investigation_hot_world_sharding2026-10-30Hot-world sharding — investigation: when one world outgrows one Durable Object
1002026-10-31T04-00-00Z_design_waiting_pool_total_cap2026-10-31Waiting Pool Total Cap — Bounding Memory and Disk Waiting Rows Against Sybil Floods
1142026-11-01_design_id2033.md2026-11-01Design: abuse-control primitives v1 for ID comms
1302026-11-01_design_id2819.md2026-11-01Design: Native-spill write lease protocol for hot worlds
1372026-11-01_design_id557.md2026-11-01Design: F12.12 per-world memory budget and many-world scale
2062026-11-08T09-55-28Z_design_standard_server_baseline2026-11-08The standard server baseline — design decision record
2162026-11-08T11-27-00Z_design_shared_workload_generator2026-11-08The shared load & workload generator — design decision record
2282026-11-08T23-05-00Z_design_id5797_latency_budget_measurement.md2026-11-08Design: per-fallback-tier latency budget & measurement plan for ID
2312026-11-08T23-45-30Z_design_id5897_regression_gates2026-11-08Decision: benchmark regression gates, waivers, and result retention
2392026-11-08_decision_id5892_dos_scenario_catalogue.md2026-11-08Decision Record: DoS Scenario Catalogue per Interface
2452026-11-08_design_id5779.md2026-11-08Design: deterministic testing for ID across time, replay, corpus, and soak
2482026-11-08_design_id5787.md2026-11-08Design: Spill v2 — native spill pools, lease failover, and multi-holder fencing
2812026-11-09T05-15-00Z_design_id_server_invariants2026-11-09Design: server-side invariants — budgets, observability, exploit resistance, failure containment
3142026-11-10_design_id6002_cooperative_timeout_contract.md2026-11-10Contract: cooperative timeout — invocation budget, checkpoint convention, hard-kill outcomes
3312026-11-12T19-35-00Z_feature_world_lease_handoff_actor_boundary2026-11-12World lease handoff at the actor boundary
3542026-11-16T09-52-00Z_design_ci_tiering_adversarial_benchmark_suites2026-11-16CI tiering for the adversarial and benchmark suites — design decision record
4012026-11-23T07-53-00Z_design_scale_perf_stress_v12026-11-23Scale & performance hardening — v1: large-world stress program design

Roadmap, issue map and the design-record index — 20 records

#Record (doc/ entry)DateSubject (record’s own first heading)
202026-10-11T11-08-42Z_design_remaining_work2026-10-11What is left in the design: decisions, open questions, and status
222026-10-11T19-04-32Z_phase_0_baseline2026-10-11Phase 0: baseline, toolchain, dependencies, and small fixes
232026-10-11T22-25-52Z_phase_1_events_storage2026-10-11Phase 1: events, storage, crash safety, and the identity store
242026-10-12T04-03-47Z_phase_2_membership2026-10-12Phase 2: membership, auth frontier, and delegation
252026-10-12T08-58-59Z_phase_3_sync_relays2026-10-12Phase 3: sync, blobs, and relays
262026-10-12T14-33-36Z_phase_4_groups_encryption2026-10-12Phase 4: groups, encryption, and history
272026-10-12T14-33-36Z_phase_5_tags_documents2026-10-12Phase 5: tags, documents, and search
282026-10-12T19-11-31Z_phase_6_invites_pull_cli2026-10-12Phase 6: invites, pull, and the CLI
292026-10-12T21-22-53Z_phase_7_connectivity2026-10-12Phase 7: connectivity for later servers
302026-10-13T23-44-27Z_phase_8_open_design_items2026-10-13Phase 8: open design items, retention, multi-device, and views
352026-10-14T_platform_completion—Platform completion: acceptance brief
632026-10-22T15-25-00Z_handoff_research_workflow_pipeline2026-10-22Handoff: the research-to-delivery pipeline and platform backlog
1362026-11-01_design_id534.md2026-11-01Design: Run Phase 12 deliverables through the research workflow
1602026-11-03T00-05-09Z_research_phase-12-package-5342026-11-03Changes
1732026-11-04_id-program-essay-answers.md—Answers to Drew’s 2026-11-04 ID program questions
3862026-11-22T07-05-00Z_phase_id_phase12_exit_audit2026-11-22Phase 12 exit audit — 2026-11-22
3872026-11-22T14-45-14Z_phase_id_phase12_exit_audit_rerun2026-11-22Phase 12 exit audit — re-run and reconciliation, 2026-11-22
3882026-11-22T16-13-20Z_design_id-walking-skeleton2026-11-22Walking skeleton for #9106: the path through the 126 rows
3952026-11-23T02-02-09Z_reference_authority_boundary_audit2026-11-23Authority-boundary audit — Phase 12 exit criterion 9
4022026-11-23T12-06-42Z_design_id_program_investigation_prompt2026-11-23ID Program — Full Investigation, Design Completion & Build-Out Prompt

Index ends. Row count check: 32 + 20 + 44 + 56 + 39 + 11 + 30 + 43 + 6 + 26 + 31 + 26 + 24 + 20 = 408 records, each listed exactly once.

Repository layout

Source: pkgs/id/Cargo.toml, pkgs/id/flake.nix, pkgs/id/book.toml and pkgs/id/docs.nix in https://github.com/developing-today/code/blob/main/pkgs/id/Cargo.toml — provenance only; this chapter is complete without following it.

ID lives in the developing-today/code monorepo, in the directory pkgs/id/. That directory is a Cargo workspace, a Nix sub-flake, and the root of this book, all at once. Everything a contributor needs for ID is under pkgs/id/, except the design-record archive, which sits at the repository root (see “The design archive” below).

The root crate

pkgs/id/Cargo.toml is two things: the package manifest for the root crate, named id, version 0.1.0, edition 2024, and the workspace root manifest.

PathWhat it holds
src/main.rsThe id binary entry point. It consumes the library through id:: paths, the same surface an external consumer uses.
src/lib.rsThe facade crate: 26 modules of first-party code (among them backup, currency, fileops, grants, hosted_binding, hosted_export, hosted_ingest and structured_logging) plus the re-export surface over the sub-crates. The facade is not a re-export shim only; it owns code.
src/ (rest)The facade-owned modules, one file or directory per module. Several files at historical paths are thin layers over the split crates that now own the code.
build.rsThe root package’s build script. It handles the web asset directory web/dist: a release build with the web feature fails when that directory is missing or empty. See Building and testing.
build.sh, scripts/The build and maintenance scripts the justfile recipes call, including scripts/build.sh, the Roc test and example rebuild scripts, and the test-sharding script.

There is no src/bin/ directory and no [[bin]] section in any workspace Cargo.toml. The two binaries exist by Cargo’s implicit src/main.rs rule: id from the root package, and id-native-shell from crates/id-native-shell/src/main.rs.

The 16 crates

crates/ holds the 16 sub-crates. The workspace has 17 members in total: the root plus these 16. default-members lists 15 packages — the root plus 14 crates. id-native-shell and id-hw-shell are members but not default members, so a plain cargo build in pkgs/id/ never builds the desktop shell or the hardware shell.

CrateRole in one line
id-coreFoundation leaf modules: addressing, frames, discovery, membership, the graph record model. Depended on by every other split crate.
id-capsCapability catalog, execution limits, the world manifest, and the MCP bridge translator and policy point.
id-configThe versioned configuration contract: the V2 ConfigDocument, its hard invariants, and the deterministic resolver. No production crate depends on it; the facade uses it in dev-dependencies for its tests.
id-storeBlob store, chains, documents, tags and search.
id-eventsEvent store, group projection, writer sets and sync gating.
id-groupsGroup policy and enforcement remainder over the model in id-events: blob gate, group encryption, group actions and log.
id-syncLog sync, the meta protocol, envelopes, signed artifacts and FileOps transfer.
id-directoryHome-server directory, views, auth, mail, invites, keysets and seitan admission.
id-worldsWorld runtime, sessions, the wasmtime sandbox, the shell contract and the program gallery. The largest crate in the workspace.
id-webThe HTTP and WebSocket server: routes, templates and markdown for the web UI.
id-cliThe application layer: the clap parser in src/cli/, the command handlers in src/commands/, the REPL, and the server-config loader.
id-currency-registryCurrency control-plane registry: the ledger allocator, the account factory and the Postgres schema and migrations.
id-renderRendering pipeline compiler core: parse and vocabulary validation of semantic markup. No dependents.
id-import-notionNotion importer manifest and inventory primitives. No dependents.
id-native-shellThe Bevy native reference shell. Not a default member.
id-hw-shellThe ESP32-class hardware shell spike: one file, src/lib.rs, frame builders only, no binary. Not a default member.

Dependency direction runs downward to id-core. Nothing in the split family depends on the facade in production code; the two shells depend on the facade, and id-store dev-depends on it for tests. The full per-crate surface is The crates.

Two directories sit outside the workspace: vendor/p2panda-sync and vendor/p2panda-encryption are listed in the workspace exclude array and are consumed as path dependencies only.

Apps, examples and the guest surface

PathWhat it holds
apps/Packaged apps. It contains exactly one app: apps/tic-tac-toe/, with an app.toml declaring [program] kind = "roc-world" and the guest source in program/main.roc. It contains no Rust.
examples/The Roc guest apps, the shared Roc platform package, the Rust guest SDK and its example, the import-policy fixture matrix, and one standalone Rust example file, examples/session_checkpoint_poc.rs. The guest apps are listed in Add a Roc guest app.
contract/The machine-readable shell contract, 4 files: shell-contract.v1.json (contract id-shell, version 1, revision 15), shell-suite.v1.json, and the two golden session transcripts sessions/terminal.jsonl and sessions/native.jsonl.
config/The JSON Schema twin of the id-config document, config/id-config-v1.schema.json.
test-vectors/Exactly 3 files: schema.json (the ID/Atlas shared conformance test-vector schema), atlas-content-hash-v1.json and legacy-artifact-signatures.json.
benches/The benchmark harness: world_bench.rs plus its baseline files. A separate benchmarks/ directory holds benchmark notes and results.
tests/The root package’s integration tests, including cli_integration.rs, the config_* tests for id-config, and the MCP bridge and spike end-to-end tests. Each sub-crate also carries its own tests/ directory.
e2e/The Playwright end-to-end suite for the web UI, with its own package.json, bun.lock and playwright.config.ts.

The web frontend and the hosted scaffold

PathWhat it holds
web/The web frontend: Bun plus TypeScript, package name id-web. Its build output lands in web/dist, which is embedded into the id-web crate at compile time with rust-embed. Only a tracked .gitkeep file is committed under web/dist; the assets are a build product. See Building and testing.
hosted-worker/The hosted edition’s Cloudflare Worker scaffold: wrangler.toml, src/ (front door, routing, the per-user Durable Object, provisioning, the currency gateway proof of concept) and test/. It is a local-only scaffold, not a deployed service. See Release and rollout.
worker-poc/A proof of concept that runs one example world in a Worker isolate, plus its d1-journal-poc/ subfolder. Not a production path.

Build and project files at the package root

PathWhat it is
flake.nixThe sub-flake: dev shell, the checks set, the packages id-web and id-lib, and apps generated from just-recipes.json.
justfileThe command runner recipes. Every build, test and serve command in Building and testing is a recipe here or a Cargo command the recipes wrap.
just-recipes.jsonA generated projection of the justfile, regenerated by the lockfiles recipe and checked for drift by a flake check. Do not edit it by hand.
rust-toolchain.tomlThe toolchain pin: channel 1.99.1, with the components rustfmt, clippy, rust-analyzer and llvm-tools. The flake reads it through rust-overlay.
Cargo.lockThe workspace lockfile, consumed by both Cargo and the Nix packages.
default.nix, shell.nix, nix/, nix-common.nixThe non-flake and shared Nix entry points, and the NixOS VM test definitions under nix/tests/.
README.md, ARCHITECTURE.md, WEB.md, TODO.mdThe package’s older prose documents. They predate parts of the current tree and disagree with it in places; this book documents the source where they differ. TODO.md states in its own text that it is idle planning and not a basis for decisions.

Where this book lives

PathWhat it is
book/This book’s chapters, as plain Markdown, organised by the sections in book/SUMMARY.md. The book is readable in the repository exactly as written.
book.tomlThe mdBook configuration at the package root: title id, source directory book, build directory rendered, and create-missing = false under [build]. That last setting is one of the two build gates in Keeping this book current.
docs.nixThe Nix derivation that renders the book: it takes only book.toml and the book/ tree as its source, rewrites links that escape the book tree to their repository URLs in the copied pages only, and bakes in a siteUrl argument that defaults to /. Its header states that it is exposed as the .#id-docs flake output.
Repository-root lib/default.nixThe root flake’s wiring for every sub-flake, ID included: its make-id function imports pkgs/id/flake.nix, re-keys its inputs, and merges its outputs into the root flake — the packages are inherited as-is, and the apps are exposed with an id- name prefix, with the id app itself running the sub-flake’s default app. This is the wiring that makes the sub-flake’s packages and checks reachable from the repository root.

The design archive

The design records for ID — and for every other programme in the repository — live in the doc/ directory at the repository root: 2,917 paths in total, of which the book’s research classified 408 top-level entries as ID-programme records.

Inside pkgs/id/, two symlinks point at that archive:

  • pkgs/id/doc → ../../doc
  • pkgs/id/docs → ../../doc

Both resolve to the same repository-root directory. There is no ID-private docs tree: the archive reached through pkgs/id/docs is shared with the Atlas, Fleet, PM-stack and home-cluster programmes, and two of its entries are themselves symlinks out of the archive, to hardware documentation. A third symlink, pkgs/id/thoughts → ../../thoughts/, points at a second shared repository-root directory holding session-continuity ledgers and the early collaborative-web working papers.

The mapping from design records to this book’s design chapters is in Roadmap, issue map and the design-record index.

Building and testing

Source: pkgs/id/justfile, pkgs/id/flake.nix, pkgs/id/Cargo.toml, pkgs/id/rust-toolchain.toml, pkgs/id/build.rs and pkgs/id/web/package.json in https://github.com/developing-today/code/blob/main/pkgs/id/justfile — provenance only; this chapter is complete without following it.

All commands in this chapter run from pkgs/id/ unless a command says otherwise. Every just recipe named here exists in pkgs/id/justfile; every Cargo flag and feature name exists in pkgs/id/Cargo.toml; every Nix package and check name exists in pkgs/id/flake.nix.

The development shell and the toolchain pin

Enter the development shell from pkgs/id/:

nix develop

The sub-flake’s devShells.default provides the build inputs, the native build inputs and the OpenSSL environment the packages use, so the Cargo, just, Bun and Roc commands below run with the pinned tool versions.

The toolchain pin is pkgs/id/rust-toolchain.toml:

  • channel: 1.99.1
  • components: rustfmt, clippy, rust-analyzer, llvm-tools
  • profile: default

The file is read by rustup directly and by the flake through rust-overlay. Its own header states that deleting it breaks nix develop and nix build. The pin is not the minimum supported version: the root Cargo.toml declares rust-version = "1.96". The pin states what the project builds with; rust-version states the oldest compiler the manifest accepts.

Building with Cargo

cargo build                        # default features: sandbox + world, no web UI
cargo build --features web         # the web variant
cargo build --release              # release profile, default features
cargo build --release --features web

The justfile wraps the same builds and tracks which variant was built last, in target/.build-variant (debug) and target/.build-variant-release (release):

RecipeWhat it runs
just build./scripts/build.sh web debug — the web variant, debug profile. Alias: build-web.
just build-lib./scripts/build.sh lib debug — the library variant: a plain cargo build with default features.
just release./scripts/build.sh web release. Aliases: build-release, build-web-release.
just release-lib./scripts/build.sh lib release.
just build-web-cargocargo build --features web. Alias: build-cargo.
just build-lib-cargocargo build.
just release-web-cargocargo build --release --features web.
just release-lib-cargocargo build --release.
just cleancargo clean.

The -force recipes (build-web-force, build-lib-force, release-web-force, release-lib-force) bypass the build script’s freshness checks and rebuild the web assets or the binary directly.

Feature flags

The root crate’s [features] table in pkgs/id/Cargo.toml is the whole feature system. id-cli’s Cargo.toml mirrors the same names for the application layer.

FeatureDefinition in the root crateDefault
sandboxImplies world; forwards to id-core/sandbox, id-caps/sandbox, id-worlds/sandbox and id-cli/sandbox. It is the wasmtime guest runtime: it gates the parser variants id world dev, id world measure, id world replay, id world verify and the whole id match-audit command.On, through default.
worldForwards to id-core/world and id-cli/world. Without it, the id world parser still prints its full help tree, but every id world invocation fails at runtime with the error this build has no world support.On, through default.
webImplies world; links the optional id-web dependency and forwards to id-core/web and id-cli/web. Without it, id serve --web fails at startup with an error naming the missing feature.Off.
sshImplies world; forwards to id-worlds/ssh and id-cli/ssh. It is the world-over-SSH server inside id serve --world-ssh-port. The flag itself parses in every build.Off.
dhtForwards to id-sync/dht and id-cli/dht: mainline DHT address lookup and publishing. The serve --dht flag parses in every build; the feature controls the lookup code behind it.Off.
currency-poc-tbLinks the optional TigerBeetle Rust client for the currency proof of concept. No command-line surface.Off.
default["sandbox", "world"].—

The CLI-2 split: --no-default-features is not the lib build

cargo build --no-default-features and the Nix id-lib package are different builds, and the package README’s Cargo quick-start conflates them — disagreement CLI-2 in the book’s research. The facts, from Cargo.toml and flake.nix:

  • A default build already has no web UI: web is opt-in and is not in default.
  • cargo build --no-default-features removes sandbox and world as well. id match-audit and the four sandbox-gated world subcommands leave the parser entirely, and every other id world command fails at runtime.
  • The Nix id-lib package sets buildNoDefaultFeatures = true and then re-adds exactly the two default features, with buildFeatures = ["sandbox", "world"]. The shipped lib build is therefore the default-feature build without web and without ssh — the same feature set as a plain cargo build.

The Nix id-web package, the flake’s default package, builds with buildFeatures = ["web", "sandbox", "ssh", "world"]. Both packages install the same single binary as bin/id. See Release and rollout.

Web assets

The web variant embeds the frontend at compile time, so the frontend is built first. The justfile’s web recipe (alias web-build) runs ./scripts/build.sh assets; web-assets-force bypasses the freshness check:

cd web && bun install && bun run build

The web/package.json build script is three steps:

ScriptCommand
build:jsbun build src/main.ts --outdir=dist --minify --sourcemap=external --entry-naming=[name].[hash].js
build:cssnode_modules/.bin/tailwindcss -i src/input.css -o dist/styles.css --minify
build:manifestbun run scripts/build-manifest.ts — renames the stylesheet to its hashed name and writes the asset manifest the templates consume.

Output lands in web/dist. The root package’s build.rs enforces the ordering: with the web feature on, a release-profile build fails when web/dist is missing or holds nothing but its .gitkeep placeholder, and the failure message names the bun install && bun run build command above. A non-release build creates the directory when it is absent, so cargo check and cargo test compile on a clean checkout.

Testing

Tests run under cargo-nextest where the justfile uses it. The recipes:

RecipeWhat it runs
just test-rustcargo nextest run --all-features, then cargo test --all-features --doc for the doc tests nextest does not run. Alias: test-cargo.
just testtest-rust plus test-web-unit plus test-web-typecheck.
just test-sandboxcargo nextest run --all-features -E 'not test(serve_tests)' — the full Rust suite minus the tests that bind and listen on sockets, which the Nix sandbox forbids.
just test-fullcargo nextest run --all-features --no-fail-fast, then the regression_replay test target, then the tuple_properties target with PROPTEST_CASES defaulting to 4096 and ID_TUPLE_FUZZ_CASES defaulting to 20000.
just test-unitcargo nextest run --all-features --lib. Alias: test-lib.
just test-crate-integrationFive named integration targets in sub-crates the root shards do not cover: id-caps roc_import_policy, id-cli aliases, id-core probe_petname_load, id-store store_traits, id-web web_router_security.
just test-native-shellcargo nextest run -p id-native-shell. A separate recipe because the crate is not a default member.
just test-hw-shellcargo nextest run -p id-hw-shell. Same reason.
just test-rust-examplescargo test against examples/rust-world/Cargo.toml and examples/rust-counter/Cargo.toml — standalone crates outside the workspace.
just test-integrationcargo nextest run --all-features --test cli_integration. Alias: test-int.
just test-web-unitcd web && bun run test (Vitest), then the build-manifest shell test.
just test-web-typecheckcd web && bun run typecheck (tsc --noEmit).
just roc-testbash scripts/roc-test.sh — the Roc library expect tests with the pinned Roc compiler.
just test-e2eA build first, then one Playwright invocation per spec file in e2e/tests/, each with a fresh ephemeral server. test-e2e-chromium and test-e2e-firefox run one browser project each.
just crash-gatecargo test --release --features web --test crash, skipping the write_corpus tests. Four split recipes — crash-gate-sampled, crash-gate-sweep, crash-gate-control, crash-gate-ingest — partition the same tests by name filter for the pull-request gate.

Run one test by name with the recipe test-one, which takes the test name as its single argument and runs cargo nextest run --all-features -E 'test(<NAME>)' with the name substituted. Example with toy data: just test-one my_test.

Checks: just and Nix

Recipe or commandWhat it runs
just cargo-checkcargo check --all-targets --all-features.
just clippy-lintcargo clippy --all-targets --all-features. clippy-native-shell runs clippy for the non-default id-native-shell member separately.
just fmt-checkcargo-fmt-check (cargo fmt -- --check) plus web-fmt-check (Biome format over the web and e2e sources).
just ciThe read-only CI set, in recipe order: cargo-fmt-check, web-fmt-check, cargo-check, clippy-lint, clippy-native-shell, web-lint, test-sandbox, test-native-shell, test-hw-shell, test-rust-examples, test-web-unit, test-web-typecheck, roc-test, doc, build, release.
just checkfix first (auto-fix formatting and lints), then ci. Alias: check-all.
just doccargo doc --no-deps --document-private-items.
just test-nixnix flake check in pkgs/id. Aliases: check-nix, nix-check.

The flake’s checks set in pkgs/id/flake.nix exposes the CI set as individual named checks — among them cargo-fmt-check, clippy-lint, clippy-native-shell, web-lint, test (which runs the test-sandbox recipe), test-unit, test-crate-integration, test-native-shell, test-hw-shell, test-rust-examples, test-int, the four integration shards test-shard-0 to test-shard-3, roc-test, roc-examples, doc, cargo-check, prod-lines-check, the five crash-gate checks and just-recipes-drift — plus NixOS VM checks for serve and end-to-end tests on Linux. The default check runs the ci recipe.

Two counts for this check set circulate in the package’s own documents and disagree — disagreement DES-4 in the book’s research: ARCHITECTURE.md states 11 CI checks in its build-system section and 27 checks in its testing section, and the justfile’s test-nix comment also states 27. The count is unverified: this chapter names the checks instead of totalling them.

At the repository level, .github/workflows/id-check.yml (workflow name id) runs the fast checks on pushes to main as a parallel matrix, one job per check listed in .github/scripts/id-pr-checks.txt, and runs the full nix flake check on its schedule and on manual dispatch. The end-to-end browser and NixOS VM checks run in .github/workflows/id-e2e-nightly.yml.

Test counts are dated measurements

This book states no standing test totals. A count is a measurement of one run on one date, and it is recorded with its date or not at all. One count was supplied to this book’s research from a separate work lane: an id-sync nextest run reported as 474 passed, attributed to the lane for issue #13291. That count is unverified here — it was not re-run for this chapter, and no date for the run was supplied with it — so it is recorded as a claim to re-measure, not as a fact about the current tree. To produce a current count for one crate, run cargo nextest run --all-features -p id-sync in pkgs/id/ and record the summary line with the date and the commit.

Running a node while developing

The serve recipes in the justfile:

RecipeWhat it runs
just serveThe web assets, then cargo run --features web -- serve --web with any extra arguments appended.
just serve-libcargo run -- serve with any extra arguments appended — no web UI.
just serve-newA new named instance: cargo run --features web -- --new=<NAME> serve --web --port 0. An empty name asks for a random 8-hex-character instance name.
just replcargo run -- repl.
just kill-serveKills any running id serve processes, waits, then serves. This is also the justfile’s default recipe: bare just restarts the server.

id serve itself defaults to web port 3000 on bind address 127.0.0.1; the full flag set is in serve and publications.

Two port numbers are working conventions for shared nodes, not constants in the pkgs/id source — a search of the source tree for this chapter did not establish either number in code, so both are unverified as code facts and are recorded here as operator convention only: a live demo node is run on loopback port 3210, kept separate from any real data, and the operator’s production node is run on port 3005. Neither number is a default; a stock id serve --web with no --port flag listens on 3000.

Add a command

Source: pkgs/id/crates/id-cli/src/cli/mod.rs, pkgs/id/crates/id-cli/src/cli/world.rs, pkgs/id/crates/id-cli/src/commands/mod.rs, pkgs/id/src/main.rs and pkgs/id/crates/id-cli/src/repl/runner.rs in https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-cli/src/cli/mod.rs — provenance only; this chapter is complete without following it.

“Command” here means a new invocable surface on the id binary: a top-level command or a subcommand under an existing family. A command is not done when its handler works. It is done when the parser, the handler, the dispatch, the help text, every surface that mirrors it, the tests and this book all describe the same command — in the same change, per Keeping this book current.

The second binary, id-native-shell, has a hand-rolled argument parser in crates/id-native-shell/src/main.rs and no clap. This chapter covers the id binary only.

1. The parser: crates/id-cli/src/cli/

The clap derive parser lives in the id-cli crate, in src/cli/:

FileWhat it declares
cli/mod.rsThe Cli struct with the global flags, the top-level Command enum, the serve arguments, and the families that have no file of their own.
cli/world.rsThe world family: one argument struct per subcommand.
cli/tag.rsThe tag family.
cli/groups.rsThe group family, plus delegate and revoke.
cli/gallery.rsThe gallery family.
cli/walk.rsThe walk family.
cli/claim.rs, cli/doc.rs, cli/writer_sets.rs, cli/match_audit.rsThe claim, doc, writer-sets and match-audit families.
cli/tests.rsThe parser test suite for the whole cli module.

Declare the new command in the file for its family: a variant on the family’s command enum, an argument struct with one #[arg] field per flag or positional, and doc comments on both. The doc comments are the help text — clap renders them — so each one states what the argument does, its literal default where it has one, and any requirement or conflict a caller would otherwise have to read the handler to learn. Follow the family’s existing conventions for the repeated shapes:

  • World client commands repeat the same connection fields in each argument struct — the node positional, --admin-token with env ID_WORLD_ADMIN_TOKEN, --capability with env ID_WORLD_CAPABILITY, --world with env ID_WORLD, --addr, --no-relay. They are not global flags. Copy the block from a sibling subcommand; do not invent a new spelling.
  • A flag with an environment fallback declares it in the #[arg(env = "...")] attribute, with hide_env_values = true when the value is a token or capability.
  • An optional-value flag declares num_args = 0..=1 and states its missing-value meaning in its doc comment. The precedent is --new on the top-level parser and --first / --last on the search family.
  • A value that must be validated at parse time gets a value parser, so a bad value is a clap error with exit status 2, not a handler error. The precedent is the result-limit parser shared by find, search, show and peek, which rejects 0 with the message zero is not a valid limit: use at least 1.

If the new syntax interacts with argument rewriting, check cli::normalize_args in cli/mod.rs: the top-level entry point rewrites a bare --new followed by a subcommand name so the subcommand is not swallowed as the instance name. A new optional-value flag in the leading position needs the same treatment.

Decide the feature gate before writing the handler

Three gating shapes exist in the current parser, and a new command takes one of them deliberately:

ShapePrecedentBehaviour in a build without the feature
Parser variant gated with #[cfg(feature = "...")]The sandbox variants world dev, world measure, world replay, world verify, and the whole match-audit command.The command does not exist: clap reports an unrecognized subcommand, and the help tree does not show it.
Parser unconditional, dispatch gatedThe whole world family: the Command variant is unconditional, and src/main.rs carries a gated dispatch arm plus a fallback arm.The help tree prints in full, and every invocation fails at runtime with this build has no world support.
Parser unconditional, handler guardserve --web and serve --server-config.The flag parses, and startup fails with an error that names the missing feature and the rebuild flag.

The feature names are defined in the root Cargo.toml and mirrored in crates/id-cli/Cargo.toml; the definitions and defaults are in Building and testing. A command that needs wasmtime takes the first shape. A command in a family that must stay discoverable in help takes the second or third, and its help text states the requirement.

2. The handler: crates/id-cli/src/commands/

Handlers live in src/commands/ in the id-cli crate, one file per family: put.rs, get.rs, find.rs, list.rs, tag.rs, world.rs with a world/ submodule directory, serve.rs with a serve/ submodule directory, group.rs, gallery.rs, walk.rs, and the rest. Add the handler to its family’s file, or give a new family its own file, and register the module in commands/mod.rs.

Handler rules, from the existing code:

  • A handler returns anyhow::Result<()>. An error propagated out of main prints Error: followed by the error chain to stderr and exits with status 1. There is no per-command exit-code table and no process::exit call in the id binary or in id-cli.
  • Multi-target handlers aggregate partial failures into one error instead of failing on the first target. The precedents are put and get, whose aggregated messages begin some puts failed: and some gets failed:.
  • Empty input is guarded explicitly, with a message that names the missing input. Precedents: no files provided, no sources provided.
  • A handler that operates locally and remotely goes through the family’s existing chooser instead of opening the store directly. For file commands that is the meta-client layer in id-cli (MetaClient in src/meta_client.rs); the local-serve lock file decides whether operations proxy to a running serve.

3. The dispatch: pkgs/id/src/main.rs

The binary entry point stays in the root package. It imports the parser and the handlers through the facade — id::{Cli, Command, ...} — and matches on the parsed Command. A new top-level command needs a match arm there. A new subcommand inside an existing family dispatches through that family’s handler entry point and needs no change in main.rs, unless the family itself is feature-gated at dispatch: the world arm is the precedent, with one arm compiled under the world feature and one fallback arm compiled without it.

Running id with no subcommand starts the REPL. A new command does not change that; a new global flag does interact with it, because the REPL entry is the None arm of the same match.

4. The REPL: decide explicitly

The interactive REPL does not reuse the clap parser. A line is whitespace-split and matched against literal patterns in crates/id-cli/src/repl/runner.rs, with input preprocessing in crates/id-cli/src/repl/input.rs and the session state in crates/id-cli/src/commands/repl.rs (ReplContext). The full REPL surface is The interactive REPL.

Ask, and record the answer in the change: does this command belong in the REPL too?

  • The REPL carries the file-operation set only: list, put, get, cat, find, search, show, peek, the tag family, and its own session commands. It has no serve, world, group, doc, claim, key, keyset, gallery or walk commands, and a command from those families does not get a REPL form.
  • If the command is a file operation and it gets a REPL form: add the match arm in runner.rs, add any flag parsing to the hand parser the neighbouring commands use — the REPL re-implements each flag itself, and clap defaults do not carry over — and add the command to the REPL’s own help output in the same file. Note the standing trap: the REPL’s internal default for find and search format is union, where the clap commands default to tag. A new shared flag must state its default in both parsers, and the two defaults must be the same unless the difference is deliberate and documented in both places.
  • The REPL also has commands with no clap counterpart at all — delete, rename and copy exist only there. A REPL-only command is a legitimate shape for a session operation, but it is a decision, not an accident: the top-level CLI’s inability to perform the operation must be stated in the reference chapter.

5. Tests

  • Parser tests in crates/id-cli/src/cli/tests.rs: the new command parses with its defaults, each flag parses in its accepted range, conflicting flags conflict, and any spelling that must stay rejected stays rejected. The precedent for a rejection test is the pair asserting that serve --replace-defaults and peers --replace-defaults are parse errors.
  • Handler tests beside the family’s existing tests, and an integration case in pkgs/id/tests/cli_integration.rs when the command drives the built binary end to end. The integration harness locates the binary through the ID_BINARY environment variable when it is set.
  • Run the family first, then the sandbox-safe suite: cargo nextest run --all-features -p id-cli for the crate, and just test-sandbox for the workspace set. The recipes and their exact commands are in Building and testing.
  • Every behavioural expectation names its oracle: the recorded output, fixture or invariant the test checks against. A test that only asserts the command exits 0 proves the parser ran, not that the command did the work.

6. The book, in the same change

Update the reference chapter that covers the family — the top-level map is The id command line, and each family has its own chapter in the reference section — plus this chapter if the change alters the pattern it teaches, plus any chapter that states a default the new command changes. A new flag with an environment fallback also updates Configuration and environment. The full contract, including the two build gates that enforce the book’s own completeness, is Keeping this book current.

Add a Roc guest app

Source: pkgs/id/examples/roc-world/platform.roc, pkgs/id/examples/roc-world/ABI.md, pkgs/id/crates/id-cli/src/cli/world.rs and pkgs/id/apps/tic-tac-toe/app.toml in https://github.com/developing-today/code/blob/main/pkgs/id/examples/roc-world/platform.roc — provenance only; this chapter is complete without following it.

A guest app is a Roc program compiled to an import-free WebAssembly module and run by the host under the Plaza ABI v1 contract. This chapter covers writing one, checking it offline, and putting it in front of users through the program gallery. The runtime model behind it is Worlds and the Roc guest runtime; the host-side commands are in World commands: administering and verifying.

Where guest apps live

Worked examples live in pkgs/id/examples/. Each app is a directory holding its Roc source, a README.md, a build script, and — for most apps — a checked-in .wasm build of the guest, so the host conformance suites run without a Roc toolchain installed.

DirectoryWhat it demonstrates
examples/roc-counter/The smallest complete world: guests send inc, all participants see the count, and records mirrors the count to the host.
examples/roc-text-counter/The same counter on the legacy plain-text presentation, importing no platform modules.
examples/roc-chat/Chat over the capability protocol: chat.say and chat.history through RocCap.
examples/roc-grid/The RocGrid library: a 4×3 byte grid with bounds-checked reads.
examples/roc-screen/The Screen and Key libraries: a structured screen document instead of text.
examples/lounge/The capability system end to end: subscriptions, arrival greetings through chat.say, and refusal counting.
examples/territory/A complete multiplayer game: at most 8 seated players on a 16×8 grid, adjacency-only claiming, seats that persist across leave, rejoin and restart.
examples/roc-cap-demo/A capability-dependent Roc library plus its app, with two compile-must-fail negative tests for the library import gate.
examples/roc-import-policy/Not an app: the compile-fixture matrix for the import gate, executed by the id-caps integration test roc_import_policy.
examples/rust-world/, examples/rust-counter/Not Roc: the Rust twin SDK (plaza_sdk) and its counter example, emitting the same Plaza exports.
apps/tic-tac-toe/The one packaged app, outside examples/: an app.toml plus program/main.roc. Packaging is an app.toml declaring [program] kind = "roc-world" and the [interfaces.web] binding where the app takes a web surface.

Scaffold a new app

id world new <DIR>

id world new is a local command; it contacts no node. It creates <DIR> — which must be absent or empty — and writes three files into it:

  • main.roc — the guest source, implementing the eight entry points below.
  • build.sh — the build script for the guest module.
  • README.md — the app’s readme.

The --name <NAME> flag sets the world name in the scaffold; its default is world.

Start from the scaffold, or copy examples/roc-counter/ when the new app is closer to a counter than to the scaffold. Keep the app’s directory self-contained: source, build script, readme, fixtures and the checked-in .wasm build live together, as they do in every directory in the table above.

The platform package: examples/roc-world

Every Roc guest builds against the one shared platform package in examples/roc-world/:

  • platform.roc is the platform definition. It exposes exactly six pure-Roc modules to apps: Screen, Key, RocJson, RocGrid, RocCap and RocText, each a .roc file beside it in the same directory. A second platform file, platform-no-caps.roc, exposes the platform with no capability module; it exists so the import gate’s negative tests have a platform under which a capability-dependent library must fail to compile.
  • host/ holds the freestanding Zig host adapter: host/src/host.zig, host/src/native_worker.zig and the generated host/src/roc_platform_abi.zig. build-host.sh and build-native.sh at the package root build it.
  • ABI.md in the same directory is the written Plaza ABI v1 contract.
  • The app readmes pin the Roc toolchain as nightly-2026-10-04-130536d and the host’s Zig as 0.16. The host-side compiler lookup honours the ID_ROC_BIN and ID_ROC_PLATFORM environment variables and the matching serve and world flags; their defaults and fallbacks are in Configuration and environment.

A guest program provides all eight entry points the platform requires. Some may be stubs, but all eight must exist:

Entry pointSignature, in wordsContract
initseed → modelThe seed is the U64 the host starts the world with.
updatemodel, participant id, event text → modelParticipant id 0 is reserved for host events, including capability results.
viewmodel → textLegacy text, or a portable screen document.
layoutmodel, width, height → textViewport-sized rendering.
recordsmodel → textA JSON object projection; the host mirrors it and serves it to readers.
wantsmodel → textSubscriptions and one-shot capability requests, as JSON.
snapshotmodel → textThe whole state as text, for journal checkpoints.
restoretext → modelThe inverse of snapshot.

update and view are pure. The platform requires no Task, and the guest has no host functions to call: all effects go through the capability protocol below.

The Plaza ABI v1 contract

The compiled module is import-free WebAssembly: no WASI, no filesystem, network, clock or randomness imports. The module exports memory plus the plaza_* exports defined in ABI.md. The required exports are memory, plaza_alloc, plaza_free, plaza_init, plaza_update, plaza_view and plaza_out_len. The optional exports are plaza_abi_version (returns 1), plaza_layout, plaza_records, plaza_wants, plaza_snapshot and plaza_restore — the last two are a pair, both present or both absent — and plaza_error_ptr / plaza_error_len for diagnostics, at most 4096 bytes.

The host runner is id_worlds::sandbox::{Sandbox, WorldInstance} on wasmtime. Fuel and memory are bounded by the world’s runtime limits; the limits and their defaults are stated in World commands: administering and verifying.

The capability protocol

Effects are requested, never performed directly. plaza_wants — surfaced in Roc as the guest’s wants entry point — returns a JSON document of the form {"v":1, "subscribe":[...], "requests":[{"id":"r1","cap":"time.now","args":{}}]}. The document is at most 64 KiB, with at most 64 subscriptions, at most 64 requests and at most 4 distinct tick intervals. The host answers each request with a participant-0 update event carrying a cap result: ok with a value, or not ok with one of the stable error codes cap_denied, unknown_cap, bad_args, failed, actor_denied, outside_ceiling and result_too_large. Host events are journaled, so a replay feeds the same events back through update in the same order.

In Roc, do not build these documents by hand. RocCap is the client library: it allocates request ids (r0, r1, …), tracks which requests are outstanding, and routes result events back to the caller. It provides request builders including chat_request, now_request, players_request, world_request, history_request, records_request, schedule_at_request and schedule_cancel_request. The provider catalog itself — capability names, argument schemas and bounds — is owned by id_caps::world_caps; a request for a capability the world was not granted returns a refusal event, never a silent execution.

Verify offline: the dev loop

Four commands check a guest without a network, a running serve or a second participant. All four are gated on the sandbox feature: in a build without it, the subcommands do not exist. See Building and testing for the feature definitions.

CommandWhat it does
id world dev <DIR>Runs the fully offline scratch-world loop over a directory: compile, instantiate, feed inputs and fixtures, and print one JSON report. Its flags include --platform <DIR>, --roc <BIN>, --seed <N> (default 1), repeatable --input <TEXT> and --fixture <FILE>, --fuzz <FILE> with --fuzz-seed <N> (default 42) and --fuzz-cases <N> (default 32), and a --watch mode bounded by --watch-max-cycles <N> (default 1000) and --watch-debounce-ms <N> (default 150).
id world doctorChecks the authoring environment — the Roc compiler, the platform, a journal, a capability ceiling and an execution profile — and exits non-zero only when a check fails; warnings do not fail it. --json prints the report as JSON.
id world replay --module <FILE> --fixture <FILE> --seed <N>Replays a recorded fixture against a compiled module. All three flags are required. The verdict line prints first; a record mismatch exits non-zero. --allow-partial accepts a partial fixture.
id world verify --module <FILE> --fixture <FILE> --seed <N>The double-replay determinism check over the same three required flags: the module is replayed twice and the first divergence exits non-zero.

id world measure --module <FILE> also runs offline, under the same sandbox gate: it measures a compiled module’s fuel use and prints one JSON object.

A guest is verified when all of the following hold:

  1. just roc-test passes — the recipe runs the Roc library expect tests for RocJson, Screen and Key with the pinned Roc compiler.
  2. id world dev over the app directory reports no failure, including its fuzz cases.
  3. A recorded session fixture replays clean under id world replay, and id world verify finds no divergence between its two replays.
  4. The checked-in .wasm build in the app directory is the build of the current source. The host conformance suites load that file; a stale .wasm tests the previous version of the app.
  5. id world contract passes for the shell surface the app presents. Run without a check file, it prints the shell contract; with --check <FILE> it fails on any violation.

With toy data, a minimal session looks like this: scaffold with id world new toy-counter, write a guest whose records returns {"count":0} at seed 1, run id world dev toy-counter --input inc, and confirm the report shows the count the toy guest’s own rules predict. The example names and inputs here are invented; no real world, token or capability is involved.

A compiled guest reaches users by two routes:

  • Direct install on a host. An operator hosts a world with id serve --world and installs the module with id world install, or pre-loads it at startup with serve --world-module <FILE>. A source-only host (started with --world-source-only) accepts Roc source installs only. The operator commands are in serve and publications and World commands: administering and verifying.
  • The program gallery. A gallery is a directory an operator serves with serve --gallery-dir <DIR> (environment fallback ID_GALLERY_DIR). Programs enter it as signed single-file program bundles — the bundle format is owned by id_worlds::program_bundle, with export and verification fully offline — and serve verifies every bundle file in the gallery directory at startup; a bundle that does not verify is not served. Admission decisions after that are operator actions, recorded on the gallery’s public transparency list and performed with the id gallery command family (parent flag --dir <DIR>, required): approve, pending, remove, refuse, reinstate, posture, response-hours and tag, each specified in Gallery, match-audit and walk. The host-side admission and operator logic lives in id_worlds::program_gallery, id_worlds::program_gallery_admission and id_worlds::program_gallery_operator; the web surface the gallery is read through is in The web UI: pages and HTTP API.

A Roc library that a guest imports goes through a second gate, separate from gallery admission: the library import gate in id-caps (library_manifest, library_resolution, library_gate, library_attach). A library declares the capabilities it needs in its manifest; resolution and the gate refuse an import whose declared capabilities exceed what the importing world may use. The worked example is examples/roc-cap-demo/, whose two negative fixtures must fail compilation, and the fixture matrix in examples/roc-import-policy/ is executed by the id-caps test named in the previous section. A new library-dependent app adds its case to that matrix in the same change.

The book, in the same change

A new example app is recorded where the book lists the apps: this chapter’s table, and Guest apps and shells as consumers where the app consumes a library surface. A change to the platform’s exposed modules, the ABI exports or the capability protocol updates this chapter and Worlds and the Roc guest runtime in the same change. The full contract is Keeping this book current.

Release and rollout

Source: pkgs/id/flake.nix (the packages set), .github/workflows/id-check.yml, pkgs/id/hosted-worker/wrangler.toml and pkgs/id/hosted-worker/README.md in https://github.com/developing-today/code/blob/main/pkgs/id/flake.nix — provenance only; this chapter is complete without following it.

ID has no versioned release process of its own: no release workflow, no tag-and-publish step and no changelog gate exists for the id binary in the repository’s workflow set. What ships is the Nix package set, built from main, and verified by the checks that run on main after each merge. This chapter states what is packaged, how a build reaches a node, and what the hosted edition’s rollout status is. The book’s own deployment is a separate subject, covered in Deploying this book; this chapter does not repeat it.

How the id binary is packaged

The packages live in the packages set of pkgs/id/flake.nix. Both are pkgs.rustPlatform.buildRustPackage derivations over the whole pkgs/id source tree, both are version 0.1.0, and both install the same single binary as bin/id.

PackageFlake nameFeature setNotes
id-webpname = "id"buildFeatures = ["web", "sandbox", "ssh", "world"]The primary product and the flake’s default package. Its build installs the web dependencies offline through the bun2nix hook (bunRoot = "web"), builds the web assets in its preBuild step, and builds the Roc platform’s Wasm host.
id-libpname = "id-lib"buildNoDefaultFeatures = true, buildFeatures = ["sandbox", "world"]The library variant: no web UI, no Bun in its build inputs, no ssh. Its feature set is the Cargo default set; the split between the two builds is explained in Building and testing.

Build either package from pkgs/id/:

nix build .#id-web
nix build .#id-lib

From the repository root, the same packages are reachable through the root flake’s sub-flake wiring in lib/default.nix, which inherits the sub-flake’s packages unchanged. The flake also generates one app per public justfile recipe from just-recipes.json; its default app runs the default package’s bin/id.

Both packages run their test phase under the ci-check profile, with the serve_tests tests skipped — those tests bind and listen on sockets, which the Nix sandbox forbids — and with a CA bundle file supplied for the check phase through SSL_CERT_FILE.

Verification on main

Merges land on main first and are verified there. The workflow .github/workflows/id-check.yml (workflow name id) is the gate:

  • On a push to main, it runs the fast checks as a parallel matrix, one job per check listed in .github/scripts/id-pr-checks.txt. A guard job checks that list against the flake first: a new flake check that is neither listed nor explicitly excluded fails the guard by name. The matrix is aggregated by a job that keeps the historical required status name nix flake check.
  • On its schedule (nightly) and on manual dispatch, it runs the full nix flake check for pkgs/id instead: the complete check set in Building and testing, in the Nix sandbox.
  • The Playwright browser tests and the NixOS VM tests are not in the push matrix. They run in .github/workflows/id-e2e-nightly.yml, nightly and on manual dispatch.

A build that is red on main is not a release candidate. There is no second channel — no beta or stable branch — between main and a deployed node.

Rolling a build out to a node

A node is one id serve process running one of the two packages against one data directory. Rolling out a new build is: build or fetch the new package, stop the old process, start the new package’s bin/id serve with the same flags and the same data directory, and confirm the node answers. The operator’s view of that work — flags, data directories and health checks — is Running a node: serve, worlds and the hosted edition.

Three format facts bound what a rollout may assume:

  • The event store’s on-disk format marker is id.events.store.v9, and a v8 store is accepted. A rollout across that boundary does not need a data migration step.
  • The tag registry file carries REGISTRY_VERSION = 1; the id-config document carries CONFIG_SCHEMA_VERSION = 1, and a document with any other schema version is rejected, not migrated.
  • Guest modules are content-verified, not version-negotiated: a gallery host verifies every bundle file at startup, and a world host loads the module it is given. Rolling out a new guest is installing the new module, per Add a Roc guest app.

No automatic update mechanism exists in the binary: id does not check for, download or apply a newer build of itself. Every rollout is an operator action.

The hosted edition: scaffold status, not a live rollout

The hosted edition has no rollout to describe, because it is not deployed. Stating its status plainly, from its own files:

  • pkgs/id/hosted-worker/ is a local-only scaffold. The header of its wrangler.toml states: this config is for wrangler dev and tests; no account-level deployment, production binding or billable resource is authorised by the package; deployment and the real-account jurisdiction canary are gated on issues #2285 and #3403.
  • Run locally, the hosted Worker’s application fails closed by design: local workerd does not implement jurisdiction restrictions, so every fully-valid request receives 503 with the error jurisdiction_unavailable. That behaviour is the scaffold working as intended, not an outage.
  • pkgs/id/worker-poc/ is a proof of concept for running one example world in a Worker isolate with journal equality against the native host. Its acceptance boxes are checked in its readme, and nothing in it is a production path. Its d1-journal-poc/ subfolder is a second local-only probe with a placeholder database ID, run only with the local flag.
  • The hosted Worker’s test suite does run in automation: .github/workflows/id-hosted-worker-tests.yml exists in the workflow set for the scaffold’s tests. Test coverage of a scaffold is not a deployment.

When the gating issues close and a deployment is authorised, the rollout procedure belongs in this chapter, written in the same change that performs the first deployment, per Keeping this book current. Until then, any text — in this book or elsewhere — that presents the hosted edition as a running service is wrong, and the concepts chapter keeps the same discipline: The hosted edition.

Two neighbouring Worker workflows are not the hosted edition and do not change this status: .github/workflows/id-mail-worker-publish.yml and .github/workflows/id-mail-worker-promote.yml concern the separate mail worker. Their existence is not evidence that id-hosted-worker is published or promoted.

This book’s own release

This book ships as the .#id-docs Nix build. Its build gate runs on main in .github/workflows/id-docs.yml, which builds only and never deploys; the actual GitHub Pages deployment is performed by a combined deploy that stages every book in the repository together, because one Pages deployment replaces the whole site. Both halves are specified in Deploying this book, and the maintenance contract that keeps the book true between releases is Keeping this book current.

Keeping this book current

Source: pkgs/id/book.toml, pkgs/id/docs.nix and .github/workflows/id-docs.yml as supplied with this book, and the contract form this chapter mirrors in pkgs/atlas-search/book/development/keeping-this-book-current.md — provenance only; this chapter is complete without following it.

A book that drifts from the system is worse than no book: agents and operators script against what it says. Before this book, ID’s documentation lived in the package documents pkgs/id/README.md, pkgs/id/ARCHITECTURE.md, pkgs/id/WEB.md and pkgs/id/TODO.md, in module-doc headers across the crates, and in the design-record archive at the repository root. That scatter drifted: the book’s research catalogued 56 numbered disagreements across its four surveys — a command table that omits a command its own file documents in a full section, a quick-start that equates two different builds, a lock filename spelled three ways. This book replaces the scatter with one reference, and this chapter states the contract that keeps it true.

The contract

Any change to a command, a flag, a default, a config key, an MCP tool, a route, a schema or an operational procedure updates the matching chapter of this book in the same change.

Concretely, in the same change as the code:

  1. A new or changed command or flag → its reference chapter, plus Add a command if the change alters the pattern that chapter teaches.
  2. A new or changed MCP tool → The MCP bridge. A new or changed web route → The web UI: pages and HTTP API or WebSocket protocols, whichever serves it. A new or changed hosted Worker route → The hosted Worker API.
  3. A changed default → every chapter that states the old default. Search the book for the value; defaults are stated in more places than you remember.
  4. A new or changed config key or environment variable → Configuration and environment.
  5. A schema or data-format change → Data stores and schemas. A new format version is described beside the old one, never written over it: the old version’s readers are still in the field during a rollout, per Release and rollout.
  6. A change to the crate layout, the workspace membership or the facade surface → Repository layout and The crates.
  7. A change to the platform package, the Plaza ABI or the capability protocol → Add a Roc guest app and Worlds and the Roc guest runtime.
  8. A changed build, test or toolchain fact → Building and testing.
  9. A changed operational procedure (ports, service shape, deploy or rollback order) → the matching operations chapter: Running a node: serve, worlds and the hosted edition or Release and rollout.
  10. A changed deployment of the book itself → Deploying this book.

“Same change” means the same pull request (or the same run, for non-PR work). A follow-up issue promising to update the book later does not satisfy the rule — that is exactly how the pre-book documentation drifted into the disagreements named above.

Two disciplines ride with the rule:

  • Designed versus shipped. Chapters in this book’s design section are marked as designs, name their tracking issues, and never present a designed behaviour as if it works today. The discipline applies outside the design section too: the hosted edition is a local-only scaffold, and every chapter that touches it — The hosted edition, The hosted Worker API, Release and rollout — states that status instead of describing a live service. A spelling that is designed but not shipped is documented as contract, not surface.
  • Source over help. Where help text and source disagree, the book documents the source behaviour and calls out the discrepancy until the stale side is fixed. Worked examples already in the book: id list has no ls alias in the parser although the package README’s command table gives it one — the alias exists only inside the REPL and on tag list — and the serve --topic help presents the hardcoded fallback constants as the defaults, although the operative defaults normally come from the embedded defaults.json. Do not “fix” a discrepancy by silently copying the wrong side into the book.

A third, smaller discipline governs numbers: test counts are dated measurements. A count is stated with the run, the date and the commit it was measured at, or it is marked unverified. Standing totals copied from older documents are how the pre-book counts — repeated identically across three package documents, substantiated by none of them — survived for months.

The two build gates

The contract is enforced by two gates, and they are the whole of its teeth today:

  1. create-missing = false. The book’s configuration, pkgs/id/book.toml (title id, sources in pkgs/id/book/), sets create-missing = false under [build]: a chapter listed in SUMMARY.md that does not exist is a build failure, never a generated stub. A new chapter is therefore a real file, written by its author, or the build is red.
  2. The .#id-docs Nix build on main. The workflow .github/workflows/id-docs.yml runs nix build .#id-docs --print-build-logs on every push to main and on manual dispatch, then stages the result and checks that the staged tree contains an index.html. The derivation is pkgs/id/docs.nix: it renders book.toml plus the book/ tree with the flake-pinned mdBook, with no network access, exactly as the deploy will render it. The workflow builds only; it never deploys — deployment is the combined Pages deploy described in Deploying this book.

An honest limitation, recorded so nobody over-trusts the gates: neither gate checks that a chapter’s contents still match the code. They prove the book is complete and renders; the same-change rule above, enforced by review, is what keeps it true — which is why this chapter exists in the book itself, where a contributor changing a surface will meet it.

Where the rule is recorded

The rule lives in two places, which must agree:

  1. This chapter — the book stating its own maintenance rule, so a reader who arrived here first can find the whole contract.
  2. The DOC-01 contract in pkgs/id/README.md — a contract section in the package readme, naming this book as the package’s documentation of record and restating the same-change rule for a contributor who meets the package root before they open the book.

The second recording is stated here as the contract’s requirement, in the future tense where it belongs: at the time this chapter was written, pkgs/id/README.md contained no DOC-01 section — its documentation pointer still described the docs/ symlink as feature documentation, which the design survey records as disagreement DES-5. Adding the DOC-01 section to the readme is part of landing this book, and until it lands, this chapter is the rule’s only recording. If the two recordings later disagree, the readme wins for package-scope questions and this chapter wins for book-scope questions — and the disagreement itself gets fixed in the same pass it is noticed.

The book’s own form rules are part of the contract: every file starts with its exact chapter title (the SUMMARY.md text) as its single # heading, and internal links are relative .md links whose text is the target chapter’s title. Both keep SUMMARY.md, the file and the rendered page in agreement, and keep the book readable in the repository as well as on the rendered site.

Build and preview the book locally

  1. From pkgs/id/, with mdBook available, build in place:

    mdbook build
    

    The rendered site lands in the build directory named by book.toml, which is rendered. Open its index.html to preview.

  2. Or build the packaged form, exactly as the gate and the deploy build it, from the repository root:

    nix build .#id-docs
    

    The result is the rendered site; serve or open result/index.html to check links, search and chapter order before merging.

Either route is a valid pre-merge check. The Nix route is the stronger one: it is the same derivation the gate and the deploy use, with the same mdBook version, and it applies the link rewriting for pages outside the book tree that a plain mdBook build does not.

Running a node: serve, worlds and the hosted edition

id serve is the only command that hosts anything. Every other command in serve and publications and in the world family is a client of a running serve, or works on a local store. This chapter is the operator version: what to pass, what it binds, what it writes to disk, and what stops working when the process stops. The full flag list is in serve and publications; the data layout behind it is in Backup, restore and data directories.

The basic node

id serve

With no flags, serve:

  • opens the blob and name store in the data directory (the current directory by default, or the directory given to the global --data-dir <DIR> flag, or the directory created by the global --new [<NAME>] flag);
  • takes the serve lock .iroh-serve.lock in that data directory (see “The serve lock” below);
  • starts an Iroh QUIC endpoint on port 0. Port 0 is the literal default of --iroh-port <PORT>: the operating system assigns the port. There is no fixed Iroh port to open in a firewall;
  • announces and discovers peers with gossip, mDNS and the relay, all on by default;
  • serves no web UI and hosts no world. Both are opt-in flags, below.

Serve runs until it is interrupted. There is no daemon mode, no service unit in the repository, and no stop verb: the operator runs the process in the foreground, in a terminal multiplexer, or under a supervisor of their own choosing. Unverified: this book found no systemd unit, launchd plist or other supervisor definition for id serve in the source tree.

Two local nodes that Drew runs are recorded in the standing record, not in the source: a demo node on laptop loopback port 3210 and a production node on laptop port 3005. Unverified against source: neither 3210 nor 3005 appears in pkgs/id/ or in the home configuration in the checkout; both are web ports chosen by the operator at launch, presumably with --port <PORT>, and a fresh id serve does not use either number.

Data directory selection

The global flags decide where a node lives, and they apply to every command, not only to serve:

FlagEffect
-d, --data-dir <DIR>Use <DIR> as the base directory for .iroh-store, .iroh-key and .iroh-serve.lock. The directory is created if missing. The process changes directory into it at startup. Conflicts with --new.
--new [<NAME>]Create .iroh/<NAME>/ under the current directory and use it as the data directory. With no name, a random 8-hex name is used. Startup fails if the directory already exists. The name must not contain /, \ or ...

Running two nodes on one machine means two data directories. Two serves in one data directory do not work; the second one meets the serve lock and the single-opener store lock (see Troubleshooting).

The web UI

FlagDefaultEffect
--weboffStart the HTTP web UI. Startup fails on a build without the web feature; see Troubleshooting.
--port <PORT>3000Web port. 0 lets the operating system assign the port.
--bind <IP>127.0.0.1Web bind address. The default binds loopback only.
--web-listen <IP:PORT>noneRepeatable. Replaces the web_bindings list from defaults.json. Startup fails if --web-listen is combined with an explicitly set --bind or --port.
--web-token <TOKEN>unsetGate token for the web UI, accepted as the id_token cookie, as Authorization: Bearer, or as a ?token= query parameter that sets the cookie and redirects. The environment variable ID_WEB_TOKEN sets the same value. The value is never printed in this book.
--web-cookie-secureoffMark web cookies Secure. The environment variable ID_WEB_COOKIE_SECURE sets the same flag.

Startup prints a warning when a web listener is bound without --web-token. On a loopback bind the web layer also enforces a Host allow-list (localhost, 127.0.0.1, ::1, plus operator extras) and a same-origin check on requests that carry an Origin header. Binding to a non-loopback address without a token removes the loopback protection and leaves the token as the only gate; the book states the mechanism and makes no recommendation beyond that fact. The pages and routes themselves are in The web UI: pages and HTTP API.

Hosting a world

FlagDefaultEffect
--worldoffHost a multiplayer world. Requires --world-admin-token <TOKEN>.
--world-admin-token <TOKEN>unsetThe admin token for the hosted world. The environment variable ID_WORLD_ADMIN_TOKEN sets the same value. The value is never printed in this book.
--world-name <NAME>lobbyName of the default world. Its files live in .id-worlds/<NAME>/ inside the data directory. The name uses the characters a-z, 0-9, - and _.
--world-module <FILE>noneA precompiled Wasm module (Roc ABI) to load into the world. Requires --world and a build with the sandbox feature.
--world-checkpoint-every <N>1000Journal events between checkpoints. 0 never trims the journal.
--world-max-open <N>256Maximum open worlds.
--world-max-sessions <N>1024Maximum world sessions.
--world-idle-secs <N>600Seconds before an idle world is closed. 0 keeps worlds open.
--world-boot-window-secs <N>600Replay-refusal window after startup, in seconds. 0 disables it.
--world-cap-policy <POLICY>denyCapability policy for the default world’s program. The other documented value is grant-on-use.
--world-allowed-caps <NAMES>noneComma-separated server-wide capability ceiling. The value * is refused here.
--world-cap <NAME>noneRepeatable. One capability for the default world’s program. * means the whole catalog.
--world-ssh-port <PORT>noneServe the world over SSH, bound to the --bind address. Requires --world. Actual SSH serving exists only in a build with the ssh feature.
--world-nativeoffAccept native (ELF) module installs, in the OS-sandbox tier.
--world-source-onlyoffAccept Roc-source installs only. Conflicts with --world-module. The environment variable ID_WORLD_SOURCE_ONLY sets the same flag.

The runtime limits for guest execution are flags in the same family: --world-fuel <UNITS> (default 10000000), --world-memory-mib <MIB> (default 16), --world-message-kib <KIB> (default 1024), --world-total-memory-mib <MIB> (default 64), and the native-tier limits --world-native-memory-mib <MIB> (default 256), --world-native-cpu-secs <SECS> (default 10) and --world-native-deadline-ms <MS> (default 10000). Confirmation mail for world sign-up has three mutually conflicting sinks, all requiring --world: --world-mail-outbox <DIR>, --world-mail-command <PROG> and --world-mail-smtp <IP:PORT> (SMTP also requires --world-mail-from <ADDR> and must be loopback).

A toy world host, with invented values:

id --data-dir toy-node serve --web --world --world-admin-token toy-admin-token --world-name lobby

Clients then join with the commands in World commands: joining and playing. Administration is in World commands: administering and verifying.

Discovery: relay, gossip, mDNS and DHT

FlagDefaultEffect
--no-relayrelay onDirect connections only; no relay is used.
--no-gossipgossip onNo gossip discovery or announcement.
--gossip—Force gossip on. Conflicts with --no-gossip.
--no-mdnsmDNS onDisable mDNS local discovery.
--dhtoffEnable mainline DHT address lookup and publishing. The flag parses in every build; the dht cargo feature controls the underlying behaviour in id-sync.
--bootstrap <IDS>from defaults.jsonComma-separated bootstrap node IDs. Repeatable through the comma delimiter.
--no-default-bootstrap—Ignore bootstrap IDs from defaults.json.
--topic <TOPIC>see belowGossip topic.
--topic-secret <SECRET>see belowGossip topic secret. The value is never printed in this book.
--no-default-topic—Ignore topic and secret from defaults.json; fall back to the hardcoded constants.

The topic defaults need care, because --help states them in a way that misleads. The help text gives --topic a default of id-peer-discovery-v1 and --topic-secret a default of id-public-discovery-v1. Those two strings are the hardcoded fallback constants. The operative default on a stock build comes first from the embedded defaults.json, whose shipped content sets topic to id-peer-discovery-v1 and topic_secret to id-public-discovery-v1 — the same strings today, by coincidence of the shipped file, not by the help text’s logic. If defaults.json changes, serve follows the file, not the constants, unless --no-default-topic is passed. The --version output reports which defaults source is in force, as a second line naming the file hash and mode (append or the built-in equivalent). This is disagreement CLI-6 in the survey record. The full configuration precedence is in Configuration and environment.

Who may write

FlagDefaultEffect
--allow-node <IDS>noneRepeatable, comma-separated. Node IDs allowed to write the store. The file .iroh-allowed in the data directory (one node ID per line) adds more, and this machine’s own keys are always allowed.
--open-writesoffAny peer may write the store. The help text documents this as insecure.

With neither flag, writes from other nodes are not accepted beyond this machine’s own keys and the .iroh-allowed list.

FlagDefaultEffect
--gallery-dir <DIR>unsetServe a program gallery from <DIR>: the Iroh registry plus the /api/gallery/* routes when --web is on. Every bundle file in the directory is verified at startup. The environment variable ID_GALLERY_DIR sets the same value.
--gallery-accept-publishoffAccept gallery publishes. Requires --gallery-dir. The environment variable ID_GALLERY_ACCEPT_PUBLISH sets the same flag.

Without a gallery directory, the gallery routes answer 404. Operating the gallery (approval, removal, reinstatement) is in Gallery, match-audit and walk.

Server config and ephemeral mode

FlagDefaultEffect
--server-config <FILE>noneLoad an operator server-config TOML file: provisioned users and groups, create policy, pull policy, budgets, residency and boundaries. A malformed file fails startup and names the parse error. Loading requires a build with the world feature. The key list is in Configuration and environment.
--ephemeraloffUse an in-memory store. All content is lost when the process exits. No .iroh-store on disk is the record for an ephemeral node.

An ephemeral node is the right shape for a throwaway test peer and the wrong shape for anything whose files must survive the terminal closing. Nothing about --ephemeral is written to the data directory’s store, because there is no store.

Operator server-config and compile-cache environment

Serve reads three environment variables outside the flag parser:

VariableEffect when set
ID_WORLD_COMPILE_CACHE_DIRDirectory for the shared compiled-world cache. Unset or empty disables that cache.
ID_WORLD_COMPILE_CACHE_LRU_BYTESSize limit for that cache. An unparsable value falls back to the default of 2 GiB.
ID_APPS_DIRApps root for host app discovery. Unset falls back to the built-in apps root.

For --world-mail-command, serve sets ID_MAIL_TO, ID_MAIL_SUBJECT and ID_MAIL_BODY in the child process environment. Those are outputs of serve, not settings an operator provides.

The serve lock

While serve runs, the data directory holds .iroh-serve.lock. Two readers depend on it:

  • a second id serve in the same data directory cannot take the store while the first holds it;
  • the REPL detects the lock at startup and switches to its Remote mode, proxying operations to the running serve instead of opening the store directly. See The interactive REPL.

The lock file name is .iroh-serve.lock, from the constant SERVE_LOCK in id-core. A module comment in serve.rs spells a different name, .id-serve-lock; that spelling is wrong and no file with that name is created. This is disagreement CLI-5 in the survey record. Deleting a lock file by hand is not a procedure this book documents: stop the serve process that owns the directory. What to do when a lock outlives its process is in Troubleshooting, marked there as unverified because the surveys record no stale-lock recovery path in the code.

Publications on a running serve

Three client commands operate on a live serve and on nothing else: id publish <WORLD>, id unpublish and id publications. They connect with the serve node’s own key, fail when no serve is running, and never edit local state. publish requires exactly one placement, --listen <ADDR> or --path <PATH>; giving neither or both is the error exactly one placement is required: --listen ADDR or --path PATH. The full treatment is in serve and publications.

The hosted edition: what an operator can run today

The hosted edition is a Cloudflare Worker package, pkgs/id/hosted-worker, with a per-user Durable Object class named UserDO. Its status is exact:

  • The package is a local-only scaffold. Its wrangler.toml header states that the config is for wrangler dev and tests, and that no account-level deployment, production binding or billable resource is authorised by the package. Deployment and the real-account jurisdiction canary are gated on issues #2285 and #3403.
  • An operator today can run it locally under wrangler dev and run its test harness (wrangler.test.toml). An operator today cannot deploy it as a production service from this package, point real users at it, or treat it as a running hosted node. There is no hosted URL in the source.
  • Locally, the Worker fails closed: local workerd does not implement jurisdiction restrictions, so the application Worker returns 503 with the error jurisdiction_unavailable for every fully valid request, by design. That response locally is the correct behaviour, not an outage. See Troubleshooting.
  • The Worker’s front door does not authenticate end users itself. It consumes context headers (X-Binding-Id, X-Jurisdiction, and X-Iroh-Id) set by an authenticated internal caller; the binding ceremony that produces them is native code, in pkgs/id/src/hosted_binding.rs. The Worker strips every client-supplied internal header and re-sets them internally before forwarding to the UserDO through the jurisdiction-restricted namespace only.
  • Its bindings, in the local config, are the Durable Object namespace USERS (class UserDO), the R2 bucket binding BLOBS (bucket name id-hosted-blobs, local emulation only), and the optional string variables USER_CEILING_BYTES, BRIDGE_WAITING_PER_AUTHOR, BRIDGE_WAITING_TOTAL and BRIDGE_WAITING_MAX_AGE_MS.

What the hosted edition would hold for a bound user, once deployed, is one UserDO per binding ID holding that user’s key-value data, blob references and a signed-object bridge store. The routes are in The hosted Worker API and the design is in The hosted edition. Neither chapter changes the status above: scaffold, local only.

A second package, pkgs/id/worker-poc, is a proof of concept that runs one example world in a Worker isolate and proves journal equality against the native wasmtime host. It is not a production path and an operator has no reason to run it outside its own tests.

Exit behaviour for operators

Serve has no special exit codes of its own. The id binary’s contract, from The id command line, is:

ExitMeaning
0Success, including --help and --version.
1A handler error. The error chain is printed to stderr as Error: <message>. Startup failures (malformed --server-config, the --web-listen conflict, a build without a required feature) are in this class.
2A command-line parse error: unknown flag, missing required argument, conflicting flags, bad value. Usage is printed to stderr.

A script that supervises serve should treat exit 1 at startup as a configuration fault to fix, not a transient fault to retry unchanged.

Backup, restore and data directories

A node’s whole state lives in its data directory. This chapter names every part of that directory, states which parts are the record and which parts can be derived again, and gives the restore shape that follows from the code. One limit runs through the chapter and is stated here, not buried: there is no backup verb and no restore verb for a whole node in the id CLI. The two exceptions are narrow and are named where they belong: id world journal backup <DIR> <OUT> for one world’s journal, and the key export commands in Groups, documents, claims and keys. Everything else in this chapter is file copying done by the operator, and each step that the surveys could not verify against code is marked unverified.

The store formats themselves are in Data stores and schemas. Running the node is in Running a node: serve, worlds and the hosted edition.

Where the data directory is

How the node was startedData directory
No global flagsThe current working directory.
--data-dir <DIR><DIR>, created if missing.
--new [<NAME>].iroh/<NAME>/ under the current directory; a random 8-hex name when <NAME> is omitted.
--ephemeral (serve only)No store on disk. The store is in memory and is lost at exit. There is nothing to back up.

All paths below are relative to the data directory, because the process changes directory into it at startup.

The directory, item by item

PathWhat it isBack it up?
.iroh-store/The blob and name store: iroh-blobs FsStore (redb plus data files). The iroh-docs store sits under .iroh-store/docs/. This is the content-addressed store: a name points at an immutable blob hash, and the blob bytes are the file content.Yes. This is the record for stored files.
.iroh-keyThe node key file. The keypair for this node’s identity. A second file, .iroh-key-client, holds the client key where a client identity exists.Yes. Losing the key loses the identity; the store without the key is content under a name nobody can prove is theirs. Keep the copy access-controlled; this book never prints a key value.
.iroh-serve.lockThe serve lock, present while a serve process owns the directory. Constant SERVE_LOCK in id-core.No. It is runtime state, recreated by the next serve. Do not copy it into a backup as a record, and do not expect it in a restored directory.
.iroh-allowedOptional plain-text file, one node ID per line, naming nodes allowed to write the store in addition to --allow-node <IDS> and this machine’s own keys.Yes, if present. It is operator configuration that exists nowhere else.
groups.jsonlThe default group log for the group, delegate and revoke commands. The global flag --groups-log <FILE> moves it; a relative path is relative to the data directory.Yes. Group membership and delegation history live here.
events/The default event-store directory for the doc, claim and writer-sets commands. The global flag --event-store <DIR> moves it; a relative path is relative to the data directory. Inside it, the event store file is events.redb, format marker id.events.store.v9.Yes. Documents, claims and writer sets live here.
.iroh-meta/registry.jsonThe tag registry: namespace records for the tag store (global, node-private and custom paired namespaces) plus a one-time migration marker. Registry format version 1.Yes. Tags themselves live in the iroh-docs namespaces under .iroh-store/docs/; the registry records which namespaces exist. Back it up together with .iroh-store/, never instead of it.
.id-worlds/<NAME>/One directory per hosted world, named by --world-name <NAME> (default world name lobby). Holds the world’s journal and its checkpoints: the signed, ordered record of world inputs and the folded state snapshots the host trims to every --world-checkpoint-every <N> events (default 1000; 0 never trims).Yes, for every world the node hosts. A world’s journal is its record; see below.
.id-keyset.jsonl, .id-keyset-client.jsonlKeyset records: device enrolment, guardians, rotation and recovery state for the account keyset.Yes, if present.
directory.jsonlThe directory journal: one JSON DirectoryEntry per line. Unverified location detail: the survey records its location as the directory that holds the server-config file given to --server-config <FILE>, not as a fixed data-directory path. Back up the copy that sits next to the server-config file the node actually loads.Yes, if the node runs with a server config.
Gallery directory (--gallery-dir <DIR>, or ID_GALLERY_DIR)Verified <content-hash>.idpb bundle files plus an operator/ subdirectory holding collections, tags and admission decisions. The directory is wherever the operator put it; it is not inside the data directory by default.Yes, if the node serves a gallery. Back up the directory the flag points at.

Files a node writes outside the data directory, and therefore outside a data-directory backup: the log file named by ID_LOG_FILE (operator logging, not node state), the compiled-world cache named by ID_WORLD_COMPILE_CACHE_DIR (derivable; see below), and the gallery directory above.

What is the record, and what is derivable

The store is the record. Blobs are content-addressed: the hash is computed from the bytes, so a blob either matches its hash or is corrupt, and no index can invent a blob that is not there. Names and tags point at hashes. Copying .iroh-store/ copies the files; copying any index, cache or listing without it copies pointers to content the restore will not have.

Derivable or replaceable, and therefore not backup-critical:

  • Blob bytes that other nodes hold. A blob can be fetched again from a peer that has it, by hash, with id get-hash <HASH> <OUTPUT> or by name from a remote node. That is replication, not backup: it works only while a peer holding the blob is reachable, and this book does not present it as a substitute for a copy the operator controls.
  • The compiled-world cache (ID_WORLD_COMPILE_CACHE_DIR). Compiled modules are produced from Roc source or precompiled modules by compiling again. Losing the cache costs compile time, not state.
  • A world’s folded state, given its journal and checkpoints. World state is a fold over the journal. The journal plus the module rebuild the state by replay; a checkpoint is a saved fold at one point in that journal, so replay after a checkpoint starts there instead of at event one. That is why the journal and checkpoints are the backup, and a memory image of a running world is not a backup format at all.
  • The serve lock, web assets and the book. The lock is runtime state. Web assets are embedded in the binary at compile time. Neither is node data.
  • Search or listing output. Anything id list, id find or id search prints is computed from the store at call time.

Not derivable, and therefore the backup itself: .iroh-store/, .iroh-key (and .iroh-key-client where present), groups.jsonl, events/, .iroh-meta/registry.json, each .id-worlds/<NAME>/, the keyset files where present, .iroh-allowed where present, and the server-config TOML file itself, which lives wherever the operator put it.

Backing up: the manual shape

Unverified as a product procedure: the steps below are the file-copy shape that follows from the directory layout above. No command in the CLI performs them, and the surveys record no tested whole-node backup procedure in the repository. Treat this section as an operator procedure to test on a toy node before trusting it on a real one.

  1. Stop the serve process for the data directory. The store is a single-opener redb database and the world journals are append-only files a running host is writing; a copy taken under a running serve is a copy of files in motion. Unverified: the surveys record no online-backup or snapshot mode in the code.
  2. Copy the whole data directory, including hidden files. In a toy example with invented names:
cp -a toy-node/ toy-node-backup-01/
  1. Copy, separately, the files that live outside the data directory and belong to this node: the server-config TOML (if the node uses one), its directory.jsonl (see the table above), and the gallery directory (if the node serves one).
  2. Verify the copy holds the items in the table: .iroh-store/, .iroh-key, groups.jsonl, events/, .iroh-meta/registry.json and .id-worlds/ where those exist. A backup missing .iroh-key is a backup of content without its identity.

For one world’s journal only, there is a real verb:

id world journal check <DIR>
id world journal backup <DIR> <OUT>

journal backup requires the output path <OUT> to not already exist, and it checks the journal first: a journal that fails journal check is not backed up by this verb. journal check exits non-zero when the journal is invalid or was written in a newer format than the binary reads. See World commands: administering and verifying.

Keys have their own export path, separate from file copying: id key export <OUTPUT> writes a key file (passphrases are hidden prompts, never flags), id key export-seed prints a 24-word phrase once and writes no file, and id key import <INPUT> and id key import-seed reverse them. The --client flag selects the client key. Details are in Groups, documents, claims and keys.

Restoring: the manual shape

Unverified as a product procedure: there is no restore verb. The shape below is the reverse of the backup above, and the same warning applies: test it on a toy node first.

  1. Install an id binary of a build that reads the backed-up formats. Format versions are real constraints here: an event store at id.events.store.v9 is read by a binary that knows v9 (v8 is also accepted by the current code); a world journal written in a newer format than the binary reads fails journal check. An old store binary is a known failure shape in the other direction too; see Troubleshooting.
  2. Place the copied data directory where the restored node will run, with the hidden files intact and the key files access-controlled.
  3. Do not restore .iroh-serve.lock as a live lock. If a copied lock file is present and no serve is running, the surveys record no code path that clears or ignores a stale lock; that gap is listed in Troubleshooting as unverified. Unverified: whether a leftover lock blocks the next serve or the REPL’s mode detection only.
  4. Start the node pointed at the restored directory:
id --data-dir toy-node-restored serve --web
  1. Check the restore before declaring it done: id --data-dir <DIR> list names the stored files, id world journal check <DIR> passes for each hosted world directory the node must serve, and a known file fetched by name matches the content the operator expects. A serve that starts is not, by itself, proof that the right directory was restored.

Restoring a single world journal backup made by id world journal backup <DIR> <OUT> into a world directory is unverified: the surveys record the backup verb and the check verb, and no restore or import verb for a journal backup file. This book does not invent one.

The hosted edition

There is nothing for an operator to back up in the hosted edition today, because there is no deployed hosted service: the Worker package is a local-only scaffold (see Running a node: serve, worlds and the hosted edition). Inside that scaffold, a user’s data would live in one UserDO Durable Object (SQLite tables at schema version 3) with blob bytes in the R2 binding BLOBS, and the UserDO exposes a GET /v1/export route that returns the full key-value and blob index export. Unverified as a restore path: the surveys record the export route and no corresponding import or restore route in the Worker. Do not describe hosted export as hosted backup and restore.

Troubleshooting

Every entry here is a recorded failure shape, from the surveys behind this book or from a numbered disagreement in them: the symptom as an operator sees it, the cause in the code, and the fix that follows from the cause. Where the surveys record no fix, the entry says so instead of inventing one. The operator companion to this chapter is Running a node: serve, worlds and the hosted edition; exit codes for the whole CLI are in The id command line.

The id binary’s exit contract, because half of scripting against it goes wrong here: success is 0; a handler error prints Error: <message> to stderr and exits 1; a command-line parse error prints the clap error and usage to stderr and exits 2. There is no per-command exit-code table. The REPL is the exception: once its prompt is running, a failed command prints the error and the REPL continues, still exiting 0 on a normal quit.

An old store binary disagrees with the source (CLI-4)

Symptom. A command or flag behaves as no chapter in this book describes: id serve --replace-defaults is accepted, --help spells the defaults file defaults.conf, there is no walk command, or --version prints one line only.

Cause. The Nix store on a machine can hold many builds of id-0.1.0 of different ages — the survey counted 23 — and they are not the same program. Older builds predate the current source: current source rejects --replace-defaults (a regression test asserts the parse error), spells the file defaults.json, has walk, and prints a two-line long version whose second line reports the embedded defaults provenance (defaults: file sha256=… mode=append, or the built-in equivalent). A second trap on the same machine: /etc/profiles/per-user/user/bin/id can be GNU coreutils id, a different program entirely, which answers with user and group IDs and knows none of these commands.

Fix. Establish which binary is running before debugging anything else: id --version must print the two-line form, and id walk --help must exist. Build or select a binary from current source and put that binary first on the path the operator actually uses. Do not debug a flag against a binary whose --version output does not match the source generation the book describes.

Serve will not start: the data directory is already owned

Symptom. A second id serve in a data directory fails to open the store, or a walk serve reports that its node directory is held, or local commands behave as if a serve were running when the operator believes none is.

Cause. Two locks, both by design. The blob store is a single-opener redb database: one process holds .iroh-store/ at a time. While a serve runs, the data directory also holds the serve lock .iroh-serve.lock, and the REPL reads that lock at startup to decide its mode — lock present means Remote mode, proxied to the serve. A node directory given to id walk is likewise held by one process at a time; walk serve holding it is the recorded reason another walk command against the same directory reports it held rather than waiting.

Fix. Find and stop the process that owns the directory, then start again. Run the second node in a second data directory (--data-dir <DIR> or --new [<NAME>]) when two nodes are wanted at once. One naming trap while checking: the lock is .iroh-serve.lock. A module comment in serve.rs spells it .id-serve-lock; no file with that name exists, and looking for it finds nothing and proves nothing (disagreement CLI-5). Unverified: the surveys record no stale-lock recovery path — no code that detects a lock left by a dead process and clears it, and no documented manual removal procedure. If a lock file remains after its process is confirmed dead, this book records the gap rather than prescribing a deletion.

The gossip topic is not the one in --help (CLI-6)

Symptom. A node does not discover the peers it was expected to discover, or two nodes started with no topic flags do not meet, and the operator’s reading of --help says both used the default topic id-peer-discovery-v1.

Cause. --help presents the hardcoded constants as the defaults: topic id-peer-discovery-v1, secret id-public-discovery-v1. The operative default normally comes first from the embedded defaults.json (keys topic, topic_secret, bootstrap, web_bindings, and a mode of append or replace). The constants are the fallback, used when the file supplies nothing or when --no-default-topic is passed. Two builds with different embedded defaults files therefore start on different topics while both --help outputs read the same.

Fix. Compare the defaults source, not the help text: id --version prints the provenance line naming the defaults file hash and mode in force. Pass --topic <TOPIC> (and --topic-secret <SECRET> where a secret is in use) explicitly on every node that must meet, or pass --no-default-topic on all of them to force the hardcoded constants on all of them. The same file-first rule applies to bootstrap peers (--no-default-bootstrap ignores the file’s list) and to web bindings. Full precedence is in Configuration and environment.

serve --web fails: this build has no web feature

Symptom. Startup fails with the error stating that the web interface was requested (--web/--web-listen/--port/--bind) but the binary was built without the web feature, and naming the rebuild flag.

Cause. The web UI is the optional id-web crate behind the root web feature. The Nix package id-web (the default package) is built with web + sandbox + ssh + world; the package id-lib is built with sandbox + world only — no web, no ssh. On an id-lib build the serve web flags parse and then fail at runtime with that error. Before the runtime guard existed, --web on such a build was silently accepted and served nothing; the loud failure is the fixed behaviour.

Fix. Run a build with the web feature — the id-web package, or a Cargo build with --features web. Do not read the error as a configuration fault in the flags themselves. The same build-shape logic explains two neighbours: --server-config <FILE> on a build without the world feature fails at startup naming the missing feature, and --world-module <FILE> on a build without the sandbox feature fails the same way.

--web-listen combined with --bind or --port (#2145)

Symptom. Serve refuses to start, naming the conflict between --web-listen and --bind/--port.

Cause. --web-listen <IP:PORT> replaces the whole web_bindings list from defaults.json. --bind <IP> and --port <PORT> set the single-listener form of the same thing. The two forms are alternatives, and serve reads explicitness from the command-line value sources: a --bind or --port the operator actually typed, combined with any --web-listen, is a startup error. Values that merely came from defaults do not trigger it.

Fix. Choose one form. One listener: --bind <IP> --port <PORT> (defaults 127.0.0.1 and 3000). Several listeners, or a program or document listener: --web-listen <IP:PORT> repeated, and no --bind or --port on the same command line.

id group join always fails (CLI-9)

Symptom. id group join <INVITE> parses the invitation ticket and then fails, every time, with the message that group join is unavailable: invitation parsing works, but admission and network acceptance are not implemented yet, and no group membership was recorded. The process exits 1.

Cause. The handler is a stub by design at this revision. The top-level help summary for group lists “join” among its verbs, which is the misleading side (disagreement CLI-9); the subcommand’s own help states “Unavailable” as its first line, and the handler matches it. A malformed ticket fails earlier, with the invitation parse error, which is a different failure from the stub message.

Fix. None in the CLI today. Do not retry, do not regenerate the ticket as a remedy for the stub message, and do not script membership on top of group join. Groups are created and managed with the other verbs in Groups, documents, claims and keys; admission by invitation is recorded there as unimplemented.

World commands and match-audit vanish, or world bails at runtime (CLI-10)

Symptom. One of two shapes, on the same class of reduced build. Either id match-audit … and the world subcommands dev, measure, replay and verify are absent — clap answers unrecognized subcommand and they do not appear in --help — or id world … shows its full help tree and then every invocation fails with this build has no world support.

Cause. The feature gates are inconsistent, and both shapes are the code working as written (disagreement CLI-10). match-audit and those four world subcommands sit behind the sandbox feature in the parser itself: no sandbox, no variant, no help entry. The rest of world is not parser-gated: the command tree exists in every build, and a build without the world feature defers the failure to a runtime bail in the binary’s dispatch. A --no-default-features build shows both shapes at once. The default build (sandbox + world) has all of them, and lacks only the web UI and world SSH serving, which are separate features. Note that id walk is gated by nothing and works in every build.

Fix. Identify the build before debugging the command: absence from --help means the feature was off at compile time, and no flag at run time adds it. Use the default build, or the Nix id-web package (web + sandbox + ssh + world), for the full surface. The feature table is in The id command line.

REPL: cat file | head -5 does not pipe (CLI-7)

Symptom. In the REPL, the line cat myfile.txt | head -5 — copied from the README’s REPL example — does not print the first five lines. It falls through to the REPL’s unknown-command handling.

Cause. The REPL has no | operator. Its input language has exactly four operators: the heredoc <<DELIM, the here-string <<<, the pipe-in operator |> and $(…)/backtick command capture. A plain | is just another word: the line is whitespace-split, cat receives extra arguments |, head and -5, no dispatch pattern matches, and the line falls to the unknown-command handling. The README example is the wrong side (disagreement CLI-7). Errors of this kind inside the REPL print and continue; the REPL does not exit.

Fix. Use the operators that exist, in the direction they run. To store a shell command’s output: put $(head -5 myfile.txt) name, or the pipe-in form head -5 myfile.txt |> put - name. To view part of a stored file, use the REPL’s peek <QUERY> (5 head and 5 tail lines by default; --lines <N>, --head-only and --tail-only adjust it) or cat the whole file. The full input language is in The interactive REPL.

The hosted Worker answers 503 jurisdiction_unavailable

Symptom. Run locally, the hosted Worker returns 503 with the error jurisdiction_unavailable for a request that is fully valid in every other respect.

Cause. By design. Local workerd does not implement jurisdiction restrictions, and the Worker fails closed rather than serve a request whose jurisdiction it cannot enforce. The package is a local-only scaffold: its config authorises wrangler dev and tests, and no production deployment. Every other UserDO route also runs a common guard — routing context present, runtime jurisdiction matching, and the persisted binding and jurisdiction matching the first routed request that bound them — and fails closed when any leg fails.

Fix. None locally, and none needed: 503 jurisdiction_unavailable from a local run is the correct answer, not an outage to clear. There is no flag in the package that turns jurisdiction enforcement off. What the hosted edition is and is not today is stated in Running a node: serve, worlds and the hosted edition and The hosted Worker API.

A malformed --server-config fails startup, naming the parse error

Symptom. Serve exits 1 at startup and the error names a TOML parse problem in the server-config file.

Cause. The file given to --server-config <FILE> is loaded at startup and a malformed file fails fast, before the node serves anything. An empty file is valid; every table in the format is optional. Two documented keys are easy to miss because the module’s own doc comment under-lists them: the [budgets] table implements five keys, including app_inbound_bytes_per_second and per_peer_burst_bytes_per_minute, where the doc comment names three (disagreement WEB-14).

Fix. Correct the TOML at the position the parse error names, and check any budget behaviour against the key list in Configuration and environment rather than the module doc comment. A missing feature is a different startup error with a different fix: on a build without the world feature, --server-config fails naming the feature, not the file.

Quick checks before filing anything

CheckWhat it settles
id --version prints two linesThe binary is a current-source build, and the second line names the defaults source in force.
id walk --help existsThe binary is not one of the old store builds (CLI-4).
The data directory holds .iroh-serve.lockA serve owns that directory now, or a lock outlived its process (unverified case, above).
id world journal check <DIR> exits 0That world’s journal is valid and readable by this binary.
Exit code is 2The command line itself was rejected; fix the flags before investigating the node.

Deploying this book

This book is one of four books on one GitHub Pages site. That single fact decides everything about how it deploys: the id book is never deployed on its own. Its build is checked on its own; its deployment happens only as one staging step inside the combined deploy that publishes the whole site at once. The live book is at https://developing-today.github.io/code/id/.

The pieces

PieceWhat it is
pkgs/id/book/The book sources — the Markdown chapters, in the layout the summary file names
pkgs/id/book.tomlThe mdBook configuration: title id, src = "book", build-dir = "rendered", create-missing = false — a chapter named in the summary but missing on disk is a build failure, never a silently generated stub
pkgs/id/docs.nixThe build: an mdBook build of the sources above, sandboxed, with the flake-pinned mdBook from nixpkgs and no network access. It rewrites links that escape the book tree to their repository URLs in the rendered copy only, and takes the base URL as its siteUrl argument
lib/default.nixExposes that build to the flake as .#id-docs
.github/workflows/id-docs.ymlThe build-only workflow for this book (below)
.github/workflows/mcpx-docs.ymlThe combined deploy workflow for the whole Pages site (below)

Build the book locally exactly as CI does:

nix build .#id-docs

The flake output uses the default siteUrl of /. The Pages deploy overrides it with /code/id/ — the id book’s path inside the repository’s project site. mdBook needs the real hosting path, or its generated 404 page points assets at the domain root.

The two workflows

id-docs.yml — build only

This workflow runs on pushes to main and on manual dispatch. It installs Nix, builds .#id-docs with nix build .#id-docs --print-build-logs, then stages the result — cp -rL result site, dereferencing the store symlink so the staged tree is a plain static site — and asserts site/index.html exists. It is the gate: a broken chapter, a missing chapter (create-missing = false), or a failed book check fails the build here, before anything can deploy.

It publishes nothing. Its permissions are contents: read only; there is no Pages deploy step in it, and adding one would be the standalone-deploy mistake described below. Its own header states the reason in full: a repository has exactly one GitHub Pages site and every Pages deployment replaces the whole site, so the id book is deployed by the mcpx-docs workflow’s deploy job, staged under id/ with siteUrl /code/id/.

mcpx-docs.yml — the combined deploy

This is the repository’s one Pages deployment. It builds each book and stages them into one site tree, then deploys that tree as the site’s single artifact. The mcpx book is the site root; the other three books are staged under it:

Staged pathBookSite URL
Site root (site/)The mcpx bookhttps://developing-today.github.io/code/
site/fleet/The fleet bookhttps://developing-today.github.io/code/fleet/
site/atlas/The atlas bookhttps://developing-today.github.io/code/atlas/
site/id/This bookhttps://developing-today.github.io/code/id/

Each book is built with its own siteUrl override — /code/ for the root mcpx book, /code/fleet/, /code/atlas/ and /code/id/ for the staged books — the path prefix the rendered links and assets must assume, because those books do not live at the site root. The deploy then publishes the assembled site/ tree once, through the Pages artifact flow: actions/configure-pages, actions/upload-pages-artifact, and actions/deploy-pages in a separate publish job, serialised so two deploys never interleave.

The one-site rule

GitHub Pages serves one site per repository, and a Pages deployment replaces that site with the artifact it is given. The rule follows directly:

Never deploy the id book on its own. A workflow that uploaded only the id build output as the Pages artifact would publish a site containing only id — and wipe the mcpx book at the root, the fleet book at /code/fleet/ and the atlas book at /code/atlas/ until the next combined deploy restored them.

Every id deploy therefore goes through mcpx-docs.yml’s combined staging, even when only id chapters changed. The same rule protects id in the other direction: no other book’s change can deploy without staging id alongside it. If you find a draft workflow, a manual gh Pages call, or a helpful script that deploys .#id-docs output directly, that is the bug — do not run it.

The writability fix when staging

Built book output arrives from the Nix store read-only, and a site tree assembled by copying store output inherits that. A later staging step that copies the next book into — or over — a read-only part of the tree then fails with permission errors, typically on the second or third book staged, which makes it look like that book’s build is at fault. It is not: it is the tree.

The fix, applied in the workflow whenever a built book is copied into the copied site tree, is to make the staged tree writable before the next staging step touches it:

cp -rL <built-book-output> site/id
chmod u+w site

The workflow applies chmod u+w site to the site root before each staged book is copied in. Keep the chmod with the copy it belongs to. Removing it because one run happened to pass reintroduces an order-dependent failure that will return the first time the staging order or the store paths change. The id book’s own build does the same thing internally for a different reason: pkgs/id/docs.nix copies its sources into a writable work directory (chmod -R u+w work) before running mdBook, because the store copy it starts from is read-only.

Verification after a deploy

A green combined deploy is not the verification. Check all four books, every time, because the failure this deploy shape risks is another book disappearing:

  1. id is live. https://developing-today.github.io/code/id/ returns the book’s front page, and a chapter page under it (this chapter, for instance) renders with working links — which also proves the /code/id/ site URL was staged correctly.
  2. The mcpx root still serves. https://developing-today.github.io/code/ returns the mcpx book, not a 404 and not the id book.
  3. The fleet book still serves. https://developing-today.github.io/code/fleet/ returns the fleet book.
  4. The atlas book still serves. https://developing-today.github.io/code/atlas/ returns the atlas book.

If check 1 passes and any of checks 2 to 4 fails, the deploy was not combined — treat it as the one-site rule having been broken, and re-run the combined mcpx-docs.yml deploy to restore the full tree. If check 1 fails while 2 to 4 pass, the id staging step is the suspect: rebuild .#id-docs locally, confirm the output exists, and check the staging copy and the writability fix above before re-deploying.

Custom domain: not wired

There is no custom domain for this book, or for the site it lives on. The canonical address is the github.io URL above; no CNAME is set, and no DNS record points a fleet domain at the Pages site.

A later DNS step — choosing a hostname, adding its DNS records, and configuring the domain on the Pages site — is documented as future work and is not wired. Until that step is deliberately done, do not add a CNAME file to any book’s output, do not set a custom domain in the repository’s Pages settings as part of a book change, and do not publish links under any domain other than developing-today.github.io. A half-wired domain would move all four books at once, which is exactly the blast radius the one-site rule exists to keep visible. The standing rule for keeping the chapters themselves current as the system changes is in Keeping this book current.

FAQ

Answers here state only what the rest of this book establishes, and each answer names the chapter that carries the full treatment. Where the honest answer is “not yet” or “there is no such verb”, the answer says that.

What is a world?

A world is a hosted, multiplayer program space: a guest program (normally a Roc module compiled to Wasm) whose state is a fold over a signed, ordered journal of inputs, with participants joining under capabilities that say what each of them may do. One node hosts a world with id serve --world; everyone else’s world commands are clients of that host. The concepts are in Worlds and the Roc guest runtime; joining one is Tutorial: join a world and run a guest app.

Where does my data live?

In the node’s data directory: the current directory by default, the --data-dir <DIR> directory when that global flag is given, or .iroh/<NAME>/ for a node created with --new [<NAME>]. Inside it, files live in .iroh-store/, the group log in groups.jsonl, documents and claims in events/, tags’ registry in .iroh-meta/registry.json, and each hosted world’s journal in .id-worlds/<NAME>/. The item-by-item table is in Backup, restore and data directories.

What is the difference between a tag and a claim?

A tag is file metadata: a key and an optional value attached to a stored file, held in the tag store, set with id tag set <FILE> <KEY> [VALUE]. A claim is a named statement about a subject, held in the event store, set with id claim set <SUBJECT> <NAME> [VALUE], and it carries a scope — shared or local — that a tag does not have. They are different stores, different commands and different subjects: tags describe files; claims make scoped statements about subjects. See The tag family, Groups, documents, claims and keys, and the worked example in Tutorial: organise a library with tags and claims.

Can I delete a file?

Yes — but not from the top-level command line. The clap CLI has no delete, rename or copy command at all. Those operations exist in the interactive REPL (delete <NAME> / rm <NAME>, rename <FROM> <TO>, copy <FROM> <TO>), in the web UI, and in the shared FileOps layer underneath both. Underneath, FileOps::delete is a hard delete of the name, its metadata and its archives; the blob bytes themselves survive until garbage collection, and the web layer builds a separate soft-delete and restore pair on top. See The interactive REPL and Sync, replication and FileOps.

Why is there no MCP server yet?

Because the code contains a translator and a policy point, not a server. What exists is a library in id-caps: mcp_bridge translates one MCP tool call into a world-session frame (or a locally rendered answer, or a session close), and mcp_policy checks the capability ceiling, charges quota before execution, and writes exactly one signed audit event per action. There is no standalone MCP server binary, no stdio or HTTP MCP transport, and no JSON-RPC tools/list implementation in pkgs/id, and no ID entry is wired into the mcpx configuration. The 8 v1 tools exist as definitions for an agent already inside a world session. The full account is in The MCP bridge and Agents in worlds: the MCP bridge and policy.

What does the hosted edition run today?

A local-only scaffold. The pkgs/id/hosted-worker package runs under wrangler dev and its test harness; its config authorises no production deployment, and locally it fails closed with 503 jurisdiction_unavailable for every fully valid request, by design, because local workerd does not implement jurisdiction restrictions. There is no hosted URL, no deployed per-user service, and no operator action that turns the scaffold into one. See Running a node: serve, worlds and the hosted edition and The hosted edition.

How do two nodes find each other?

Through the discovery layers serve runs by default: gossip on the topic from defaults.json (fallback constants id-peer-discovery-v1 and id-public-discovery-v1), mDNS on the local network, bootstrap node IDs, and relay-assisted connection. Each layer has an off switch — --no-gossip, --no-mdns, --no-default-bootstrap, --no-relay — and the mainline DHT is opt-in with --dht. The operational table is in Running a node: serve, worlds and the hosted edition. One warning belongs here: --help calls the fallback constants “the default”; the file comes first. That trap is in Troubleshooting.

I ran id and got user and group IDs, not a prompt. What happened?

That binary is GNU coreutils id, a different program that happens to share the name; on the surveyed machine it sits at /etc/profiles/per-user/user/bin/id. This book’s id, run with no subcommand, starts the interactive REPL. Check which binary the path resolves, and check id --version: this book’s binary prints a two-line long version whose second line reports the embedded defaults provenance. Old builds of this book’s own binary are a second version of the same trap; see Troubleshooting.

Is there a backup command?

No whole-node backup or restore verb exists. The narrow exceptions are id world journal backup <DIR> <OUT> for one world’s journal (the output path must not already exist, and the journal must pass journal check first) and the id key export family for keys. Everything else is the operator copying the data directory with serve stopped, as laid out — and marked unverified as a product procedure — in Backup, restore and data directories.

Can anyone write to my node?

Only writers the node admits: this machine’s own keys, node IDs passed with --allow-node <IDS>, and node IDs listed one per line in the .iroh-allowed file in the data directory. The exception is --open-writes, which lets any peer write and is documented in its own help text as insecure. See Running a node: serve, worlds and the hosted edition.

Why did id world --help work on a build where every world command fails?

Because the world command tree is not gated in the parser, while its dispatch is gated on the world feature: help prints the full tree in every build, and a build without the feature fails each invocation at runtime with this build has no world support. Neighbouring commands gate the other way — match-audit and four world subcommands disappear from the parser entirely without the sandbox feature. Both shapes, and the build that shows each, are in Troubleshooting.

What is a guest?

The program that runs inside a world: a Roc (or Rust SDK) module compiled to Wasm, exporting the Plaza ABI, which receives inputs through the host, asks for effects through capabilities, and returns views. The host owns the journal, the capabilities and the limits; the guest owns the world’s logic and its folded state. See Worlds and the Roc guest runtime and Glossary.

Glossary

One line per term, in plain words. Each definition states what the book’s sources establish; the chapter that treats the term in full is named where one chapter owns it.

  • archive tag — the reserved name form <name>.archive.<unix-ts> given to a file’s previous content when it is renamed or replaced; the writer refuses that form as a user file name.
  • bootstrap — the starting node IDs a node contacts to enter the gossip network, taken from --bootstrap <IDS> or from defaults.json unless --no-default-bootstrap is given.
  • capability — an unforgeable grant, presented as a token, that lets its holder perform named actions in a world or against a store; world clients present one with --capability <C> or ID_WORLD_CAPABILITY.
  • ceiling — the upper bound on what a holder may do: a set of named capabilities (for an agent, also its worlds, object classes and program allowlist) that grants can narrow and never widen.
  • checkpoint — a saved fold of a world’s journal at one point, written every --world-checkpoint-every <N> events (default 1000), so replay can start there instead of at event one.
  • claim — a named statement about a subject, held in the event store with a scope of shared or local, set with id claim set. Distinct from a tag.
  • data directory — the directory a node keeps all its state in: the working directory by default, --data-dir <DIR> when given, or .iroh/<NAME>/ under --new [<NAME>].
  • defaults.json — the defaults file embedded in the binary at compile time, supplying the gossip topic, topic secret, bootstrap IDs and web bindings before command-line flags override them.
  • delegation — the act, and the resulting record, of granting part of one’s own authority in a group to another account, done with id delegate <GROUP> <GRANTEE> and undone with id revoke.
  • directory — the account and group register: who has signed up, their keys, tiers, groups and friendships, recorded as entries in directory.jsonl and served to clients through the directory routes.
  • FileOps — the single implementation of put, rename, copy and delete for a stored file, shared by the CLI, the REPL, the meta protocol and the web UI (crates/id-sync/src/fileops.rs).
  • fixture — a recorded set of world inputs (with a module and a seed) used to replay a world deterministically in tests and in id world replay and id world verify.
  • gallery — the program registry a node can serve from --gallery-dir <DIR>: signed .idpb bundles, collections, and a public transparency list of removals, refusals and reinstatements.
  • group — a named set of accounts with roles, created and managed in the group log (groups.jsonl by default) and governed by a group policy.
  • guest — the program inside a world: a Roc or Rust module compiled to Wasm that exports the Plaza ABI and owns the world’s logic and folded state.
  • journal — a world’s signed, ordered record of inputs; the world’s record, from which its state is folded and replayed.
  • node ID — a node’s public identity, written as 64 hex characters; commands that take a node fail with invalid node ID: must be 64 hex characters on anything else.
  • Plaza ABI — the host/guest interface a world module exports (Plaza ABI v1): memory plus the plaza_* exports — plaza_init, plaza_update, plaza_view, plaza_snapshot and kin — through which the host runs the guest.
  • provider — a host-side service a guest can ask for through the capability protocol (an “effect”), whose offer and reply pass through the world session; a provider declaration moves through the lifecycle Filed, Admitted, Live, Suspended or Tombstoned.
  • RegistryEntry — one entry in a signed registry list: a world announcement kept verbatim, the time it was included, and its registry sequence number.
  • replay — re-running a world’s journal through its module from the start, or from a checkpoint, to rebuild or verify the folded state; id world replay compares the result against a fixture.
  • serve lock — the file .iroh-serve.lock in the data directory while a serve process owns it; the REPL reads it to decide whether to proxy operations to that serve.
  • shell contract — the fixed set of frames and behaviours every client shell (terminal, web, native, hardware) must implement to talk to a world, checked by id world contract.
  • tag — a key and optional value attached to a stored file as metadata, held in the tag store, set with id tag set <FILE> <KEY> [VALUE]. Distinct from a claim.
  • tombstone — the registry record that delists a world: its world ID, the removal time, a reason of at most 200 characters, and its registry sequence number.
  • topic — the gossip channel name nodes meet on (with its topic secret); the shipped fallback values are id-peer-discovery-v1 and id-public-discovery-v1, behind defaults.json.
  • UserDO — the per-user Durable Object class in the hosted Worker, one object per binding ID, holding that user’s key-value data, blob references and bridge store at SQLite schema version 3.
  • world — a hosted, multiplayer program space: one guest program, one journal, and participants joining under capabilities; hosted by id serve --world and stored under .id-worlds/<NAME>/.
  • writer set — the set of writers authorised for an event or document chain at a given point, inspected and expanded with the id writer-sets commands.