QueryBackendSpec
The query backend contract (the 9.x SnapshotQueryBackendSpec of wow-tck, ported to the 10.x snapshot model): every snapshot query backend passes it. A backend's test extends it, stores the snapshots each test gives in store, and supplies its binding of an aggregate type in binding.
Each test runs on its own aggregate type (a fresh context), so a backend that keeps a table or a collection per context isolates the tests. The schema is compiled as the Catalog compiles it: the snapshot system fields, the order state DECLARATION and the backend's storage facts. Queries are admitted through QueryAdmission.Trusted (no caller scope, no default deletion scope) and run through the core's query shapes (BackendQueries.kt), except the gateway tests, which run the whole admission.
Features a storage may decline (keyset pages, unbounded streams, distinct counts, percentiles, FIRST / LAST, root groups, temporal aggregation) are assumed only where its facts grant them; a declined feature skips its test.
The cases come in families, each a parent class of this one (SnapshotQueryFixtures lists them); this class holds the timeouts and the gateway cases.