import type { TaskEntity, TaskStatus, TransitionGuard } from "./types.js";
export declare const DELIVERY_EVIDENCE_METADATA_KEY = "deliveryEvidence";
export declare const DELIVERY_WAIVER_METADATA_KEY = "deliveryWaiver";
export type DeliveryEvidenceEnforcementMode = "off" | "advisory" | "enforce";
/** v2 discriminant for `deliveryEvidence.schemaVersion === 2`. */
export type DeliveryEvidenceModeV2 = "github-pr" | "local-reviewed-merge" | "direct-reviewed-merge" | "external-review";
export declare const DELIVERY_EVIDENCE_V2_MODES: ReadonlySet<DeliveryEvidenceModeV2>;
export type DeliveryEvidenceViolation = {
    taskId: string;
    title: string;
    status: TaskStatus;
    phaseKey: string | null;
    code: string;
    message: string;
    missingFields: string[];
    requiredEvidenceMode?: string | null;
    actualEvidenceMode?: string | null;
    policyProfile?: string | null;
    policyWarnings?: string[];
};
export type DeliveryEvidenceEvaluation = {
    required: boolean;
    satisfied: boolean;
    satisfiedBy: "evidence" | "waiver" | "not-required" | null;
    violations: DeliveryEvidenceViolation[];
    /** When satisfied via evidence: reported shape (best-effort). */
    evidenceSchemaVersion?: 1 | 2;
    evidenceMode?: DeliveryEvidenceModeV2 | "v1-github-pr";
};
export type DeliveryEvidenceValidationResult = {
    ok: true;
    schemaVersion: 1 | 2;
    evidenceMode?: DeliveryEvidenceModeV2 | "v1-github-pr";
} | {
    ok: false;
    code: string;
    message: string;
    missingFields: string[];
};
export type EvaluateDeliveryEvidenceOptions = {
    /**
     * When set (e.g. from resolved maintainer delivery policy), v2 evidence with a mode
     * outside this list yields `delivery-evidence-mode-not-allowed`.
     */
    allowedEvidenceModes?: readonly string[];
    requiredEvidenceMode?: string | null;
    policyProfile?: string | null;
    policyWarnings?: readonly string[];
};
type DeliveryEvidenceGuardOptions = {
    enforcementMode?: DeliveryEvidenceEnforcementMode;
    resolvePolicyContext?: (task: TaskEntity) => EvaluateDeliveryEvidenceOptions | undefined;
};
/** v1 GitHub PR-shaped evidence (legacy). */
export declare function missingDeliveryEvidenceFieldsV1(value: unknown): string[];
export declare function summarizeDeliveryEvidence(evidence: unknown): {
    schemaVersion: number | null;
    mode: string | null;
};
export declare function isPhaseDeliveryTask(task: TaskEntity): boolean;
export declare function validateDeliveryEvidenceMetadata(raw: unknown, options?: EvaluateDeliveryEvidenceOptions): DeliveryEvidenceValidationResult;
export declare function evaluateDeliveryEvidence(task: TaskEntity, options?: EvaluateDeliveryEvidenceOptions): DeliveryEvidenceEvaluation;
export declare function buildPhaseDeliveryPreflight(args: {
    tasks: TaskEntity[];
    phaseKey?: string | null;
    includeInProgress?: boolean;
    /** When set, constrains acceptable v2 evidence modes (legacy policy-aware preflight). */
    allowedEvidenceModesByTaskId?: Record<string, readonly string[]>;
    /** Preferred policy-aware preflight context keyed by task id. */
    policyContextByTaskId?: Record<string, EvaluateDeliveryEvidenceOptions>;
}): {
    schemaVersion: 1;
    phaseKey: string | null;
    checkedTaskCount: number;
    violationCount: number;
    violations: DeliveryEvidenceViolation[];
};
export declare function buildPhaseCloseoutReadiness(args: {
    tasks: TaskEntity[];
    phaseKey?: string | null;
}): {
    schemaVersion: 1;
    phaseKey: string | null;
    passed: boolean;
    remainingCount: number;
    remainingByStatus: Partial<Record<TaskStatus, Array<{
        id: string;
        title: string;
    }>>>;
    terminalCount: number;
    checkedTaskCount: number;
};
export declare function readDeliveryEvidenceEnforcementMode(effectiveConfig: Record<string, unknown> | undefined): DeliveryEvidenceEnforcementMode;
export declare function createDeliveryEvidenceGuard(options?: DeliveryEvidenceGuardOptions & EvaluateDeliveryEvidenceOptions): TransitionGuard;
export {};
