"""Pipeline data types for the multi-agent diagnose pipeline.""" from __future__ import annotations from dataclasses import dataclass from typing import Literal SeverityLabel = Literal["CRITICAL", "ERROR", "WARN", "INFO", "DEBUG", "UNKNOWN"] @dataclass class EventCluster: cluster_id: str entries: list[str] # entry_id refs start_iso: str | None end_iso: str | None duration_seconds: float source_ids: list[str] pattern_tags: list[str] severity: SeverityLabel # highest severity from raw text burst: bool gap_before_seconds: float representative_text: str @dataclass class TimelineResult: clusters: list[EventCluster] total_entries: int window_start: str | None window_end: str | None gap_count: int burst_count: int dominant_sources: list[str] @dataclass class ClassifiedTimeline: timeline: TimelineResult cluster_severities: dict[str, SeverityLabel] classifier_used: Literal["ml", "pattern_tags", "regex"] model_id: str | None @dataclass class Hypothesis: hypothesis_id: str title: str description: str confidence: float supporting_cluster_ids: list[str] runbook_refs: list[str] severity: SeverityLabel @dataclass class RankedHypothesis: hypothesis: Hypothesis novelty_score: float similarity_to_known: float suppress: bool suppression_reason: str | None