diff --git a/docs/batches/bat-062_20260729_shared-account-capital-allocation/implementation.md b/docs/batches/bat-062_20260729_shared-account-capital-allocation/implementation.md index f2f3665..d90fb02 100644 --- a/docs/batches/bat-062_20260729_shared-account-capital-allocation/implementation.md +++ b/docs/batches/bat-062_20260729_shared-account-capital-allocation/implementation.md @@ -11,6 +11,7 @@ - `trex_core/domain/capital_allocation.py` - `tests/domain/test_capital_allocation.py` +- `tests/integration/test_kis_submission_recovery_virtual.py` - `docs/project-structure.md` - `docs/discovery/dcy-042_20260729_shared-account-capital-allocation-policy.md` - `docs/srs/Interface/req-127_shared-account-capital-allocation-policy.md` @@ -24,11 +25,13 @@ 3. 입력 검증과 계획 내부 현금 불변식 검사를 추가했다. 4. 메가·탑50 대표값, 오류 입력, 10,000건 무작위 불변식 테스트를 추가했다. 5. 로컬 KIS 어댑터의 중복 계산을 Core 정책 호출로 대체했다. +6. 선행 Core 브랜치의 가상 KIS 복구 테스트 시계를 거래 가능 시각으로 고정해 + 야간 실행에서도 같은 주문 복구 경로를 검증하도록 했다. ## Validation - Core 신규 테스트: 16 passed. -- Core 전체 회귀: 849 passed, 47 skipped. +- 최신 선행 Core 전체 회귀: 919 passed, 51 skipped. - 기존 어댑터 공식 50,000건 완전 일치: PASS. - Core 연결 로컬 어댑터 전체 회귀: 161 passed, 4 skipped. - 탑50 월간 가상거래 요약·거래원장·배분결정 원장 완전 일치: PASS. diff --git a/docs/batches/bat-062_20260729_shared-account-capital-allocation/verification.md b/docs/batches/bat-062_20260729_shared-account-capital-allocation/verification.md index 9728f74..ead8e61 100644 --- a/docs/batches/bat-062_20260729_shared-account-capital-allocation/verification.md +++ b/docs/batches/bat-062_20260729_shared-account-capital-allocation/verification.md @@ -15,7 +15,7 @@ | REQ-127 AC-5 | PASS | 잘못된 보호가격·현금·슬롯·후보·중복·유동 여유 입력 단위 테스트 | | REQ-127 AC-6 | PASS | 고정 시드 10,000건 최악 활성 슬롯 현금 불변식 | | REQ-127 AC-7 | PASS | 이전 어댑터 커밋 `46f5936`과 고정 시드 50,000건 결과 완전 일치 | -| REQ-127 AC-8 | PASS | Core 849 passed/47 skipped, Core 연결 어댑터 161 passed/4 skipped | +| REQ-127 AC-8 | PASS | 최신 선행 Core 919 passed/51 skipped, Core 연결 어댑터 161 passed/4 skipped | | REQ-127 AC-9 | PASS | 탑50 월간 요약 동일, `trade_ledger.csv`·`allocation_decisions.csv` 바이트 동일 | | REQ-127 AC-10 | PASS | Core·docker-local 격리 작업트리만 변경, 실전 런타임·주문 게이트·계좌·Hub 변경 없음 | @@ -23,7 +23,7 @@ - Test: - Core 정책: 16 passed. - - Core 전체: 849 passed, 47 skipped. + - 최신 선행 Core 전체: 919 passed, 51 skipped. - Core 대상 Ruff: PASS. - 로컬 어댑터 연결부: 11 passed. - 로컬 어댑터 전체: 161 passed, 4 skipped. @@ -33,6 +33,8 @@ duplicate orders/fills 0, restart equivalent true. - 공용 가상 인증: logic→regression→virtual contract→virtual end-to-end →fault injection→restart recovery→ledger reconcile 1~7단계 PASS. + - 선행 Core 가상 KIS 복구 3건은 거래 가능 시각을 고정해 야간 회귀에서도 + 주문 결과불명·재시작·거부 후 재시도 경로가 결정적으로 통과한다. - Manual: - Core는 순수 계산, 어댑터는 현금·호가, 전략은 후보·슬롯·최종 수량, Portfolio Hub는 원장 정본으로 책임 경계를 대조했다. diff --git a/tests/integration/test_kis_submission_recovery_virtual.py b/tests/integration/test_kis_submission_recovery_virtual.py index 9b222ee..d7912f2 100644 --- a/tests/integration/test_kis_submission_recovery_virtual.py +++ b/tests/integration/test_kis_submission_recovery_virtual.py @@ -17,6 +17,7 @@ from trex_core.domain.slot import SlotService, SlotState from trex_core.domain.slot.in_memory_repository import InMemorySlotRepository KST = ZoneInfo("Asia/Seoul") +VIRTUAL_AT = datetime(2026, 7, 29, 10, 0, tzinfo=KST) INSTANCE = "virtual-reliability" PORTFOLIO = "virtual-005930" SYMBOL = "005930" @@ -37,8 +38,8 @@ class _ExchangeState: "sll_buy_dvsn_cd": "02", "ord_qty": body["ORD_QTY"], "ord_unpr": body["ORD_UNPR"], - "ord_dt": datetime.now(KST).strftime("%Y%m%d"), - "ord_tmd": datetime.now(KST).strftime("%H%M%S"), + "ord_dt": VIRTUAL_AT.strftime("%Y%m%d"), + "ord_tmd": VIRTUAL_AT.strftime("%H%M%S"), "ord_gno_brno": "91258", "odno": f"{self.submit_attempts:010d}", "tot_ccld_qty": "0", @@ -124,6 +125,7 @@ def _broker(server: ThreadingHTTPServer) -> KISBroker: base_url=f"http://127.0.0.1:{server.server_port}", timeout=0.03, allow_live=True, + clock=lambda: VIRTUAL_AT, ) broker._headers = lambda _tr_id: {} # virtual exchange needs no credentials return broker