# BAT-033 Implementation - Status: done - Batch: BAT-033 ## 변경 파일 | 파일 | 변경 유형 | 연결 REQ/AC | |------|----------|-------------| | `trex_core/runtime/cli.py` | 수정 | REQ-032 CHG-20260610-06 AC-7 | | `tests/runtime/test_cli_operator.py` | 수정 | AC-7 검증 + 기존 enter 테스트 --qty 보완 | ## M1: `enter --qty` 미지정 검증 ### `trex_core/runtime/cli.py` `_cmd_enter` 함수 상단(forced_close_at 검증 앞)에 qty 검증 블록 추가: ```python # REQ-032 AC-7 (CHG-20260610-06, issue #23): qty is required — reject before # RPC so a missing --qty fails immediately instead of admitting a zero-qty order # that the broker rejects silently after the fact. if not args.qty: _fail("--qty is required for enter (no quantity → broker would reject)", args.json) return 1 ``` - `--qty` 없음(None) 또는 0 → 즉시 `rc=1`, RPC 미호출 - `--dry-run` 경로도 동일하게 걸림 (qty 검증이 `_intent_guard` 진입 전에 위치) - 기존 `--qty` 있는 경우 동작 불변 ### `tests/runtime/test_cli_operator.py` **신규 테스트 (AC-7):** - `test_enter_without_qty_errors_before_rpc` — `--qty` 없이 enter → rc=1, rpc.calls==[], stderr에 `--qty` 포함 **기존 테스트 수정 (회귀 방지):** 기존 enter 테스트 9개에 `"--qty", "10"` (또는 적절한 값) 추가. qty 검증이 가장 앞에 위치하므로, 각 테스트가 본래 의도한 guard(confirm abort, live guard, json guard, forced_close_at 검증 등)에 도달하도록 보정.