import type { Decision } from "../decision.js"; import type { IntentEnvelope } from "../envelope.js"; import type { PolicyBundle } from "./policy.js"; export type DivergenceClass = "NONE" | "BASIS_ONLY" | "DECISION_KIND" | "PAYLOAD_REWRITE"; export interface LegacyDecisionResult { readonly kind: "EXECUTE" | "REFUSE"; } export interface ShadowResult { readonly legacyDecision: LegacyDecisionResult; readonly adjudicateDecision: Decision; readonly divergence: DivergenceClass; } export interface ShadowTelemetrySink { /** BASIS_ONLY → metric only. */ recordBasisOnly(intentKind: string, decision: Decision): void; /** DECISION_KIND → Sentry alert + AnalyticsEvent. */ alertDecisionKind(intentKind: string, legacy: LegacyDecisionResult, adjudicate: Decision): void; /** PAYLOAD_REWRITE → Sentry alert + AnalyticsEvent. */ alertPayloadRewrite(intentKind: string, adjudicate: Decision): void; } /** Replace the telemetry sink (called by the adopter's wiring at boot). */ export declare function setShadowTelemetrySink(sink: ShadowTelemetrySink): void; /** @internal — for tests. */ export declare function _resetShadowTelemetrySink(): void; /** * Classify the divergence between the legacy boolean path and the new * adjudicate() Decision. Pure function; tests assert behavior directly. */ export declare function classifyDivergence(legacy: LegacyDecisionResult, adj: Decision): DivergenceClass; export interface AdjudicateWithShadowInput { readonly envelope: IntentEnvelope; readonly state: S; readonly policy: PolicyBundle; readonly legacy: () => boolean; } /** * Run `adjudicate()` alongside the legacy boolean path. Emits classified * divergence telemetry per the operational policy above. Returns both * decisions plus the classification — the caller decides which is * authoritative based on `IBX_KERNEL_ENFORCE` config. */ export declare function adjudicateWithShadow(input: AdjudicateWithShadowInput): ShadowResult; /** * Helper for callers that have a legacy boolean path and need to convert it * into a Decision shape so downstream code can treat both paths uniformly. */ export declare function legacyDecisionAsKernelDecision(legacy: LegacyDecisionResult): Decision; //# sourceMappingURL=shadow.d.ts.map