feat(rel-006): dcy-022/023 + BAT-032~034 — 실행 정책·qty 검증·allocated_capital 제거 통합

BAT-032 (dcy-022): timeout_sec/slippage_pct 실행 정책, 미체결 자동 취소,
보호 지정가, `trex-core cancel` 백스톱. 마이그레이션 012.
BAT-033: `trex-core enter --qty` 필수 검증 — 미지정 시 RPC 전 즉시 오류.
BAT-034 (dcy-023): allocated_capital 죽은 필드 전 경로 제거 (domain·intent·
persistence·snapshot·CLI). 마이그레이션 013(비가역 DROP). 외부 발신자
unknown key 무시 수신 의미론 적용.
REL-006 confirmed: BAT-026~034 통합 릴리즈, pre-release smoke 증거 포함.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 07:42:03 +09:00
co-authored by Claude Sonnet 4.6
parent 5ee5f7f4e2
commit fb05a73130
56 changed files with 3151 additions and 103 deletions
@@ -0,0 +1,27 @@
# BAT-034 Implementation
- Status: done
- Batch: BAT-034
## 변경 파일
| 파일 | 변경 | Milestone / REQ |
|------|------|----------------|
| `trex_core/domain/slot/models.py` | `Slot.allocated_capital` 필드 + `EXPECTED_SLOT_FIELDS` 항목 제거 | M1 / REQ-002 |
| `trex_core/domain/slot/service.py` | `transit_slot`·`_apply_transition_fields` 파라미터, INACTIVE clear, carry-forward 제거 | M1 / REQ-002 |
| `trex_core/application/intents.py` | `BuyIntent.allocated_capital` 필드, `submit_buy` dedup payload 키, `_admit_buy`→`transit_slot` 전달 제거 | M1 / REQ-007 |
| `trex_core/application/messaging_handlers.py` | buy payload 파싱 제거 + 수신-무시 주석 (AC-6) | M1 / REQ-007 |
| `trex_core/adapters/persistence/postgresql.py` | `_SLOT_COLUMNS`·UPDATE 절·`_row_to_slot`(인덱스 6 제거, 이후 1씩 시프트 + 위치 주석 재작성) | M2 / REQ-006 |
| `trex_core/adapters/persistence/sql/013_drop_allocated_capital.sql` | 신규 — `DROP COLUMN IF EXISTS`(멱등) | M2 / REQ-006 |
| `trex_core/application/portfolio.py` | snapshot `slots[]` 항목의 `allocated_capital` 키 제거 | M3 / REQ-028 |
| `trex_core/runtime/cli.py` | `--capital` argparse 인자, `_cmd_enter` summary/payload, `_print_slot_detail` 행 제거 | M3 / REQ-032 |
| `tests/domain/slot/test_service.py` | `allocated_capital` 인자/assert 제거 | M4 |
| `tests/runtime/test_cli_operator.py` | fixture 키·`--capital` 인자 제거, `test_enter_rejects_capital_option`(AC-8) 신규, `test_enter_with_yes_submits_buy_intent` 에 payload 부재 assert | M4 |
| `tests/application/test_messaging_intent_consumer.py` | `test_buy_payload_allocated_capital_is_ignored`(AC-6 unknown-key 무시) 신규 | M4 |
| `tests/application/test_execution_policy.py` | 잔여 lint 정리(F401/F841 — BAT-032 잔재, 본 배치 변경과 무관) | M4 |
## 설계 정합
- design.md D1 제거 지점 8개 전부 처리. D4 인덱스 시프트는 위치 주석 재작성 + 드리프트 테스트로 검증.
- D3 수신-무시: 파싱 제거 = unknown key 무시. 전용 테스트로 고정.
- D5 불변 확인: `qty` 집행 경로·BAT-033 AC-7 guard·외부 모듈·baseline 문서 모두 미변경.