Foresight.Evals.Labeling.LabelStore (Foresight v0.1.0)

Copy Markdown View Source

D2: persist label attrs (from GoldIngest or the judge labeler) into labeled_pairs, idempotently. A re-run upserts on the natural key (bank_id, query_ref, memory_ref, source) rather than duplicating, so a labeling pass can be safely resumed or corrected. Invalid rows are collected, not fatal — the batch reports what it wrote and what it rejected.

Summary

Types

result()

@type result() :: %{written: non_neg_integer(), errors: [Ecto.Changeset.t()]}

Functions

write_all(attrs_list, opts \\ [])

@spec write_all(
  [map()],
  keyword()
) :: result()