/** * Chef's failure classifier. Pure function: given the PR head's * check status + the merge base's check status, decide what kind of * failure this is. Chef's action depends on the class. * * Four classes (matches `docs/plans/0.13-bug-flow-and-chef.md`): * * • self-conflict — head doesn't fast-forward against base; needs * rebase. (Chef rebases + auto-resolves * append-only files; halts on substantive conflicts.) * • self-fail — failure is on PR head but absent from base. * Caused by the PR's own diff. Chef dispatches a * retry of the originating agent. * • external-fail — same failure exists on base. Pre-existing red * that's not the PR's responsibility. Chef posts * a diagnostic comment + escalates to operator. * • infra-fail — workflow/runner error, npm registry hiccup, * OOM. Chef re-runs the workflow once; if still * failing, escalate. */ export interface CheckStatus { /** Stable identifier for the check (workflow + job name). */ name: string; /** "success" | "failure" | "cancelled" | "skipped" | "neutral" | other. */ conclusion: string; /** Optional payload for infra detection (rare workflow errors). */ message?: string; } export type FailureClass = { kind: "self-conflict"; reason: "branch-not-up-to-date" | "merge-conflict"; } | { kind: "self-fail"; failingChecks: string[]; } | { kind: "external-fail"; failingChecks: string[]; } | { kind: "infra-fail"; failingChecks: string[]; } | { kind: "no-failure"; }; export interface ClassifyInput { /** All checks on the PR head's most recent commit. */ headChecks: CheckStatus[]; /** All checks on the merge-base commit. Empty array if unavailable. */ baseChecks: CheckStatus[]; /** Whether GitHub reports the PR as out-of-date with main. */ outOfDate: boolean; } /** * Classify a PR's failure mode. Pure: no I/O, no network. The caller * shells out to gh / git to gather inputs and to act on the verdict. */ export declare function classifyPrFailure(input: ClassifyInput): FailureClass; /** * Map a failing PR (head ref starts with `slowcook/X/...`) to the * agent that owns retries. Used by chef when classifying as self-fail * to know which workflow to dispatch. Returns null when the head ref * doesn't match a known slowcook agent. */ export declare function originatingAgent(headRef: string): SlowcookAgent | null; export type SlowcookAgent = "refine" | "recipe" | "brew" | "sift" | "investigate"; //# sourceMappingURL=classify.d.ts.map