On this page

0188. Binary fingerprints cover wire schemas

Context

Binary placed eight bytes of the target's reflected API signature digest before the payload. API identity intentionally hides newtype representations (ADR-0075). Changing a direct or nested newtype from i64 to u64 therefore allowed old bytes to decode as a different value under the same header.

Decision

Supersede the Binary header clause of ADR-0083. The Binary generator hashes the reflected target and its full reachable wire schema. It uses the deduplicated reference table and the deterministic postorder named table described in ADR-0081. The ordered tables include primitive widths, container arguments, qualified type names, ordered fields and variants, and each newtype's representation. Visibility, derive flags and API signatures are excluded.

FNV-1a-64 starts at the standard offset basis and consumes the length-prefixed domain harness-binary-schema-1, the target index, and the length-prefixed reference and named tables in that order. Shape and reference kinds have explicit one-byte tags in binary.tn. Counts and indices are little-endian u64 words. Strings are prefixed by their byte length. The wire header is the resulting u64 in big-endian order. Named children continue to encode only their payloads within the parent.

Alternatives considered

Consequences

Regenerate companions. Read retained payloads with the original codec and write them with the regenerated codec. The header detects schema mismatches and supplies no authentication. Public signatures and the payload grammar stay the same.