import type { HeldoutStudyModule, Digest } from '../heldout/types.js'; import { aggregateEnsembleResults } from '../ensemble/aggregate.js'; import type { ChampionChallengerObservation } from '../ensemble/runtime.js'; import type { DecisionChampionChallenger } from '../ensemble/types.js'; import type { QualificationIntegrityMetadata } from '../qualification/release.js'; import { type D17Pair } from './statistics.js'; import type { prepareD17Study } from './corpus.js'; import type { prepareD17StagedStudy } from './staged.js'; import type { D17CalibrationContext } from './calibration.js'; import { calibrationIdentityDigest } from '../calibration/registry.js'; import type { PromotionEligibility } from '../calibration/types.js'; import type { ChampionAliasGateway } from '../ensemble/runtime.js'; type ScoreInput = Parameters[0]; type Prepared = ReturnType; type StagedPrepared = ReturnType; /** Maps retained provider distributions only; confidence and agreement never become calibrated probability. */ export declare function scoreD17Study(input: ScoreInput, prepared: Prepared): Promise<{ schemaVersion: string; scope: string; calibrated: boolean; d09Qualified: boolean; calibratedGate: boolean; corpusDigest: `sha256:${string}`; preregistrationDigest: `sha256:${string}`; executionPins: { definition: import("../types.js").ArtifactPin; binding: import("../types.js").ArtifactPin | null; model: string; adapter: { id: string; version: string; }; aggregatePolicyDigest: `sha256:${string}` | null; }; integrityDigest: `sha256:${string}`; integrity: QualificationIntegrityMetadata; integrityProblems: string[]; statistics: { benefitSupported: boolean; findings: string[]; statisticalGate: "HOLD" | "pass"; worstCaseFailureAsError: { n: number; championCorrect: number; challengerCorrect: number; missingPairsCountedAsErrors: number; }; sampleN: number; missingIds: string[]; slices: { slice: "authority" | "direct-facts" | "multi-fact" | "negation"; n: number; qualityDelta: number | null; harm: boolean; descriptiveOnly: boolean; }[]; pairedDeltas: import("../index.js").PairedDeltaObservation[]; quality: import("../index.js").PairedDifferenceInterval | null; brier: import("../index.js").PairedDifferenceInterval | null; abstention: import("../index.js").PairedDifferenceInterval | null; acceptedN: number; acceptedErrors: number; acceptedErrorUpperBps: number | null; coverageLowerBps: number | null; p95LatencyIncreaseMs: number | null; latencyDifferencesMs: number[]; netSavingsMicros: number; costBasis: string; }; statisticsDigest: `sha256:${string}`; pairs: D17Pair[]; observations: { id: string; champion: ChampionChallengerObservation | null; challenger: ChampionChallengerObservation | null; aggregate: ReturnType | null; }[]; accounting: { allSplits: { attempts: number; reservedCostMicros: number; }; test: { championReservedCostMicros: number; challengerReservedCostMicros: number; netSavingsMicros: number; complete: boolean; }; }; calibrationDiagnostics: { champion: { overall: import("../index.js").BinarySliceMetrics; slices: Record; } | null; challenger: { overall: import("../index.js").BinarySliceMetrics; slices: Record; } | null; calibrated: boolean; }; pending: string[]; decision: "HOLD" | "ROLLBACK"; }>; /** Native serialization requires a separately anchored record. It cannot create approval or eligibility. */ export declare function buildD17NativeReport(input: { report: Awaited> | D17StagedReport; prepared: Prepared | StagedPrepared; record: DecisionChampionChallenger; integrity: QualificationIntegrityMetadata; trustedIntegrityDigest: Digest; trustedReportDigest: Digest; /** Staged (v2) only: D09's stored eligibility for `record.eligibilityId`, checked against the registry that will promote. */ eligibility?: PromotionEligibility; registry?: Pick; /** Staged (v2) only: the anchored extra-cost tradeoff approval an upstream PROMOTE must carry. */ tradeoff?: unknown; trustedTradeoffDigest?: Digest; }): Promise; export type D17StagedReport = Awaited>; /** * Calibrated test-phase scorer (#2611 staged D09). The collector passes only test rows and `calibrated: null`. * The approved calibration set, both approved artifacts, their mappings and the completed development review * are verified and D09-qualified at the scoring clock before any row is scored. The champion's native P(yes) * passes through the member calibrator; the challenger's raw three-member mean passes through the aggregate * calibrator, and it is accepted only when the native aggregate accepts and the calibrated value is not a tie. * The frozen D17 native gates are evaluated on those calibrated measurements; the uncalibrated statistics are * retained as a descriptive comparison. The decision is HOLD or a preserved ROLLBACK, never PROMOTE. */ export declare function scoreD17StagedStudy(input: Omit & { approvedCalibration: unknown; calibrated: unknown; }, prepared: StagedPrepared, context: D17CalibrationContext): Promise<{ schemaVersion: "decision-d17-study-report/v2"; scope: "synthetic-staged-calibrated"; calibrated: true; d09Qualified: true; calibratedGate: true; corpusDigest: `sha256:${string}`; preregistrationDigest: `sha256:${string}`; executionPins: { definition: import("../types.js").ArtifactPin; binding: import("../types.js").ArtifactPin | null; model: "jev-1.13.0"; adapter: { id: string; version: string; }; aggregatePolicyDigest: `sha256:${string}` | null; }; integrityDigest: `sha256:${string}`; integrity: QualificationIntegrityMetadata; integrityProblems: string[]; calibration: { mode: "staged-test"; calibrationSetDigest: `sha256:${string}`; calibrationPhaseRecordDigest: `sha256:${string}`; priorApprovalDigest: `sha256:${string}`; member: { artifactId: string; artifactDigest: `sha256:${string}`; mappingDigest: `sha256:${string}`; compatibility: { action: "allow"; state: "exact" | "approved-compatible"; pinId: string; }; }; aggregate: { artifactId: string; artifactDigest: `sha256:${string}`; mappingDigest: `sha256:${string}`; compatibility: { action: "allow"; state: "exact" | "approved-compatible"; pinId: string; }; }; qualifiedAt: string; applied: { champion: "member"; challenger: "aggregate"; }; }; developmentReviewDigest: `sha256:${string}`; calibrationReviewDigest: `sha256:${string}`; statistics: { benefitSupported: boolean; findings: string[]; statisticalGate: "HOLD" | "pass"; worstCaseFailureAsError: { n: number; championCorrect: number; challengerCorrect: number; missingPairsCountedAsErrors: number; }; sampleN: number; missingIds: string[]; slices: { slice: "authority" | "direct-facts" | "multi-fact" | "negation"; n: number; qualityDelta: number | null; harm: boolean; descriptiveOnly: boolean; }[]; pairedDeltas: import("../index.js").PairedDeltaObservation[]; quality: import("../index.js").PairedDifferenceInterval | null; brier: import("../index.js").PairedDifferenceInterval | null; abstention: import("../index.js").PairedDifferenceInterval | null; acceptedN: number; acceptedErrors: number; acceptedErrorUpperBps: number | null; coverageLowerBps: number | null; p95LatencyIncreaseMs: number | null; latencyDifferencesMs: number[]; netSavingsMicros: number; costBasis: string; }; statisticsDigest: `sha256:${string}`; uncalibratedStatistics: { benefitSupported: boolean; findings: string[]; statisticalGate: "HOLD" | "pass"; worstCaseFailureAsError: { n: number; championCorrect: number; challengerCorrect: number; missingPairsCountedAsErrors: number; }; sampleN: number; missingIds: string[]; slices: { slice: "authority" | "direct-facts" | "multi-fact" | "negation"; n: number; qualityDelta: number | null; harm: boolean; descriptiveOnly: boolean; }[]; pairedDeltas: import("../index.js").PairedDeltaObservation[]; quality: import("../index.js").PairedDifferenceInterval | null; brier: import("../index.js").PairedDifferenceInterval | null; abstention: import("../index.js").PairedDifferenceInterval | null; acceptedN: number; acceptedErrors: number; acceptedErrorUpperBps: number | null; coverageLowerBps: number | null; p95LatencyIncreaseMs: number | null; latencyDifferencesMs: number[]; netSavingsMicros: number; costBasis: string; }; pairs: D17Pair[]; observations: { id: string; champion: ChampionChallengerObservation | null; challenger: ChampionChallengerObservation | null; aggregate: ReturnType | null; }[]; accounting: { allSplits: { attempts: number; reservedCostMicros: number; }; test: { championReservedCostMicros: number; challengerReservedCostMicros: number; netSavingsMicros: number; complete: boolean; }; }; calibrationDiagnostics: { champion: { overall: import("../index.js").BinarySliceMetrics; slices: Record; } | null; challenger: { overall: import("../index.js").BinarySliceMetrics; slices: Record; } | null; calibrated: true; }; gates: { source: "d17-native-protocol"; gateBinding: null; statisticalGate: "pass" | "HOLD"; findings: string[]; promotion: "not-authorized: requires separate extra-cost tradeoff approval and D09 promotion eligibility"; }; pending: string[]; decision: "HOLD" | "ROLLBACK"; }>; /** Operator-supplied identity for the anchored champion/challenger record; nothing here confers eligibility. */ export interface D17NativeOperator { alias: string; aliasRevision: number; eligibilityId: string; integrityReportId: string; approvalReference: string; approvedAt: string; holdoutAccessedAt: string; } /** * Builds the real champion/challenger record and the shadow baseline for a calibrated v2 report. Each role * cites the D09 artifact applied to it; identities are the calibrated decision identities. The caller binds * the returned baseline and statistics digest into eval-integrity metadata, anchors that digest externally, * and only then serializes the native report with `buildD17NativeReport`. */ export declare function d17NativeHandoff(input: { report: D17StagedReport; trustedReportDigest: Digest; prepared: StagedPrepared; artifacts: { member: { id: string; digest: Digest; identity: Parameters[0]; }; aggregate: { id: string; digest: Digest; identity: Parameters[0]; }; }; operator: D17NativeOperator; }): Promise<{ record: DecisionChampionChallenger; pairedBaseline: { championChallengerShadow: import("../index.js").ChampionChallengerShadowBaseline; d17StatisticsDigest: `sha256:${string}`; }; }>; export interface D17TradeoffApproval { schemaVersion: 'decision-d17-tradeoff-approval/v1'; approved: true; reviewer: string; reportDigest: Digest; statisticsDigest: Digest; netSavingsMicros: number; acceptedAdditionalCostMicros: number; qualityLowerBps: number; approvalReference: string; approvedAt: string; } /** * The preregistered extra-cost tradeoff: an anchored approval of this exact report and statistics that accepts at least the * measured additional reservation cost and records the observed quality lower bound. It approves cost, not quality. */ export declare function validateD17Tradeoff(report: D17StagedReport, tradeoff: unknown, trustedDigest: unknown): D17TradeoffApproval; /** * Eval-integrity metadata for the native D17 record. The release gate comes from the locked-snapshot evidence (`base`); a * PROMOTE gate survives only when the calibrated study gate passes, the quality lower bound is positive and an anchored * extra-cost tradeoff approval binds this report. Otherwise PROMOTE is held, with the missing pieces as reasons. */ export declare function d17NativeIntegrity(input: { base: QualificationIntegrityMetadata; pairedBaseline: Record; report: D17StagedReport; tradeoff?: unknown; trustedTradeoffDigest?: Digest | null; }): QualificationIntegrityMetadata; export {}; //# sourceMappingURL=score.d.ts.map