import { GateDecisionUpgradeError } from '../../gates/lattice.js'; import type { AliasEvent, CompatibilityDecision, PromotionEligibility } from '../calibration/types.js'; import type { DecisionChampionChallenger, DecisionDriftResponse, DecisionEnsembleAggregate, DecisionEnsembleIntegrityReport, DecisionEnsemblePolicy, EnsembleAggregationAlgorithm, EnsembleBudgetPlan, EnsembleCeilings, EnsembleDigest, EnsembleDisagreementMetric, EnsemblePrimitive, IntegrityGateDecision, PairedMetric, PairedMetricThreshold, DriftResponseRule } from './types.js'; /** Pure D17 contract validation. Nothing here resolves credentials, calls an adapter or opens a transport. */ export declare class EnsembleContractError extends Error { readonly layer: 'admission' | 'schema' | 'semantic'; readonly details: readonly string[]; constructor(message: string, layer?: 'admission' | 'schema' | 'semantic', details?: readonly string[], cause?: GateDecisionUpgradeError); } export declare const ENSEMBLE_SCHEMA_FILES: { readonly policy: "DecisionEnsemblePolicy.v1.schema.json"; readonly championChallenger: "DecisionChampionChallenger.v1.schema.json"; readonly driftResponse: "DecisionDriftResponse.v1.schema.json"; readonly aggregate: "DecisionEnsembleAggregate.v1.schema.json"; readonly integrityReport: "DecisionEnsembleIntegrityReport.v1.schema.json"; }; export type EnsembleSchemaKind = keyof typeof ENSEMBLE_SCHEMA_FILES; /** Versioned algorithm and metric compatibility. An unknown version is rejected, never approximated. */ export declare const ENSEMBLE_AGGREGATION_PRIMITIVES: Readonly>; export declare const ENSEMBLE_DISAGREEMENT_PRIMITIVES: Readonly>; export declare const REQUIRED_PAIRED_METRICS: readonly PairedMetric[]; /** Admission then JSON Schema; the semantic layer runs only on schema-valid values. */ export declare function checkEnsembleSchema(kind: EnsembleSchemaKind, value: unknown): void; export declare function ensembleContractDigest(value: unknown): EnsembleDigest; /** Order-independent digest a preregistration pins before any held-out access. */ export declare function pairedThresholdsDigest(metrics: readonly PairedMetricThreshold[]): EnsembleDigest; export declare function driftThresholdsDigest(rules: readonly DriftResponseRule[]): EnsembleDigest; /** Locale-independent code-unit ordering; the canonical order for ties and member lists. */ export declare function compareEnsembleKeys(a: string, b: string): number; export interface EnsemblePolicyValidationOptions { /** Host/tenant/workflow ceilings; the effective limit is the minimum of every layer, as in effectiveGraphCeilings. */ hostCeilings?: ReadonlyArray>; /** D09 compatibility pins per member ID, when the host has already resolved them. */ calibrationPins?: Readonly>; } export interface EnsemblePolicyValidation { policy: DecisionEnsemblePolicy; digest: EnsembleDigest; budget: EnsembleBudgetPlan; } /** Refuses incompatible members, primitives, uncertainty semantics, calibration, capabilities or budgets. */ export declare function validateEnsemblePolicy(value: unknown, options?: EnsemblePolicyValidationOptions): EnsemblePolicyValidation; /** Validation-time mirror of GraphBudgetLedger: effective limits are layer minima, estimates must be * safe integers with at least one attempt, attempts are never refunded, unknown cost needs a trusted * bound, and the whole plan is admitted all-or-nothing before any dispatch could start. */ export declare function planEnsembleBudget(value: unknown, hostCeilings?: ReadonlyArray>): EnsembleBudgetPlan; export interface ChampionChallengerContext { /** The D09 registry's PromotionEligibility record named by `eligibilityId`. */ eligibility?: PromotionEligibility; /** Immutable D09 alias history used to confirm the exact rollback target. */ aliasHistory?: readonly AliasEvent[]; } /** Stable problem codes comparing a champion/challenger record with the D09 eligibility record. */ export declare function championChallengerEligibilityProblems(record: DecisionChampionChallenger, eligibility: PromotionEligibility): string[]; export declare function validateChampionChallenger(value: unknown, context?: ChampionChallengerContext): { record: DecisionChampionChallenger; digest: EnsembleDigest; }; export declare function validateDriftResponsePolicy(value: unknown): DecisionDriftResponse; export declare function validateEnsembleAggregate(value: unknown): DecisionEnsembleAggregate; /** D17 findings derived from the carried #2037/#2048 integrity fields alone. */ export declare function integrityMetadataFindings(integrity: DecisionEnsembleIntegrityReport['integrity'], minimumPairs: number): string[]; /** The finding for one paired delta against its preregistered threshold, or null when it passes. */ export declare function pairedDeltaFinding(threshold: PairedMetricThreshold, item: { delta: number | null; pairs: number; } | undefined): string | null; /** Upstream ROLLBACK or any compromise gives ROLLBACK; upstream HOLD or any finding gives HOLD. */ export declare function ensembleIntegrityDecision(integrity: DecisionEnsembleIntegrityReport['integrity'], findingCount: number): IntegrityGateDecision; /** A D17 report may keep or tighten the upstream #2037/#2048 decision, never loosen it. Every * finding, passed flag and the decision are recomputed from the carried integrity fields and the * preregistered thresholds; D09-derived findings need the record and are rechecked at promotion. */ export declare function validateEnsembleIntegrityReport(value: unknown): DecisionEnsembleIntegrityReport; export declare function integrityGateRank(decision: IntegrityGateDecision): number; //# sourceMappingURL=contract.d.ts.map