/**
 * @sanity/ailf-core — Error-summary trip policy (eval failure observability)
 *
 * The single, shared definition of "this run's errors are worth surfacing."
 * Validity (slice B2, `report-validity-detector.ts`) and notification (slice
 * B3, `notifications/match.ts`) both key on the identical condition, so it
 * lives here once rather than being re-derived per consumer.
 *
 * The trip condition (design doc — "Data model and classification"):
 *
 *   fullyErroredTasks.length > 0  OR  errorRate >= threshold (default 0.2)
 *
 * The fully-errored-task condition needs no threshold: a task where every
 * model × variant expansion errored is a deterministic break regardless of the
 * overall rate. The error-rate condition catches the systemic case (many tests
 * errored across tasks) without alarming on a single transient provider hiccup.
 *
 * Pure functions — zero I/O, safe to call from browser or Node.
 *
 * @see docs/design-docs/eval-failure-observability.md — Data model and
 *      classification (shared keystone); Slice B (validity + notification)
 */
import type { ErrorSummary } from "../types/index.js";
/**
 * Default error-rate above which a run trips the error condition, in `[0, 1]`.
 *
 * The design doc sources this from `thresholds.yaml` / `ThresholdConfigSchema`;
 * the detector and the notification matcher do not currently receive threshold
 * config, so both use this constant. Wiring the configurable threshold through
 * to these consumers is tracked as a follow-up — until then this is the one
 * place the value is defined, so both slices stay in lockstep.
 */
export declare const DEFAULT_ERROR_RATE_THRESHOLD = 0.2;
/**
 * Whether an {@link ErrorSummary} trips the shared error condition.
 *
 * `true` when at least one task fully errored OR the overall error rate meets
 * or exceeds `threshold`. An absent summary (pre-B1 reports, or a run with no
 * error data) never trips.
 *
 * @param summary   The report's `summary.errorSummary`, or `undefined`.
 * @param threshold Error-rate trip point in `[0, 1]`. Defaults to
 *                  {@link DEFAULT_ERROR_RATE_THRESHOLD}.
 */
export declare function errorSummaryTrips(summary: ErrorSummary | undefined, threshold?: number): boolean;
/**
 * Machine-readable reason strings explaining why an {@link ErrorSummary}
 * tripped — the audit trail behind a `suspect` validity verdict (B2) and the
 * `eval.tests-errored` event payload (B3).
 *
 * Emits one `errored-task:<id>` per fully-errored task, and appends
 * `error-rate:<n>` when the rate condition is what trips (the rate is rounded
 * to 3 decimals so the reason is stable and comparable across re-runs). Returns
 * an empty array when {@link errorSummaryTrips} is `false`, so callers can gate
 * on `reasons.length > 0` interchangeably with the predicate.
 *
 * @param summary   The report's `summary.errorSummary`, or `undefined`.
 * @param threshold Error-rate trip point in `[0, 1]`. Defaults to
 *                  {@link DEFAULT_ERROR_RATE_THRESHOLD}.
 */
export declare function errorSummaryReasons(summary: ErrorSummary | undefined, threshold?: number): string[];
