// engine/escalator/policy.ts — SPEC-729: Retry budgets and next-decision logic
// ---------------------------------------------------------------------------
// Retry budgets
// ---------------------------------------------------------------------------
/**
 * Maximum number of automatic retries before escalating to human.
 * Reviewer and Validator get 3 attempts; Releaser gets 2 (more conservative).
 */
export const RETRY_BUDGETS = {
    reviewer: 3,
    validator: 3,
    releaser: 2,
};
// ---------------------------------------------------------------------------
// Policy function
// ---------------------------------------------------------------------------
/**
 * Determine what to do next given the role and how many attempts have been made.
 *
 * @param role     - The role being retried.
 * @param attempts - Number of attempts already completed (1-based: 1 = first try done).
 * @returns `'retry'` if within budget, `'escalate'` if budget exhausted.
 */
export function nextDecision(role, attempts) {
    const budget = RETRY_BUDGETS[role];
    return attempts < budget ? 'retry' : 'escalate';
}
//# sourceMappingURL=policy.js.map