Files
trex-core/docs/srs/Documentation/req-009_daemon-api-baseline-alignment.md
T
genichinandClaude Opus 4.8 0b7db66463 feat(runtime): dcy-014 trading_date KST 타임존 분리 + 일일 슬롯 preallocation (BAT-018)
데몬이 시스템 UTC 날짜로 슬롯을 1회만 preallocate 해 trading_date 가 KST 캘린더와
어긋나고 재시작 없이는 다음날 슬롯이 안 생기던 문제(issue #14) 정정.

거버넌스: 전부 change-req (신규 REQ 없음, dcy-014 OQ-3; 스케줄러는 REQ-030 패턴 준용).
- REQ-005: trading_date 를 설정 타임존(기본 Asia/Seoul) 기준 계산(timestamp 는 UTC
  유지). DailyPreallocationScheduler 신규 — TZ 일자당 1회 멱등 fire, 재시작 없이
  다음날 슬롯 자동 생성. setup() 배선 + trex-preallocation 스레드
- REQ-048: TOML trading_timezone/daily_preallocation_time 키 + from_config 전파
- REQ-009: runtime-flows/data-model 정합 + instance.example.toml

OQ-1 기본 00:00(TZ 자정, TOML 설정 가능) / OQ-2 매 캘린더일 생성(거래일 캘린더 후속).
멱등 preallocate 로 중복 tick·다중 인스턴스 중복 생성 0.

검증: 단위 302 passed/32 skipped, 인프라 게이트(PG+RabbitMQ) 334 passed, ruff clean.
신규 test_preallocation_scheduler(고정 clock) + test_instance_config 확장.
BAT-018 release-candidate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 15:39:04 +09:00

5.3 KiB

req-009: 데몬/API/영속화 baseline 문서 정합

  • Status: Implemented
  • Type: Documentation
  • Priority: Medium
  • Owner: project maintainers

Intent

  • 데몬화·HTTP API·영속화 레이어가 추가된 뒤 baseline 문서를 실제 구조/흐름/계약과 일치시켜 cross-cutting 참조의 정확성을 유지한다.

Requirement

  • docs/interface-contract.md 에 HTTP API 계약(/v1 엔드포인트 6종)을 추가하고, docs/runtime-flows.md 에 데몬 lifecycle·intent 요청 흐름을 추가하며, docs/project-structure.md(API/persistence/런타임 레이어)와 docs/data-model.md(intent_log + 영속화 테이블)를 갱신한다.

Acceptance Criteria

  1. Given API 구현 완료, When docs/interface-contract.md 확인, Then /v1 엔드포인트 6종의 입력/출력/에러 계약이 실제 구현과 일치한다.
  2. Given 데몬/영속화 구현 완료, When docs/runtime-flows.md·docs/project-structure.md 확인, Then 데몬 흐름과 레이어 구조(domain/application/adapters)가 실제와 일치한다.
  3. Given intent_log + 영속화 테이블, When docs/data-model.md 확인, Then 신규 엔티티/테이블이 반영된다.

Impacted Area

  • Docs: docs/interface-contract.md, docs/runtime-flows.md, docs/project-structure.md, docs/data-model.md
  • Modules: 없음(문서 전용)
  • Tests: 없음

Notes

  • dcy-002 FR-6. REQ-005~008 구현 완료 후 수행해야 의미가 있다(순서 의존).
  • 출처: dcy-002 FR-6.

Change Log

CHG-20260603-01

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

Change Summary

  • dcy-002 FR-6 로부터 최초 생성(Proposed).

Intent

  • 데몬/API/영속화 baseline 정합 요구사항을 backlog 로 정규화.

Acceptance Criteria Delta

  • Added:
    • interface-contract, runtime-flows/project-structure, data-model 정합 3개 기준
  • Updated:
    • 없음
  • Removed:
    • 없음

Impacted Area Delta

  • Docs:
    • docs/interface-contract.md, docs/runtime-flows.md, docs/project-structure.md, docs/data-model.md
  • 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: REQ-005~008 구현 후 batch verification 단계에서 수행

Validation Plan

  • baseline 문서와 실제 구현(엔드포인트/레이어/테이블) 대조로 검증.

CHG-20260603-02

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

Change Summary

  • Status Proposed → Approved (confirm-req).

Intent

  • 승인 게이트(필수 필드·구체 AC·blocker 없음) 충족, source dcy-002(confirmed, handoff 승인)와 모순 없음 확인.

Acceptance Criteria Delta

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

Impacted Area Delta

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

Delivery Trace Delta

  • Batches:
    • none (batch 편성 전)
  • Releases:
    • none

Revalidation Impact

  • Reverification Needed: no
  • Existing Implementation Invalidated: no
  • Status Recommendation: keep-current
  • Follow-up Action: REQ-005~008 구현 후 batch 편성

Validation Plan

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

CHG-20260603-03

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

Change Summary

  • Status Approved → Implemented (confirm-req-implemented, 근거 batch BAT-002 release-candidate).

Intent

  • BAT-002 verification.md 의 acceptance mapping + evidence(pytest 74 pass / PG 통합 / 데몬 E2E)로 모든 AC 충족 → 구현 완료 동기화.

Acceptance Criteria Delta

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

Impacted Area Delta

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

Delivery Trace Delta

  • Batches:
    • BAT-002 (release-candidate)
  • Releases:
    • none

Revalidation Impact

  • Reverification Needed: no
  • Existing Implementation Invalidated: no
  • Status Recommendation: keep-current
  • Follow-up Action: draft-release 로 release 편성

Validation Plan

  • BAT-002 verification evidence 재참조로 충분.

CHG-20260608-01

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

Change Summary

  • (change-req, dcy-014) baseline 문서를 trading_date 타임존 분리·일일 preallocation 흐름에 맞춰 정합: docs/runtime-flows.md(데몬 lifecycle TOML 키·8 스레드·일일 슬롯 preallocation Flow 신규), docs/data-model.md(trading_date=설정 TZ 기준 / timestamp=UTC 구분). BAT-018 정합 완료 → Implemented 유지.

Intent

  • 코드(preallocation_scheduler/daemon/config) 변경과 baseline 문서를 일치(S-1~S-4)시켜 운영자 참조 정합 유지.

Acceptance Criteria Delta

  • Updated:
    • runtime-flows 데몬 lifecycle/일일 preallocation, data-model trading_date TZ vs UTC timestamp 기술 정합.

Impacted Area Delta

  • Docs: docs/runtime-flows.md, docs/data-model.md

Delivery Trace Delta

  • Batches: BAT-018
  • Releases: none

Revalidation Impact

  • Reverification Needed: no (문서 정합)
  • Existing Implementation Invalidated: no
  • Status Recommendation: Implemented (change-req → BAT-018 정합)
  • Follow-up Action: confirm-req-implemented(BAT-018).

Validation Plan

  • BAT-018: 코드-문서 diff 대조.