# BAT-031 Verification - Status: approved (confirm-batch-verification, 2026-06-10) - Batch: BAT-031 - 검증 환경: Python 3.12 / PostgreSQL trex_core_test / 실 RabbitMQ / paper broker ## Acceptance Mapping ### REQ-066 (포지션 사이징 end-to-end) | AC | 판정 | Evidence | |---|---|---| | AC-1 증액 가중평균 | pass | `test_increase_accumulates_qty_and_weights_avg_price`(10@1000 +5@1200 → 15@1066.67) + e2e 2단계 | | AC-2 부분 매도 잔량 holding·cost basis | pass | `test_partial_sell_qty_is_min_intent_broker`(잔량 6, avg 1000) + e2e 3단계(9 @1066.67) | | AC-3 전량 매도 → inactive | pass | `test_full_sell_qty_is_broker_balance`·`test_partial_sell_caps_at_broker_balance` + e2e 4단계 | | AC-4 부분 체결 실제만 반영·미추적 | pass | `test_execution_cancel`(부분 체결→브로커 정본 잔량) + _on_filled/_on_partial_cancel 브로커 resync | | AC-5 무회귀 | pass | 단위 378 / 통합 422 passed | ### REQ-057 (CHG-03 상태머신 holding→pending_buy) | AC | 판정 | Evidence | |---|---|---| | AC-1 전이 집합(13) | pass | `test_state.py`(holding→pending_buy allowed, size 13) | | AC-5 증액 전이·복귀 | pass | `test_holding_to_pending_buy_increase_preserves_avg` + e2e | ### REQ-061 (CHG-04 사이징 intent) | AC | 판정 | Evidence | |---|---|---| | AC-6 증액 매수(holding) | pass | `test_increase_*` + e2e 2단계(admitted) | | AC-7 부분 매도 qty·명령형·core 미저장 | pass | `test_partial_sell_*` + messaging sell qty 파싱 + e2e 3단계 | ### REQ-062 (CHG-03 부분 매도 집행) | AC | 판정 | Evidence | |---|---|---| | AC-1 매도 = min(intent, 브로커)·이상이면 전량 | pass | `test_partial_sell_qty_is_min_intent_broker`·`test_partial_sell_caps_at_broker_balance` | | AC-5 부분 체결 실제만·미추적 | pass | `test_execution_cancel` + _balance_map resync | ### REQ-067 (baseline 정합) | AC | 판정 | Evidence | |---|---|---| | AC-1~3 data-model/runtime-flows/interface-contract/project-structure 정합 | pass | commit (사이징 흐름·13 전이·intent qty·가중평균 반영) | ## Evidence 1. 단위: `pytest tests` → **378 passed**, ruff clean. 2. 통합(PG `trex_core_test` + 실 RabbitMQ): **422 passed, 1 skipped**(KIS sandbox 환경 이슈, 무관). 3. **run-the-app e2e**(라이브 trex_core + 실 MQ + paper, M=5): 초기 매수 10@1000 → 증액 +5@1200 → holding 15@1066.67(가중평균) → 부분 매도 6 → holding 9@1066.67(cost basis) → 전량 매도 → inactive. 데몬 ERROR 0. 4. baseline 동기화: 4문서 + (run-the-app e2e 가 증액·부분/전량 매도 흐름 실증). ## Blocking Issues - 없음. 전략 모듈(trex-orb) 사이징 전환은 병존(additive)이라 무중단; 미체결 pending 처분은 issue #21(별도) 범위. ## Result - 포함 REQ AC 전부 evidence 연결. **Ready for Release: true** (코드·단위·통합·e2e·baseline). 실 운영 전환은 전략 모듈 사이징 발행 시 활성(계약 병존).