/**
 * Tier 2 — what a repository ruleset actually requires.
 *
 * `contextsFor()` derives what the required contexts *should* be; the ruleset
 * says what they *are*; nothing compares the two, so they are only ever equal
 * by hand. This module makes the comparison, and it is the one part of the
 * report that needs a network call.
 *
 * The failure mode it exists to avoid is the easy one - an unauthenticated run
 * reporting "this gate does not block a merge" when it simply did not look.
 * Every failure path here lands on `unknown` carrying a reason that separates
 * `not-authenticated` from `call-failed` from `offline`, and no path lands on
 * a verdict.
 * @module cli/gate-report-ruleset
 */
import type { Finding, RulesetComparison } from "./gate-report-types.js";
/** Reads the required status contexts guarding the default branch. */
export type RequiredContextsReader = (projectRoot: string) => Promise<readonly string[]>;
/**
 * Pull every required status-check context out of a branch-rules payload.
 * @param payload - Parsed `rules/branches/{branch}` response
 * @returns Contexts, sorted and de-duplicated
 */
export declare function extractRequiredContexts(payload: unknown): string[];
/**
 * Read the live ruleset through the `gh` CLI.
 * @param projectRoot - Project root, so `gh` resolves the right remote
 * @returns The required contexts guarding the default branch
 */
export declare const defaultRequiredContextsReader: RequiredContextsReader;
/**
 * Turn a `gh` failure into the narrowest honest reason.
 * @param error - Whatever the call threw
 * @returns A machine reason and a human message
 */
export declare function classifyGhFailure(error: unknown): {
    reason: string;
    message: string;
};
/**
 * Read the live required contexts, degrading to `unknown` and never to a pass.
 * @param options - Probe inputs
 * @param options.projectRoot - Project root
 * @param options.offline - Whether the run may make a network call
 * @param options.read - Injectable reader
 * @returns The contexts, or an honest unknown
 */
export declare function readRequiredContexts(options: {
    projectRoot: string;
    offline: boolean;
    read: RequiredContextsReader;
}): Promise<Finding<readonly string[]>>;
/**
 * Compare the contexts a declaration implies with the ones a ruleset requires.
 * @param declared - Contexts derived from the gates block
 * @param required - Contexts the ruleset actually requires
 * @returns The three-way comparison
 */
export declare function compareContexts(declared: readonly string[], required: readonly string[]): RulesetComparison;
//# sourceMappingURL=gate-report-ruleset.d.ts.map