DaemonConfig.from_env() now best-effort loads a .env file (find_dotenv usecwd, load_dotenv override=False) so operators can manage daemon env vars via .env, with real OS env taking precedence. Add python-dotenv dependency, gitignore .env, ship .env.example, and add config tests (load / OS-env precedence / absence regression / missing-DSN guard). Verification: 78 passed, ruff clean, .env ignored + .env.example tracked, and a .env-only DaemonConfig smoke. Processed via the minor-change fast path: REQ-010 (Configuration) -> Implemented, BAT-003 (batch-lite, no design) -> release-candidate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1.3 KiB
1.3 KiB
BAT-003 Planning
- Status: confirmed
- Batch: BAT-003
- Profile: batch-lite
Included REQ
- REQ-010 (Configuration): 데몬 설정 .env 파일 로딩
Delivery Plan
- pyproject.toml 에
python-dotenv의존성 추가. trex_core/runtime/config.py의DaemonConfig.from_env()시작부에서 best-effortload_dotenv()(미설치/부재 시 no-op, OS env override 안 함)..gitignore에.env추가,.env.example신규(키 목록 참고용).tests/runtime/test_config_dotenv.py: .env 로드 / OS env 우선 / .env 부재 회귀.
Dependencies
- Internal: REQ-005(DaemonConfig) 위 확장.
- External: python-dotenv.
Design Gate
- Design Required Before Implementation: no
- Reason: 구조/인터페이스/런타임 흐름 변경 없음. 기동 시 환경변수 소스(.env)만 추가하는 국소 설정 변경이라 batch-lite + design 생략(minor-change).
Milestones
- M1 — config 에 .env 로딩 + deps + gitignore/.env.example.
- M2 — 단위테스트 green(로드/우선순위/부재).
Risks
- R-1 (Low): .env 가 실 OS env 를 덮어쓰면 운영 사고. 대응:
load_dotenv(override=False)기본(실 env 우선)으로 AC-2 검증. - R-2 (Low): dotenv 미설치 환경 회귀. 대응: best-effort import(no-op) + AC-3 회귀 테스트.