ADR 0008: Canonical serialization is a protocol boundary

Decision

Canonical EDN is a versioned wire protocol, not an implementation detail. A format version defines the complete byte representation; implementations MUST NOT serialize equivalent structures differently. The permanent answers, per format-version 1:

Any change to canonical output — however “equivalent” — is a format-version bump.

Context

A future developer will be tempted by “this is semantically equivalent, let’s make the serializer nicer.” That is a hash fork: every event id and signature in every store is derived from these exact bytes. This is the most immutable layer after the hash function itself (ADR 0006), and it is where the one real encoding bug so far lived (the pr-str map-ordering instability, found by property test).

Consequences

see history · edit this page