# app/models/memory/enums.py
"""
Enums for Memory System database models.

These enums define the database-level constraints for memory types
and scoping levels.
"""

from enum import Enum as PyEnum


class ScopeType(str, PyEnum):
    """
    Memory scope levels matching the memory service types.

    GLOBAL: System-wide memories accessible by all
    PROJECT: Project-scoped memories
    AGENT_TYPE: Type-specific memories (shared by instances of same type)
    AGENT_INSTANCE: Instance-specific memories
    SESSION: Session-scoped ephemeral memories
    """

    GLOBAL = "global"
    PROJECT = "project"
    AGENT_TYPE = "agent_type"
    AGENT_INSTANCE = "agent_instance"
    SESSION = "session"


class EpisodeOutcome(str, PyEnum):
    """
    Outcome of an episode (task execution).

    SUCCESS: Task completed successfully
    FAILURE: Task failed
    PARTIAL: Task partially completed
    """

    SUCCESS = "success"
    FAILURE = "failure"
    PARTIAL = "partial"


class ConsolidationType(str, PyEnum):
    """
    Types of memory consolidation operations.

    WORKING_TO_EPISODIC: Transfer session state to episodic
    EPISODIC_TO_SEMANTIC: Extract facts from episodes
    EPISODIC_TO_PROCEDURAL: Extract procedures from episodes
    PRUNING: Remove low-value memories
    """

    WORKING_TO_EPISODIC = "working_to_episodic"
    EPISODIC_TO_SEMANTIC = "episodic_to_semantic"
    EPISODIC_TO_PROCEDURAL = "episodic_to_procedural"
    PRUNING = "pruning"


class ConsolidationStatus(str, PyEnum):
    """
    Status of a consolidation job.

    PENDING: Job is queued
    RUNNING: Job is currently executing
    COMPLETED: Job finished successfully
    FAILED: Job failed with errors
    """

    PENDING = "pending"
    RUNNING = "running"
    COMPLETED = "completed"
    FAILED = "failed"
