Skip to main content

Module message

Module message 

Source
Expand description

Message protocol — the unit of communication between nodes.

Mirrors ~/src/graphrefly-ts/src/core/messages.ts and GRAPHREFLY-SPEC.md §1 under the handle-protocol cleaving plane: payload-bearing variants (Data, Error) carry a HandleId rather than a raw user value. The Core never sees T; the binding-side registry resolves handles to values.

§Tier table (per canonical spec R1.3.7.b, post-13.6.A lock)

TierVariantsPurpose
0Message::StartSubscribe handshake
1Message::DirtyPhase 1 control
2Message::Pause, Message::ResumePause coord
3Message::Data, Message::ResolvedValue delivery
4Message::InvalidateCache clear
5Message::Complete, Message::ErrorTermination
6Message::TeardownPermanent destruction

Tier ordering is enforced globally during dispatch (R1.3.1.b two-phase push, R1.3.7 batch coalescing) — DIRTY drains system-wide before tier-3, etc.

§Open type set (R1.2.2)

The canonical spec allows custom message types. M1 first-slice ships only the 10 built-ins; custom types arrive as a follow-up via a registry shape mirroring MessageTypeRegistration in messages.ts.

Enums§

Message
A protocol message.

Type Aliases§

Messages
A batch of messages delivered as one wire emission.