/** * The clock-driven counterpart to the respawn guards (PLA-153). * * `rate_limit_cooldown` refuses a re-dispatch inside a quota window, and until * now nothing came back once the window closed: the run settled `rate_limited`, * the Todo stopped, and only a human moving its status would start it again. * Todos sat five hours past a reset the failure itself had named. * * So this is a sweep, not a new classifier — everything needed to decide was * already stored. The failure text on the settled run says which classes it * carries and, often, the moment the window reopens; engine health remembers the * same fact per engine across a restart; and the run's own id is the identity * that keeps one failure from being resumed twice. */ /** The actor a resume records when the workflow's trigger asks for nobody in * particular. A clock decided this, and the trail should say so. */ export declare const AVAILABILITY_RESUME_ACTOR = "availability-resume"; /** How the reopening instant was arrived at, recorded so a resume that fired at * the wrong moment says which of the three answers it believed. */ export type ResetSource = 'stated' | 'engine-health' | 'cooldown'; /** Where the Todo landed, as the re-arm port reports it back. */ export interface AvailabilityRearmed { status: string; /** The trigger's label filter, when one had to be restored or confirmed. */ label?: string; } export type AvailabilityRearmResult = AvailabilityRearmed | { unavailable: string; }; export interface AvailabilityResumeDeps { /** * Put the Todo back where its own Workflow trigger fires — restoring the * arming label if it has gone missing — or say why nothing can fire. * * Injected because resolving that target means reading a Workflow definition, * and `work-items/` does not import `workflows/`. */ rearm(workItemId: string): AvailabilityRearmResult; /** Test seam. */ now?: () => Date; } /** * One pass: re-arm every Todo whose last attempt died waiting on a provider that * has since reopened. Returns how many were resumed. Exported for tests; the * gateway runs it on the interval below. */ export declare function sweepAvailabilityResumes(deps: AvailabilityResumeDeps): number; /** * Periodic availability resume. Same primitive as the work-item reconciler — * unref'd interval, one guarded sweep per tick, ticks never overlap because the * sweep is synchronous. Returns a stop function. */ export declare function startAvailabilityResumeSweep(deps: AvailabilityResumeDeps, intervalMs?: number): () => void; //# sourceMappingURL=availability-resume.d.ts.map