fix: QUANT_AUTO_ENTRY live 무시 보호 사문화 해소 — 잔존 ENV로 live 자동매수되던 구멍 - #417
Merged
Conversation
config_loader 적대 감사(16차)에서 발견 — 문서화된 보호("live 모드에서는 ENV
override 무시")가 실제 live 경로에서 작동하지 않았다.
[HIGH] live-ignore 분기는 '로드 시점 YAML mode'가 live일 때만 발동하는데, 정식
live 경로는 YAML mode=paper로 Config를 로드한 뒤 run_live_trading이 mode를
플립한다(재해석 없음) — paper 실험용 QUANT_AUTO_ENTRY=true가 셸/.env에 남아
있으면 signal-only 설정(auto_entry: false)의 live가 실돈 자동매수를 한다.
실행으로 재현 검증된 결함. 수정: YAML 원천 값(엄격 파싱)을 보존하고, Config.
enforce_live_auto_entry_policy()를 신설해 run_live_trading의 모드 플립 직후
같은 정책을 재적용한다. 끄는 방향(ENV=false)은 fail-safe라 live에서도 존중
(YAML true를 ENV로 끄려는 운영자 의도를 무시하는 게 더 위험).
[MED] YAML 문자열 'false'가 bool()로 True — 따옴표 하나로 auto_entry 마스터
스위치가 뒤집힘(live 보호 분기에도 동일). 기존 엄격 파서 _coerce_bool_setting
으로 両 사이트 교체.
테스트 4건(문자열 false 차단, 모드 플립 후 ENV 켜기 복귀, ENV 끄기 존중,
YAML 소스 무변화) + 더블에 신규 인터페이스 반영. 전체 1494 passed.
easygap
added a commit
that referenced
this pull request
Jul 6, 2026
fix: QUANT_AUTO_ENTRY live 무시 보호 사문화 해소 — 잔존 ENV로 live 자동매수되던 구멍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
문제 (HIGH — 실돈 직결, config_loader 적대 감사 16차)
문서화된 보호("live 모드에서는
QUANT_AUTO_ENTRYENV override 무시", PROJECT_GUIDE)가 정식 live 경로에서 죽은 코드였다:mode: paper로 로드 →run_live_trading이 mode를 나중에 플립(재해석 없음)QUANT_AUTO_ENTRY=true가 셸/.env에 잔존하면, signal-only 설정(auto_entry: false)의 live가 실돈 자동매수 — 실행으로 재현 검증됨[MED 동반] YAML에 따옴표로
'false'를 쓰면bool('false')==True— 마스터 스위치가 따옴표 하나로 뒤집힘(live 보호 분기에도 동일 결함).수정
_resolve_auto_entry: YAML 값을 기존 엄격 파서(_coerce_bool_setting)로 해석 + 원천 값 보존Config.enforce_live_auto_entry_policy()신설 —run_live_trading의 모드 플립 직후 호출해 ENV '켜는 방향'을 YAML 값으로 강제 복귀(경고 로그)검증
테스트 4건(문자열 false / 플립 후 복귀 / ENV 끄기 존중 / YAML 소스 무변화) — 전체 1494 passed
감사 잔여 (별도 위임)
같은 감사에서 MED 2건 추가 식별: ①
get_account_no침묵 폴백·env 오버라이드가 YAML 선언 키에만 적용(+:포함 키의 env 이름 불가), ②resolved_hash가QUANT_DB_PATH·계좌 라우팅 누락(freeze-pack drift 미탐) — 작업 칩으로 분리.