Searchable Feature gallery

ADR-0002: JSON-first index format; binary is an opt-in per-shard encoding

Status

Accepted (implemented: JSON tier since Phase 1; binary tier since Phase 7 — packages/indexer/src/binary-*-shard.ts, packages/client/src/binary-*-shard.ts).

Context

concepts/index-format.md commits to the index format being "a spec, not a library dependency" — a Python or Java producer should be able to emit a conforming index with standard-library tooling alone, proven by the two independent reference generators in spec/examples/. archive/investigations/binary-vs-json-index.md's benchmarking then asked a separate question: does a binary format pay for itself at scale, and if so, does it replace JSON or coexist with it?

Decision

JSON is the default and the format every shard type supports. A binary encoding exists only where a real, benchmarked win was found — term shards, fuzzy shards, and the doc store (archive/specs/binary-format.md) — each per-shard, selected independently (Manifest.shards.terms[*].format: "json" | "binary"), never a whole-deployment format switch. Facet, synonym, and pins shards deliberately stay JSON-only: the benchmarking in archive/investigations/binary-vs-json-index.md found no access pattern for them that a binary encoding would win on (facet shards are usually decoded in full for aggregate counts, the opposite of the lazy-per-key-decode shape that makes the binary tier a win for terms/fuzzy/docs).

Alternatives Considered

Consequences