
    j                        U d Z ddlmZ ddlZddlmZmZ dZded<   dZ	edu sJ d	        e
h d
      ZddZ	 d	 	 	 ddZddZy)u  utils.activation_flag_validator — real merge executor activation flag.

task-2637 — real merge executor wiring 코드화 (activation false default · 실제 merge 실행 0).

Spec: memory/specs/system_real_merge_executor_wiring_spec_260523.md
sha256: bcaf654e981a43083af50879164021c918eeac9753cad3b3ad146209a1a62765

회장 verbatim (spec §6 / task-2637 회장 10결정 #1):
    ACTIVATION_FLAG_DEFAULT = False (hardcoded · 런타임 변경 0)
    activation = env_var + chair_authorization JSON 둘 다 필요.
    둘 중 하나라도 없으면 NO_OP_NO_AUTHORIZATION.

ANCHOR-2 (task md §"frozen anchor"):
    "activation_flag default=False hardcoded · chair_authorization 부재 시
     NO_OP_NO_AUTHORIZATION · 둘 다 True 일 때만 11종 gate 재검증"
    )annotationsN)CallableOptionalFboolACTIVATION_FLAG_DEFAULTANU_REAL_MERGE_EXECUTOR_ACTIVEuZ   ACTIVATION_FLAG_DEFAULT must remain False at module load (spec §6.3 default OFF doctrine)>   1ONonYESyesTRUETruetruec                >    | | S t         j                  j                  S N)osenvironget)
env_lookups    P/home/jay/workspace/.worktrees/task-2680-dev2/utils/activation_flag_validator.py_env_lookupr   &   s    #/:CRZZ^^C    c                b    t        |       } |t              }|t        S t        |      t        v S )u1  Return the resolved activation flag (spec §6).

    Resolution rules (fail-closed):
      * Default is ``ACTIVATION_FLAG_DEFAULT`` (False) at all times.
      * If the env var ``ANU_REAL_MERGE_EXECUTOR_ACTIVE`` is set to one of the
        known truthy tokens, the flag is True. Any other value, including the
        string "false"/"0"/"", returns False.
      * The env var is intended for chair-explicit setup only. ``register the
        env value at activate-time + chair_authorization JSON`` is the only
        path that produces True (spec §6.3).
    )r   ACTIVATION_FLAG_ENV_VARr   str_TRUE_TOKENS)r   lookupraws      r   resolve_activation_flagr    *   s3     $F
(
)C
{&&s8|##r   c                 "    t         du sJ d       y)a  Defensive re-check used by regression tests and the dispatch wiring.

    Always re-asserts that the hardcoded default is False. Raises
    ``AssertionError`` if a hostile patch somehow mutated the constant; the
    real merge executor must never proceed past this assertion.
    Fu^   ACTIVATION_FLAG_DEFAULT mutated from False — abort real merge executor (spec §6.3 ANCHOR-2)N)r    r   r   assert_default_offr#   ?   s     #e+ 	)+r   )r   (Optional[Callable[[str], Optional[str]]]returnzCallable[[str], Optional[str]]r   )r   r$   r%   r   )r%   None)__doc__
__future__r   r   typingr   r   r   __annotations__r   	frozensetr   r   r    r#   r"   r   r   <module>r,      su     # 	 % %  %: 
 %' (' PQD
 <@$8$	$*
r   