Skip to content

Runtime instances

A runtime instance on a Host is described by a single <host-home>/runtimes/<runtimeId>.json file. The shape is IHostRuntimeRecord from packages/host-service/src/types.ts:81-97. This page walks every field.

On-disk layout

<host-home>/
├── runtimes/
│   ├── RUNTIME-HOST-SYSTEM.json
│   ├── RUNTIME-HOST-GATEWAY.json
│   ├── RUNTIME-HOST-CHAT.json
│   └── ...
└── runtime-env/
    ├── RUNTIME-HOST-SYSTEM.json
    ├── RUNTIME-HOST-GATEWAY.json
    └── ...

Two files per runtime:

FilePurpose
runtimes/<runtimeId>.jsonThe runtime record (this page)
runtime-env/<runtimeId>.jsonThe per-runtime environment file consumed by the runner

IHostRuntimeRecord fields

FieldTypePurpose
runtimeIdstringStable runtime identity
packageRefstring?The package + version this runtime serves (e.g. @open-matrix/chat@0.2.9)
packageDirstring?Absolute path on disk to the package directory
environmentstring?The --env <name> value used at up time
pidnumber?OS pid of the runtime process (when running)
statusenumstarting | running | stopping | stopped | failed
startupenummanual | auto
restartenumnever | always | on-failure
startedAtISO dateWhen the runtime was last started
stoppedAtISO dateWhen the runtime was last stopped
updatedAtISO dateWhen the record was last written
runtimeMountstring?The runtime's primary control mount
controlMountstring?The runtime's control-actor mount
runtimeWireRootstring?The wire root for this runtime (e.g. COM.NIMBLETEC.RICHARD-SANTOMAURO)
localMountsstring[]All actor mounts the runtime has registered
metadataobjectFree-form blob: source command, transport snapshot, webapp info, etc.

IHostRuntimeStartSpec — the input shape

When you run hivecast up, the CLI assembles an IHostRuntimeStartSpec (packages/host-service/src/types.ts:98-115) and hands it to runtime.start. The supervisor then writes the resulting IHostRuntimeRecord:

FieldFromNotes
runtimeId--id or auto-allocatedStable id
packageDirresolved from positional or registryAbsolute path
packageReffrom package.json:name@versionWhen known
environment--env valueDefault host
startup--startupDefault manual
restart--restartDefault never
runtimeWireRootfrom Host statusThe current wire root
runtimeMount, controlMountderived from runtimeId
command, argsthe command to spawnDefault is the bundled matrix run
cwd, envoptional overrides
readyTimeoutMs--timeoutDefault 30000
localMountsdeclared mountsIncludes runtimeMount + controlMount + package mounts
metadatasource/target/transport/webapp blobUsed by system.runtimes and the gateway

A real example

<host-home>/runtimes/RUNTIME-HOST-CHAT.json:

json
{
  "runtimeId": "RUNTIME-HOST-CHAT",
  "packageRef": "@open-matrix/chat@0.2.9",
  "packageDir": "/tmp/matrix-home/packages/global/node_modules/@open-matrix/chat",
  "environment": "hivecast",
  "pid": 18432,
  "status": "running",
  "startup": "auto",
  "restart": "always",
  "startedAt": "2026-05-05T15:42:01.117Z",
  "updatedAt": "2026-05-05T15:42:11.348Z",
  "runtimeMount": "system.runtimes.chat-host",
  "controlMount": "system.runtimes.chat-host.control",
  "runtimeWireRoot": "COM.NIMBLETEC.RICHARD-SANTOMAURO",
  "localMounts": [
    "chat",
    "chat.conversation",
    "chat.security-realm",
    "chat.topic-claims",
    "system.runtimes.chat-host",
    "system.runtimes.chat-host.control"
  ],
  "metadata": {
    "source": "matrix-cli",
    "target": "@open-matrix/chat",
    "envFile": "/tmp/matrix-home/runtime-env/RUNTIME-HOST-CHAT.json",
    "transport": { "...": "..." },
    "controlReadyTimeoutMs": 30000,
    "autoStartPriority": 25,
    "serve": true,
    "webapp": {
      "appName": "chat",
      "displayName": "Chat",
      "navOrder": 30,
      "shells": ["platform", "edge"],
      "assetMount": "system.gateway.http.routes.chat-host",
      "origin": "http://127.0.0.1:5005",
      "port": 5005
    }
  }
}

Lifecycle of a record

mermaid
stateDiagram-v2
    [*] --> starting: hivecast up
    starting --> running: control.ready
    running --> stopping: hivecast down
    stopping --> stopped: clean exit
    stopping --> failed: timeout / kill
    running --> failed: process exit
    failed --> starting: restart policy fires
    stopped --> starting: hivecast up

The record persists across all transitions; updatedAt ticks whenever the status changes.

See also

Source:projects/matrix-3/packages/host-service/src/types.ts:81-115 defines IHostRuntimeRecord and IHostRuntimeStartSpec.