import type { TrustBundle } from "@kontourai/surface"; import { type CalibrationMetrics } from "./calibration.js"; import type { SurveyInput } from "./types.js"; export interface SurveyCalibrationOptions { /** * EXPERIMENTAL opt-in, required for any `conclusionConfidence.value` to be * set (#279). The value is the affirmation rate of the claim's whole * extractor/field GROUP — a base rate every affirmed claim in the group * shares — not a per-claim probability. Without this flag the `calibration` * option sets no value. */ experimentalConclusionValue?: boolean; /** * Precomputed calibration to source the value from — typically derived over a * LONGER history than the current batch (a better-grounded curve, and it avoids * the mild self-reference of a claim's own review outcome feeding its value). * When omitted, calibration is derived from THIS batch's review outcomes. */ metrics?: CalibrationMetrics; /** * Minimum labeled samples a group needs before its accuracy is emitted as a * value. Groups below the floor leave `value` unset rather than emitting a * poorly-grounded number. Default {@link DEFAULT_CALIBRATION_MIN_SAMPLES}. */ minSamples?: number; } export interface BuildSurveyTrustBundleOptions { reviewProofs?: boolean; /** * Caller-owned identity for one projection or resolution context, such as a * review-session, proposal, or append-only persistence record id. When set, * Survey folds it into generated Evidence and VerificationEvent ids so * repeated projections of the same Claim cannot collide. Claim ids and all * legacy output remain unchanged when omitted. * * Use a portable resource-name fragment: ASCII letters, digits, `.`, `_`, * `:`, or `-`, beginning with a letter or digit. */ projectionContextId?: string; /** * EXPERIMENTAL. Populate `conclusionConfidence.value` from empirical review * calibration — the affirmation rate of the claim's extractor/field group * (a group base rate, not a per-claim probability; see #114/#137/#279). * A value is set ONLY with `{ experimentalConclusionValue: true }`; `true` or * an object without that flag sets no value. The object may also supply * precomputed `metrics` and/or a `minSamples` floor. Absent → `value` stays * unset and only the comfort-zone signal is carried. * * ADVISORY (ADR 0003 §4): this only enriches the emitted conclusion confidence; * it never changes a claim's `status`. */ calibration?: boolean | SurveyCalibrationOptions; } /** * Thrown when a claim's trusted status or value does not agree with the review * outcome it cites, or when the governing review cannot be chosen. * - `status-mismatch`: a `verified`/`assumed` claim cites a review whose status differs. * - `value-mismatch`: a `verified`/`assumed` claim carries a value other than the reviewed value. * - `ambiguous-review-order`: several reviews apply to one candidate and the latest * cannot be determined from `reviewedAt` (missing, unparseable, or tied). */ export declare class ReviewAgreementError extends Error { readonly name = "ReviewAgreementError"; readonly code: "status-mismatch" | "value-mismatch" | "ambiguous-review-order"; constructor(code: ReviewAgreementError["code"], message: string); } export declare function buildSurveyTrustBundle(input: SurveyInput, options?: BuildSurveyTrustBundleOptions): TrustBundle; /** Test-only: re-arm the once-per-process calibration opt-in warning. Not exported from the package index. */ export declare function resetCalibrationOptInWarningForTests(): void;