"""Learning data capture and self-improvement primitives."""

from .coordinator import (
    LearningCoordinator,
    LearningSubscriber,
    LearningSubscriberResult,
    LearningSyncResult,
    MemoryLearningSubscriber,
    ModelRoutingSyncTarget,
    ModelRoutingLearningSubscriber,
    RetrievalSyncTarget,
    RetrievalLearningSubscriber,
    WorkflowLearningSubscriber,
    WorkflowSyncTarget,
)
from .dataset import DatasetBuilder
from .evaluation import (
    ChampionChallengerReport,
    CONTINUOUS_EVAL_SCHEMA_KIND,
    CONTINUOUS_EVAL_SCHEMA_VERSION,
    ContinuousEvalIncident,
    ContinuousEvalIncidentSnapshot,
    ContinuousEvalJob,
    ContinuousEvalTrendDeltaReport,
    ContinuousEvalRunner,
    EvaluationLoopEngine,
    JudgeDisagreement,
    LearningScorecard,
    LiveChampionChallengerMetrics,
    OfflineChampionChallengerMetrics,
    ProductionRegressionDataset,
    ScoreWindow,
)
from .feedback_api import FeedbackAPI
from .feedback_api import MemoryLearningTarget
from .knowledge_transfer import (
    KnowledgeTransferEngine,
    TransferApplyResult,
    TransferArtifact,
    TransferRecommendation,
    TransferUpliftReport,
)
from .improvement import (
    build_reward_scorer,
    CriticIssue,
    CriticReview,
    CriticReviserLoop,
    CriticReviserResult,
    FailurePattern,
    HeuristicRewardScorer,
    IMPROVEMENT_SCHEMA_KIND,
    IMPROVEMENT_SCHEMA_VERSION,
    LearnedPreferenceModelState,
    LearnedPreferenceScorer,
    PatternMiner,
    PolicyDecision,
    PolicyLearner,
    ReflectionLesson,
    ReflectionMemory,
    RevisionSuggestion,
    RewardComponent,
    RewardScorer,
    RewardModel,
    RewardScore,
    RootCauseAnalyzer,
    RootCauseHypothesis,
    RootCauseReport,
    TrainingExport,
    TrainingExportBuilder,
    RLExport,
)
from .loop import (
    SelfLearningLoop,
    SelfLearningLoopAction,
    SelfLearningLoopPolicy,
    SelfLearningLoopRun,
)
from .meta_learning import (
    META_LEARNING_SCHEMA_KIND,
    META_LEARNING_SCHEMA_VERSION,
    InterventionRecord,
    InterventionRecommendation,
    InterventionSource,
    InterventionStatus,
    InterventionType,
    MetaLearningEngine,
    MetaLearningPolicy,
    ROIEntry,
)
from .memory_learning import MemoryLearningEngine
from .model_routing_learning import (
    MODEL_ROUTING_SCHEMA_KIND,
    MODEL_ROUTING_SCHEMA_VERSION,
    CanaryDeployment,
    ModelRoutingLearningEngine,
    ModelScore,
    RoutingBudget,
    RoutingDecision,
)
from .models import (
    FAILURE_TYPES,
    FEEDBACK_KINDS,
    OUTCOME_KINDS,
    SUGGESTION_OUTCOMES,
    FeedbackRecord,
    LearningExample,
    OutcomeRecord,
    RunRecord,
    validate_failure_types,
)
from .optimizer import (
    PromptCandidateScore,
    PromptExperimentReport,
    PromptOptimizer,
    PromptPolicyGuard,
    PromptPolicyGuardResult,
    RecommendationEngine,
)
from .prompt_registry import (
    PROMPT_REGISTRY_SCHEMA_KIND,
    PROMPT_REGISTRY_SCHEMA_VERSION,
    PromptDefinition,
    PromptDeployment,
    PromptExperiment,
    PromptRecommendation,
    PromptRegistry,
    PromptResolution,
    PromptVersionRecord,
    get_prompt_registry,
    reset_prompt_registry,
)
from .prompt_evolution import PromptCandidate, PromptCandidateGenerator, PromptGenerationReport
from .retrieval_learning import (
    RETRIEVAL_LEARNING_SCHEMA_KIND,
    RETRIEVAL_LEARNING_SCHEMA_VERSION,
    QueryRewriteRecord,
    ReindexRequest,
    RetrievalEvent,
    RetrievalLearningEngine,
    RetrievalProfile,
    RetrievalSettings,
    ReindexTrigger,
    SourceDocumentSnapshot,
    SourceUsefulnessScore,
)
from .tool_workflow_learning import (
    TOOL_WORKFLOW_LEARNING_SCHEMA_KIND,
    TOOL_WORKFLOW_LEARNING_SCHEMA_VERSION,
    ApprovalScore,
    FallbackPolicyScore,
    LoopRecommendation,
    ToolScore,
    ToolWorkflowLearningEngine,
    WorkflowBranchScore,
)
from .store import (
    LEARNING_SCHEMA_KIND,
    LEARNING_SCHEMA_VERSION,
    LearningStore,
    PostgreSQLLearningStore,
    SQLiteLearningStore,
    build_learning_store,
    get_learning_store,
    make_run_id,
    record_to_dict,
    reset_learning_store,
)

