from __future__ import annotations

from dataclasses import dataclass
from typing import Dict


@dataclass(frozen=True)
class ExperimentSpec:
    code: str
    slug: str
    description: str
    pipeline: str
    preprocessing_mode: str = "baseline"


EXPERIMENTS: Dict[str, ExperimentSpec] = {
    "B0": ExperimentSpec("B0", "baseline_exact", "Exact accepted E0 baseline.", "baseline"),
    "B1": ExperimentSpec("B1", "structural_clean", "Objective structural cleaning only.", "structural_clean"),
    "B2_CS": ExperimentSpec("B2_CS", "drop_course_status", "Remove all course_status_* columns only.", "drop_course_status"),
    "B2_TIME": ExperimentSpec("B2_TIME", "drop_unstable_time", "Remove unstable registration timing and absolute semester fields only.", "drop_time"),
    "B2_CLUSTER": ExperimentSpec("B2_CLUSTER", "drop_course_cluster", "Remove raw numeric course_cluster_id only.", "drop_cluster"),
    "B2_REDUNDANT": ExperimentSpec("B2_REDUNDANT", "isolated_redundancy", "Prune near-duplicate E0 features using train-only temporal priority.", "isolated_redundancy"),
    "B3": ExperimentSpec("B3", "temporal_stability", "Train-only temporal stability feature selection.", "stability"),
    "B4": ExperimentSpec("B4", "stable_nonredundant_core", "B3 plus correlation-cluster pruning.", "stable_core"),
    "B5": ExperimentSpec("B5", "sparse_history_masks", "B4 plus targeted history availability masks.", "sparse_masks", "missing_aware"),
    "B6_W": ExperimentSpec("B6_W", "winsorized_core", "B4 with replacement winsorized preprocessing.", "stable_core", "winsor"),
    "B6_Q": ExperimentSpec("B6_Q", "quantile_rank_core", "B4 with replacement quantile-rank preprocessing.", "stable_core", "quantile_rank"),
    "B7": ExperimentSpec("B7", "course_status_compression", "B4 with course-status columns replaced by compact summaries.", "course_status_compression"),
    "B8": ExperimentSpec("B8", "cross_fitted_risk_bins", "B4 plus chronological cross-fitted risk-bin features.", "risk_bins"),
}
