Files
trex-core/docs/srs/Interface/req-061_asset-keyed-intent-contract.md
T
genichinandClaude Opus 4.8 f7d309be71 docs(req): dcy-020 confirm-req(REQ-056~065 Approved) + 기존 REQ supersession change-req
- confirm-req: REQ-056~065 Proposed→Approved (CHG-20260610-02 각). srs/index Register Approved.
- change-req(forward-looking): REQ-002/003/005/006/007 에 dcy-020 재정의/폐기 예정 기록
  (CHG-20260610-01). 현재 코드 불변이라 status Implemented 유지(keep-current);
  실제 폐기/재정의·status 전환은 dcy-020 delivery 배치에서 확정.
  - REQ-002 상태머신/도메인 → REQ-056/057/062
  - REQ-003 테스트 계약 → REQ-056/057
  - REQ-005 일일 preallocation 폐기 → REQ-058(reconcile)/REQ-060(M)
  - REQ-006 persistence 스키마 → REQ-056/062/064
  - REQ-007 admission/intent → REQ-059/061

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 10:32:52 +09:00

3.9 KiB

req-061: intent 계약 자산(portfolio_id) 키 통일 + 중복/무효 규칙

  • Status: Approved
  • Type: Interface
  • Priority: High
  • Owner: project maintainers

Intent

  • 자산 중심 모델에서 매수·매도 신호를 모두 자산(portfolio_id)으로 식별하도록 intent 계약을 통일하고, 슬롯이 자산 1:1 영구이므로 sell-by-slot_id 노출을 폐기한다. (dcy-020 FR-7/NFR-4)

Requirement

  • 매수·매도 intent 를 모두 portfolio_id(자산) 키로 식별한다. 매수 = 해당 자산 슬롯 활성화(inactive→pending_buy), 매도 = 비활성화(holding→pending_sell). sell-by-slot_id 는 폐기한다. 중복/무효 신호 규칙: 이미 활성(pending_buy/holding/pending_sell)인 자산에 매수 신호 → 멱등 거부(already_active); 보유 아닌 자산에 매도 신호 → 거부(not_holding). intent_id 멱등(intent_log)은 보존한다. 계약 변경은 외부 전략 모듈을 깨뜨리므로 cutover/버전 절차를 명시한다(NFR-4).

Acceptance Criteria

  1. Given 매도 신호, When portfolio_id 로 제출, Then 해당 자산 슬롯이 pending_sell 로 전이하고 slot_id 없이 처리된다.
  2. Given 이미 holding 인 자산, When 매수 신호, Then already_active 로 멱등 거부된다.
  3. Given 보유하지 않은 자산, When 매도 신호, Then not_holding 으로 거부된다.
  4. Given 같은 intent_id 재전송, When 처리, Then 슬롯 중복 전이 없이 최초 결정과 동일 응답(멱등).

Impacted Area

  • Docs: docs/runtime-flows.md(intent 흐름), docs/interface-contract.md(메시지 계약)
  • Modules: trex_core/application/intents.py, 메시지 핸들러/스키마
  • Tests: tests/application/test_messaging_intent_consumer.py, tests/application/test_intent.py

Notes

  • 기존 REQ-007(intent API) 재정의 change-req 동반(sell-by-slot_id 폐기·자산 키 통일). NFR-4(전략 계약 호환): 외부 전략 모듈 동시 전환 또는 한시적 하위호환 — REQ/배치 cutover 에서 명시.
  • 출처: dcy-020 FR-7, NFR-4.

Change Log

CHG-20260610-01

  • Date: 2026-06-10
  • Author: Justin Ko

Change Summary

  • dcy-020 FR-7/NFR-4 로부터 최초 생성(Proposed). intent 자산(portfolio_id) 키 통일 + sell-by-slot_id 폐기 + already_active/not_holding.

Intent

  • 매수·매도 신호를 자산 키로 통일하는 계약 변경을 backlog 정규화.

Acceptance Criteria Delta

  • Added: 매도 자산키/already_active/not_holding/intent_id 멱등 4개 기준
  • Updated: 없음
  • Removed: 없음

Impacted Area Delta

  • Docs: docs/runtime-flows.md, docs/interface-contract.md
  • Modules: application/intents.py, 메시지 핸들러/스키마
  • Tests: test_messaging_intent_consumer.py, intent 테스트

Delivery Trace Delta

  • Batches: none
  • Releases: none

Revalidation Impact

  • Reverification Needed: no
  • Existing Implementation Invalidated: no (REQ-007 재정의 change-req 로 기존 폐기)
  • Status Recommendation: keep-current
  • Follow-up Action: confirm-req. NFR-4 외부 전략 계약 cutover 명시.

Validation Plan

  • 자산 키 매도/거부 규칙/멱등 단위·통합 테스트 green.

CHG-20260610-02

  • Date: 2026-06-10
  • Author: Justin Ko

Change Summary

  • Status Proposed → Approved (confirm-req). 필수 필드·구체 AC 충족, source dcy-020(confirmed, handoff 승인)과 모순 없음.

Intent

  • delivery input 으로 승격.

Acceptance Criteria Delta

  • Added: 없음 / Updated: 없음 / Removed: 없음

Impacted Area Delta

  • Docs: docs/srs/index.md (Register Approved) / Modules: 없음 / Tests: 없음

Delivery Trace Delta

  • Batches: none / Releases: none

Revalidation Impact

  • Reverification Needed: no / Existing Implementation Invalidated: no / Status Recommendation: keep-current / Follow-up Action: suggest-batch-reqs / draft-batch.

Validation Plan

  • 승인 후 batch planning 에서 본 REQ AC 를 검증 기준으로 사용.