/**
 * Pass 7 — Observability & Continuous Learning (ADR-038)
 *
 * Unlike Passes 1-6, Pass 7 is continuous. It starts after Pass 6 and
 * runs until explicitly stopped. Operates in three concurrent workstreams:
 *
 *   Workstream A: Observability (LLM-Observatory)
 *   Workstream B: Diagnostics & Incident Handling (LLM-Latency-Lens + LLM-Incident-Manager)
 *   Workstream C: Continuous Learning Loop (RuVector / Memory-Graph)
 *
 * The initial setup (executePass7) is synchronous and completes when:
 *   1. Telemetry is configured
 *   2. First health check passes
 *   3. Learning loop is registered
 *   4. Initial nodes written to DecisionGraph
 *
 * After setup, the pass reports as 'active' (not 'complete').
 */
import type { PassNumber, AgentRef, AgentInvocationResult } from './types.js';
import { DecisionGraph } from './decision-graph.js';
import { ProvenanceTracker } from './provenance-tracker.js';
export type HealthStatus = 'healthy' | 'degraded' | 'unhealthy';
export interface HealthCheck {
    readonly endpointUrl: string;
    readonly status: HealthStatus;
    readonly latencyMs: number;
    readonly lastChecked: string;
    readonly checkInterval: string;
    readonly failureCount: number;
    readonly alertThreshold: number;
}
export type MetricCategory = 'availability' | 'performance' | 'usage' | 'errors' | 'sla_compliance';
export interface TelemetryMetric {
    readonly category: MetricCategory;
    readonly name: string;
    readonly value: number;
    readonly unit: string;
    readonly timestamp: string;
}
export interface TelemetryConfig {
    readonly executionId: string;
    readonly metrics: readonly TelemetryMetric[];
    readonly healthChecks: readonly HealthCheck[];
    readonly collectionIntervalMs: number;
    readonly configuredAt: string;
}
export type VisualizationType = 'timeseries' | 'gauge' | 'table' | 'heatmap';
export type AlertSeverity = 'critical' | 'warning' | 'info';
export interface DashboardPanel {
    readonly title: string;
    readonly metricQuery: string;
    readonly visualization: VisualizationType;
    readonly thresholds: readonly {
        readonly value: number;
        readonly color: string;
    }[];
}
export interface AlertRule {
    readonly condition: string;
    readonly severity: AlertSeverity;
    readonly notificationChannel: string;
}
export interface DashboardSpec {
    readonly name: string;
    readonly panels: readonly DashboardPanel[];
    readonly alertRules: readonly AlertRule[];
}
export interface DiagnosticReport {
    readonly trigger: string;
    readonly rootCause: string;
    readonly affectedComponents: readonly string[];
    readonly recommendation: string;
    readonly estimatedImpact: string;
    readonly automaticMitigation: boolean;
}
export type IncidentSeverity = 'P1' | 'P2' | 'P3' | 'P4';
export type ActionItemStatus = 'open' | 'in_progress' | 'complete';
export interface IncidentTimeline {
    readonly detected: string;
    readonly escalated: string;
    readonly mitigated: string;
    readonly resolved: string;
}
export interface ActionItem {
    readonly action: string;
    readonly owner: string;
    readonly dueDate: string;
    readonly status: ActionItemStatus;
}
export interface PostMortem {
    readonly incidentId: string;
    readonly severity: IncidentSeverity;
    readonly timeline: IncidentTimeline;
    readonly rootCause: string;
    readonly impact: string;
    readonly actionItems: readonly ActionItem[];
    readonly lessonsLearned: readonly string[];
}
export interface Incident {
    readonly id: string;
    readonly severity: IncidentSeverity;
    readonly description: string;
    readonly detectedAt: string;
    readonly status: 'open' | 'investigating' | 'mitigated' | 'resolved';
    readonly diagnosticReport?: DiagnosticReport;
    readonly postMortem?: PostMortem;
    readonly requiresHumanReview: boolean;
}
export type PatternType = 'success_pattern' | 'anti_pattern' | 'calibration_adjustment';
export type Verdict = 'correct' | 'partially_correct' | 'incorrect';
export interface PatternEvidence {
    readonly executionId: string;
    readonly predicted: string;
    readonly actual: string;
    readonly verdict: Verdict;
}
export interface LearnedPattern {
    readonly id: string;
    readonly type: PatternType;
    readonly domain: string;
    readonly description: string;
    readonly evidence: PatternEvidence;
    readonly adjustment: string;
    readonly confidence: number;
    readonly applicableWhen: readonly string[];
}
export type FeedbackType = 'decision_outcome' | 'artifact_quality' | 'missing_information' | 'correction';
export interface FeedbackEntry {
    readonly id: string;
    readonly type: FeedbackType;
    readonly executionId: string;
    readonly artifactNumber?: number;
    readonly rating?: number;
    readonly comment: string;
    readonly timestamp: string;
}
export type LearningStep = 'retrieve' | 'judge' | 'distill' | 'consolidate';
export interface LearningCycleResult {
    readonly executionId: string;
    readonly timestamp: string;
    readonly stepsCompleted: readonly LearningStep[];
    readonly patternsLearned: readonly LearnedPattern[];
    readonly feedbackProcessed: number;
    readonly verdicts: readonly {
        readonly domain: string;
        readonly verdict: Verdict;
    }[];
}
export type Pass7Phase = 'startup' | 'active_monitoring' | 'incident_response' | 'learning_cycle' | 'shutdown';
export type Pass7WorkstreamId = 'observability' | 'diagnostics-incidents' | 'learning-loop';
export interface Pass7WorkstreamConfig {
    readonly id: Pass7WorkstreamId;
    readonly label: string;
    readonly agents: readonly AgentRef[];
}
export declare const PASS7_WORKSTREAM_CONFIGS: readonly Pass7WorkstreamConfig[];
export interface Pass7WorkstreamResult {
    readonly workstream: Pass7WorkstreamId;
    readonly label: string;
    readonly agentResults: readonly AgentInvocationResult[];
    readonly successCount: number;
    readonly totalCount: number;
    readonly durationMs: number;
}
export interface Pass7Result {
    readonly workstreamResults: readonly Pass7WorkstreamResult[];
    readonly telemetryConfig: TelemetryConfig;
    readonly healthChecks: readonly HealthCheck[];
    readonly dashboardSpec: DashboardSpec;
    readonly incidents: readonly Incident[];
    readonly learnedPatterns: readonly LearnedPattern[];
    readonly learningCycle: LearningCycleResult;
    readonly currentPhase: Pass7Phase;
    readonly graphNodeIds: readonly string[];
    readonly totalAgentResults: readonly AgentInvocationResult[];
}
/**
 * Execute Pass 7 initial setup: Observability & Continuous Learning.
 *
 * This performs the synchronous startup phase:
 *   1. Configure telemetry collection
 *   2. Run initial health checks
 *   3. Generate dashboard spec
 *   4. Run initial diagnostics
 *   5. Execute first learning cycle
 *   6. Write all initial nodes to DecisionGraph
 *
 * After this returns, Pass 7 is 'active' (not 'complete').
 */
export declare function executePass7(params: {
    prompt: string;
    graph: DecisionGraph;
    tracker: ProvenanceTracker;
    timeoutMs: number;
    verbose: boolean;
    invokeAgents?: (agents: readonly AgentRef[], payload: Record<string, unknown>, pass: PassNumber, timeoutMs: number) => Promise<AgentInvocationResult[]>;
}): Promise<Pass7Result>;
//# sourceMappingURL=pass7-observability.d.ts.map