Expand description
The daemon wire protocol: length-prefixed binary frames (ADR 0011).
A request is u32 (big-endian) body length, then the body: one operation
byte, then its payload.
| Op | Payload | Response |
|---|---|---|
1 HELLO | Hello JSON (path and mode) | 0, u32 len, identity JSON; or 1, u32 len, error text |
2 GET | 32-byte key | 0 (miss); or 1, u32 len, reply bytes, then optionally u32 len, effort JSON |
3 PUT | 32-byte key, u32 meta len, meta JSON, reply bytes | 0 |
4 STATS | empty | 0, u32 len, StatsSnapshot JSON |
5 INFO | empty | 0, u32 len, Info JSON |
Operations 4 and 5 are read-only and additive: they kept the original version (ADR 0012, ADR 0015). Version 4 requires silent-session publication (ADR 0022) and negotiates the mode in HELLO (ADR 0020). A daemon that predates one rejects it by closing that connection; nothing else changes.
Version 5 requires exactly one successful HELLO before GET or PUT.
Missing, failed or repeated handshakes close the connection without reading
further requests. STATS and INFO remain available without a handshake.
Frames larger than MAX_FRAME are rejected.
Structs§
- Effort
- Solver effort recorded with a
check-satreply (ADR 0009). - Hello
- A solver handshake, including the cache namespace.
- Identity
- Solver identity as the daemon reports it (see
sail_key::SolverIdentity). - Info
- The daemon’s configuration and state (the
INFOoperation). - Memory
Info - The in-memory tier’s state, as
INFOreports it. - PutMeta
- Metadata sent with a
PUT. - Queue
Info - The write-behind queue’s state, as
INFOreports it. - Remote
Info - Sanitized optional HTTP transport state, with no credentials or response bodies.
- Shared
Info - The shared tier’s configuration, as
INFOreports it. - Stats
Snapshot - The daemon’s counters since it started (the
STATSoperation). Benchmarks read them before and after a run and report the difference.
Enums§
- Request
- A decoded request.
- Verification
Mode - A cache namespace negotiated for one solver connection.
Constants§
- MAX_
FRAME - Largest accepted frame body, in bytes.
- PROTOCOL_
VERSION - The protocol version. Bump on any incompatible change; the daemon reports
it in
HELLO, clients refuse a mismatch, and the default socket name includes it, so an upgraded client never talks to a stale daemon.
Functions§
- get_
effort_ trailer - The effort trailer of a
GEThit body, if present. - read_
response - Reads one response frame body.
- split_
status_ payload - Splits a
status, u32 len, payloadresponse body. - write_
get_ response - Writes a
GETresponse. - write_
hello_ response - Writes a
HELLOresponse. - write_
info_ response - Writes an
INFOresponse. - write_
put_ response - Writes a
PUTacknowledgement. - write_
stats_ response - Writes a
STATSresponse.