Files
trex-core/.proofline/lines/line-0008/req-0008.md
T

2.7 KiB

id, status, discovery, criteria
id status discovery criteria
req-0008 approved dcy-0008
create update retire satisfy
ac-0025

최초 reconcile_warned intent 거부 알림 발행

Objective

trex-core는 재조정 경고가 남아 있는 slot에 대한 외부 전략 buy/sell intent가 rejected/reconcile_warned로 확정될 때, 기존 idempotency와 차단 정책을 유지하면서 새 intent_id의 최초 거부에 한해 trex.alerts 경고를 한 건 발행해야 한다.

Scope

  • 경고 발행 조건
    • IntentStore.try_insert()가 성공한 최초 처리여야 한다.
    • 외부 전략 buy 또는 sell intent여야 한다.
    • 최종 결과가 status="rejected", reason="reconcile_warned"여야 한다.
    • IntentStore.finalize()가 성공한 뒤여야 한다.
  • 경고 계약
    • severity=warn
    • code=strategy_intent_rejected
  • dedup 경계
    • 같은 intent_id 재요청은 저장된 기존 결과를 반환하고 경고를 재발행하지 않는다.
    • duplicate_in_flight와 최초 처리 중 중복 요청은 경고 대상이 아니다.
    • 같은 slot이라도 intent_id가 다르면 독립 발행한다.
    • process-local set, 별도 notification table, reconcile_notification_state를 추가하지 않는다.
  • payload allowlist
    • 필수: instance_key, intent_id, intent_type, reason="reconcile_warned", broker_submitted=false
    • optional(확인 가능 시에만): slot_id, portfolio_id, symbol, strategy_id
    • buy strategy_id와 sell sell_strategy_id는 공통 strategy_id로 표현한다.
    • quantity, entry_price, limit_price, venue, raw request/strategy extra는 포함하지 않는다.
  • failure isolation
    • emitter 부재/실패, optional context 조회 실패는 저장 결과와 RPC 응답을 바꾸지 않는다.
    • 이미 확정된 거부를 rollback하거나 admitted로 바꾸지 않는다.
  • production wiring
    • IntentService는 optional AlarmEmitter를 받는다.
    • daemon은 기존 공용 AlarmEmitter를 IntentService에 전달한다.
    • emitter 없이 생성하는 기존 테스트/사용 경로는 계속 동작한다.

Constraints

  • AC-0023·AC-0024의 기존 warning 판정, clear authority, intent dedup semantics를 변경하지 않는다.
  • 경고 발행을 위해 broker/slot/warning/ledger/portfolio-hub side effect를 추가하지 않는다.
  • 경고/로그에 account number/hash, credential/token/password/secret, DSN/connection string, raw payload, exception 본문을 노출하지 않는다.

Non-Goals

  • 다른 거부 사유를 위한 범용 경고 정책 추가
  • safety-sell/kill-switch/watchdog 내부 경로 신규 알림
  • notifier 렌더링/채널, RabbitMQ topology, production 배포/릴리즈 절차 변경