Foresight.Schemas.LabeledPair (Foresight v0.1.0)

Copy Markdown View Source

D2: graded relevance label for a (query, candidate memory) pair — the training/eval substrate for learned per-bank fusion weights.

Each row is one source's grade for one pair. Candidates are keyed on memory_ref, the stable corpus id (metadata["eval_id"]), NOT the ephemeral memory_units.id UUID, so a human-graded gold set survives corpus reloads instead of being re-labelled each run.

Cohen's weighted kappa is computed by joining a REFERENCE source (:human or :agent) against source: :llm on {query_ref, memory_ref} where split == :calibration. The :test split is the held-out reference set the judge never sees; :train is the bulk LLM-labelled set D2 ascends against.

Currently, the shipped reference set for both D2 lanes is :agent, not :human — no person has graded a D2 pair. Pipeline.calibration_report/2 always reports which reference source it scored against, and refuses to pick silently when both are present.

Summary

Types

t()

@type t() :: %Foresight.Schemas.LabeledPair{
  __meta__: term(),
  bank: term(),
  bank_id: term(),
  grade: term(),
  id: term(),
  inserted_at: term(),
  judge_model: term(),
  memory_ref: term(),
  query_ref: term(),
  query_text: term(),
  source: term(),
  split: term(),
  updated_at: term()
}

Functions

changeset(labeled_pair, attrs)

@spec changeset(t(), map()) :: Ecto.Changeset.t()