/** * @fileoverview Per-check execution lifecycle * * `runOneCheck` is the single entry point for "run this Check, with its * timeout, retry, and abort behavior, and tell me how it ended." Both * the parallel and sequential schedulers delegate to it; they keep only * the scheduling shape (sliding window vs `for-of` loop). * * Reconciled abort semantics: * * The earlier parallel/sequential implementations diverged on how they * detected a timeout — parallel inspected `signal.aborted` after the * retry resolved; sequential maintained a separate `timedOut` flag * mutated by the setTimeout callback. Either signal source is sufficient * because the per-check `AbortController` is only aborted by the * setTimeout we install here. We keep `signal.aborted` as the canonical * shape (it is the controller's own state and survives the retry chain * without a closure-scoped flag), and treat any post-retry `aborted` * signal as a timeout. */ import { type ProcessorContext, type ProcessResultOutput } from './check-result-processor.js'; import type { Check } from '../framework/check-types.js'; import type { FileCache } from '../framework/file-cache.js'; /** Per-call options for `runOneCheck`. */ export interface RunOneCheckOptions { readonly cwd: string; readonly checkIndex: number; readonly totalChecks: number; readonly recipeTimeoutMs: number; readonly retryEnabled: boolean; readonly maxRetries: number; /** Service-level cancellation signal, combined with the per-check timeout signal. */ readonly abortSignal?: AbortSignal; readonly checkTargetFiles?: ReadonlyMap; readonly globalExcludes?: readonly string[]; /** Per-service FileCache (for SaaS isolation; forwarded from ExecutionOptions). */ readonly fileCache?: FileCache; } /** Outcome of running a single check. */ export interface RunOneCheckOutcome { /** * Whether the scheduling layer should stop dispatching further * checks. Mirrors the `shouldStop` field on * `ProcessResultOutput`; `false` when no result was processed * (e.g. nothing to record because the call short-circuited). */ readonly shouldStop: boolean; /** Defined when a result was successfully processed (may be a pass or a fail). */ readonly processOutput?: ProcessResultOutput; } /** * Execute one check end-to-end: build the abort controller, install the * timeout, run with retry, then dispatch the result to * `processSuccessResult` / `processErrorResult` based on the outcome. * * Schedulers should call this once per check. The returned * `shouldStop` field tells the scheduler whether to break out of its * loop (e.g. `recipe.execution.stopOnFirstFailure`). */ export declare function runOneCheck(check: Check, opts: RunOneCheckOptions, ctx: ProcessorContext): Promise; //# sourceMappingURL=run-one-check.d.ts.map