__all__ = [
    "FAILURE_TYPES",
    "FEEDBACK_KINDS",
    "OUTCOME_KINDS",
    "SUGGESTION_OUTCOMES",
    "LearningCoordinator",
    "LearningSubscriber",
    "LearningSubscriberResult",
    "LearningSyncResult",
    "FeedbackRecord",
    "OutcomeRecord",
    "RunRecord",
    "LearningExample",
    "DatasetBuilder",
    "ChampionChallengerReport",
    "CONTINUOUS_EVAL_SCHEMA_KIND",
    "CONTINUOUS_EVAL_SCHEMA_VERSION",
    "ContinuousEvalIncident",
    "ContinuousEvalIncidentSnapshot",
    "ContinuousEvalJob",
    "ContinuousEvalTrendDeltaReport",
    "ContinuousEvalRunner",
    "CriticIssue",
    "CriticReview",
    "CriticReviserLoop",
    "CriticReviserResult",
    "EvaluationLoopEngine",
    "FailurePattern",
    "FeedbackAPI",
    "build_reward_scorer",
    "HeuristicRewardScorer",
    "IMPROVEMENT_SCHEMA_KIND",
    "IMPROVEMENT_SCHEMA_VERSION",
    "JudgeDisagreement",
    "KnowledgeTransferEngine",
    "LearnedPreferenceModelState",
    "LearnedPreferenceScorer",
    "LearningScorecard",
    "LiveChampionChallengerMetrics",
    "MemoryLearningTarget",
    "MemoryLearningSubscriber",
    "MemoryLearningEngine",
    "META_LEARNING_SCHEMA_KIND",
    "META_LEARNING_SCHEMA_VERSION",
    "InterventionRecord",
    "InterventionRecommendation",
    "InterventionSource",
    "InterventionStatus",
    "InterventionType",
    "MetaLearningEngine",
    "MetaLearningPolicy",
    "ROIEntry",
    "ModelRoutingLearningSubscriber",
    "ModelRoutingSyncTarget",
    "PatternMiner",
    "OfflineChampionChallengerMetrics",
    "PolicyDecision",
    "PolicyLearner",
    "ProductionRegressionDataset",
    "RetrievalSyncTarget",
    "RetrievalLearningSubscriber",
    "WorkflowLearningSubscriber",
    "WorkflowSyncTarget",
    "ReflectionLesson",
    "ReflectionMemory",
    "RevisionSuggestion",
    "RewardComponent",
    "RewardScorer",
    "RewardModel",
    "RewardScore",
    "RootCauseAnalyzer",
    "RootCauseHypothesis",
    "RootCauseReport",
    "TransferApplyResult",
    "TransferArtifact",
    "TransferRecommendation",
    "TransferUpliftReport",
    "SelfLearningLoop",
    "SelfLearningLoopAction",
    "SelfLearningLoopPolicy",
    "SelfLearningLoopRun",
    "ScoreWindow",
    "TrainingExport",
    "MODEL_ROUTING_SCHEMA_KIND",
    "MODEL_ROUTING_SCHEMA_VERSION",
    "CanaryDeployment",
    "ModelRoutingLearningEngine",
    "ModelScore",
    "RoutingBudget",
    "RoutingDecision",
    "LearningStore",
    "SQLiteLearningStore",
    "PostgreSQLLearningStore",
    "LEARNING_SCHEMA_KIND",
    "LEARNING_SCHEMA_VERSION",
    "build_learning_store",
    "get_learning_store",
    "reset_learning_store",
    "make_run_id",
    "record_to_dict",
    "validate_failure_types",
    "PromptCandidate",
    "PromptCandidateScore",
    "PromptCandidateGenerator",
    "PromptGenerationReport",
    "PromptExperimentReport",
    "PromptOptimizer",
    "PromptPolicyGuard",
    "PromptPolicyGuardResult",
    "RecommendationEngine",
    "PROMPT_REGISTRY_SCHEMA_KIND",
    "PROMPT_REGISTRY_SCHEMA_VERSION",
    "PromptDefinition",
    "PromptDeployment",
    "PromptExperiment",
    "PromptRecommendation",
    "PromptRegistry",
    "PromptResolution",
    "PromptVersionRecord",
    "get_prompt_registry",
    "reset_prompt_registry",
    "RETRIEVAL_LEARNING_SCHEMA_KIND",
    "RETRIEVAL_LEARNING_SCHEMA_VERSION",
    "QueryRewriteRecord",
    "ReindexRequest",
    "RetrievalEvent",
    "RetrievalLearningEngine",
    "RetrievalProfile",
    "RetrievalSettings",
    "ReindexTrigger",
    "SourceDocumentSnapshot",
    "SourceUsefulnessScore",
    "TOOL_WORKFLOW_LEARNING_SCHEMA_KIND",
    "TOOL_WORKFLOW_LEARNING_SCHEMA_VERSION",
    "ApprovalScore",
    "FallbackPolicyScore",
    "LoopRecommendation",
    "ToolScore",
    "ToolWorkflowLearningEngine",
    "WorkflowBranchScore",
]
