Expand description
The schema-derived path table and the type check.
PathTable is built once per process from the committed JSON Schema in
evalhub_schema plus the currently applied ext_schemas from the
registry. It maps each legal query path to where its value lives, what
type it has, and which operators the storage can actually serve:
| Path form | Type | Served by | Operators |
|---|---|---|---|
{facet}.{key} with a column | from the schema leaf | generated column | all that suit the type |
{facet}.{key} without one | from the schema leaf | GIN index on body | eq, exists |
fingerprint.{facet} | string | fingerprints table | eq, ne, in, exists |
results, relations, attachments | array of object | own tables | any |
results[{metric}].value (sort) | number | results table | sort only |
ext.{ns}.{key} registered | from the ext_schema | expression index | all that suit the type |
ext.{ns}.{key} unregistered | unknown | GIN index on body | eq, exists |
title, producer.name, … | string | generated column | all that suit the type |
The row that is easy to get wrong is the second one. Only sixteen facet
keys have a generated column (the migration lists them, and
GENERATED_COLUMNS mirrors that list with a test that fails if the two
disagree). Every other key of the record is readable and equality-
searchable through the GIN index over body, but ordering or ranging on
it would be a sequential scan, so the check refuses with not_indexed
and names the registry. That is the same answer an unregistered ext
path gets, and for the same reason.
runs is deliberately absent: an Eval’s runs live in the body and have
no side table, so there is nothing for any to range over. A query that
needs them wants attachments or a registered ext path.
The check walks the parsed tree and, for each leaf, looks the path up,
confirms the operator is legal for the type, confirms the literal is of
that type, and confirms the operator is served by the path’s index.
Failures are collected into 422 { errors[] } with codes
unknown_path, type_mismatch, not_indexed, each carrying a JSON
pointer into the submitted request.
The table is rebuilt when an ext_schema transitions to applied; the
server holds it behind an ArcSwap-style handle so a query in flight
sees a consistent table.
Structs§
- ExtSchema
- A registered extension schema, as the registry holds it.
- Path
Table - The set of legal query paths with their types and index status,
projected from the record schema and the applied
ext_schemas.
Enums§
- Indexed
- How much of the operator set a path’s storage can serve.
- Path
Info - What a legal query path denotes.
Constants§
- GENERATED_
COLUMNS - The generated columns of
versions, as JSON path and column name.