"""Shared validation constants for TrustMem."""

# Maximum content length in characters (~32K chars ≈ 8K tokens for embedding API)
MAX_CONTENT_LENGTH = 32_000

VALID_ENTITY_TYPES = {
    "person", "organization", "location", "product",
    "concept", "event", "other",
}

VALID_EDGE_DIRECTIONS = {"outgoing", "incoming", "both"}

# --- Source Trust Level (Zero Trust Memory) ---
# Application-specified trust level for information sources.
# NOT LLM-judged — set by the calling application based on data origin.
#   verified: System-integrated data (CRM, API, DB imports, official docs)
#   input:    Authenticated user's direct statements (chat, form, voice)
#   derived:  AI-generated/inferred information (LLM extraction, pattern matching)
SOURCE_TRUST_LEVELS = ("verified", "input", "derived")
DEFAULT_SOURCE_TRUST = "derived"
SOURCE_TRUST_HIERARCHY: dict[str, int] = {
    "verified": 2,
    "input": 1,
    "derived": 0,
}

# --- Memory Type ---
MEMORY_TYPES = ("semantic", "document")
DEFAULT_MEMORY_TYPE = "semantic"

# --- Search Mode ---
SEARCH_MODES = ("hybrid", "vector", "keyword")
DEFAULT_SEARCH_MODE = "hybrid"
RRF_K = 60  # Reciprocal Rank Fusion constant
