REQ-048/010 change-req. `--config` 를 이름으로 해석 + `--config-path <dir>` (기본 ./config) + resolve_config_toml(슬래시 포함 값은 하위호환 명시 경로). `.env` 를 config-dir 결정적 해석(--env-file 우선, 없으면 <config_dir>/.env, CWD 무관) + config/.env.example + .gitignore config/* 허용목록. 운영자 CLI 도 --config-path/--env-file 동일 적용. from_env() legacy 루트 .env 폴백 유지로 완전 하위호환. 단위 23 + 전체 375 passed, ruff clean, 라이브 스모크(name·path 동일). REQ-048/010 → Implemented. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2.5 KiB
2.5 KiB
BAT-026: config 디렉터리 기반 설정 관리 — --config-path/--env-file + config-dir .env 공용화 (trex-orb-v1 정합)
- Status: release-candidate
- Profile: batch-lite
- Source Discovery: 없음 (trex-orb-v1 설정 관리 정합 — change-req 주도)
- Included REQ: REQ-048 (CHG-20260609-01), REQ-010 (CHG-20260609-01)
- Excluded REQ: 없음
Summary
- trex-orb-v1의 config 디렉터리 기반 설정 관리(
--config <name>+--config-path <dir>+ config-dir.env)를 trex-core 에 이식한다. - 핵심:
resolve_config_toml(name, config_path)(이름→<dir>/<name>.toml,.toml자동 부착, 슬래시 포함 값은 하위호환 명시 경로)(REQ-048),.env를 config-dir 기준 결정적 해석(--env-file우선 →<config_dir>/.env)으로 변경 +config/.env.example+.gitignoreconfig/*허용목록(REQ-010). 데몬·운영자 CLI 양쪽에--config-path/--env-file적용. - 안전:
from_env()의 legacy.env로드(루트.env폴백)를 유지 → config/.env 부재 시에도 기존 루트.env로 동작(완전 하위호환). config/.env 존재 시 먼저 로드돼 우선(override=False).
Scope
- In Scope:
resolve_config_toml+DEFAULT_CONFIG_DIR(REQ-048)_load_dotenv(config_path, env_file)config-dir 결정적 해석 + legacy 폴백 (REQ-010)- 데몬
mainargparse--config-path/--env-file+from_config(toml_path, env_file) - 운영자 CLI
--config-path/--env-file+_resolve_instance통일 .gitignoreconfig/*허용목록,config/.env.example신규
- Out of Scope:
- 실제
.env→config/.env물리 이동(운영 배포 절차 — 루트.env폴백으로 무중단) - TOML/env 레이어링 정책(키 우선순위) 변경 — 기존 유지
- 실제
Documents
- Planning: planning.md
- Design: none (batch-lite with no architecture impact)
- Implementation: verification.md 에 구현 요약 포함 (batch-lite)
- Verification: verification.md
Notes
- Profile batch-lite: 국소 변경(config.py/daemon.py/cli.py + .gitignore + config 예제). 신규 런타임 흐름·계약 필드 없음(인자·해석 규칙 추가).
--config의미 확장은 인터페이스 영향이라 정식 change-req(REQ-048/010 CHG-20260609-01) 경유 → Design Gate: no. - REQ-048/010 은 CHG-20260609-01 로 Approved(신규 AC 미구현). 본 batch release-candidate + confirm-req-implemented 로 Implemented 복귀.
- 발견 근거: 사용자 요청(trex-orb-v1 설정 관리 형태 정합).