Commit Graph
111 Commits
Author SHA1 Message Date
genichinandClaude Opus 4.8 b2165eac25 docs(dcy-033): kdh emitter 범위 제외 반영 (사장님 결정)
kis-data-hub를 알람 모듈 emitter 범위에서 제외(Out of Scope),
생성된 REQ 참조에 REQ-057 Deprecated 표기. 모듈 emitter는 core/orb/tsl만.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-21 15:27:38 +09:00
genichinandClaude Opus 4.8 cc166bd531 docs(dcy-033): 생성된 REQ 참조에 cross-repo 모듈 REQ 보강
orb REQ-039/tsl REQ-024/kdh REQ-057/notifier REQ-001~008 역참조 추가
(confirm-req 완료 반영).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-21 15:16:58 +09:00
genichinandClaude Opus 4.8 ebca9be0d1 docs(dcy-033): 제품군 알람 전달 체계 discovery + REQ-098~101 (trex-core 소유분)
confirm-discovery + draft-req + confirm-req 완료. 알람 envelope wire 계약(098)·
trex.alerts AMQP exchange 가산·격리(099)·core CRITICAL emitter 8종
best-effort 비차단(100)·baseline 정합(101). 전송=trex.alerts AMQP 확정,
paging=ALARM-INVENTORY §A 전체. delivery는 M2 이후 큐잉.
orb/tsl/kdh emitter·trex-notifier는 각 repo 별도.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-21 14:56:14 +09:00
genichinandClaude Opus 4.8 f1b649cf2a feat(execution): 체결가 0/None 시 지정가 백필 가드 + WARN 로깅 (dcy-032/BAT-048)
REQ-095(슬롯 평단·원장 price 지정가 백필, 0 오염 방지) + REQ-096(백필/미해결 WARN 로깅) 구현.
지정가 부재 시 skip+강WARN. application 단일화(_resolve_fill_price), wire/LedgerTrade 스키마 불변.
575 passed/0 fail, opus QC PASS. REQ-097 알람=스파이크 산출물만(impl 후속).

- _resolve_fill_price 헬퍼 추가: avg_price 검증, limit_price 백필, 미해결 WARN
- _on_filled/_on_partial_cancel 통합: 백필 적용, 슬롯/원장 일관성
- _record_ledger 시그니처: resolved_price 파라미터 (backward compat)
- test_execution_fill_price_backfill.py: 21 시나리오 (avg=None/0, limit=있음/없음 등)
- docs: dcy-032, req-095/096/097, bat-048 설계/검증

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-21 13:34:31 +09:00
genichinandClaude Opus 4.8 d182464b7a feat(messaging): OPS-005 이벤트 발행 연결 신뢰성 (BAT-047)
발행 전용 연결의 idle heartbeat 사망 후 첫 발행 유실 결함 제거.
- REQ-091 발행 재시도 + 강제 재연결(_force_reconnect, is_open 불신)
- REQ-092 idle keepalive(execution-loop 단일스레드 틱, process_data_events time_limit=0)
- REQ-093 DLQ 가시성 + emit 실패 ERROR 경보(구조화 로그, dcy-029 재사용)
- REQ-094 baseline 문서 정합(runtime-flows/operations/project-structure)

