/** * Classifies check runs into shepherd categories and filters out irrelevant ones. * * Rules: * 1. Skip checks whose workflow event is NOT `pull_request` or `pull_request_target`. * Push-triggered, merge-queue, schedule, and workflow-dispatch runs are irrelevant * to PR readiness. * 2. Drop checks with `conclusion == SKIPPED` or `conclusion == NEUTRAL` from the * pass/fail tally. Report them as "skipped" for transparency but don't block on them. * 3. Reclassify `CANCELLED` checks as "superseded" (non-blocking) when a newer run of * the same workflow exists on the same commit — this is GitHub's concurrency-group * eviction behavior, not a real failure. GitHub branch protection itself resolves * required status checks by latest-run-per-name and merges past these; mirroring * that here keeps shepherd's verdict aligned with what GitHub will actually allow. */ import type { CheckRun, ClassifiedCheck } from "../types.mts"; /** * Classify a list of raw check runs into shepherd categories. * * @param checks Raw check runs from the batch query. * @returns Classified checks. "filtered" items were excluded from the tally. */ export declare function classifyChecks(checks: CheckRun[], opts?: { additionalRelevantEvents?: string[]; }): ClassifiedCheck[]; export interface CiVerdict { /** True when all relevant (non-filtered, non-skipped, non-ignored) checks passed. */ allPassed: boolean; /** True when at least one relevant (non-filtered, non-skipped, non-ignored) check exists. */ hasChecks: boolean; /** True when at least one check is still running/queued. */ anyInProgress: boolean; /** True when at least one check failed. */ anyFailing: boolean; /** Names of checks that were filtered out (triggered by non-PR events). */ filteredNames: string[]; /** Names of checks suppressed by the user's ignoreChecks config. */ ignoredNames: string[]; /** Names of CANCELLED checks superseded by a newer run of the same workflow (concurrency-group eviction). */ supersededNames: string[]; } /** Compute a high-level CI verdict from a list of classified checks. */ export declare function getCiVerdict(classified: ClassifiedCheck[]): CiVerdict;