Skip to main content

Module arrow

Module arrow 

Source
Expand description

Arrow emission: the columnar contract for decision batches.

For a set of questions, DecisionSchema emits (in question authoring order, then the version triple):

columntypenullabilitycontent
{qid}.probabilitiesfixed_size_list<f32; N>nullableone probability per label, canonical order; null = abstained
{qid}.labelutf8nullableargmax label (D6 tie-break); null = abstained
{qid}.conformal_setlist<utf8>nullableconformal prediction set — reserved in v1, may be entirely unpopulated
schema_versionutf8non-nullquestion-set schema version
model_versionutf8non-nullresolved model id
calib_versionutf8nullablecalibration-fit version; null = uncalibrated

N (cardinality) is 2 for noul (["false", "true"]), the option count for choice, the level count for score.

§Contract rules

  • Label lists live in Arrow field metadata on the probabilities column (jev.kind, jev.labels as a JSON array) — never in schema metadata, which this crate always emits empty. Calibration parameters are likewise never schema content; they are rows in the P0.3 metrics tables.
  • Label-set evolution is schema evolution and fails loudly: DecisionSchema::check_evolution rejects any change to an existing question’s kind or label set — and any flip of conformal-set emission, which changes the emitted column set; the remedy is minting a new schema version (the schema_version triple column), which is what prepared statements pin (P3.5).
  • Question ids must be identifier-safe ([A-Za-z_][A-Za-z0-9_]*) for the columnar surface so emitted columns compose unquoted in SQL (the ADBC path). Wire-level ids stay opaque; the constraint applies at schema construction, not at authoring.

Structs§

AnswerRow
One row of a decision batch: answers keyed by question id.
DecisionSchema
The Arrow-emission view over a set of questions. Cheap to clone (the questions are shared); the Arrow schema itself is rebuilt on demand so an emitted schema can never drift from the IR.
EvolutionReport
Compatible differences between two schema generations.
LabelChange
One changed question in a failed label-set evolution check.
LabelEvolutionError
Label-set evolution on an existing question — schema evolution fails loudly.

Enums§

ArrowSchemaError
Why a set of questions cannot back an Arrow schema.
BatchError
Why a row cannot be encoded into a batch under this schema.
EvolutionError
Why a schema generation pair fails the evolution check.

Constants§

CALIB_VERSION_COLUMN
Column name of the calibration-fit version (version triple; null = uncalibrated).
FIELD_META_KIND
Field-metadata key carrying the question kind (noul / choice / score).
FIELD_META_LABELS
Field-metadata key carrying the label list as a JSON array in canonical order.
MODEL_VERSION_COLUMN
Column name of the resolved model id (version triple).
SCHEMA_VERSION_COLUMN
Column name of the question-set schema version (version triple).