OQ-1: (a′) 기존 슬롯 도메인 유지 + 운영 프로파일/규칙 추가 (PositionBook 불필요) OQ-2: safety_sell_enabled=false → 코어 손절매 루틴 없음, 전략 모듈 전적 책임 OQ-3: per-instance watchdog_timeout_sec 연장 (1800s 이상 권장), 알림은 후속 Discovery OQ-4: 중장기 전략 폴링 주기 최소 1분·최대 10분 feat(bat-041): REQ-076/077/078 — watchdog timeout TOML + 중장기 운영 프로파일 + baseline Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4.7 KiB
4.7 KiB
BAT-041 Verification
- Status: confirmed
- Batch: BAT-041
Acceptance Mapping
-
REQ-076 AC-1 (TOML
watchdog_timeout_sec = 1800→ 1800s 동작):- Evidence:
test_toml_watchdog_timeout_applied(1800 적용) +test_toml_wins_over_env(env 300 무시, TOML 1800 승리) PASSED.
- Evidence:
-
REQ-076 AC-2 (미설정 → env 폴백, byte-for-byte 무회귀):
- Evidence:
test_absent_falls_back_to_env(env 300 적용) +test_absent_and_no_env_keeps_default_120PASSED. 전체 회귀 446 passed(기존 인스턴스 경로 무회귀).
- Evidence:
-
REQ-076 AC-3 (인스턴스별 독립 timeout):
- Evidence:
test_instances_get_independent_timeouts— day 120 / lt 1800 동시 분리 PASSED.
- Evidence:
-
REQ-076 AC-4 (저빈도 폴링 비오인 + last_seen 가시성):
- Evidence: timeout 1800s 적용 경로가 slots RPC 핸들러·SafetySellService 양쪽의 단일 소스(
config.safety_sell.watchdog_timeout_sec, daemon.py:284 wiring 코드 리뷰)로 일치 — 600s 폴링 < 1800s timeout 으로is_expired산식상 비오인(WatchdogStore.is_expired 는 경과>timeout 비교).last_seen노출 경로(slot_to_dict) 불변(기존 slots 핸들러 16 테스트 회귀 green).
- Evidence: timeout 1800s 적용 경로가 slots RPC 핸들러·SafetySellService 양쪽의 단일 소스(
-
REQ-077 AC-1 (프로파일 기동 구성 — 워커 미기동 + 1800 + 독립 큐):
- Evidence:
test_longterm_example_profile_loads_with_expected_combination— instance_key=longterm,safety_sell_enabled=False, watchdog 1800, max_active_slots=10 PASSED. 워커 미기동(safety_sell_enabled=false→trex-safety-sell스레드 제외 + WARNING)은 BAT-036 verification evidence 유효(본 batch 코드 경로 불변). per-instance 큐명은 dcy-009/BAT-013 evidence 유효.
- Evidence:
-
REQ-077 AC-2 (멀티데이 보유 유지 — 일자 경계·재시작):
- Evidence: 영구 자산 슬롯의 DB 영속·날짜 키 부재(dcy-020/BAT-027~030 verification — holding 이 재시작·일자 경계 통과)는 기존 evidence 유효. 본 프로파일은 자율 청산 트리거 전부 OFF(safety_sell_enabled=false + market-close env 미설정) 조합 — 설정 단위 검증 PASSED. 실 데몬 장기 run(수일) 검증은 release 운영 단계로 위임(planning R-3 명시) — 코드 경로는 기존 검증 조합의 재구성이므로 release-ready 차단 아님.
-
REQ-077 AC-3 (당일·중장기 병행 무간섭):
- Evidence:
test_instances_get_independent_timeouts(설정 독립) + 기존 instance topology/스코프 격리 테스트 회귀 green(446 passed — DB instance_key 스코프·per-instance 큐 기존 evidence 유효).
- Evidence:
-
REQ-077 AC-4 (예시 파일 — 표준 레시피 + 의미 주석):
- Evidence:
config/longterm.example.toml— 키별 중장기 의미 주석(safety_sell off 이유, 1800s 근거, forced_close_at 미사용, market-close env 미설정) 포함, 예시 로딩 테스트로 유효성 보증.
- Evidence:
-
REQ-078 AC-1 (runtime-flows 중장기 흐름 — 토폴로지/프로파일/보호 경계 정합):
- Evidence:
docs/runtime-flows.md중장기(멀티데이) 인스턴스 병행 운영flow 신설(6단계) + Change Log — 현행 코드(BAT-036 워커 미기동, REQ-076 override 경로)와 정합 확인.
- Evidence:
-
REQ-078 AC-2 (forced_close_at 미사용 명시):
- Evidence: runtime-flows flow 5단계("의미 없다 — 집행 주체 OFF, 발화 불가") + longterm.example.toml 주석 명시.
-
REQ-078 AC-3 (운영자 판단 가능성 — 보호장치 부재·책임 주체 명확):
- Evidence: flow 4단계 — "코어 손절매 루틴 일절 미사용 / 모든 보호 규칙 전략 모듈 전적 책임 / 유일한 백스톱 = 운영자 CLI exit" 모호함 없이 명시.
Evidence
- Test:
pytest tests/runtime/test_watchdog_timeout_toml.py— 7 passed (신규)pytest tests/— 446 passed, 46 skipped (BAT-040 439 → +7, 회귀 0 — dcy-027 NFR-1 당일 무회귀 게이트 green)ruff check trex_core tests— All checks passed
- Manual / Baseline 동기화 (Architecture Impact: runtime-flows):
docs/runtime-flows.md중장기 운영 flow 신설 + Change Log ✓ 코드 정합.docs/project-structure.md: 변경 불필요(design Reference Doc Update Plan — 구조 불변, config 필드 1개 + 예시 파일).- override 단일 지점(daemon.py:284 + SafetySellService) 코드 리뷰 확인.
Result
- Ready for Release: true
- Blocking Issues: 없음
- REQ-077 AC-2 의 실 데몬 장기 run(수일) 검증은 release 운영 단계 사항 — 구성 요소별 기존 evidence(영구 슬롯 영속 BAT-027~030, 워커 미기동 BAT-036) + 프로파일 조합 설정 검증으로 release-ready 충족. verification 한계로 명시.
- out-of-scope finding(
default_order_timeout_secTOML 전파 누락, implementation.md 기록)은 본 batch REQ 와 무관한 pre-existing — 별도 change-req 후속.