Skip to main content
The typed row schema and its conversions. 10 public names. import whileai.simulations as wai, then wai.name.

Calibration

Measured difficulty of one task for one student. Optional; only calibrate produces it. pass_rate_ci95 is the Wilson 95% interval on pass_rate from n rollouts (about +/-0.3 wide at n=8), so a band assignment can be read with its uncertainty. mean_kl is the sampled KL to a reference policy per generated token; simulate(logprobs=True) captures the student side and calibrate(rows, ref=...) fills it in.

Dataset

Split membership is a dataset decision, so one task can be holdout in one dataset and training in another.

Judgment

Marker

Rollout

One episode. Mutable so grading paths can attach to it in place; the no-verdict invariant is enforced at the boundary, not here.

Task

The situation. Identity-bearing, so nothing computed lives here: splits belong to a Dataset, difficulty to a Calibration.

calibration_of

The typed Calibration a row carries, or None when absent or malformed. publish_gate / calibrate write it as a flat dict under calibration; this is the read side. mean_kl is optional.

from_row

Split one flat row into its four objects. Any version, any shape.

to_row

The flat v1 wire row. Inverse of from_row on engine rows; on other shapes it is the canonical row load_traces would produce, with the source row’s unknown keys carried along.

validate

Problems with one row, empty when it is fine. Never raises. Stamped rows must carry the required fields with the right types. Unstamped kind="row" rows are version 0 and only have to be non-empty dicts: nothing that works today is rejected there. Two things are reported regardless of version, because “0 validation failures” is read as a guarantee and neither case is one:
  • an empty dict, which carries no prompt, no messages, no verdict;
  • a training or preference row with no messages or no chosen/rejected. Those two kinds ask “is this a training sample”, and an unstamped dict with no conversation in it is not one whatever version it claims.