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:
@@ -163,3 +163,27 @@ def test_buy_symbol_resolved_from_universe():
|
||||
from uuid import UUID
|
||||
slot = repo.fetch_slot(UUID(resp.payload["slot_id"]))
|
||||
assert slot.symbol == "005930" and slot.portfolio_id == "PF-9"
|
||||
|
||||
|
||||
def test_buy_payload_allocated_capital_is_ignored():
|
||||
"""dcy-023 / REQ-007 AC-6: allocated_capital is no longer a contract field.
|
||||
Senders (e.g. trex-orb-v1) may still include it — admission proceeds
|
||||
normally and the value lands nowhere (no Slot/BuyIntent field exists)."""
|
||||
repo, _, intents = _wire()
|
||||
handler = make_intent_rpc_handler(intents)
|
||||
req = RpcRequest(
|
||||
payload={
|
||||
"intent_type": "buy",
|
||||
"intent_id": "buy-cap",
|
||||
"portfolio_id": "PF-1",
|
||||
"qty": 10,
|
||||
"allocated_capital": 1_000_000, # unknown key — ignored
|
||||
},
|
||||
correlation_id="buy-cap",
|
||||
)
|
||||
resp = handler(req)
|
||||
assert resp.payload["status"] == "admitted"
|
||||
from uuid import UUID
|
||||
slot = repo.fetch_slot(UUID(resp.payload["slot_id"]))
|
||||
assert slot.status is SlotState.PENDING_BUY and slot.qty == 10
|
||||
assert not hasattr(slot, "allocated_capital")
|
||||
|
||||
Reference in New Issue
Block a user