Reference
ADR index
All eleven architecture decision records, with one-line summaries and links to the full texts.
Every architectural decision is recorded as an ADR in the repository — read them to understand why the spec looks the way it does. When a decision is ambiguous, the priority order is: (1) Java portability → (2) type safety → (3) bundle size → (4) API ergonomics.
| ADR | Title | In one line |
|---|---|---|
| 0001 | Canonical QuerySpec model & kind-discriminated FilterNode AST | One frozen JSON shape; groups reserved in the AST from day one so v0.3 changes zero wire bytes. |
| 0002 | Immutable builder & progressive sort semantics | Every method returns a new frozen query; thenSort never disturbs existing priorities. |
| 0003 | Result-based structured errors; no-throw data path | Data errors return a multi-error Result; only programmer misuse throws TypeError. |
| 0004 | Adapter interface contract (reserved for v0.2) | Adapters must match client apply exactly: parametrized values, tie-breaker parity, Result-typed totality. |
| 0005 | Deterministic tie-breaker (stableBy) injection | A unique sortable field is appended at execution time — never into the spec — making every order total. |
| 0006 | Guard limits & injection safety | Whitelist + limits on sort columns, filters, value length and in-lists; no user input becomes a pattern. |
| 0007 | Canonical string format: escaping & canonicalization | Six-character escape set, fixed segment order, lenient-in/canonical-out, idempotence law. |
| 0008 | Reference comparator: SQL ORDER BY model & NULL semantics | PostgreSQL NULL rules as the single model shared by client apply and all future adapters. |
| 0009 | Optional value validation via Standard Schema | Zod/Valibot/ArkType plug in through the dependency-free ~standard interface; sync-only in v0.1. |
| 0010 | Syntax dialect plugin interface (reserved for v0.2) | Foreign syntaxes (page=, JSON:API, OData) translate at the boundary into the same canonical spec. |
| 0011 | Java portability constraints | Everything must deserialize into sealed Java types from the same JSON and produce byte-identical canonical strings. |
Related normative documents:
- Query-string grammar (mirrors
docs/spec/query-string.md) - Wire format (JSON) (mirrors
docs/spec/wire-format.md) docs/spec/test-vectors.md— conformance vector formatdocs/api/public-api.d.ts— the frozen public API surface