import type { DomainId, PhaseRequiredField, QualityContract, QualityContractMode, WorkflowPhase } from '../types/index.js';
export declare const CONTRACT_REGISTRY: Record<string, QualityContract>;
export type HandoffQualityResult = {
    passed: boolean;
    violations: string[];
    mode: QualityContractMode;
};
export type HandoffContentResult = {
    valid: boolean;
    warnings: string[];
};
export type RequiredFieldsResult = {
    valid: boolean;
    missing: PhaseRequiredField[];
};
export type EscalationEvent = {
    type: 'quality-escalation';
    timestamp: string;
    taskId: string;
    phase: string;
    role: string;
    violations: string[];
    missingFields: PhaseRequiredField[];
    severity: 'info' | 'warning' | 'critical';
};
/**
 * Resolves the applicable quality contract for a given phase/profile.
 * Checks workspace config first; falls back to defaults.
 */
export declare function resolveQualityContract(cwd: string, phase: WorkflowPhase, profile: string): QualityContract;
/**
 * Validates whether a task has sufficient evidence/decisions for a handoff.
 */
export declare function validateHandoffQuality(cwd: string, storyId: string, phase: WorkflowPhase, profile: string): HandoffQualityResult;
/**
 * Validates handoff content to reject generic/empty summaries.
 */
export declare function validateHandoffContent(summary: string, evidenceIds: string[]): HandoffContentResult;
/**
 * Validates that all required fields defined in a contract are present in the
 * provided field set.
 */
export declare function validateRequiredFields(contract: QualityContract, providedFields: Set<string>): RequiredFieldsResult;
/**
 * Emits a structured escalation event to stderr for consumption by
 * orchestration tooling or observability pipelines.
 */
export declare function emitEscalation(event: EscalationEvent): void;
/**
 * Applies domain-specific escalation rules to a contract when the workspace
 * operates in a regulated domain. Returns a new contract with additional
 * checks merged and mode elevated to 'escalate' if applicable.
 */
export declare function applyDomainEscalation(contract: QualityContract, workspaceDomains: DomainId[]): QualityContract;
/**
 * Returns a contract for a role with domain escalation applied from workspace config.
 */
export declare function resolveQualityContractWithDomain(cwd: string, phase: WorkflowPhase, profile: string): QualityContract;
