/**
 * ADR-PIPELINE-089 §1 — Centralized transient-failure classification.
 *
 * The retry loops in `executeNaturalLanguageRoute` (src/commands/agents.ts)
 * used to inline a substring allowlist over `Error.message`:
 *
 *   const isRetryable = msg.includes('unavailable')
 *     || msg.includes('timeout')
 *     || msg.includes('rate exceeded')
 *     || msg.includes('econnreset')
 *     || msg.includes('econnrefused')
 *     || msg.includes('network error')
 *     || msg.includes('aborterror');
 *
 * Three problems with that shape:
 *
 * 1. `unreachable` is NOT on the list. Several adapter paths surface that
 *    word when a Cloud Run backend is down, and the retry loop then bails
 *    on attempt 1 — the exact field-report symptom on 2026-04-22.
 * 2. It only looks at `.message`. Node/undici errors often carry the
 *    transient signal on `.code` (ECONNRESET, ETIMEDOUT) or on a wrapped
 *    HTTP `response.status` (503, 504). Both were invisible to the
 *    substring check.
 * 3. 400-class terminal failures (contract_violation, unauthorized) never
 *    had an explicit short-circuit. A future drift that made their message
 *    match a retryable substring would silently retry three times.
 *
 * This module exposes:
 *   - isTransientFailure(err) — returns true when a retry has a reasonable
 *     chance of succeeding (widened allowlist + code + status + cause-chain).
 *   - isTerminalFailure(err) — returns true when retrying cannot help
 *     (payload / auth / canonical-not-found). Takes precedence over
 *     isTransientFailure when both match.
 *
 * Used by: the simulation retry loops at src/commands/agents.ts:4154 and
 * :4505. Future sites should import and reuse the helper instead of
 * re-inlining a substring list.
 */
/**
 * True when the failure shape suggests a retry has a reasonable chance of
 * succeeding: network resets, timeouts, 5xx, rate limits, cold-starts.
 *
 * Takes precedence over isTerminalFailure when inspecting a wrapped error:
 * callers should test `isTerminalFailure(e)` first and short-circuit if true.
 */
export declare function isTransientFailure(err: unknown): boolean;
/**
 * True when retrying cannot help: bad payload, bad credentials, canonical
 * 404. Callers should short-circuit their retry loop on true.
 */
export declare function isTerminalFailure(err: unknown): boolean;
/**
 * Best-effort classification used by the Phase 1 Health Gate when deciding
 * whether a simulator-level failure should produce a `failed` vs `degraded`
 * verdict.
 *
 *   - 'transient' → the retry loop gave up but the error was retryable;
 *     environment-flake. Still counts as a failure for verdict purposes
 *     (we already retried) but tags the degradation so the user knows a
 *     re-run is likely to succeed.
 *   - 'terminal'  → payload/credentials/canonical. Actionable by user.
 *   - 'unknown'   → neither signature matched. Treat as terminal for
 *     verdict purposes (do not recommend a re-run) but surface the raw
 *     message so the user can see what happened.
 */
export declare function classifyFailure(err: unknown): 'transient' | 'terminal' | 'unknown';
//# sourceMappingURL=transient.d.ts.map