/**
 * src/compute/strategies/two-phase-orient.ts
 *
 * Two-Phase Orient pattern.
 *
 * Phase 1 — Orient: read-only context gathering, produces an orientation state.
 * Phase 2 — Act:    state-mutating execution driven by the orientation.
 *
 * The separation enforces a hard OODA discipline:
 * - Phase 1 has no side effects; it may be retried cheaply on failure.
 * - Phase 2 consumes the orientation and may be retried up to `maxActRetries`.
 *
 * Error semantics:
 * - `TwoPhaseOrientError` (phase: "orient") — Phase 1 threw; Phase 2 is never reached.
 * - `TwoPhaseOrientError` (phase: "act")    — Phase 2 exhausted all retries.
 * - Each Phase 2 retry attempt is tracked in `retriesUsed` (0 = first attempt succeeded).
 */
export declare class TwoPhaseOrientError extends Error {
    readonly phase: "orient" | "act";
    readonly cause: unknown;
    readonly retriesUsed: number;
    constructor(phase: "orient" | "act", cause: unknown, retriesUsed: number, message: string);
}
export interface TwoPhaseOrientConfig<C, O, R> {
    /**
     * Phase 1: orientation (read-only, observe + analyse).
     * Receives the raw context and returns an orientation state.
     * Must not produce observable side effects.
     */
    orient: (context: C) => Promise<O>;
    /**
     * Phase 2: act on the orientation.
     * Receives both the orientation produced by Phase 1 and the original context.
     * Returns the final result.
     */
    act: (orientation: O, context: C) => Promise<R>;
    /**
     * Maximum number of times Phase 2 may be retried after a recoverable failure.
     * `maxActRetries = 1` means one initial attempt + one retry = 2 total attempts.
     * Default: 1.
     * Must be a non-negative integer; values < 0 are treated as 0.
     */
    maxActRetries?: number;
}
export interface TwoPhaseOrientResult<O, R> {
    orientation: O;
    result: R;
    /** Number of Phase-2 retries consumed (0 = succeeded on first attempt). */
    retriesUsed: number;
}
/**
 * Executes the Two-Phase Orient pattern.
 *
 * @param config  Wiring for both phases + optional retry cap.
 * @param context Opaque context forwarded to both `orient` and `act`.
 *
 * @throws {TwoPhaseOrientError} When Phase 1 throws (phase: "orient") or
 *   Phase 2 exhausts all retries (phase: "act").
 *
 * @example
 * ```ts
 * const { orientation, result, retriesUsed } = await runTwoPhaseOrient(
 *   {
 *     orient: async (ctx) => await gatherSignals(ctx),
 *     act:    async (orient, ctx) => await executeDecision(orient, ctx),
 *   },
 *   requestContext,
 * );
 * ```
 */
export declare function runTwoPhaseOrient<C, O, R>(config: TwoPhaseOrientConfig<C, O, R>, context: C): Promise<TwoPhaseOrientResult<O, R>>;
//# sourceMappingURL=two-phase-orient.d.ts.map