Files
trex-core/docs/srs/Documentation/req-009_daemon-api-baseline-alignment.md
T
genichinandClaude Opus 4.8 a4e263c8e7 Deliver BAT-002: slot-core daemon + HTTP intent API + PostgreSQL
Implement REQ-005~009 (dcy-002 slice 1) as an onion stack on top of the
BAT-001 pure domain:
- application: IntentService (admission + single-writer transition +
  intent_id idempotency via durable intent_log)
- adapters/persistence: PostgreSQLSlotRepository + PostgreSQLIntentStore +
  trex-core-owned migrations (daily_slot per Appendix A, daily_symbol_entries,
  slot_transition_log, intent_log) + in-memory intent store
- adapters/api: FastAPI /v1 (healthz, intents/buy|sell|{id}, slots, capacity)
- runtime: trex-core-daemon entrypoint with lifespan migrate+preallocate

Verification (against local PostgreSQL 18): 74 passed, ruff clean, domain
import sweep shows zero web/db deps (NFR-1), 20-thread concurrency admits
exactly the idle count (NFR-2), idempotent resubmit causes no double
transition (NFR-3), EXPECTED_SLOT_FIELDS<->information_schema drift test
(realizes dcy-001 OQ-2's deferred DB-side check), and a daemon E2E smoke.

Align all four baseline docs to the new daemon/API/persistence layers.
BAT-002 -> release-candidate; REQ-005~009 -> Implemented. Full async outbox,
broker execution, safety floor, and strategy daemons remain deferred to a
follow-up Discovery.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 13:46:08 +09:00

4.2 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 재참조로 충분.