export type ConcurrencyModel = 'async-await' | 'goroutines' | 'threads-locks' | 'actor-model' | 'rust-ownership' | 'reactive-streams' | 'green-threads' | 'unknown';
export type ResiliencePatternKind = 'circuit-breaker' | 'retry' | 'timeout' | 'bulkhead' | 'rate-limiter' | 'fallback' | 'cache';
export type RateLimitAlgorithm = 'token-bucket' | 'sliding-window' | 'fixed-window' | 'leaky-bucket' | 'unknown';
export type InterServiceProtocol = 'rest' | 'grpc' | 'graphql' | 'message-queue' | 'websocket' | 'unknown';
export type DistributedConsistencyStrategy = 'saga-choreography' | 'saga-orchestration' | 'two-phase-commit' | 'eventual-idempotent' | 'none';
export type BackoffStrategy = 'exponential' | 'linear' | 'fixed' | 'fibonacci';
export interface CircuitBreakerConfig {
    /** Failure percentage (0-100) to open the circuit */
    failureRateThreshold: number;
    /** Minimum calls in window to evaluate threshold */
    minimumCallsInWindow: number;
    /** Duration in ms of OPEN state before transitioning to HALF-OPEN */
    openStateDurationMs: number;
    /** Number of probe calls in HALF-OPEN state */
    halfOpenTestCallCount: number;
    /** Exceptions that do NOT count as failures (e.g., client 4xx validation) */
    ignoredExceptions?: string[];
}
export interface RetryConfig {
    /** Maximum attempts including the first try */
    maxAttempts: number;
    /** Backoff type between attempts */
    backoffStrategy: BackoffStrategy;
    /** Base delay in ms (multiplied per strategy) */
    baseDelayMs: number;
    /** Maximum delay in ms even if strategy calculates more */
    maxDelayMs: number;
    /** Whether random jitter is added to delay (recommended to avoid thundering herd) */
    jitter: boolean;
    /** HTTP status codes that justify a retry (only 5xx and timeout — never 4xx) */
    retryOnStatusCodes: number[];
    /** Whether to retry on network timeout (only if the operation is idempotent) */
    retryOnNetworkError: boolean;
}
export interface ResilienceConfig {
    /** Name or identifier of the external service */
    serviceName: string;
    /** Connection timeout in ms */
    connectTimeoutMs: number;
    /** Read timeout in ms (total time waiting for a response) */
    readTimeoutMs: number;
    /** Retry config; null if the endpoint is not idempotent and should not retry */
    retry: RetryConfig | null;
    /** Circuit breaker configuration */
    circuitBreaker: CircuitBreakerConfig;
    /** Fallback description: what to return when circuit is open or retries exhausted */
    fallback: string;
}
export interface RateLimitConfig {
    /** Rate limiting algorithm in use */
    algorithm: RateLimitAlgorithm;
    /** Whether rate limiting is distributed (with Redis or shared store) or local (in-memory) */
    distributed: boolean;
    /** Name of shared store if distributed (e.g., "Redis", "Memcached") */
    sharedStore?: string;
    /** Per-IP unauthenticated limit: requests per window */
    perIpLimit: {
        requests: number;
        windowSeconds: number;
    } | null;
    /** Per-authenticated-user limit: requests per window */
    perUserLimit: {
        requests: number;
        windowSeconds: number;
    } | null;
    /** Per-API-key limit: requests per window */
    perApiKeyLimit: {
        requests: number;
        windowSeconds: number;
    } | null;
    /** Response status code when limit is exceeded (standard: 429) */
    statusCode: 429;
    /** Response headers included: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset */
    responseHeaders: string[];
}
export interface MicroserviceContract {
    /** Name of the service providing the resource or executing the operation */
    providerService: string;
    /** Name of the consuming service (this project) */
    consumerService: string;
    /** Communication protocol */
    protocol: InterServiceProtocol;
    /** Version of the provider contract being consumed */
    contractVersion: string;
    /** Provider availability SLO (percentage, e.g., 99.9) */
    providerAvailabilitySlo: number;
    /** Description of degraded behavior when provider is unavailable */
    degradedBehavior: string;
    /** Whether a Pact consumer test validates this contract */
    hasPactConsumerTest: boolean;
    /** Protocol Buffer definition if gRPC (partial .proto text) */
    protobufDefinition?: string;
}
export interface ConcurrencyInvariant {
    /** Description of the invariant in natural language */
    description: string;
    /** Synchronization mechanism protecting the invariant */
    syncMechanism: string;
    /** Consistency guarantee provided by the mechanism */
    consistencyGuarantee: 'strong' | 'eventual' | 'read-your-writes';
    /** Scenario in which the invariant could be violated if the mechanism fails */
    violationScenario: string;
}
export interface SagaStepSpec {
    /** Step order (1-based) */
    order: number;
    /** Service responsible for executing the step */
    service: string;
    /** Operation executed by the step (RPC, endpoint, published event) */
    operation: string;
    /** Event or response indicating success */
    successSignal: string;
    /** Event or response indicating failure */
    failureSignal: string;
    /** Compensation operation (rollback) if a subsequent step fails */
    compensation: string;
    /** Whether the operation is idempotent (can be repeated without double effects) */
    idempotent: boolean;
}
export interface HealthCheckSpec {
    /** Path of the liveness endpoint */
    livenessPath: string;
    /** Path of the readiness endpoint */
    readinessPath: string;
    /** Path of the startup probe (Kubernetes-specific) */
    startupProbePath?: string;
    /** What readiness checks: list of verified dependencies */
    readinessDependencies: {
        name: string;
        type: 'database' | 'cache' | 'queue' | 'external-service';
        healthCheck: string;
    }[];
    /** Maximum liveness response time in ms (must be < 1s to avoid false positives) */
    livenessMaxResponseMs: number;
}
export interface ValidationDetectorEntry {
    language: string;
    name: string;
    detectionPatterns: string[];
}
export interface ResilienceDetectorEntry {
    language: string;
    name: string;
    detectionPatterns: string[];
    status?: string;
    migrationNote?: string;
    patterns: string[];
}
export interface ValidationResilienceProfile {
    /** Detected validation library by language */
    validationLibrary: string | null;
    /** Validation library version (important for Pydantic v1 vs v2) */
    validationLibraryVersion: string | null;
    /** Runtime concurrency model */
    concurrencyModel: ConcurrencyModel;
    /** Installed resilience libraries */
    resilienceLibraries: string[];
    /** Active rate limiting mechanism */
    rateLimitMechanism: string | null;
    /** Detected rate limiting algorithm */
    rateLimitAlgorithm: RateLimitAlgorithm;
    /** Whether rate limiting is distributed */
    rateLimitDistributed: boolean;
    /** Detected middleware frameworks */
    middlewareFrameworks: string[];
    /** Detected middleware chain order */
    middlewareChain: string[];
    /** Whether the project is part of a microservices ecosystem */
    isMicroservice: boolean;
    /** Detected service discovery mechanism */
    serviceDiscovery: string | null;
    /** Whether the project uses gRPC */
    usesGrpc: boolean;
    /** Whether the project has distributed tracing configured */
    hasDistributedTracing: boolean;
    /** Detected tracing library */
    tracingLibrary: string | null;
    /** Whether the project has a liveness endpoint implemented */
    hasLivenessEndpoint: boolean;
    /** Whether the project has a readiness endpoint implemented */
    hasReadinessEndpoint: boolean;
}
export interface MicroserviceConfig {
    isMicroservice: boolean;
    serviceDiscovery: string | null;
    usesGrpc: boolean;
    hasDistributedTracing: boolean;
    tracingLibrary: string | null;
    hasLivenessEndpoint: boolean;
    hasReadinessEndpoint: boolean;
}
export interface MiddlewareFrameworkSignal {
    name: string;
    pattern: string;
    language: string;
    chain: string[];
}
//# sourceMappingURL=concurrency.d.ts.map