/** * Typed-judgment answer mapper (SP-306, GitHub #185) — pure domain, no I/O. * * Maps raw {@link TypedJudgmentAnswers} (keyed by question id, SP-304 wire * types) onto the normalized {@link TypedJudgment} signal consumed by the * routing pipeline: * - score answers are normalized by `(levels - 1)` onto 0–1; * - noul answers pass through as the calibrated P(yes) from the wire; * - a missing answer maps its fields to `null` (no signal); * - malformed answers are **rejected** with `TypedJudgmentError` * (`kind: 'invalid_response'`): unknown choice, answer/question kind * mismatch, out-of-range or non-finite scores, out-of-range confidence, * out-of-range or non-finite noul probability. */ import { type TypedJudgmentAnswers } from '../ports/typed-judgment-port.js'; import { type TaskKind } from './questions.js'; /** Normalized, pipeline-ready typed judgment. Fields are `null` when the * corresponding question was not answered (partial results allowed). */ export interface TypedJudgment { /** Selected task kind, or `null` when `task_kind` was not answered. */ readonly taskKind: TaskKind | null; /** Judge confidence in `taskKind` (0–1), or `null`. */ readonly taskKindConfidence: number | null; /** `capability_deserved` normalized to 0–1 (`score / (levels - 1)`), or `null`. */ readonly capabilityDeserved: number | null; /** Probability the task needs deep reasoning (noul P(yes)), or `null`. */ readonly deepReasoningP: number | null; /** `code_gen` normalized to 0–1, or `null`. */ readonly codeGen: number | null; /** `tool_use` normalized to 0–1, or `null`. */ readonly toolUse: number | null; /** Probability the request is destructive (noul P(yes)), or `null`. */ readonly destructiveP: number | null; /** * Judge confidence (0–1) per answered question that carries one (choice * and score answers). Noul answers carry no confidence on the wire. */ readonly confidences: Readonly>; } /** * Map raw judge answers to the normalized {@link TypedJudgment} signal. * * @throws {TypedJudgmentError} with `kind: 'invalid_response'` when an * answer is malformed (unknown choice, kind mismatch, out-of-range * score/confidence). Callers follow the port's fail-open contract: any * rejection means "no judgment available". */ export declare function mapTypedJudgment(answers: TypedJudgmentAnswers): TypedJudgment; //# sourceMappingURL=answer-mapper.d.ts.map