This format is independent of repository, object, and workspace formats. Adding a gateway changes none of their bytes. The gateway root contains:
SCRIBE_GATEWAY: exact UTF-8 bytesscribe-gateway\n1\n.LOCK: exclusive OS ownership lock.routes.redb: redb 4 database containingroutesandinstancestables.status.json: disposable observation snapshot, never authoritative routing.
routes maps a repository name string to a scribe_format::gateway::RouteRecord:
| Field | Encoding |
|---|---|
| Record version | u8 = 1 |
| Instance name | u16 LE byte length, then UTF-8; 1–64 ASCII letters/digits/hyphens/underscores |
| Storage compression | u8: 0 none, 1 LZ4 |
| Has repository ID | u8: 0 or 1 |
| Repository ID | 16 exact bytes, present only when the preceding flag is 1 |
| Conflict flag | u8: 0 or 1 |
Unknown versions, invalid flags, invalid compression, invalid names, truncated
records, and trailing bytes are rejected. A record without an ID is a durable
pending name reservation. A conflict flag prevents routing that name.
Golden bytes and strict decoding tests live in scribe-format/src/gateway.rs.
instances maps a configured instance-name string to its exact 16-byte data-root
incarnation. An identity is pinned after successful inventory. A different
identity at the same name or the same identity under another name is rejected.
Both placement reservations and completed assignments commit with
Durability::Immediate. Payload encoding, authentication, inventory collection,
and upstream requests happen outside database write transactions. Routing state
is never inferred from the disposable JSON snapshot. There is no format migration
or legacy fallback.