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 (0xe0–0xff) 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

Room.channel wraps application payloads in a channel header. Raw Room.broadcast and Room.sendTo payloads have no such header: a live SeamRoom refuses any payload classified by this registry with ReservedRoomPrefix before sending it. The check uses classifies, not matches, so short channel-like payloads and ordinary k payloads remain valid. This registry owns the byte space and distinctness; channel framing makes arbitrary application bytes safe to send.

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'.

Companion properties

Link copied to clipboard

Returns an immutable kotlin.enums.EnumEntries list containing the constants of this enum type, in the order they're declared.

Companion functions

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.

Properties

Link copied to clipboard
val byte: Byte

the first byte of every frame in this family.

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.