D2 component 3a: build the human-graded gold set from per-query candidate pools and serialize it to a gradeable artifact.
build/2 selects a stratified sample of (query, candidate) pairs (balanced across
question types), deterministically under a seed, caps how many pairs any one query
contributes, and assigns each pair a :calibration split (co-graded by the LLM judge →
Cohen's kappa) or a :test split (held out from D2 training, so the final exceed metric
rests on human labels). to_artifact/2 renders the selection to a JSON-encodable map
whose "grade" fields are blank for the human to fill.
Determinism mirrors the LongMemEval stratified sampler: :rand.seed(:exsss, {s, s*7, s*13}).
Pure: no DB, no recall call.
Summary
Functions
Build the gold set from query_pools (each %{query_ref, query_text, question_type, candidates: [pooled candidate]}).
Render a built gold set to a JSON-encodable artifact with blank grades.
Types
Functions
Build the gold set from query_pools (each %{query_ref, query_text, question_type, candidates: [pooled candidate]}).
Options: :seed, :target_pairs, :per_query_cap, :calibration_ratio.
Render a built gold set to a JSON-encodable artifact with blank grades.