/**
 * Readiness Gate — Gate 7 (Execution Safety Enforcement)
 *
 * PURPOSE: Enforce that write-path commands (deploy run, erp export in
 * execute mode, rollback, live sync) are blocked when the platform state
 * is INTEGRATION_READY_EXECUTION_GATED. This gate ensures no ERP writes
 * or production deployments occur until all prerequisites are met.
 *
 * INVARIANTS ENFORCED:
 * - No production writes when execution_gate is LOCKED
 * - No deploy run / deploy rollback when connectors are missing
 * - No erp export --mode=execute when systems are BLOCKED
 * - Read-only and integration-mode commands always allowed
 *
 * EXIT CODE: 111 (READINESS_GATE_VIOLATION)
 *
 * BEHAVIOR:
 * - Commands that perform external writes (deploy run, deploy rollback)
 *   are blocked when the readiness state has execution_gate.locked = true.
 * - Commands that are read-only (readiness show, inspect, erp list) are
 *   always permitted regardless of readiness state.
 * - The gate reads state from ~/.agentics/exports/decision-readiness/readiness-state.json.
 *   If the file does not exist, the gate assumes INSPECTION_ONLY (most restrictive).
 */
import type { CommandObject } from '../types/index.js';
export declare const READINESS_GATE_EXIT_CODE = 111;
/**
 * Canonical readiness states.
 * Transitions: INSPECTION_ONLY -> INTEGRATION_READY_EXECUTION_GATED -> EXECUTION_READY
 */
export type ReadinessState = 'INSPECTION_ONLY' | 'INTEGRATION_READY_EXECUTION_GATED' | 'EXECUTION_READY';
export interface ReadinessGateResult {
    /** Whether the command passed readiness validation */
    allowed: boolean;
    /** Error message if validation failed */
    message: string;
    /** Exit code if validation failed */
    exitCode: number;
    /** Whether this command requires readiness validation */
    readinessRequired: boolean;
    /** Current readiness state (if loaded) */
    state?: ReadinessState;
}
export interface ReadinessStateFile {
    schema: string;
    state: ReadinessState;
    simulation_id: string;
    plan_ref: string;
    determined_at: string;
    execution_gate: {
        locked: boolean;
        reason: string;
        prerequisites_total: number;
        prerequisites_completed: number;
        critical_blockers: Array<{
            id: number;
            system: string;
            severity: string;
            effort: string;
        }>;
    };
    integration_readiness: {
        entities_ready: number;
        entities_blocked: number;
        entities_total: number;
        readiness_pct: number;
        systems_ready: string[];
        systems_blocked: string[];
    };
    financial_posture: {
        annual_api_spend_usd: number;
        year1_investment_usd: number;
        annual_savings_usd: number;
        roi_payback_months: number;
        npv_5yr_usd: number;
    };
    audit_matrix: {
        result: string;
        checks_passed: number;
        checks_total: number;
        last_audit: string;
    };
}
/**
 * Load readiness state from the canonical artifact path.
 * Returns null if the file does not exist or is invalid.
 */
export declare function loadReadinessState(): ReadinessStateFile | null;
/**
 * Check whether a command passes readiness validation.
 * Returns a result indicating whether the command is allowed.
 *
 * Write-path commands are blocked when:
 * 1. The readiness state file exists AND execution_gate.locked === true
 * 2. The readiness state file does not exist (defaults to most restrictive)
 *
 * Read-only commands always pass.
 */
export declare function checkReadinessGate(cmd: CommandObject): ReadinessGateResult;
/**
 * Enforce readiness gate — exits the process if validation fails.
 */
export declare function enforceReadinessGate(cmd: CommandObject): void;
/**
 * Check if a command requires readiness validation.
 */
export declare function requiresReadinessValidation(primary: string, sub?: string): boolean;
//# sourceMappingURL=readiness-gate.d.ts.map