RoomFramePrefix

The single source of truth for the room frame-prefix byte space (#2007).

Every frame SeamRoom.dispatchIncoming classifies is discriminated by its first byte. Before this enum those bytes were five loose public const vals in four packages, and nothing made a collision a compile error. One member per frame family means a family cannot be added without claiming a byte, and RoomFramePrefixTest pins that no two claim the same one.

The real collision band is 0x60..0x7f, not 0xe0..0xff

Inherited prose (originally RoomChannel's KDoc) claimed these bytes are safe because they sit "outside the CBOR major-type-7 range (0xe00xff) used by serialization". That is false, and it is false in the direction that matters. CBOR text-string headers are 0x60 or len, so a bare top-level CBOR string collides with every byte claimed here:

payloadfirst bytecollides with
1-char string0x61Admit
3-char string0x63Channel
5-char string0x65Lobby
11-char string0x6bHeartbeat
18-char string0x72Relay

The codebase lives with this because room payloads are framed, not bare — an application payload is wrapped by the channel header before it reaches the wire. This registry's job is single-source-of-truth for the byte space and distinctness; it is deliberately not a safety proof, because no registry can make one.

Entries

Link copied to clipboard

The admit handshake — AdmitMessage. 0x61, ASCII 'a'.

Link copied to clipboard

A Room.channel(id) view's frames — RoomChannel. 0x63, ASCII 'c'.

Link copied to clipboard

Host election — LobbyMessage. 0x65, ASCII 'e'.

Link copied to clipboard

Liveness ping/pong — HeartbeatPartitionDetector.

Link copied to clipboard

A host-forwarded frame between two spokes of a star — RelayEnvelope (#1994). 0x72, ASCII 'r'.

Properties

Link copied to clipboard
val byte: Byte

the first byte of every frame in this family.

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int

Functions

Link copied to clipboard
open fun classifies(bytes: ByteArray): Boolean

Whether bytes is a frame of this family, by the family's own real classifier.

Link copied to clipboard

Whether bytes claims this family's prefix byte — a single-byte test. Empty is never.

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.