import { type CompactMetricDiagnosticsResult, type CompactPreparedDiagnosticData, type CompiledDiagnosticDefinition, type DiagnosticCompletePeriodCutoff, type DiagnosticDeepReadonly, type DiagnosticDefinition, type DiagnosticExpectedCell, type DiagnosticExposureObservation, type DiagnosticLossInput, type DiagnosticsFilter, type JsonValue, type MetricDiagnosticsResult } from "@actuarial-ts/core"; import { type DiagnosticReviewEvidence, type DiagnosticReviewReceipt, type CompactDiagnosticReviewReceipt } from "./diagnosticPreparedReview.js"; import { type DiagnosticExecutionPreflight } from "./diagnosticExecutionContracts.js"; export type DiagnosticAllowedReviewStatus = "pass" | "warning" | "not-evaluated" | "fail"; export interface DiagnosticExecutionPolicyInput { readonly allowedReviewStatuses?: readonly DiagnosticAllowedReviewStatus[]; readonly allowedMetricFindingSeverities?: readonly ("info" | "warning" | "fail")[]; readonly rationaleRef?: string; } export interface DiagnosticRunInput { readonly definition: DiagnosticDefinition; readonly losses: readonly DiagnosticLossInput[]; readonly exposures?: readonly DiagnosticExposureObservation[]; readonly filter?: DiagnosticsFilter; readonly completePeriodCutoffs?: readonly DiagnosticCompletePeriodCutoff[]; readonly expectedCells?: readonly DiagnosticExpectedCell[]; readonly reviewEvidence?: DiagnosticReviewEvidence | null; readonly runPresetId?: string; readonly datasetArtifactId?: string; readonly groupMap?: Readonly>; readonly groupDimensions?: Readonly>; readonly policy?: DiagnosticExecutionPolicyInput; } declare const validatedDiagnosticRunInputBrand: unique symbol; export interface ValidatedDiagnosticRunInput { readonly [validatedDiagnosticRunInputBrand]: true; readonly definition: CompiledDiagnosticDefinition; readonly losses: readonly DiagnosticDeepReadonly[]; readonly exposures: readonly DiagnosticDeepReadonly[]; readonly filter: DiagnosticDeepReadonly | null; readonly completePeriodCutoffs: readonly DiagnosticCompletePeriodCutoff[]; readonly expectedCells: readonly DiagnosticExpectedCell[] | null; readonly reviewEvidence: DiagnosticDeepReadonly | null; readonly runPresetId: string | null; readonly datasetArtifactId: string | null; readonly groupMap: Readonly>; readonly groupDimensions: Readonly>; readonly policy: { readonly allowedReviewStatuses: readonly DiagnosticAllowedReviewStatus[]; readonly allowedMetricFindingSeverities: readonly ("info" | "warning" | "fail")[]; readonly rationaleRef: string | null; }; } type DiagnosticRunInputContent = Omit; declare const compactValidatedDiagnosticRunInputBrand: unique symbol; /** Validated owned input whose preparation does not eagerly expand identity evidence. */ export interface CompactValidatedDiagnosticRunInput extends DiagnosticRunInputContent { readonly [compactValidatedDiagnosticRunInputBrand]: true; } export interface DiagnosticExecutionGateReceipt { readonly allowedReviewStatuses: readonly DiagnosticAllowedReviewStatus[]; readonly allowedMetricFindingSeverities: readonly ("info" | "warning" | "fail")[]; readonly rationaleRef: string | null; readonly reviewGate: "passed" | "blocked"; readonly metricGate: "not-run" | "passed" | "blocked"; } export interface CompletedValidatedMetricDiagnosticsRun { readonly status: "completed"; readonly prepared: import("@actuarial-ts/core").PreparedDiagnosticData; readonly review: DiagnosticReviewReceipt; readonly result: DiagnosticDeepReadonly; readonly runPresetId: string | null; readonly datasetArtifactId: string | null; readonly groupMap: Readonly>; readonly groupDimensions: Readonly>; readonly gate: DiagnosticExecutionGateReceipt & { readonly reviewGate: "passed"; readonly metricGate: "passed"; }; } export type ValidatedMetricDiagnosticsOutcome = CompletedValidatedMetricDiagnosticsRun | { readonly status: "blocked"; readonly stage: "review"; readonly prepared: import("@actuarial-ts/core").PreparedDiagnosticData; readonly review: DiagnosticReviewReceipt; readonly result: null; readonly runPresetId: string | null; readonly datasetArtifactId: string | null; readonly groupMap: Readonly>; readonly groupDimensions: Readonly>; readonly gate: DiagnosticExecutionGateReceipt & { readonly reviewGate: "blocked"; readonly metricGate: "not-run"; }; } | { readonly status: "blocked"; readonly stage: "metric"; readonly prepared: import("@actuarial-ts/core").PreparedDiagnosticData; readonly review: DiagnosticReviewReceipt; readonly result: DiagnosticDeepReadonly; readonly runPresetId: string | null; readonly datasetArtifactId: string | null; readonly groupMap: Readonly>; readonly groupDimensions: Readonly>; readonly gate: DiagnosticExecutionGateReceipt & { readonly reviewGate: "passed"; readonly metricGate: "blocked"; }; }; /** A distinct authenticated run; it cannot be substituted for an eager receipt. */ export interface CompletedCompactMetricDiagnosticsRun { readonly status: "completed"; readonly prepared: CompactPreparedDiagnosticData; readonly review: CompactDiagnosticReviewReceipt; readonly result: DiagnosticDeepReadonly; readonly runPresetId: string | null; readonly datasetArtifactId: string | null; readonly groupMap: Readonly>; readonly groupDimensions: Readonly>; readonly gate: DiagnosticExecutionGateReceipt & { readonly reviewGate: "passed"; readonly metricGate: "passed"; }; } type CompactRunMetadata = Omit; export type CompactMetricDiagnosticsOutcome = CompletedCompactMetricDiagnosticsRun | (CompactRunMetadata & { readonly status: "blocked"; readonly stage: "review"; readonly result: null; readonly gate: DiagnosticExecutionGateReceipt & { readonly reviewGate: "blocked"; readonly metricGate: "not-run"; }; }) | (CompactRunMetadata & { readonly status: "blocked"; readonly stage: "metric"; readonly result: DiagnosticDeepReadonly; readonly gate: DiagnosticExecutionGateReceipt & { readonly reviewGate: "passed"; readonly metricGate: "blocked"; }; }); declare const queryContextBrand: unique symbol; /** SDK-owned source snapshot. Cloning or serializing this handle loses authority. */ export interface DiagnosticQueryContext { readonly [queryContextBrand]: true; } /** * Omitted fields inherit the context; null clears filter/expected-cell selection. * Group maps/dimensions must match the selected scope; empty records clear them. */ export interface DiagnosticQuery { /** Per-query evidence labels; null clears the inherited label. */ readonly runPresetId?: string | null; readonly datasetArtifactId?: string | null; readonly filter?: DiagnosticsFilter | null; readonly completePeriodCutoffs?: readonly DiagnosticCompletePeriodCutoff[]; readonly expectedCells?: readonly DiagnosticExpectedCell[] | null; readonly groupMap?: Readonly>; readonly groupDimensions?: Readonly>; } export declare function validateDiagnosticRunInput(value: unknown): ValidatedDiagnosticRunInput; /** Validate, own and prepare inputs without eagerly materializing identity graphs. */ export declare function validateDiagnosticRunInputCompact(value: unknown): CompactValidatedDiagnosticRunInput; /** * Own and validate source rows and compile the definition once. Queries keep the * definition, execution policy, source order and review evidence fixed. * Metric selections and eligible clean aggregate source/origin/date/age queries * share prepared cells; ineligible inputs still perform full core preparation. * Source/origin queries reuse invariant owned review evidence. Date/age queries * reuse cell-local checks but recompute monotonic comparisons and controls. Every * query enforces review and metric gates, including unchanged evidence validation. */ export declare function createDiagnosticQueryContext(value: unknown): DiagnosticQueryContext; /** Create an authentic per-query input without cloning/reparsing owned source rows. */ export declare function validateDiagnosticQueryCompact(context: DiagnosticQueryContext, query?: unknown): CompactValidatedDiagnosticRunInput; /** Execute all review and metric gates for this scope, even if another scope passed. */ export declare function runDiagnosticQueryCompact(context: DiagnosticQueryContext, query?: DiagnosticQuery): CompactMetricDiagnosticsOutcome; export declare function assertCompactValidatedDiagnosticRunInput(value: unknown): asserts value is CompactValidatedDiagnosticRunInput; export declare function assertValidatedDiagnosticRunInput(value: unknown): asserts value is ValidatedDiagnosticRunInput; export declare function runValidatedMetricDiagnostics(input: ValidatedDiagnosticRunInput): ValidatedMetricDiagnosticsOutcome; export declare function assertCompletedValidatedMetricDiagnosticsRun(value: unknown): asserts value is CompletedValidatedMetricDiagnosticsRun; /** Run every review and metric gate while retaining complete compact evidence. */ export declare function runValidatedMetricDiagnosticsCompact(input: CompactValidatedDiagnosticRunInput): CompactMetricDiagnosticsOutcome; export declare function assertCompletedCompactMetricDiagnosticsRun(value: unknown): asserts value is CompletedCompactMetricDiagnosticsRun; /** * Return the original SDK-owned validated input for an authentic completed run. * This is the same deeply immutable input owner, not a reconstruction from its * normalized audit or a mutable copy of the caller's upload values. */ export declare function getCompletedCompactDiagnosticRunInput(run: CompletedCompactMetricDiagnosticsRun): CompactValidatedDiagnosticRunInput; /** Prepares eager inputs and bounds native expansion; does not run review/metric gates. */ export declare function validateDiagnosticExecutionRequest(value: unknown): DiagnosticExecutionPreflight; /** Prepares compact inputs without materializing preparation identity or review evidence. */ export declare function validateCompactDiagnosticExecutionRequest(value: unknown): DiagnosticExecutionPreflight; /** Returns the original native outcome; completed-run authority survives this gateway. */ export declare function runMetricDiagnosticsFromInput(value: unknown): ValidatedMetricDiagnosticsOutcome; /** Returns the original compact outcome and its opaque stores; JSON copies lose authority. */ export declare function runMetricDiagnosticsCompactFromInput(value: unknown): CompactMetricDiagnosticsOutcome; export {}; //# sourceMappingURL=diagnosticInput.d.ts.map