Appearance
Reserved subjects
The protocol reserves a small set of facet names and system command names. Packages MUST NOT use these for application ops or events.
Reserved facets (transport-handled)
These appear in the wire grammar as {root}.{mount}.<facet>:
| Facet | Direction | Use | Source |
|---|---|---|---|
$inbox | inbound | actor receives ops | NatsTransport.semanticToNats lines 308–330 |
$events | outbound | pub/sub events fan-out | same |
$reply (with suffix .<cid>) | actor → caller | request/reply correlation | line 297–305 |
$exit | child → parent | lifecycle exit signal for supervision | line 316–319 |
$state | actor → watchers | KV last-value updates (handled by JetStream) | spec |
These are reserved at the transport layer. Custom mounts MUST NOT name themselves with leading $ (e.g., a mount named $mything would collide with facet handling).
Reserved root-level subjects
| Subject | Use |
|---|---|
{root}.$inbox | root-level actor inbox (the runtime root) |
{root}.$events | root-level events |
{root}.$exit | root-level exit |
{root}.$reply.<cid> | reply subjects for any caller in this root |
{root}.> (wildcard) | match-all under root |
Reserved system commands
Auto-subscribed by MatrixActor. Verbatim from projects/matrix-3/packages/core/src/core/MatrixActor.ts:111:
typescript
const SYSTEM_COMMANDS = [
'$join',
'$join_ack',
'$leave',
'introspect',
'$introspect',
'$ping',
'$reply',
'$getState',
'$getHistory',
'$createControl',
'$activity',
'$preferences',
'$config',
'$membrane-inherit',
'$membrane',
'$skill',
'$cognitive.set',
'$cognitive.get',
'$triggers.add',
'$triggers.remove',
'$triggers.list',
'$skills.add',
'$skills.remove',
] as const;Each is auto-handled; no actor needs to declare them in static accepts.
| Command | What it does |
|---|---|
$join / $join_ack / $leave | child registers/unregisters with parent |
$introspect (and introspect) | returns the actor's full declared surface |
$ping | health check, returns $pong |
$reply | response envelope op |
$getState / $getHistory | state read / event history read |
$createControl | spawn a control child |
$activity | activity tracking (oracle loop) |
$preferences / $config | actor configuration |
$membrane / $membrane-inherit | CESK membrane program management |
$skill / $skills.add / $skills.remove | runtime skill management |
$cognitive.set / $cognitive.get | cognitive overrides |
$triggers.add / $triggers.remove / $triggers.list | runtime prompt triggers |
Excluded system commands
$prompt and $source-code are NOT in SYSTEM_COMMANDS. The source comment (MatrixActor.ts:135):
"NOTE: $prompt and $source-code are intentionally NOT here. They live in headlessFrameworkOps (see _subscribeToInbox) so that shell-managed actors defer to the shell handler, avoiding the dual-dispatch race (actor + shell both fire for the same op)."
These two commands route through a separate framework-ops layer to preserve shell ownership of conversational/source surfaces.
Aspirational system commands (target)
WORKSTREAMS/core-and-packaging/ACTOR-COMMUNICATION-CONTRACT.md § "System Commands" documents Plan 9-aligned commands not yet implemented:
| Command | Plan 9 analog | Status |
|---|---|---|
$ctl | /proc/<pid>/ctl | target |
$status | /proc/<pid>/status | target |
$children | ls /proc/<pid>/ | target |
$ns | /proc/<pid>/ns | target |
$env | /proc/<pid>/env | target |
$health | (Matrix-only) | target |
$ctl would unify stop/restart/reconfigure/gc/debug under one op. The spec is settled; the implementation is workstream material.
Reserved op name prefix
$<verb> and $<verb>.<modifier> are reserved for system commands. Application ops MUST NOT use a leading $. Instead use <area>.<verb>:
| Application op | Reserved (forbidden) |
|---|---|
chat.send | $send |
registry.resolve | $resolve |
runtimes.start | $start |
NATS protocol-internal subjects
These are NATS server internals and not Matrix subjects:
| Subject | Use |
|---|---|
_INBOX.* | NATS native request/reply reply subject |
_R_.* | NATS service routing |
$SYS.* | NATS system account subjects |
Matrix code does NOT publish to these. The transport rejects publishes that fall outside the Matrix root prefix; NATS rejects publishes to $SYS.* from non-system accounts.
See also
- Subjects — conceptual.
- Subject grammar — wire format.
- Subject naming reference — conventions.
- Actors — system commands the base class handles.