독립 opus QC PASS-WITH-NOTES → 시정 2건(ruff F401, AC-3 프로덕션 경로) 완료.
554 passed/47 skipped/회귀 0/ruff clean. NFR-1 wire 무회귀(interface-contract diff 0).
BAT-047 release-candidate, REQ-091~094 Implemented. dcy-031. M2 트랙B.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-19 22:39:43 +09:00
genichinandClaude Opus 4.8 bc79f60274 docs(dcy-031): OPS-005 이벤트 발행 신뢰성 Discovery + REQ-091~094
운영팀 OPS-005(이벤트 발행 실패) 코드검증 → dcy-031 confirm-discovery.
스코프 B(재시도/강제재연결)+A(idle keepalive)+D(DLQ 가시성/emit 경보).
REQ-091~094 draft-req → confirm-req 완료(4건 Approved). M2 트랙B.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-19 21:21:19 +09:00
genichinandClaude Opus 4.8 9e35467336 docs(rel-008): 범위 정정 — BAT-042/043 포함 (남아있는 배치 전부)
REL-008 초안 시 BAT-042(dcy-028 strategy-state/#26)·BAT-043(retryable/#27)을
주제 기준으로 제외했으나, 단일 main 브랜치 배포(HEAD 통째)에서는 이미 운영에
동반 배포된 release-candidate 배치다. "남아있는 배치 전부를 REL-008로" 지시에
맞춰 포함하도록 정정.

- Included Batch: BAT-044/045/046 → BAT-042/043/044/045/046
- BAT-042/043: release-candidate → released
- 마이그레이션 014/015는 BAT-042 소속으로 명시, 거버넌스 갭 해소
- 코드/운영 변경 없음 — 문서(release scope) 정정만. 재배포 불요.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 13:59:26 +09:00
genichinandClaude Opus 4.8 00ce5d95bb docs(rel-008): draft + confirm — 호가단위 스냅(#28) + 운영 관측성(#29) 통합 릴리즈
BAT-044/045/046(release-candidate)를 REL-008(app-service)로 묶음.
배포 전 준비 근거(운영자 확인용) 표 기록 — 537 passed/47 skipped, ruff clean,
DB 스키마 무변경(롤백 무손실), 호가단위 케이스·로깅·주문결과·거부ERROR·실현PnL
단위 검증. confirm-release: draft → confirmed (Recorded By: Justin Ko).

실 운영 배포 + #28/#29 close 는 capture-release-feedback 단계.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 13:26:31 +09:00
genichinandClaude Opus 4.8 d8d9021260 feat(execution,obs): 호가단위 스냅(dcy-030/#28) + 운영 관측성(dcy-029/#29) + REL-007 환류
dcy-030 (issue #28, P0 체결 복구):
- REQ-083 KRX 호가단위(tick) 순수 유틸 (domain/pricing.py)
- REQ-070 CHG: 슬리피지 실효가 호가단위 스냅 — 상한 준수(매수 floor/매도 ceil)
  + band<1tick 하한/상한 보장 + 부동소수 epsilon 가드. 147700→148400/54500→54700.
- BAT-044 release-candidate

dcy-029 (issue #29, 운영 관측성):
- REQ-084 구조화 로깅 기반 (runtime/logging_setup.py): ISO8601 KST·레벨·Loki JSON
  ·correlation id(slot_id)
- REQ-085 주문 결과 로깅 (event=order_submit|fill|reject)
- REQ-087 거부 ERROR 가시성 (조용한 롤백 제거)
- REQ-086 청산 reason+actor 동반 노출 (안전망/전략 구분, 신규 필드 없음)
- REQ-088 운영 조회 CLI report (application/operator_report.py, 보유·오늘 체결
  ·실현 PnL net·대기, direct-DB)
- REQ-089 운영자 런북 docs/operations.md
- REQ-090 baseline 정합 (runtime-flows·project-structure·interface-contract)
- BAT-045(P0)·BAT-046(P1) release-candidate

REL-007: confirmed → feedback-captured (운영 인스턴스 라이브 검증 + #28/#29 환류
정규화). BAT-037~041 released.

검증: 537 passed, 47 skipped, 회귀 0, ruff clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 13:19:31 +09:00
genichinandClaude Opus 4.8 e0d4e71304 feat(slot,intent): slot strategy-state 저장소 (dcy-028) + sell retryable 플래그 (issue #27)
BAT-042 (dcy-028 / issue #26 C-1/C-2/C-2b/C-3, REQ-079~082 + REQ-073/074 CHG):
- slot_strategy_state 별도 테이블 + StrategyStateStore(in-memory+PG) + occupancy_seq·version CAS + opaque UTF-8 data + 2단 size cap (REQ-079)
- trex.slots.strategy_state.set write RPC — reject reason 집합, 멱등 (REQ-080)
- Slot.occupancy_seq 필드 + inactive→pending_buy bump + →INACTIVE close 삭제 훅 → 점유 전환 ABA 구조적 차단 (REQ-081)
- slots.req 응답 행에 strategy_state 맵(batched 조립)·occupancy_seq additive (REQ-073 AC-7/REQ-074 AC-6)
- 마이그레이션 014(occupancy_seq)/015(slot_strategy_state), baseline 문서 정합 (REQ-082)

BAT-043 (issue #27 / REQ-007 CHG):
- rejected SellIntent 응답에 additive retryable: bool (core 소유 reason→retryable 매핑, 미인식 기본 true, bad_request* false) — 손절매 재시도 안전 경로 decoupling

검증: 487 passed, 47 skipped (신규 41: store CAS 6+ABA, occupancy bump/close 4경로, set RPC 9, slots read 5, retryable 8, PG 게이트), ruff clean.
REQ-079·080·081·082·073·074·007 → Implemented. issue #27 close. PG 경로 실 DB 검증은 release 위임.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 19:27:57 +09:00
genichinandClaude Opus 4.8 bfadd0d5c8 docs(discovery): dcy-028 confirmed — Slot Strategy-State 저장소 (issue #26 C-1/C-2/C-3)
new-discovery → review-discovery → confirm-discovery (승인자: Justin Ko).
OQ-1~4 전부 Answered:
- OQ-1: data = opaque UTF-8 문자열 + 2단 상한(기본 1~2KB / ceiling 4KB), state_too_large reject
- OQ-2: write = 별도 RPC trex.slots.strategy_state.set / read = slots.req piggyback
- OQ-3: 신규 삭제 이벤트 없음 — 스냅샷 부재 + CAS 의존 (기존 slot_filled_sell 옵션 재사용)
- OQ-4: 별도 slot_strategy_state 테이블 + 맵(복합 PK (slot_id, strategy_id)) + slot_id 키

trex-tsl 팀 점유 전환 ABA 누수(High) 지적 반영 → occupancy_seq 경량 가드(C-2b) v1 포함,
full 3계층 슬롯 구조 분할은 후속 "영구 슬롯 구조 정합" Discovery로 Deferred.
C-4(SellIntent/watchdog)는 기존 계약 확인으로 issue #26 답변 완료.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 17:58:37 +09:00
genichinandClaude Sonnet 4.6 1f59322f52 docs(rel-006/bat-026~036): confirm-release 상태 반영 — released 전환
REL-006 confirm-release 스킬 실행 결과 BAT-026~036 상태를 released로 갱신하고
rel-006 배포 근거를 보완한 변경 사항을 커밋.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 22:45:45 +09:00
genichinandClaude Sonnet 4.6 b1ce06ca3b docs(rel-007): confirmed — slots RPC 개선 + 매도세 정정 + paper seq + 중장기 프로파일
배포 근거: BAT-037~041 전체 verification confirmed, DB 스키마 변경 없음,
slots RPC 스모크(available_slots=5, degraded=False, slots 23개) 통과,
데몬 PID 802942 정상 운영 중 (2026-06-12 22:35 KST, SHA d30e915)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 22:37:07 +09:00
genichinandClaude Sonnet 4.6 d30e915b75 docs(rel-007): draft — slots RPC 개선 + 매도세 정정 + paper seq + 중장기 프로파일 (BAT-037~041)
BAT-037: available_slots capacity hint (REQ-073 CHG)
BAT-038: 매도 증권거래세 누락 수정 (REQ-018 CHG, issue #24)
BAT-039: paper order seq Redis 영속화 (REQ-011 CHG, issue #4)
BAT-040: slots RPC DB-level status 필터 (REQ-002/006/073 CHG, issue #25)
BAT-041: watchdog TOML + 중장기 인스턴스 운영 프로파일 (REQ-076/077/078, dcy-027)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 22:32:30 +09:00
genichinandClaude Sonnet 4.6 6786ffd05d docs(discovery): dcy-027 모든 OQ Answered — 중장기 슬롯 운영 결정 완료
OQ-1: (a′) 기존 슬롯 도메인 유지 + 운영 프로파일/규칙 추가 (PositionBook 불필요)
OQ-2: safety_sell_enabled=false → 코어 손절매 루틴 없음, 전략 모듈 전적 책임
OQ-3: per-instance watchdog_timeout_sec 연장 (1800s 이상 권장), 알림은 후속 Discovery
OQ-4: 중장기 전략 폴링 주기 최소 1분·최대 10분

feat(bat-041): REQ-076/077/078 — watchdog timeout TOML + 중장기 운영 프로파일 + baseline

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 22:19:33 +09:00
genichinandClaude Opus 4.8 d737467d70 perf(slots): BAT-040 — slots RPC DB-level status 필터 (REQ-002/006/073, issue #25)
REQ-002/006 change-req(CHG-20260612-01)→구현→confirm-req-implemented,
REQ-073 change-req(CHG-20260612-02, 관찰 계약 불변 Implemented 유지) 전체 delivery.

- repository.py/in_memory_repository.py: SlotRepository.list_slots(instance_key,
  status_filter=None) — status 값 집합 필터, None=전체(기존 호출자 불변).
- postgresql.py: list_slots DB-level WHERE status = ANY(%s) (full scan + Python
  필터 제거). 스키마/마이그레이션 변경 없음.
- messaging_handlers.py: _FILTER_STATUS 매핑으로 filter→status 집합 위임,
  watchdog 갱신용 holding 조회를 all/holding fetch 결과에서 재사용(2nd 커넥션 생략).
- 관찰 가능한 RPC 계약(REQ-073 AC-1~6) 불변 — 동작 보존 최적화.
- tests: in-memory status_filter 5종 + PG 게이트 1종. 439 passed (+5), ruff clean.

REQ-002·006 Approved→Implemented, REQ-073 Implemented 유지, BAT-040 release-candidate.
issue #25 close.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 19:27:51 +09:00
genichinandClaude Opus 4.8 14da195b1e docs(discovery): dcy-027 OQ-1~4 Answered (중장기 전략 슬롯 운영)
- OQ-1: 구현 위치 (a′) 기존 슬롯 도메인 유지 + 운영 프로파일/규칙 추가
  (PositionBook 신설 Out of Scope).
- OQ-2: safety_sell_enabled=false 인스턴스는 코어 손절매 미사용 — 보호 규칙
  전략 모듈 전적 책임, 코어는 운영자 CLI exit 백스톱만 제공.
- OQ-3: watchdog per-instance timeout 연장(중장기 ≥1800s). 알림 연동은 후속 Discovery.
- OQ-4: 폴링/intent 주기 최소 1분~최대 10분 전제.
FR-2/범위/R-1/DECIDE 항목 동기화.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 18:16:26 +09:00
genichinandClaude Opus 4.8 9871008bb6 fix(paper): BAT-039 — paper order seq Redis 영속화 (재시작 멱등 키 충돌 방지, REQ-011/issue #4)
REQ-011 change-req(CHG-20260612-01)→구현→confirm-req-implemented(CHG-20260612-02)
전체 delivery. paper 한정 결정성 버그(프로덕션 무관).

- seq_store.py 신규: SeqStore 포트 + RedisSeqStore(원자 INCR, 재시작 단조·영속)
  + InMemorySeqStore(폴백/테스트). REQ-016 token_cache 패턴 재사용.
- paper.py: optional seq_store 주입. 미주입 시 기존 in-memory 동작 byte-for-byte 유지.
- config.py/daemon.py: TREX_PAPER_REDIS_URL → RedisSeqStore wiring
  (key=trex:broker:paper:{instance_key}:order-seq).
- 런타임 Redis 오류는 전파(silent in-memory 폴백 금지 — 버그 재현 방지).
- tests: 재시작 단조성/correlation_id 비충돌/in-memory 폴백/fake redis INCR (5).
  434 passed (+5), ruff clean.

REQ-011 Approved→Implemented, BAT-039 release-candidate. issue #4 close.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 18:16:11 +09:00
genichinandClaude Opus 4.8 c369d4d1ee docs(discovery): new-discovery dcy-027 (중장기 전략 슬롯 운영, issue #20)
dcy-020 Out-of-Scope "중장기 전용 운영" 이월 주기. dcy-020 후속 Discovery
참조에 dcy-027 추가, discovery 인덱스에 dcy-027(draft) 행 추가.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 17:58:50 +09:00
genichinandClaude Opus 4.8 1cf13b060f feat(broker): BAT-038 — 매도 증권거래세 누락 정정 + fee/tax 단일 정책 지점 (dcy-026/REQ-018, issue #24)
dcy-026 confirm-discovery + REQ-018 change-req(CHG-20260612-01)→구현→
confirm-req-implemented(CHG-20260612-02) 전체 delivery.

- broker_port.py: calculate_tax(side, amount) 신규 + fee/tax 율 env 상수화
  (TREX_KIS_FEE_BPS=1.5, TREX_KRX_TAX_SELL_BPS=20.0). 매도 0.2%/매수 0.
- paper.py / kis.py: tax=0.0 하드코딩 3곳 제거 → 정책 함수 호출.
  KIS daily-ccld 응답에 fee/tax 필드 부재 → 정책 폴백(향후 정본 우선 훅).
- runtime-flows.md: 체결→ledger fee/tax 산출 흐름 갱신.
- tests: fee/tax 정책 단위 + issue #24 4건 회귀(fee+tax=1,376.9원).
  429 passed (+6), ruff clean.

REQ-018 Approved→Implemented, BAT-038 release-candidate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 17:57:15 +09:00
genichinandClaude Sonnet 4.6 08fdf680bf docs(req-073): Approved → Implemented (BAT-037 / CHG-20260612-IMPL)
available_slots capacity hint — AC-3 반전·AC-6 신규, 16 tests passed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 10:31:22 +09:00
genichinandClaude Sonnet 4.6 d17df5263e docs(bat-037): release-candidate — verification confirmed, 모든 AC evidence 충족
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 10:30:14 +09:00
genichinandClaude Sonnet 4.6 4b6996a5bf docs(bat-037): verification confirmed — AC-3/AC-6 evidence 연결, Ready for Release
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 10:29:44 +09:00
genichinandClaude Sonnet 4.6 6c24bd4c2c feat(slots-rpc): available_slots capacity hint 추가 (BAT-037 / REQ-073 AC-6)
slots RPC 응답에 available_slots: int|null 포함.
max_active_slots 미설정 시 null, 설정 시 max(0, M-active).
16 tests passed (AC-6 신규 3개 포함), 423 전체 통과.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 10:28:29 +09:00
genichinandClaude Sonnet 4.6 8135dffb90 docs(bat-037): draft — slots RPC available_slots capacity hint (REQ-073 CHG-20260612-01)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 10:26:04 +09:00
genichinandClaude Sonnet 4.6 31c18bf8d2 docs(req-073): CHG-20260612-01 — available_slots 응답 추가 change-req
응답 payload에 available_slots: int|null 추가. AC-3 반전·AC-6 신규.
BAT-035 AC-3 evidence 무효 → Implemented → Approved 되돌림.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 10:23:37 +09:00
genichinandClaude Sonnet 4.6 808a851d39 docs(req-058): CHG-20260611-01 — symbol 누락 수정 change-req 반영
reconcile_universe 슬롯 생성 시 symbol 미저장 구현 누락을 AC-5로 추가.
Implemented 상태 유지 (기존 AC 1~4 evidence 유효).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 21:12:38 +09:00
genichinandClaude Sonnet 4.6 002340e5fd docs(rel-006): BAT-035/036 포함 + 배포 근거 보완 — confirmed
- BAT-035/036 batch index: confirmed → release-candidate
- rel-006: BAT-035/036 추가, status confirmed, SHA 명시, smoke 한계·외부 소비자 분석 기술
- daemon.py: stale 주석 trex.snapshot.req → trex.slots.req

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 19:01:59 +09:00
genichinandClaude Opus 4.8 f0ad37747b feat(rel-007): dcy-025/024 + BAT-035/036 — slots.req 즉시 교체 + safety_sell_enabled
BAT-035 (dcy-025): trex.snapshot.req → trex.slots.req 즉시 교체
- topology: SNAPSHOT_REQ_QUEUE 제거, SLOTS_REQ_QUEUE = "trex.slots.req" 추가
- portfolio.py: View/build_snapshot_envelope/SnapshotEnvelope/_asset_to_dict 제거;
  slot_to_dict 시그니처 확장(snapshot_store/watchdog_store/pause_store/watchdog_timeout_sec)
  — asset_quantity(hub)/cash_balance/cash_estimated/warned/watchdog{}/paused 병합 (REQ-074)
- messaging_handlers.py: make_snapshot_rpc_handler 제거, make_slots_rpc_handler 추가
  — filter(all/inactive/pending/holding/error) + spy(bool) 처리; strategy 필드 제외 (REQ-073/074)
- daemon.py: _snapshot_rpc_loop → _slots_rpc_loop, make_slots_rpc_handler 연결
- cli.py: universe/slots → slots_queue + spy=True + server-side filter; buyable→inactive 매핑 (REQ-063)
- rabbitmq.py: snapshot_queue → slots_queue
- docs: interface-contract.md + runtime-flows.md slots.req 계약으로 업데이트 (REQ-075)
- REQ-028: Implemented → Deprecated (코드 삭제 완료)
- 테스트: test_snapshot_handler/selection/rpc_watchdog/messaging_snapshot_consumer 삭제;
  test_slots_handler.py(신규, 13 cases), test_killswitch_masking_resume 재작성,
  test_ledger_option_d._apply_cash_estimate → slots handler 경유, test_topology/cli_operator 갱신

BAT-036 (dcy-024): per-instance safety_sell_enabled 플래그
- config.py: DaemonInstanceConfig + DaemonConfig 에 safety_sell_enabled: bool = True 추가;
  from_toml 파싱, from_config 전파
- daemon.py: start() workers 조건부 — safety_sell_enabled=false 시 trex-safety-sell 미기동 + WARNING
- tests: test_instance_config.py 에 safety_sell_enabled 파싱 3개 케이스 추가

REQ: 073/074/075/021/034/063/048/005 Approved → Implemented

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 14:45:45 +09:00
genichinandClaude Sonnet 4.6 fb05a73130 feat(rel-006): dcy-022/023 + BAT-032~034 — 실행 정책·qty 검증·allocated_capital 제거 통합
BAT-032 (dcy-022): timeout_sec/slippage_pct 실행 정책, 미체결 자동 취소,
보호 지정가, `trex-core cancel` 백스톱. 마이그레이션 012.
BAT-033: `trex-core enter --qty` 필수 검증 — 미지정 시 RPC 전 즉시 오류.
BAT-034 (dcy-023): allocated_capital 죽은 필드 전 경로 제거 (domain·intent·
persistence·snapshot·CLI). 마이그레이션 013(비가역 DROP). 외부 발신자
unknown key 무시 수신 의미론 적용.
REL-006 confirmed: BAT-026~034 통합 릴리즈, pre-release smoke 증거 포함.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 07:42:03 +09:00
genichinandClaude Opus 4.8 5ee5f7f4e2 docs(srs/batch): dcy-021 REQ + BAT-031 + Implemented 전환
- draft-req: REQ-066(사이징 도메인·end-to-end), REQ-067(baseline 정합) 신규
- change-req: REQ-057(CHG-03 holding→pending_buy)·REQ-061(CHG-04 사이징 intent)·
  REQ-062(CHG-03 부분 매도 min(주문,잔고)) — Implemented→Approved 후 재구현
- confirm-req: REQ-066/067 Approved
- BAT-031 batch(index/planning/design D1~D4/implementation/verification) → release-candidate
- confirm-batch-verification 승인 + confirm-req-implemented:
  REQ-057/061/062/066/067 → Implemented (BAT-031 verification 근거)
- srs/batch index + dcy-021 discovery 생성 REQ 역참조 갱신

(issue #21 dcy-022 는 별도 작업으로 미포함)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 18:53:53 +09:00
genichinandClaude Opus 4.8 e4be4d60c2 feat(slot): dcy-021 포지션 사이징 — 보유 슬롯 증액·부분 매도 (BAT-031)
자산 영구 슬롯(dcy-020)의 수량 가변 전제 위에 보유 포지션 수량 조정 구현.
명령형 계약(전략이 cash+quantity 로 qty+price 계산), core 는 실행 substrate,
수량 정본 = 브로커 잔고 재동기화로 "주문 수량 vs 보유 수량" 충돌 해소(별도 필드 없음).

- state.py: holding→pending_buy 전이 추가(증액) → 13 transitions (REQ-057)
- service.py: PENDING_SELL 진입 qty=caller as-is(None=전량 sentinel, 값=부분 주문) (REQ-062)
- intents.py: 증액 admission(holding 슬롯 매수=increase, M 캡 미적용), SellIntent.qty 부분 매도 (REQ-061)
- execution.py: _balance_map; 매도 dispatch=브로커잔고(전량)/min(주문,잔고)(부분);
  매수 체결 avg_price 가중평균+브로커 정본 resync; 매도 체결 잔고>0→holding/0→inactive;
  증액 롤백 holding 복귀 (REQ-066/062)
- messaging_handlers.py: sell payload qty 파싱(부분 매도)
- baseline 4문서(data-model/runtime-flows/interface-contract/project-structure) 정합 (REQ-067)

검증: 단위 378 / 통합(PG+RabbitMQ) 422 passed, ruff clean. run-the-app 사이징 e2e:
매수 10@1000 → 증액 +5@1200 → 15@1066.67(가중평균) → 부분 매도 6 → 9@1066.67(cost basis) → 전량→inactive.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 18:53:37 +09:00
genichinandClaude Opus 4.8 b2ba8c73fe docs(discovery): dcy-021 포지션 사이징 Discovery 생성·confirmed (issue #1, dcy-020 OQ-4 후속)
new-discovery: 보유 자산 슬롯 수량 변경(HOLDING→HOLDING)·부분 매도·사이징 intent.
OQ-1~4 전부 결정 후 confirm-discovery 승인(Justin Ko):
- OQ-1 명령형 계약 — 전략이 cash+quantity 로 qty+price 계산·전송, core 는 실행 substrate(target 미저장·미추적)
- OQ-2 wire 단위 = 정수 주식 수+가격, 비중/금액 환산은 전략 책임
- OQ-3 증액 avg_price 가중평균·부분 매도 cost basis 유지·실현손익 ledger/hub 소유
- OQ-4 intent 당 1회 집행, core 측 target 저장·주기 reconcile 없음, 자동 리밸런싱 Out of Scope
- 부수: 과매도→min(intent,잔고)·이상이면 전량, 부분 체결→실제 체결만 ledger·미추적·전략 재수렴(증액/감액 대칭)
능동 capacity 배분·미체결 pending 고착 처분(issue #21)은 별도 Discovery 후보로 분리.
dcy-020 후속 참조 갱신 + index dcy-021 confirmed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 17:40:39 +09:00
genichinandClaude Opus 4.8 c04fd276b3 feat(reset): cutover 도구 폐기 → trex-core-reset(DB 재초기화) 대체 (REQ-064 CHG-20260610-03)
실 DB 점검 중 마이그레이션 009 부분 유니크 인덱스가 legacy 풀 데이터(같은
자산이 closed+재진입 holding 으로 portfolio_id 중복)에 적용 불가 → cutover·
데몬 부팅 모두 차단되는 결함 확인. 데이터 보존 cutover 를 폐기하고 DB wipe +
자산 중심 재초기화로 전환(사용자 결정). 빈 테이블에는 009 인덱스가 정상
생성되고 자산 중심에서 (instance_key, portfolio_id)는 설계상 유일.

- trex_core/runtime/reset.py 신규(trex-core-reset): slot-core 7테이블 wipe +
  apply_migrations 재적용 → 자산 중심 스키마 착지 검증. dry-run 기본/--yes 적용,
  파괴적·DB 전역. 보유 carry-over 없음(재초기화 후 reconcile_core_holdings 재편입).
- runtime/cutover.py + trex-core-cutover console script + test_cutover_rehearsal.py 삭제.
- pyproject: trex-core-reset 등록.
- tests/runtime/test_reset.py 신규 5건(PG-gated): wipe+착지·dry-run 무변경·멱등·
  wipe 후 admission·테이블 커버리지.
- change-req REQ-064 CHG-20260610-03(cutover→재초기화 재정의) + srs index 갱신.
- baseline 4문서(data-model/runtime-flows/project-structure/interface-contract)
  + BAT-030 design/planning/index/implementation/verification 도구 서술 reset 으로 교체.

검증: ruff clean, 단위 367 passed, PG+RabbitMQ 통합 411 passed/1 skip(KIS sandbox).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 16:08:05 +09:00
genichinandClaude Opus 4.8 5330f32247 docs(batch): BAT-030 verification 승인 + REQ-056~065 Implemented (dcy-020 delivery 완료)
draft/confirm-batch-verification: BAT-030 AC 매핑(REQ-056·057·062·064·065) +
evidence(단위 367/PG 29/MQ 21, cutover 리허설 8건, run-the-app e2e) 기록,
Ready for Release: true → release-candidate 승격.
BAT-027/028/029 의 보류 사유(dcy-020 전체 delivery 미완)가 BAT-030 완성으로
해소되어 함께 release-candidate 승격.
confirm-req-implemented: REQ-056~065 전부 Approved → Implemented
(각 REQ Change Log CHG-20260610-IMPL + srs index 갱신).
실 운영 cutover(REQ-064)는 REL 단계 운영자 실행으로 위임.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 15:20:52 +09:00
genichinandClaude Opus 4.8 7d727824dc feat(slot): BAT-030 — 자산 중심 cutover 완성 (dcy-020 BAT-δ, REQ-056·057·062·064·065)
M1 literal inactive 전면화: SlotState 5-state(idle/closed 별칭 제거),
마이그레이션 010(CHECK 교체+행 rewrite), ops_checks 를 transition_log 기반 재작성.
M2 집행 매도 수량 브로커 정본(D3): dispatch 매도 qty=broker hldg_qty,
미러 fallback 없음, 브로커 0 → skip+WARN, 리스트 기반 dispatch(head-block 방지).
M3 컬럼 drop + legacy pool 제거: 마이그레이션 011(trading_date·entry_count DROP),
repo 계약 instance 스코프 개편(집행 큐 포함), preallocation 폐기(데몬 7스레드),
admission 자산 중심 단일 경로(slot_id 정본), capacity 재정의(available=M−active),
daily_symbol_entries 코드 경로 제거.
M4 cutover 도구(D1·D4): trex-core-cutover(전체 rebuild, preflight/브로커 carry-over/
--allow-unmapped/--promote-unique/dry-run) + PG 리허설 테스트 8건.
M5 baseline 마감: data-model/runtime-flows/project-structure/interface-contract
자산 중심 최종 갱신 + run-trex-core-daemon 스킬 정합.

검증: 단위 367 passed + ruff clean; PG-gated 29 passed(010/011 round-trip·드리프트
가드·cutover 리허설); RabbitMQ 21 passed; run-the-app e2e(test DB+실 MQ, M=1):
reconcile 슬롯 생성→slot_id 매수→dedup→capacity_full→fill→already_active→
매도→inactive(자산 바인딩 보존)→영구 슬롯 재활성 전 구간 green.
실 cutover 는 운영자 실행(REL 단계, D4).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 15:16:15 +09:00
genichinandClaude Opus 4.8 cec34be5f4 docs(batch): draft-batch BAT-030 (dcy-020 BAT-δ cutover) + design 확정
dcy-020 최종 배치. design 확정(사용자 결정):
- D1: 전체 rebuild — daily_slot 비우고 universe+브로커 잔고 기준 재생성,
  보유 carry-over 정본=브로커 잔고
- D2: 전부 완성 — literal inactive 전면화 + idle/closed 별칭 제거 +
  entry_count/trading_date 컬럼 drop
- D3: 집행 매도 수량 브로커 정본(미러 fallback 없음, 0이면 skip+divergence)
- D4: 실 cutover 는 운영자(REL 단계, 리허설 후); 본 배치는 스크립트+코드+test DB 리허설
batches/index BAT-030 등록.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 12:36:09 +09:00
genichinandClaude Opus 4.8 78a743a2ef feat(slot): BAT-029 M2(a)/M3 — holding 불일치 reconcile + slots 단일 뷰 (dcy-020/REQ-062·063)
- REQ-062 divergence: list_holding_slots(protocol+in_memory+PG) +
  reconcile_core_holdings(A=코어 holding/broker0→error, C=수량 불일치→warning,
  B=broker 보유/코어 없음→warning; 자동 청산 없음 issue #15). snapshot_scheduler
  자산 중심 모드에서 best-effort 호출, daemon slot_service 배선.
- REQ-063: slot_to_dict 에 universe_detached(retired_at) 추가 — slots 단일 뷰 tombstone 표시.
- 신규 테스트: test_holding_divergence(4).

M2(b) 청산 수량 브로커 정본(execution dispatch)은 라이브 집행 변경 → BAT-δ carry-over.

검증: 단위 393 passed / 36 skipped, PG-gated 18 passed, ruff clean. legacy 무파손.
REQ-061/062/063 Approved 유지(γ 경로 도입 검증; default 전환·M2(b) 는 BAT-δ).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 12:18:56 +09:00
genichinandClaude Opus 4.8 e10ac519c7 docs(batch): draft-batch BAT-029 (dcy-020 BAT-γ) + FR-7 재정의(계약 키=slot_id)
사용자 결정으로 intent 계약 키를 portfolio_id → slot_id 재정의(코어 native·스냅샷
slots[] round-trip·portfolio-hub 식별 누수 방지). 매도는 이미 slot_id; 매수만 이동
(레거시 portfolio_id dual-accept, 폐기 BAT-δ).

- REQ-061 change-req(CHG-20260610-03): 계약 키 slot_id 로 body/AC 재작성
- dcy-020 FR-7 재정의 주석(2026-06-10)
- draft-batch BAT-029(REQ-061/062/063) + design 확정
  (D1=slot_id 계약, D2=reconcile 3자 확장+A=error/B·C=warning)
- batches/index BAT-029 등록

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 12:07:10 +09:00
genichinandClaude Opus 4.8 8a377e6fb3 feat(slot): BAT-028 M2/M3 — universe reconcile + 자산 중심 admission (dcy-020/REQ-058·059)
config 게이트 이중 경로(max_active_slots 설정 시 자산 중심, 미설정 시 legacy pool).
운영 데몬은 cutover(BAT-δ) 전까지 pool 무중단.

- repository: find_slot_by_portfolio·count_active(holding+pending_buy+pending_sell)·
  reconcile_universe(생성 멱등/soft-retire/tombstone, allow_retire 가드) — protocol+in_memory+PG
  (PG: ON CONFLICT (instance_key, portfolio_id) WHERE portfolio_id IS NOT NULL)
- snapshot_scheduler: run_once swap 직후 _reconcile_slots(빈 universe skip, ≥50%↓ retire 보류)
- intents: _admit_buy 모드 분기 + _admit_buy_asset_centric(활성화/already_active/
  capacity_full/unknown_portfolio/over-cap, 인스턴스 lock)
- daemon: instance_key·max_active_slots·reconcile_enabled·trading_date_fn 배선
- 신규 테스트: test_universe_reconcile(6), test_asset_centric_admission(6), PG reconcile(1)

검증: 단위 387 passed / 35 skipped, PG-gated 17 passed, ruff clean. legacy 무파손.
REQ-058/059/060 은 Approved 유지(자산 중심 경로 도입 검증; default 전환·cutover 는 BAT-δ).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 11:14:50 +09:00
genichinandClaude Opus 4.8 8bd9495c4b docs(batch): draft-batch BAT-028 (dcy-020 BAT-β reconcile+admission) + design 확정
REQ-058(universe reconcile)+REQ-059(자산 admission FCFS/M)+REQ-060(max_active_slots).
design 확정(사용자 결정):
- D1: config 게이트 이중경로 (max_active_slots 설정 시 자산중심, 미설정 시 legacy pool;
  운영 데몬은 cutover 전까지 pool 무중단)
- D2: "활성"(M 캡) = holding+pending_buy+pending_sell
- D3: 대량소멸 가드 = N→0 + 급감(50%↓) 경고
batches/index BAT-028(standard, planning) 등록.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 11:04:57 +09:00
genichinandClaude Opus 4.8 017b8185e0 feat(slot): BAT-027 M2/M3 — 상태머신 inactive 재정의 + 인스턴스 스코프 advisory lock (dcy-020/REQ-057)
안 B 점진의 2/3단계. runtime 무변경(idle/closed 별칭 흡수)으로 cascade 통제.

- state.py: SlotState.INACTIVE 추가 + idle/closed 별칭 normalize_state(); 전이 집합
  inactive 기준 재정의(inactive↔pending_buy↔holding↔pending_sell), closed→idle 제거;
  is_allowed_transition 양쪽 정규화; slot_advisory_lock_id(instance_key) 헬퍼
- service.py: SlotService(instance_key) + advisory lock 인스턴스 스코프(self._lock_id)
- __init__: normalize_state/slot_advisory_lock_id export; daemon: instance_key 전달
- 테스트 갱신: test_state(전이/멤버7/락/size12), test_service(closed→idle 제거→reallocation),
  test_slot_entry_count, test_postgresql_repository(closed→idle 거부+reallocation)

검증: 단위 375 passed / 35 skipped, PG-gated(trex_core_test) 8 passed
(마이그레이션 009 드리프트 + lifecycle/reallocation), ruff clean.

REQ-056/057 은 토대만 충족 → Approved 유지(entry_count/trading_date drop·literal
inactive 전면 전환은 BAT-δ; confirm-req-implemented 는 dcy-020 후속 배치 완료 후).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 10:53:39 +09:00
genichinandClaude Opus 4.8 86c892aa0c feat(slot): BAT-027 M1 — additive 영구 슬롯 필드(instance_key, retired_at) + 마이그레이션 009 (dcy-020/REQ-056)
안 B(점진/additive-first)의 1단계. 라이브 영향·cascade 없이 자산 영구 슬롯 토대의
스키마/모델 필드만 additive 추가.

- Slot.instance_key(기본 "default")·retired_at 추가 + EXPECTED_SLOT_FIELDS 정합
- 마이그레이션 009: instance_key NOT NULL DEFAULT 'default', retired_at,
  부분 UNIQUE(instance_key, portfolio_id) WHERE portfolio_id IS NOT NULL (멱등)
- postgresql _SLOT_COLUMNS/_row_to_slot/update_slot 매핑(row[19]/[20])
- entry_count/trading_date 컬럼은 유지(drop 은 cutover BAT-δ)

검증: 전체 375 passed / 35 skipped, ruff clean (additive — cascade 무파손).
M2(상태머신 inactive 별칭+인스턴스 lock)/M3(소비처 cascade)는 후속.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 10:42:24 +09:00
genichinandClaude Opus 4.8 4e92134c28 docs(batch): draft-batch BAT-027 (dcy-020 BAT-α 자산 영구 슬롯 토대) + design 확정(안 B)
REQ-056(영구 슬롯 스키마)+REQ-057(상태머신 재정의+인스턴스 lock) 토대 배치.
- planning: delivery plan/Design Gate(R-cascade)/milestones/risks
- design: R-cascade 실측(idle·closed/entry_count/전역 lock/trading_date 소비처) +
  접근안 A/B/C → 안 B(점진/additive-first) 확정:
  * additive 스키마(instance_key·retired_at, entry_count/trading_date 유지→BAT-δ drop)
  * inactive 표준 + idle/closed 별칭(closed→idle 제거)
  * advisory lock 인스턴스 스코프화
  * 부분 UNIQUE(instance_key, portfolio_id) WHERE portfolio_id NOT NULL
  * instance_key NOT NULL DEFAULT 'default'
- batches/index BAT-027(standard, planning) 등록

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 10:39:33 +09:00
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
genichinandClaude Opus 4.8 e2a71e50e2 docs(req): dcy-020 confirm + 추가 사양(FR-6~8/NFR-4~5/OQ-8) + draft-req REQ-056~065
dcy-020(자산 중심 영구 슬롯 모델) Requirements phase.

- 추가 사양: FR-6(상태머신 재정의), FR-7(intent 자산 키), FR-8(운영자 단일뷰),
  NFR-4(전략 계약 호환), NFR-5(불일치 감지 주기), OQ-8(over-cap=신규 차단·기존 유지),
  dcy-019 산출물 제거 명시. review-discovery 정리 반영.
- confirm-discovery: 상태 draft→confirmed, Handoff 승인, Ready=true,
  Confirmed By=Justin Ko, 2026-06-10. index 행 confirmed.
- draft-req: 신규 REQ-056~065(전부 Proposed) 생성
  - 056 영구 슬롯 스키마 / 057 상태머신+인스턴스 lock / 058 universe reconcile
  - 059 capacity·admission / 060 max_active_slots TOML / 061 intent 자산 키
  - 062 수량 hub 정본+불일치 해소 / 063 slots 단일뷰 / 064 cutover / 065 baseline
  - srs/index Next ID→066, Register 10행, Recent Change Log 갱신
  - dcy-020 생성된 REQ 참조 갱신

기존 REQ-002/003/005/006/007/048 폐기·재정의 change-req 는 후속(문서 단계).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 10:28:38 +09:00
genichinandClaude Opus 4.8 1db7ab13bb docs(discovery): dcy-020 asset-centric slot model — OQ-1~7 결정 + A-1 확정
자산 중심 슬롯 모델 재설계(issue #1/#20) Discovery. 익명 슬롯 풀 →
portfolio-hub universe 자산과 1:1 영구 슬롯 + 동시 활성(M개) 제어로 substrate 전환.

결정 사항:
- A-1(대전제): 자산 중심 포지션 관리 + 동시 보유 수 제어 (익명 풀 아님)
- OQ-1: FCFS + 가득 차면 거부, 코어 자율 치환 없음
- OQ-2: universe reconcile — 생성 즉시 / 비활성 soft-retire / 보유·pending tombstone / degrade·대량소멸 보류
- OQ-3: 영구 슬롯(키=portfolio_id), trading_date 강등, dcy-014 일일 preallocation 폐기·재해석
- OQ-4: 포지션 사이징(issue #1) 분리(토대만) + 토대 가드 2개
- OQ-5: 불일치 해소 — ground truth=브로커, 표면화·운영자 게이트, 자율청산 금지
- OQ-6: 동시 활성 최대치 M = per-instance TOML(max_active_slots)
- OQ-7: 공유 DB + instance_key 스코프(UNIQUE(instance_key, portfolio_id)) + advisory lock 인스턴스 스코프화, daemon_id 는 universe 파티션/감사용·1:1 가드
- FR-3/FR-4: holding=코어 로컬 정본 / 수량=hub 정본+미러, 청산 수량=브로커 조회

review-discovery 정리 반영(§3 시나리오·§4·§11 현행화). 상태 draft, Handoff 보류
(confirm-discovery 에서 R-1/R-2 책임자·CONFIRMED_BY 지정 + 플래그 전환 예정).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 09:35:16 +09:00
genichinandClaude Opus 4.8 8b2c26c04c feat(config): config 디렉터리 기반 설정 관리 (--config-path/--env-file, trex-orb-v1 정합, BAT-026)
REQ-048/010 change-req. `--config` 를 이름으로 해석 + `--config-path <dir>`
(기본 ./config) + resolve_config_toml(슬래시 포함 값은 하위호환 명시 경로).
`.env` 를 config-dir 결정적 해석(--env-file 우선, 없으면 <config_dir>/.env,
CWD 무관) + config/.env.example + .gitignore config/* 허용목록. 운영자 CLI 도
--config-path/--env-file 동일 적용. from_env() legacy 루트 .env 폴백 유지로
완전 하위호환.

단위 23 + 전체 375 passed, ruff clean, 라이브 스모크(name·path 동일).
REQ-048/010 → Implemented.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 23:45:08 +09:00
genichinandClaude Opus 4.8 6e8e79660c feat(slot): slot entry_count + closed-slot reallocation (dcy-019, BAT-025) + REL-005
dcy-019/issue #18: slot 자원을 진입 횟수 기준으로 고르게 재사용하고 idle 소진 시
closed 슬롯을 직접 재할당한다. 거버넌스는 전부 change-req(신규 REQ 없음).

- 도메인(REQ-002): Slot.entry_count(기본 0) + EXPECTED_SLOT_FIELDS, 상태 머신
  closed→pending_buy 신규 전이(base 8→9, ALLOWED_TRANSITIONS 14→15),
  _apply_transition_fields closed→pending_buy clean-slate + →pending_buy 시 +1
- 영속화(REQ-006): 멱등 마이그레이션 008(entry_count), flat 매핑,
  find_allocatable_slot(idle∪closed, entry_count→updated_at→slot_id) + in-memory 동등
- admission(REQ-007): _admit_buy find_idle_slot→find_allocatable_slot + from_state=slot.status
- 테스트(REQ-003): 전이 카운트/계약 가드 정합 + test_slot_entry_count.py / test_buy_admission_reallocation.py
- 문서(REQ-009): data-model.md / runtime-flows.md 정합
- 기존 daily_symbol_entries(symbol-scoped) 분리·미변경

BAT-025(release-candidate) delivery + change-req REQ-002/003/006/007/009(CHG-20260609-01).
REL-005(confirmed, app-service): BAT-024+BAT-025 묶음. operator-facing run-the-app
스모크로 enter --forced-close-at(BAT-024)·closed 재할당(BAT-025) 실 데몬 검증
(실 PG 마이그레이션 008 round-trip 포함).

검증: 단위 366 passed / 35 skipped(KIS sandbox 1건 deselect — live .env 환경 의존), ruff clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 14:49:22 +09:00
genichinandClaude Opus 4.8 941d324899 docs(release): REL-002/003 feedback-captured + 포함 batch released 정합
REL-002(BAT-009)·REL-003(BAT-010~013) 을 released→feedback-captured 로 전환해
REL-001/004 와 동일한 완료(종착) 상태로 정합. REL-002 Feedback Handoff 빈
플레이스홀더 정리(tooling 릴리즈, Discovery/REQ Input=없음). 포함 batch
BAT-009~013 release-candidate→released(register + 개별 index) — 누락 정정.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 13:59:41 +09:00