feat(execution,obs): 호가단위 스냅(dcy-030/#28) + 운영 관측성(dcy-029/#29) + REL-007 환류
dcy-030 (issue #28, P0 체결 복구): - REQ-083 KRX 호가단위(tick) 순수 유틸 (domain/pricing.py) - REQ-070 CHG: 슬리피지 실효가 호가단위 스냅 — 상한 준수(매수 floor/매도 ceil) + band<1tick 하한/상한 보장 + 부동소수 epsilon 가드. 147700→148400/54500→54700. - BAT-044 release-candidate dcy-029 (issue #29, 운영 관측성): - REQ-084 구조화 로깅 기반 (runtime/logging_setup.py): ISO8601 KST·레벨·Loki JSON ·correlation id(slot_id) - REQ-085 주문 결과 로깅 (event=order_submit|fill|reject) - REQ-087 거부 ERROR 가시성 (조용한 롤백 제거) - REQ-086 청산 reason+actor 동반 노출 (안전망/전략 구분, 신규 필드 없음) - REQ-088 운영 조회 CLI report (application/operator_report.py, 보유·오늘 체결 ·실현 PnL net·대기, direct-DB) - REQ-089 운영자 런북 docs/operations.md - REQ-090 baseline 정합 (runtime-flows·project-structure·interface-contract) - BAT-045(P0)·BAT-046(P1) release-candidate REL-007: confirmed → feedback-captured (운영 인스턴스 라이브 검증 + #28/#29 환류 정규화). BAT-037~041 released. 검증: 537 passed, 47 skipped, 회귀 0, ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -98,6 +98,19 @@ def test_forced_close_fire_logs_warn(caplog):
|
||||
assert rec and "forced_close_at" in rec[0].message and "inst-1" in rec[0].message
|
||||
|
||||
|
||||
def test_fire_log_exposes_reason_and_actor(caplog):
|
||||
"""REQ-086 (dcy-029): safety-sell 청산 로그가 reason+actor 를 함께 노출."""
|
||||
repo, svc, broker, watchdog, service = _wire()
|
||||
_holding(svc, repo, forced_close_at=_NOW - timedelta(seconds=1))
|
||||
with caplog.at_level(logging.WARNING):
|
||||
service.check_forced_close(_NOW)
|
||||
rec = [r for r in caplog.records if "safety-sell fired" in r.message]
|
||||
assert rec
|
||||
msg = rec[0].message
|
||||
assert "reason=forced_close_at" in msg
|
||||
assert "actor=trex-safety-sell" in msg # 안전망 자율청산 구분
|
||||
|
||||
|
||||
def test_take_profit_fire_logs_info(caplog):
|
||||
repo, svc, broker, watchdog, service = _wire()
|
||||
slot = _holding(svc, repo, take_profit_price=Decimal("60000"))
|
||||
|
||||
Reference in New Issue
Block a user