Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
31 lines
1.9 KiB
Markdown
31 lines
1.9 KiB
Markdown
---
|
|
id: "dcy-0008"
|
|
status: confirmed
|
|
---
|
|
|
|
# 최초 `reconcile_warned` intent 거부 알림
|
|
|
|
## Problem
|
|
|
|
`IntentService`는 재조정 경고(`reconcile_warned`)가 남아 있는 slot의 전략 buy/sell intent를 거부하지만, 현재 경고 알림을 발행하지 않아 운영자가 최초 거부를 즉시 인지하기 어렵다. 기존 intent dedup 기준(`IntentStore.try_insert/get/finalize`)과 차단 정책은 유지되어야 하며, 같은 `intent_id` 재시도에서는 추가 알림이 없어야 한다.
|
|
|
|
## Evidence
|
|
|
|
- `trex_core/application/intents.py`는 `reconcile_warned` 거부 결과를 `IntentStore.finalize()`로 저장하지만 `trex.alerts` 알림 발행이 없다.
|
|
- daemon은 공용 `AlarmEmitter`를 이미 생성해 다른 서비스에 주입하지만 `IntentService`에는 연결하지 않는다.
|
|
- issue #74와 승인된 REQ-0008/AC-0025는 finalize 이후 최초 거부 1회 알림, allowlist payload, optional context 조회 실패/발행 실패의 비차단 경계를 요구한다.
|
|
|
|
## Scope
|
|
|
|
- 대상은 외부 전략 buy/sell intent의 `rejected/reconcile_warned` 결과다.
|
|
- `IntentStore.finalize()` 성공 뒤에만 `severity=warn`, `code=strategy_intent_rejected` 알림을 best-effort로 발행한다.
|
|
- 필수 fields(`instance_key`, `intent_id`, `intent_type`, `reason`, `broker_submitted=false`)와 확인된 optional fields(`slot_id`, `portfolio_id`, `symbol`, `strategy_id`)만 포함한다.
|
|
- 같은 `intent_id`는 기존 durable dedup 결과를 재사용해 추가 발행하지 않고, 다른 `intent_id`는 독립 발행한다.
|
|
- 발행기 부재/실패/optional context 조회 실패는 저장 결과와 RPC 응답을 변경하지 않는다.
|
|
|
|
## Out of Scope
|
|
|
|
- AC-0023/AC-0024의 warning 판정·clear authority 변경
|
|
- broker 주문/취소, slot/warning/ledger/portfolio-hub write side effect 추가
|
|
- 신규 durable outbox, publish retry persistence, restart 후 보장 재발행
|