Files
trex-core/docs/discovery/index.md
T
genichinandClaude Opus 4.8 4746f74aae fix(broker): dcy-013 KIS 외부 취소 감지 + 부분 체결 회계 + stale 워치독 (BAT-017)
KIS 계좌에서 직접 매도 주문을 취소하면 poll_fill 이 cncl_yn 을 파싱하지 않아
슬롯이 pending_sell 에 영구히 갇히고 죽은 주문을 무한 폴링하던 버그(issue #9)
정정.

거버넌스: 전부 change-req (신규 REQ 없음, dcy-013 OQ-3).
- REQ-012: KIS poll_fill cncl_yn 파싱 → 외부 취소 감지. FillStatus.cancelled
  /is_partial_cancel 추가. 체결 0 취소→cancelled, 부분 체결 후 취소→partial+cancelled
- REQ-013: 집행 _on_partial_cancel — 체결분 원장 1회 + qty 차감(매도 잔여/매수 체결분)
  + holding 복귀 (OQ-1 A안). 전량 취소는 기존 롤백 경로 재사용
- REQ-018: 부분 체결분 원장 1회 기록 (_record_ledger 재사용)
- REQ-031: 잔여 포지션 정합 연계 (slot.qty ↔ 실 잔고, 과매도 방지)
- REQ-014: pending stale 워치독 Alert-only (TREX_PENDING_STALE_THRESHOLD,
  WARN+카운터, 상태 미변경) — 취소 감지 누락 backstop
- REQ-015: interface-contract/runtime-flows 정합

전량 취소는 holding 자동 복구(limit_price clear→재매도 시장가, dcy-012 연계).
KIS cncl_yn 실 규약은 운영 검증(미지 값 보수 처리 + 워치독 backstop).

검증: 단위 294 passed/32 skipped, 인프라 게이트(PG+RabbitMQ) 326 passed, ruff clean.
신규 test_kis_cancel(httpx stub) + test_execution_cancel(programmable broker).
BAT-017 release-candidate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 14:11:49 +09:00

3.5 KiB

Discovery 전체 인덱스

Discovery 목록

ID 날짜 이슈명 문서 상태
dcy-001_20260603_slot-pure-domain-migration 20260603 trex-core 베이스 수립 및 slot 순수 도메인 이식 Discovery confirmed
dcy-002_20260603_slot-core-daemon-http-api 20260603 trex-core 슬롯 코어 데몬화 + HTTP intent API Discovery confirmed
dcy-003_20260604_broker-execution-and-outbox 20260604 브로커 단일 세션 + 주문 집행 + durable outbox (불변식 B) Discovery confirmed
dcy-004_20260604_portfolio-hub-ledger-integration 20260604 portfolio-hub ledger 연동 — 체결을 외부 원장에 기록 Discovery confirmed
dcy-005_20260604_portfolio-hub-asset-snapshot-api 20260604 portfolio-hub 종목 스냅샷 read API — 전략 모듈에 전략 실행 대상 자산 리스트 제공 Discovery confirmed
dcy-006_20260605_strategy-module-rabbitmq-transport 20260605 trex-core ↔ 전략 모듈 통신 transport — RabbitMQ 도입 (스냅샷 read + intent 제출 + 이벤트) Discovery confirmed
dcy-007_20260606_core-autonomous-safety-sell 20260606 core 자율 안전 매도 — stop-loss·시간 만기 자동 트리거 Discovery confirmed
dcy-008_20260607_emergency-stop-kill-switch 20260607 비상 정지/강제 청산(kill-switch) — portfolio/전역 슬롯 청산 + 당일 전략 제외 Discovery confirmed
dcy-009_20260607_multi-instance-rabbitmq-topology 20260607 인스턴스별 독립 RabbitMQ 채널 토폴로지 — trex-core 다중 인스턴스 운영을 위한 Topic Exchange + Fanout Exchange per-instance 큐 분리 Discovery confirmed
dcy-010_20260607_safety-sell-persistent-rejection-backoff 20260607 safety-sell 영속 거부 재시도 백오프 — 장 휴장·잔고 부족·규제 등 지속 거부 상황에서 KIS 주문 spam 방지를 위한 슬롯별 재시도 backoff/cooldown 정책 Discovery confirmed
dcy-011_20260608_buy-intent-portfolio-id-required-symbol-resolve 20260608 buy intent — portfolio_id를 필수 키로, symbol은 universe(SnapshotStore)에서 resolve (+ issue #11 portfolio_id 누락 체결 ledger silent skip 가시화 흡수) Discovery confirmed
dcy-012_20260608_sell-order-pricing-entry-price-bug 20260608 매도 주문이 현재가가 아닌 entry_price(매수가) 지정가로 나가는 버그 — sell dispatch 가격 정책 부재 (issue #10) Discovery confirmed
dcy-013_20260608_kis-external-cancel-pending-sell-stuck 20260608 KIS 외부 주문 취소 시 슬롯이 pending_sell 에 영구히 갇힘 — cncl_yn 미파싱 (issue #9) Discovery confirmed