Deliver BAT-003: daemon .env loading (REQ-010, minor-change)

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>
This commit is contained in:
2026-06-04 14:56:42 +09:00
co-authored by Claude Opus 4.8
parent a4e263c8e7
commit 575ba9f513
13 changed files with 346 additions and 5 deletions
@@ -0,0 +1,28 @@
# BAT-003: 데몬 설정 .env 로딩 (minor-change)
- Status: release-candidate
- Profile: batch-lite
- Source Discovery: dcy-002 (REQ-010 은 데몬 설정 편의 개선)
- Included REQ: REQ-010
- Excluded REQ: 없음
## Summary
- REQ-010 단일 저위험 Configuration 요구사항을 minor-change fast path 로 처리한다. 데몬 기동 시 `.env` 를 로드(실 OS env 우선)하고, `.env` 는 gitignore, `.env.example` 제공.
## Scope
- In Scope:
- python-dotenv 의존성 추가, `DaemonConfig.from_env()` 에 `.env` best-effort 로드.
- `.gitignore` 에 `.env` 추가, `.env.example` 신규.
- 설정 로드/우선순위/부재 회귀 단위테스트.
- Out of Scope:
- 다른 설정 방식(TOML/CLI/시크릿 매니저) — 본 변경과 무관.
## Documents
- Planning: [planning.md](./planning.md)
- Design: none (batch-lite, no architecture impact)
- Implementation: [implementation.md](./implementation.md)
- Verification: [verification.md](./verification.md)
## Notes
- minor-change: 구조/인터페이스/런타임 흐름 변경 없음(기동 시 env 소스 추가뿐). design 불요.
- dotenv 미설치/.env 부재 시 graceful no-op → 회귀 없음.