import type { RuntimeStateHandle } from './runtime-state-handle.js'; import type { RecoveryResult } from './store/lifecycle/recovery-sweep.js'; import type { OwnerRetryOutcome } from './internalization/owner-retry.js'; export interface FailedTaskRecoveryInfo { taskId: string; taskKind: string; attemptCount: number; maxAttempts: number; isExhausted: boolean; status: string; /** * Persisted inputRef of the task record. For diag_* stage tasks this is * the parent diagnostician task ID (linkage written by * SplitDiagnosticianRunner.ensureSubTask); for diagnostician parent tasks * it is the source painId. null when absent — consumers that need the * stage→parent linkage must fall back to the diag_- * ID convention and report unresolved linkage honestly. */ inputRef: string | null; } export interface FailedTaskRecoveryResult { taskId: string; previousStatus: string; newStatus: string; attemptCount: number; maxAttempts: number; forceApplied: boolean; } export interface RecoverySweepService { detectExpiredLeases(): Promise; recoverTask(taskId: string): Promise; detectFailedTasks(): Promise; recoverFailedTask(taskId: string, force?: boolean): Promise; /** * Governance Recovery Actions v1: Owner authority reset for a * needs_human_review task (→ pending, clears runnerDecision + * completionIntent atomically). Same sequence as * `pd runtime internalization retry --confirm` (shared implementation). */ recoverNeedsHumanReviewTask(taskId: string): Promise; close(): Promise; } export interface RecoverySweepServiceHandle { service: RecoverySweepService; close: () => Promise; } /** * Recover a failed task to `pending` — the single recovery authority for the * failed→pending reset semantics (PRI-674), shared by the recovery sweep * service and `pd pain retry` (PRI-934). Callers must not re-implement this * transition: attempt-budget handling (exhausted + force → +3) and lease/ * result clearing live here only. * * Returns null (no mutation) when the task is absent or not in `failed` * status; throws `input_invalid` when the budget is exhausted and force is * not supplied. */ export declare function recoverFailedTask(stateManager: RuntimeStateHandle['stateManager'], taskId: string, force?: boolean): Promise; export declare function createRecoverySweepService(opts: { workspaceDir: string; }): Promise; //# sourceMappingURL=recovery-sweep-service.d.ts.map