"""자동화 오케스트레이터 패키지.

Phase 2 보안 기반 모듈:
  - pipeline_validator: YAML 파이프라인 검증
  - token_ledger: 일일 토큰 한도 관리
  - event_bus: 원자적 .done 이벤트 소비

orchestrator.py (최상위 파일)의 코드를 이 패키지 네임스페이스에서 실행하여
`import orchestrator` 시 Orchestrator 클래스 및 플래그에 접근 가능하게 합니다.
패키지 네임스페이스에서 실행하므로 `patch("orchestrator.xxx")` 도 올바르게 동작합니다.
"""

from pathlib import Path as _Path

# orchestrator.py (최상위 파일)의 코드를 이 패키지 네임스페이스에서 실행
_core_file = _Path(__file__).parent.parent / "orchestrator.py"
if _core_file.exists():
    _code = _core_file.read_text(encoding="utf-8")
    # __file__을 orchestrator.py로 설정하여 Path(__file__) 참조가 올바르게 동작
    _saved_file = globals().get("__file__")
    globals()["__file__"] = str(_core_file)
    exec(compile(_code, str(_core_file), "exec"), globals())  # noqa: S102
    globals()["__file__"] = _saved_file
