Serialization (CBOR)

A single internal CBOR format sits between the field-walker and the storage layer, encoding each field value directly to bytes — no JSON text detour, no intermediate string representation at all.

// conceptually, per field:
val bytes: ByteArray = cbor.encodeToByteArray(serializer, fieldValue)
storage.putBytes("note-1::title", bytes)

Not a pluggable extension point

This is an internal implementation detail, not a public knob — the on-disk format isn't configurable in v1. An earlier design considered a pluggable Codec<T> abstraction for swapping serialization strategies; that design was superseded before release in favor of a single internal CBOR format, which is simpler and removes an entire axis of configuration a caller never actually needed. If you've seen a Codec abstraction mentioned elsewhere, treat it as historical — it isn't part of the current public surface.

Why CBOR, not JSON

CBOR encodes directly to compact binary — no text serialization, no parsing back out of a string — which keeps the format small and the encode/decode step cheap, on top of an already memory-mapped storage engine. Since each field is encoded independently (see Field Decomposition), the format only ever needs to represent one field's value at a time, not a whole document.