feat(config): config 디렉터리 기반 설정 관리 (--config-path/--env-file, trex-orb-v1 정합, BAT-026)

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>
This commit is contained in:
2026-06-09 23:45:08 +09:00
co-authored by Claude Opus 4.8
parent 6e8e79660c
commit 8b2c26c04c
14 changed files with 531 additions and 32 deletions
+5 -3
View File
@@ -83,7 +83,9 @@ def test_config_required_cli_exits_nonzero():
def test_gitignore_excludes_instance_toml():
"""AC-5: .gitignore excludes instance TOML but keeps the example."""
"""AC-5 (CHG-20260609-01): .gitignore ignores config/* but keeps example
templates (*.example.toml covers instance.example.toml) and .env.example."""
gi = (_REPO / ".gitignore").read_text()
assert "/config/*.toml" in gi
assert "!/config/instance.example.toml" in gi
assert "/config/*" in gi
assert "!/config/*.example.toml" in gi
assert "!/config/.env.example" in gi