
    Uig                    n    U d Z ddlmZ ddlmZ ddddddddd	d
dddddddZded<   dZddZddZ	y)a  RLM Neo-Cortex -- Per-tier surprise threshold configuration.

Provides tier-aware threshold lookup so that surprise scoring
sensitivity can be adjusted per customer subscription tier without
requiring code changes.

Tier design:
    - Starter ($497/mo):      Most selective -- only stores clearly surprising content
    - Professional ($997/mo): Default thresholds -- balanced capture
    - Enterprise ($1,497/mo): More sensitive -- captures more memories for deeper recall
    - Queen ($20K+/mo):       Captures nearly everything for maximum intelligence

Each tier has three thresholds:
    - discard: below this score, memory is discarded entirely
    - working: above discard but below this, stored as short-term working memory
    - episodic: above working but below this, stored as medium-term episodic memory
    - (anything >= episodic is stored as long-term semantic memory / axiom candidate)
    )annotations)Dictgffffff?g      ?g?)discardworkingepisodicg333333?g?g?g      ?g?g333333?)starterprofessional
enterprisequeenzDict[str, Dict[str, float]]TIER_THRESHOLDSr	   c                `    t         j                  | j                         t         t                 S )a6  Get surprise thresholds for a given tier.

    Args:
        tier: Customer tier name (starter, professional, enterprise, queen).
              Case-insensitive. Falls back to professional defaults if unknown.

    Returns:
        Dict with keys: discard, working, episodic -- all float values in (0, 1).
    )r   getlowerDEFAULT_TIER)tiers    1/mnt/e/genesis-system/core/rlm/surprise_config.pyget_thresholdsr   '   s"     tzz|_\-JKK    c                    t         j                         D ]u  \  } }|j                         D ]'  \  }}d|cxk  rdk  rn t        d|  d| d| d       |d   |d   cxk  r	|d	   k  rUn t        d|  d
|d    d|d    d|d	           y)a+  Validate that all tier thresholds are sane.

    Checks:
        1. All values between 0.0 and 1.0
        2. For each tier: discard < working < episodic (monotonically increasing)

    Returns:
        True if all validations pass.

    Raises:
        ValueError: If any threshold is invalid.
    g        g      ?zTier 'z' threshold 'z' = z is outside [0, 1]r   r   r   z7' thresholds are not monotonically increasing: discard=z
, working=z, episodic=T)r   items
ValueError)	tier_name
thresholdskeyvalues       r   validate_thresholdsr   4   s     "1!6!6!8 	:$**, 	JC%&3& YK}SEeWDVW 	
 9%
9(=V
:@VV $%i01Jy<Q;R S&z235  r   N)r   strreturnzDict[str, float])r   bool)
__doc__
__future__r   typingr   r   __annotations__r   r   r    r   r   <module>r%      s]   $ #   DdC $4H"tF$DA	0,  
Lr   