/**
 * QE Gating Executor (ADR-PIPELINE-086)
 *
 * Encapsulates the phase-8-validation decision tree driven by the gating mode
 * resolved from env / persisted config (see src/config/qe-gating.ts).
 *
 * Contract:
 *   on       → run all mandatory QE agents; any failure halts the pipeline
 *              with exit code 141 (via Ruvector Acceptance Gate integration
 *              upstream). The executor returns `status: 'completed'` or throws.
 *   advisory → run all mandatory QE agents; failures become warnings in the
 *              output. Returns `status: 'completed_with_warnings'`.
 *   off      → skip QE invocation entirely. Returns `status: 'bypassed'`.
 *
 * The executor is pure — it does not invoke agents itself; callers pass in an
 * `invokeAgent` callback. This keeps the module testable without a live
 * pipeline and independent of adapter implementation.
 */
import type { QeGatingMode, ResolvedQeGating } from '../../config/qe-gating.js';
export type Phase8Status = 'completed' | 'completed_with_warnings' | 'bypassed';
export interface QeAgentInvocation {
    agent: string;
    status: 200 | 502;
    data?: Record<string, unknown>;
    error?: string;
    timing_ms?: number;
}
export interface QeExecutionOutcome {
    status: Phase8Status;
    mode: QeGatingMode;
    source: ResolvedQeGating['source'];
    invocations: readonly QeAgentInvocation[];
    warnings: readonly string[];
    bypassRecord?: BypassRecord;
    /** Exit code upstream should propagate on failure (on mode only). */
    exitCode?: number;
}
export interface BypassRecord {
    timestamp: string;
    mode: 'advisory' | 'off';
    source: ResolvedQeGating['source'];
    reason?: string;
    correlation_id: string;
    affected_agents: readonly string[];
}
export type InvokeAgentFn = (agentId: string) => Promise<QeAgentInvocation>;
export interface ExecuteOptions {
    correlationId: string;
    /** Explicit mode override (tests). If omitted, resolves from env/persisted. */
    modeOverride?: ResolvedQeGating;
    /** Clock override. */
    now?: Date;
}
/**
 * Run phase-8 QE validation per the gating mode.
 *
 * @param mandatoryAgents — list of agent IDs the phase requires (from ADR-083)
 * @param invokeAgent — callback that dispatches a single agent invocation
 * @param options — correlation id + optional mode override
 */
export declare function executePhase8Qe(mandatoryAgents: readonly string[], invokeAgent: InvokeAgentFn, options: ExecuteOptions): Promise<QeExecutionOutcome>;
/**
 * Emit a structured JSON log line to stderr describing a gating bypass.
 * Observatory consumes this via the standard stderr-to-metrics pipeline.
 */
export declare function emitBypassLog(record: BypassRecord, writeLine?: (s: string) => void): void;
/**
 * Build the Markdown header block stamped onto VALIDATION_REPORT.md when a
 * bypass occurs. Callers prepend this to the normal report body so reviewers
 * see the bypass at the top.
 */
export declare function buildValidationReportBypassHeader(record: BypassRecord): string;
//# sourceMappingURL=qe-gating-executor.d.ts.map