7. Frame Types
All frames are JSON objects with a type field (string). Implementations MUST silently ignore frames with unrecognised type values to allow forward compatibility.
| Type | Layer | Gated | Fields |
|---|---|---|---|
| handshake | 2 | No | nodeId (string), name (string), version (string), extensions (string[]) |
| state-sync | 2/3 | No | h1 (float[]), h2 (float[]), confidence (float) |
| memory-share | 3/4 | SVAF | timestamp (int), cmb (object: { key, createdBy, createdAt, fields, lineage }) |
| mood | 4 | Drift | from, fromName, mood (string), context?, timestamp |
| message | 2 | No | from, fromName, content, timestamp |
| xmesh-insight | 6 | No | from, fromName, trajectory (float[6]), patterns (float[8]), anomaly (float), outcome (string), coherence (float), timestamp |
| peer-info | 2 | No | peers: [{ nodeId, name, wakeChannel?, lastSeen }] |
| wake-channel | 2 | No | platform (string), token (string), environment (string) |
| error | 2 | No | code (int), message (string), detail? (string) |
| ping | 2 | No | (no additional fields) |
| pong | 2 | No | (no additional fields) |
7.2 Error Frame
When a node encounters a protocol-level error, it SHOULD send an error frame before closing the connection (if applicable). Error frames are informational — the receiving node MUST NOT treat them as commands.
| Code | Name | Action | Description |
|---|---|---|---|
| 1001 | VERSION_MISMATCH | Close | Peer version is incompatible |
| 1002 | DIMENSION_MISMATCH | Reject frame | h1/h2 vector dimension mismatch |
| 1003 | FRAME_TOO_LARGE | Close | Frame exceeds MAX_FRAME_SIZE |
| 1004 | HANDSHAKE_TIMEOUT | Close | No handshake within deadline |
| 1005 | DUPLICATE_NODE | Close | nodeId already connected |
| 2001 | SVAF_REJECTED | None | Memory-share rejected by SVAF (informational) |
| 2002 | CONSENT_WITHDRAWN | Close | Consent withdrawn by this node |
Codes 1xxx are connection-level (close connection). Codes 2xxx are evaluation-level (informational). Error frames MUST NOT contain sensitive information.
7.3 Frame Type Registry
Frame types are identified by their type string value.Core types (this specification) MUST NOT be redefined by extensions.Extension types MUST use <extension>-<name> format.Vendor types MUST use x-<vendor>-<name> format and MUST be silently ignored by non-supporting nodes.