/**
 * The joins between one project's declarations and the world outside it.
 *
 * Three of them, and each is a place two sources of truth are compared for the
 * first time: the ruleset against the declaration (#2854's finding — nothing
 * compares these today, so they are only ever equal by hand), every required
 * context against who owns it, and one gate's implied context against the
 * moment a ruleset can actually guard.
 *
 * Kept out of the report assembly because the assembly is a list of steps and
 * these are the reasoning. Every one of them carries an unknown through rather
 * than resolving it: a run that could not read branch protection has nothing to
 * compare, and an empty comparison would report agreement.
 * @module cli/gate-report-joins
 */
import { type DeclarationDriftReport, type DriftSurface, type EnforcedContext } from "../core/gate-declaration-drift.js";
import type { FacadeFacts } from "./gate-report-facade.js";
import type { GateRegistryModule } from "./gate-report-registry.js";
import type { Finding, MergeBlock, RequiredContextRow, RulesetComparison } from "./gate-report-types.js";
/** Everything the joins need about this run. */
export interface JoinContext {
    /** The shipped registry. */
    readonly registry: GateRegistryModule;
    /** The project's gates block. */
    readonly gates: Record<string, unknown>;
    /** The live required contexts, or an unknown. */
    readonly contexts: Finding<readonly string[]>;
    /** What the project's own workflows say. */
    readonly facade: FacadeFacts;
    /** The moment a ruleset guards. */
    readonly mergeMoment: string;
    /** The workflow name a run gate's context is built from. */
    readonly workflowName: string;
}
/**
 * The Tier 2 answer for one cell, never defaulted to a verdict.
 * @param context - The join inputs
 * @returns A resolver for one cell's expected context
 */
export declare function mergeBlockResolver(context: JoinContext): (moment: string, expectedContext: string | null) => Finding<MergeBlock>;
/**
 * The ruleset comparison, or the same unknown the contexts came back with.
 * @param context - The join inputs
 * @returns The comparison
 */
export declare function buildRulesetFinding(context: JoinContext): Finding<RulesetComparison>;
/**
 * Every context a merge is blocked on, with who owns it.
 * @param context - The join inputs
 * @returns One row per required context, or the same unknown
 */
export declare function buildRequiredContexts(context: JoinContext): Finding<readonly RequiredContextRow[]>;
/**
 * Hold the declaration against one enforcing surface.
 *
 * The fourth join, and the one #2854 filed: `buildRulesetFinding` above says
 * WHICH contexts differ, and `buildRequiredContexts` says WHO owns each live
 * one, but neither says what the difference MEANS for the declaration that was
 * supposed to govern it. A gate declared `off` and a gate never declared at all
 * both show up as "required, not declared" in a set comparison, and they are
 * opposite problems: one is a contradiction, the other is silence.
 *
 * The surface's own `unknown` is returned unchanged rather than replaced with a
 * comparison of what little was read. A run that could not reach a surface has
 * not compared anything, and saying so is the whole contract.
 * @param context - The join inputs
 * @param surface - Which surface `enforced` came from
 * @param enforced - What the surface requires, or why it is unknown
 * @returns The comparison, or the surface's unknown
 */
export declare function buildDeclarationDrift(context: JoinContext, surface: DriftSurface, enforced: Finding<readonly EnforcedContext[]>): Finding<DeclarationDriftReport>;
/**
 * The live required contexts, restated as attributed enforcement.
 *
 * The live reader answers with bare strings because that is all branch
 * protection gives it; the comparison wants to say WHERE a requirement was
 * read, so the attribution is added here rather than invented downstream.
 * @param contexts - Contexts read from the live ruleset, or an unknown
 * @returns The same finding, in the comparison's shape
 */
export declare function liveEnforcement(contexts: Finding<readonly string[]>): Finding<readonly EnforcedContext[]>;
//# sourceMappingURL=gate-report-joins.d.ts.map