
    j                         U d Z ddlmZ ddlmZ  eh d      Zee   ed<    eh d      Z	ee   ed<   e	ek  sJ dd	d
dddddZ
eeef   ed<    ee
      edhz
  k(  sJ deddfdZdedefdZdedefdZy)u  C1 — perception_mode enum SOT v1 (helper module).

Spec ref: docs/superpowers/specs/2026-05-20-c1-perception-mode-enum-sot-v1-design.md
Plan ref: docs/superpowers/plans/2026-05-20-c1-perception-mode-enum-sot-v1-implementation.md
Codex APPROVED_FOR_EXECUTION (plan narrow re-review #4, N-1~N-13 absorbed).

Field separation (Codex Guard 1): the directionality_class domain (Area C closed
boundary) and the perception_mode domain are separate. This module imports/uses no
directionality_class constant or render_prompt_card symbol.
    )Mapping)AppError>   dreamdirectmemorymirror
projection
reflectionhallucinationthrough_devicePERCEPTION_MODES>   r   r	   r
   r   REPRODUCTION_PERCEPTION_MODESu  이 장면은 화면/렌즈를 통해 보이는 것이지만, t2i_prompt에서 '디바이스 프레임/화면 테두리'를 묘사하지 마세요. 화면 속 내용물만 직접 촬영한 것처럼 묘사하세요. 약간의 디지털 질감이나 해상도 차이만 반영.u   이 장면은 환각/왜곡된 시각이므로 현실과 다른 색감/왜곡 효과를 반영하세요. 하지만 장면 자체는 직접 촬영한 것처럼 묘사.uk   이 장면은 꿈/몽환적 상태이므로 부드러운 포커스, 비현실적 색감을 반영하세요.uT   이 장면은 회상이므로 탈색된 색감, 부드러운 빛을 반영하세요.uW   이 장면은 거울/수면 반사이므로 좌우 반전된 구도를 고려하세요.ua  이 장면은 거울(mirror) surface 안에 보이는 것이므로, 거울면의 좌우 반전 + 반사면 quality (광택/표면 상태/변형 정도) + 거울 frame 가시 여부를 t2i_prompt 에 반영하세요. reflection (일반 반사면) 과 다른 mirror specific 행동: 거울 가장자리/거울 frame/mirror image 의 별도 surface 명시.u   이 장면은 프로젝터/스크린에 투사된 것이지만, 프로젝터 장비나 스크린 프레임을 묘사하지 마세요. 투사된 내용물만 직접 촬영한 것처럼 묘사.)r   r   r   r   r
   r   r	   _PERCEPTION_GUIDESr   pmreturnNc           	      T    | t         vr t        dd| dt        t                      y)zValidation gate: a value outside PERCEPTION_MODES raises AppError.

    None / empty / "direct" default coercion is the caller's responsibility
    (no silent coercion inside this helper).
    zperception_mode.unknownperception_mode=z not in PERCEPTION_MODES enum codemessageN)r   r   sortedr   s    N/Users/manta/Documents/Projects/TheRoad-I1/backend/app/core/perception_mode.py_validate_perception_moder   ,   s=     
!!*"2&(F*+,.
 	
 "    c                 (    t        |        | t        v S )a  Validate first, then subset check (no silent false on an unknown value).

    Caller convention: legacy default coercion is the caller's responsibility
    (e.g. ``pm = perception_mode or "direct"``). An empty string reaches
    _validate_perception_mode and raises AppError.
    )r   r   r   s    r   is_reproduction_perceptionr   <   s     b!...r   c                 \    t        |        | t        vrt        dd| d      t        |    S )u  Return the guide string for a non-direct perception mode.

    Two-stage check before any dict lookup (no raw KeyError surfaces):
      1. _validate_perception_mode(pm) — enum membership. An unknown value
         raises AppError("perception_mode.unknown").
      2. Membership in _PERCEPTION_GUIDES (the non-direct 7-key set). A value
         that is enum-valid but has no guide entry (i.e. "direct") raises
         AppError("perception_mode.guide_not_applicable") before the lookup.
      3. Dict lookup is then always safe.
    z$perception_mode.guide_not_applicabler   zk is enum-valid but has no guide entry. get_perception_guide must be called only inside a non-direct branch.r   )r   r   r   r   s    r   get_perception_guider   G   sE     b!	##7"2& )W X
 	
 b!!r   )__doc__typingr   app.core.errorsr   	frozensetr   str__annotations__r   r   setr   boolr   r    r   r   <module>r)      s   	  $ $- . $ )C. 
 1: ; 1 y~  %'77 77 m ~zdk r T
) GCH% 
 "2hZ"?? ??
# 
$ 
 /3 /4 /"S "S "r   