100 Commits
Author SHA1 Message Date
genichin 903267189c Merge pull request #102 from fourblocks2020/feat/issue-97-outbox-idle-observability
feat(ledger): quiet idle outbox polling
2026-09-20 21:59:35 +09:00
genichin 62e4f57c2b Merge pull request #101 from fourblocks2020/feat/issue-95-sell-event-owner
fix: preserve SELL event routing owner
2026-09-20 21:10:54 +09:00
genichin 3f6a967aa1 Merge pull request #100 from fourblocks2020/feat/issue-87-release-operation
feat(ops): verify release provenance evidence pairs
2026-09-20 11:50:22 +09:00
genichinandHermes Agent cd2342f2c6 Forward ledger venue provenance to Portfolio Hub (#99)
Co-authored-by: Hermes Agent <noreply@nousresearch.com>
2026-09-19 19:30:57 +09:00
genichin 3569d864c9 Merge pull request #93 from fourblocks2020/copilot/ops-release-preserve-audit-checkout
ops(release): add restart/audit provenance gate with clean-checkout enforcement
2026-09-13 16:45:27 +09:00
genichin 6dbc92bfa7 Merge pull request #92 from fourblocks2020/copilot/ops-broker-track-kis-balance-failure
ops(broker): KIS 잔고 실패 lifecycle 추적 및 worker별 fail-closed/backoff 분리
2026-09-13 16:09:25 +09:00
genichin 19af864bf3 Merge pull request #91 from fourblocks2020/copilot/feat-reconcile-unmanaged-position-durable-lifecycl
feat(reconcile): durably track unmanaged position lifecycle by instance and symbol
2026-09-13 15:14:37 +09:00
genichin 3cb0fdc303 Merge pull request #90 from fourblocks2020/copilot/bug-ledger-shared-outbox-consumption
Isolate ledger outbox delivery by instance and add lease-based claims
2026-09-13 10:48:57 +09:00
genichin 60a835fde1 Merge pull request #89 from fourblocks2020/copilot/bugfix-reconcile-warning-issue
fix(reconcile): preserve B/C warning causes per slot and unify strategy blocking with admission
2026-09-12 23:09:39 +09:00
genichin 729abdd946 Merge pull request #88 from fourblocks2020/fix/issue-81-kis-correction-reconciliation
fix: reconcile KIS correction order chains
2026-09-12 22:15:21 +09:00
genichin 869664aa4a Merge pull request #82 from fourblocks2020/copilot/fix-cancel-sql-error-and-pending-issue
fix(execution): cancel SQL IndeterminateDatatype, KIS child cancel detection, worker exception visibility
2026-09-01 23:21:01 +09:00
genichin dd2ae33ee1 Merge pull request #76 from fourblocks2020/fix/v0.4.0-uv-lock-20260826
fix(release): refresh uv lock for v0.4.0
2026-08-26 22:46:57 +09:00
genichin 81624931cf Merge pull request #75 from fourblocks2020/copilot/feat-alerts-notify-reconcile-warned
feat(alerts): emit first `reconcile_warned` intent rejection alarm from `IntentService`
2026-08-26 14:53:25 +09:00
genichin 2e314232e3 Merge pull request #73 from fourblocks2020/copilot/feat-alerts-publish-reconciliation-quantity-mismat
feat(alerts): publish B/C reconciliation quantity mismatches to trex.alerts with durable deduplication
2026-08-26 10:03:24 +09:00
genichin 24a64b55d1 Merge pull request #72 from fourblocks2020/copilot/bug-fix-portfolio-hub-quantity-discrepancy
AC-0023: Block C-case quantity mismatch slots from strategy RPC; fail-closed on warn-store failure
2026-08-25 22:54:17 +09:00
genichin d18f098b27 Merge pull request #71 from fourblocks2020/copilot/bug-send-broker-authoritative-holding-quantity
slots RPC: make holding `qty` broker-authoritative with fail-closed availability semantics
2026-08-25 21:34:58 +09:00
genichin 131d694ce4 Merge pull request #70 from fourblocks2020/copilot/feat-alerts-persist-unresolved-skipped-fills 2026-08-24 22:54:07 +09:00
genichin 231e8e2eec Merge pull request #69 from fourblocks2020/copilot/feat-cli-add-ledger-backfill-command
Add evidence-backed `ledger backfill` operator command
2026-08-24 20:09:05 +09:00
genichin 59a4694899 Merge pull request #55 from fourblocks2020/fix/ghcr-workflow-locked-tooling
fix(ci): use locked tooling for image verification
2026-08-10 15:25:46 +09:00
genichin 9ea3b9de75 Merge pull request #54 from fourblocks2020/feat/line-0002-ghcr-image-publication
feat(release): add verified GHCR image publication
2026-08-10 14:51:41 +09:00
genichin 869e07fb34 feat(reconcile): safely seed canonical cost basis (#43)
Merged after independent PR QC re-check PASS. REL-012 remains release-pending; no production execution is authorized by this merge.
2026-07-17 10:13:56 +09:00
genichin 94e148940a Merge pull request #42 from fourblocks2020/feat/dcy-037-operator-broker-truth-hotfix
fix(broker): enforce operator broker truth boundary
2026-07-15 08:47:37 +09:00
genichin c1e67c7055 docs: approve dcy-037 emergency requirements 2026-07-14 22:40:38 +09:00
genichin 7845fbe856 REQ-117/118 Implemented — bat-056 머지 079fc04, QC opus PASS(주문 페이로드 불변 잠금). 배포게이트: NXT 소액 스모크(poll_fill 실측) 선행 2026-07-07 06:56:42 +09:00
genichin 079fc042ec Merge pull request #38 from fourblocks2020/feat/req-117-118-kis-broker-venue
bat-056: KIS 브로커 venue 파라미터화 — EXCG_ID_DVSN_CD 명시 (REQ-117/118)
2026-07-07 06:54:38 +09:00
genichin 70a732b60a REQ-117/118 Approved (confirm-req) — OrderRequest.venue + KIS 브로커 EXCG 명시/취소 venue 의미론/poll_fill NXT/현재가 market. dcy-002 NXT 트랙(고위험, QC opus 예정) 2026-07-06 23:26:07 +09:00
genichin 0ea2103865 REQ-116 Implemented (confirm-req-implemented) — bat-055 머지 dc6d7a9, QC opus PASS-WITH-NOTES(watchdog 실증). 배포 게이트: pf-hub REQ-055 선행 2026-07-06 23:26:07 +09:00
genichinandClaude Fable 5 eca7937543 docs(bat-056): verification report — 794 passed, 47 skipped, OI-1 open item
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-07-06 23:24:51 +09:00
genichinandClaude Fable 5 ee3dc83a93 feat(broker): KIS venue parameterization — OrderRequest.venue + EXCG_ID_DVSN_CD (REQ-117/118, BAT-056)
- OrderRequest.venue: str = "KRX" additive 추가 (기존 위치 인수 순서 불변)
- BrokerPort.cancel_order: venue: str = "KRX" 파라미터 추가
- BrokerPort.get_current_price: market: str = "J" 파라미터 추가
- KISBroker.submit_order: EXCG_ID_DVSN_CD=req.venue 항상 명시 전송
- KISBroker.cancel_order: EXCG_ID_DVSN_CD=venue 항상 명시 전송
- KISBroker.get_current_price: FID_COND_MRKT_DIV_CODE=market 파라미터화
- PaperBroker: cancel_order/get_current_price 시그니처 정합 (venue/market 수신·무시)
- poll_fill TR 유지 (TTTC8001R) — NXT 체결 포함 여부 미확인 open item (코드 주석 기록)
- tests/adapters/broker/test_venue.py: REQ-117 AC-1~5 + REQ-118 AC-1~8 신규 17개
- docs: interface-contract.md OrderRequest/BrokerPort 섹션 + change log 추가
- docs: runtime-flows.md venue 전달 경로 명시 + change log 추가

결과: 794 passed, 47 skipped (기존 777+47 대비 신규 17개 추가 전부 통과)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-07-06 23:24:51 +09:00
genichin dc6d7a943b Merge pull request #37 from fourblocks2020/feat/req-116-slots-strategy-field-filter
bat-055: slots.req strategy 필터 + row strategy/markets 필드 (REQ-116)
2026-07-04 11:37:18 +09:00
genichin e8089f4a69 docs: interface-contract.md BAT-031 changelog 줄 UTF-8 손상 복원 (QC 권고, 코드 무관) 2026-07-04 11:16:20 +09:00
genichinandClaude Fable 5 690071afad feat(slots): additive strategy fields + filter (REQ-116, BAT-055)
trex.slots.req wire 계약 additive 확장 — 기존 소비자(orb/tsl) backward compatible.

- PortfolioItem: strategy_name(Optional[str]) + markets(list) 필드 추가
- hub_read.py: get_portfolios()에서 strategy_name/markets 파싱 추가 (safe default)
- slot_to_dict(): strategy_name/strategy_params/markets 3필드 row에 추가 (SnapshotStore→PortfolioItem 경유)
- make_slots_rpc_handler(): strategy 요청 파라미터 → Python 레벨 후처리 필터 (available_slots 계산 이후, REQ-073 AC-6 불변)
- 테스트: AC-1~8 전수 + hub_read 파싱 + 회귀 갱신 (777 passed, 47 skipped)
- docs/interface-contract.md: 요청 파라미터·응답 행 스키마·소스 테이블·REQ-074 AC-5 주석 갱신

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-07-04 11:10:01 +09:00
genichin 5267e72efe REQ-116 Approved (confirm-req, 팀장) — slots.req strategy 필터 + row strategy_name/params/markets additive. tvr e2e 배관 ②, 필드명 REQ-055와 상호잠금 2026-07-04 10:55:19 +09:00
genichinandClaude Opus 4.8 e48908489a docs(rel-010): released 마감 — M3 배포 완료(314047b, dcy-034/035/036+slot_filled+verify핫픽스)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-30 17:03:31 +09:00
genichinandClaude Opus 4.8 314047b4de docs(req-106): verify ImportError 핫픽스 change-req + postmortem
51cc3cc(make_broker→_build_broker) 거버넌스 기록 — 증상·근본원인·검증(운영 재검증 OK)·
테스트 갭 postmortem·롤백. main 직접푸시 사후추인 노트 포함.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-30 13:55:22 +09:00
genichin 9e787c81a2 Merge pull request #35 from fourblocks2020/feat/dcy-036-kis-credential-inject
feat(dcy-036/bat-054): KISBroker 양의 경로 — 데몬-스코프 KIS 인증정보 실거래 주입
2026-06-30 13:54:49 +09:00
genichin aa0189bd89 Merge pull request #36 from fourblocks2020/feat/slot-filled-no-route
fix(slot-filled): 매도 체결 이벤트 NO_ROUTE 라우팅 갭 해소 (M3)
2026-06-30 13:54:37 +09:00
genichinandClaude Opus 4.8 51cc3ccb09 fix(cli): verify 명령 ImportError 핫픽스 — make_broker→_build_broker
운영 배포 스모크(REL-010 STEP2)서 trex-core verify가 ImportError(make_broker 부재)로 실패.
_cmd_verify가 존재하지 않는 trex_core.adapters.broker.make_broker를 import하던 것을
_cmd_sync와 동일한 trex_core.runtime.daemon._build_broker로 교체. 회귀 테스트 2개 추가.
747 passed/회귀 0. CLI 전용, trading/wire 무관.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-30 13:30:07 +09:00
genichinandClaude Opus 4.8 de97bc842d fix(slot-filled): 매도 체결 이벤트 NO_ROUTE 해소 — strategy_id 전이 전 캡처
INACTIVE 전이가 strategy_id를 None 초기화(REQ-057) → 라우팅키 slot_filled_sell._.{sym}
→ orb/tsl 바인딩 불일치 NO_ROUTE/DLQ. _on_filled/_on_partial_cancel에서 전이 직전
strategy_id 캡처해 emitter에 전달. wire 계약 불변(포맷 유지·값 교정). QC opus PASS, 747 passed/회귀 0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-29 09:38:45 +09:00
genichinandClaude Opus 4.8 ababf80234 docs(rel-010): M3 trex-core 릴리즈 문서 (dcy-034/035/036)
REL-010 draft — reconcile cold-start + WAC 리포트 + dcy-036 휴면배포 묶음.
배포 선결=PR #35 머지. 미푸시(사장님 결재 시 push).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 23:03:57 +09:00
genichinandClaude Sonnet 4.6 6b066e19cb feat(bat-054): 그날-시작 KIS 인증정보 양의 경로 주입 — KISBroker reinitialize (REQ-113 AC-2/AC-4, REQ-115 AC-1)
BAT-053 스캐폴드에서 연기된 양의 경로 완성:
- KISBroker.reinitialize(credential): app_key/app_secret/account_ref 교체 + L1 token 무효화
- SnapshotScheduler에 kis_reinit_callback 주입 지점 추가; 그날-시작 성공 시 callback 호출
- daemon.py에 _build_kis_reinit_callback() 헬퍼 + SnapshotScheduler 조립 수정
- 신규 테스트 12개 추가: 757 passed / 47 skipped (기존 745 대비 +12, 회귀 0)

안전 불변식 유지:
- credential_fetch_enabled=False(기본) 경로 byte-for-byte 보존
- fail-closed 불변식 미파괴 (reinit 실패 시 entry_allowed 유지)
- AMQP wire 계약 변경 없음

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 19:51:48 +09:00
genichinandClaude Opus 4.8 a50b5e34a2 docs(req-113,req-115): dcy-036 confirm-req-implemented (BAT-054)
BAT-054로 REQ-113 AC-2/AC-4, REQ-115 AC-1 충족 → Approved→Implemented.
QC(opus) PASS-WITH-NOTES, blocker 0. REQ-115 AC-1 통합검증은 배포후 릴리즈 스모크(단서 부기).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 19:51:39 +09:00
genichinandClaude Opus 4.8 dc68e644d7 docs(dcy-036): confirm-req-implemented — REQ-112/114 Implemented, REQ-113/115 부분(Approved, KISBroker 재조립 M3 후속), BAT-053 release-candidate
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 12:34:23 +09:00
genichin 01655ab2d7 Merge pull request #34 from fourblocks2020/feat/dcy-036-daystart-credential-failsafe
dcy-036: 그날-시작 KIS 인증정보 fetch + fail-safe 로드 (스캐폴드) — BAT-053 (REQ-112~115)
2026-06-28 12:28:14 +09:00
genichinandClaude Sonnet 4.6 a612e8763b docs(bat-053): draft-batch-verification 완료 — AC 커버리지 + 미해결 기록
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 11:00:18 +09:00
genichinandClaude Sonnet 4.6 e4e5c70422 feat(bat-053): 그날-시작 KIS 인증정보 fetch + fail-safe 로드 (REQ-112~115)
REQ-112: BrokerCredentialPayload/TradingContext 데이터클래스 + PortfolioHubReadPort.fetch_broker_credential() 포트 메서드 + hub_read 어댑터(_fetch_user_info 헬퍼 추출) + stub_read 결정론 stub
REQ-113: DaemonInstanceConfig/DaemonConfig.credential_fetch_enabled opt-in(기본 False) + TOML 파싱 + break-glass(TREX_KIS_BROKER_BREAK_GLASS) 감지
REQ-114: SnapshotScheduler._maybe_fetch_credential() — fail-closed 3조건(unavailable/broker-null/trading_disabled) + CRITICAL 알람 DAY_START_LOAD_FAILED + IntentService entry_allowed_fn 게이트(BuyIntent 차단, SellIntent 통과)
REQ-115: 그날 고정 캐시(_cached_credential/_credential_date) — 동일 날짜 재fetch 방지 + app_secret 메모리 한정(Redis 미기록)

스텁 기반 구현: 실 portfolio-hub/네트워크 없이 AC 전부 단위 테스트.
회귀: credential_fetch_enabled=False(기본) 경로 byte-for-byte 보존.
745 passed, 47 skipped (0 failed).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 11:00:18 +09:00
genichinandClaude Opus 4.8 f9c4fb4eba docs(dcy-036): draft-req + confirm-req — REQ-112~115 Approved (그날-시작 KIS fetch + fail-safe 로드)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 10:12:18 +09:00
genichinandClaude Opus 4.8 9312ac4401 docs(dcy-036): confirm-discovery — 그날-시작 KIS 인증정보 fetch + fail-safe 거래 로드 (교차발원 pf-hub dcy-010)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 00:17:18 +09:00
genichinandClaude Opus 4.8 6da552bedb docs(dcy-035): confirm-req-implemented — REQ-109/110/111 Implemented, BAT-052 release-candidate
머지 PR #33(81d06d9) 반영. 실현PnL WAC 멀티데이 리포트 delivery 완료.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-26 20:59:20 +09:00
genichin 81d06d9db4 Merge pull request #33 from fourblocks2020/feat/dcy-035-multiday-wac-report
feat(dcy-035): 멀티데이 WAC 실현PnL 운영리포트 (REQ-109/110/111)
2026-06-26 20:52:38 +09:00
genichin a96fd54799 docs/style(bat-052): QC 재검 비차단 minor 정리
- docs/operations.md: report 섹션을 WAC 실현PnL 정의로 갱신 (portfolio-hub WAC
  기반, 매수 fee cost basis 편입, 멀티데이 정확; 미가용 시 실현섹션 에러·타섹션 정상;
  당일 net 함수는 회귀 비교용 보존 명시)
- docs/runtime-flows.md: 운영 조회 리포트 흐름에 BAT-052 WAC 경로(get_realized_pnl
  N콜) + degrade(폴백 없음) 단계 추가
- docs/batches/bat-052_*/: CHG-20260626-02 기준으로 buy_fee_only_assets·
  buy_fee_by_asset 잔존 참조 제거 및 최종 구현 일치 갱신 (planning/design/
  implementation/verification)
- tests/application/test_operator_report.py:82: 섹션 헤더 주석에서
  buy_fee_by_asset 단어 제거 및 CHG-20260626-02 근거 추가 (주석만)
- trex_core/runtime/cli.py: __import__("datetime").timezone/timedelta inline
  패턴을 정식 from datetime import timezone, timedelta로 교체 (동작 동일)

pytest: 717 passed, 47 skipped (로직 변경 없음, 회귀 0)
2026-06-26 20:35:17 +09:00
genichinandClaude Sonnet 4.6 d3e4af59cf fix(bat-052): CHG-20260626-02 보정 — buy_fee_only_assets 제거 + NFR-2 엄격화
portfolio-hub WAC가 매수 fee를 cost basis에 편입함에 따라(REQ-110 change-req)
이중계상을 방지하기 위해 buy_fee_only_assets 관련 로직을 전면 제거하고,
일중 닫힌 거래 AC-2 단언을 엄격 동치(realized_pnl_wac == realized_pnl)로 강화.

변경:
- OperatorReport.buy_fee_only_assets 필드 제거
- apply_wac_to_report buy_fee_only_assets 인자 제거
- buy_fee_by_asset 헬퍼 함수 제거
- render_text 매수전용 수수료 섹션 제거
- render_json buy_fee_only_assets 필드 제거 (WAC 필드 4개→3개)
- cli.py: buy_fee_by_asset import/사용 제거, 미사용 'from datetime import date, timedelta' 제거
- test_wac_equals_net_when_same_day_buy_sell: WAC 957.0, 엄격 동치 단언
- test_buy_only_assets_has_fee → test_buy_only_asset_no_fee_line (fee 라인 없음)
- test_render_json_has_all_four_wac_fields → test_render_json_has_three_wac_fields
- 동일 CLI 통합 테스트 보정

결과: 717 passed, 47 skipped

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-26 20:35:17 +09:00
genichinandClaude Sonnet 4.6 73d3b35ab2 feat(bat-052): WAC 실현손익 리포트 통합 (REQ-109/110/111, dcy-035)
- portfolio.py: RealizedPnlItem/RealizedPnlResult 데이터클래스 추가;
  PortfolioHubReadPort에 get_realized_pnl 포트 메서드 추가
- hub_read.py: GET /v1/portfolios/{id}/pnl/realized 어댑터 구현
  (from/to/symbol query, 비2xx/네트워크→PortfolioHubUnavailableError)
- stub_read.py: get_realized_pnl 고정 결과 stub 추가 (무네트워크)
- operator_report.py: OperatorReport에 WAC 4필드+degrade 2필드 추가;
  apply_wac_to_report/buy_fee_by_asset 헬퍼; render_text/render_json WAC 섹션
- cli.py: _cmd_report에 WAC 경로(portfolio-hub 설정 시) + degrade 경로 통합
  (REQ-111: base_url 미설정/Unavailable → 식별가능 에러, 폴백 없음)
- tests: 51개 신규 테스트 (domain sweep, hub_read, stub_read, operator_report,
  cli_report_wac); 전체 717 passed, 47 skipped

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-26 20:35:17 +09:00
genichinandClaude Opus 4.8 b9ee8edf8f docs(REQ-110): change-req CHG-20260626-02 — 매수 fee 편입 반영(NFR-2 엄격, buy_fee_only_assets 제거)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-26 20:34:55 +09:00
genichinandClaude Opus 4.8 e32eb78656 docs(dcy-035): 멀티데이 WAC 실현PnL 운영리포트 — discovery confirmed + REQ-109/110/111 approved
- dcy-035 confirm-discovery: OQ-1=전 인스턴스 WAC 통일, OQ-5=섹션 에러 degrade
- REQ-109 portfolio-hub /pnl/realized read 어댑터(포트+HTTP+stub)
- REQ-110 운영리포트 WAC 실현손익 통합(전 인스턴스, 매수일 수수료, completeness, 일중 net 회귀)
- REQ-111 portfolio-hub 미가용 시 실현손익 섹션 에러 degrade(폴백 없음)
- srs/index register 갱신

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-26 18:18:39 +09:00
genichinandClaude Opus 4.8 5b2e256c8d docs: dcy-034 거버넌스 마감 — REQ-102~108 Implemented, BAT-050/051 release-candidate
BAT-050(PR #31 ced7eda, core-A) + BAT-051(PR #32 07b393d, core-B) origin/main
머지 완료 및 QC(opus) PASS + 팀장 confirm-batch-verification 반영.

- REQ-102~108: Approved → Implemented (상태 필드 + CHG-20260626-01 Change Log)
- docs/srs/index.md: Register 상태 7건 갱신, Recent Change Log Summary 마감 1줄 추가
- docs/batches/index.md: BAT-050 in-delivery → release-candidate, BAT-051 행 신규 추가
- bat-050/index.md, bat-051/index.md: in-delivery → release-candidate
- 코드 변경 없음 (문서 상태 필드만)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-26 15:55:51 +09:00
genichinandClaude Sonnet 4.6 3f10c2379b docs(rel-009): capture-release-feedback — OPS-005 해소 + slot_filled NO_ROUTE 환류
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-26 14:07:16 +09:00
genichinandClaude Opus 4.8 07b393d27d feat(core-B): 운영자 sync/verify CLI + cold-start onboarding (BAT-051, REQ-105/106, PR #32)
dcy-034 마지막 조각. sync(슬롯 qty←브로커+warning해제+OQ-A 전이엣지+FR-7 평단seed)/verify(C 재대조·강제해제없음). core-A QC minor 2건 정리 동봉. QC(opus) PASS, 683 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-26 09:53:49 +09:00
genichin ced7eda682 Merge pull request #31 from fourblocks2020/feat/dcy-034-core-a-reconcile-warning
feat(core-A): 차단형 reconcile — reconcile-warning durable store + 전략 차단 게이트 (BAT-050, REQ-102/103/104/107/108)
2026-06-26 06:58:27 +09:00
genichinandClaude Sonnet 4.6 c193388198 feat(core-A): reconcile-warning durable store + blocking gate (BAT-050, REQ-102/103/104/107/108)
B/C 불일치 시 슬롯을 durable 차단(ReconcileWarningStore)하고 전략 intent 경로에
pause∨reconcile_warned 게이트를 추가한다. 안전망(safety-sell/kill-switch/watchdog)
경로는 SlotService 직접 호출로 게이트를 구조적으로 우회(OQ-B 확정).
SlotState enum/전이표/wire 계약 필드는 불변, reconcile_warned 필드만 additive 추가.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-26 00:43:04 +09:00
genichinandClaude Opus 4.8 35f3147250 docs(dcy-034): confirm-req REQ-102~108 Approved — 차단형 reconcile + sync/verify
dcy-034 confirm-req 완료(팀장 2026-06-25): REQ-102(warning store)/103(차단 reconcile)/104(pause∨warning 게이트)/105(sync)/106(verify)/107(로깅·알람)/108(NFR) Approved. OQ-A(INACTIVE→HOLDING actor제한 전이)/OQ-B(안전망 차단예외)/OQ-C(verify C전용) 반영. FR-7→portfolio-hub dcy-008/REQ-043 교차참조. .claude/worktrees gitignore.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-26 00:16:21 +09:00
genichinandClaude Opus 4.8 e052e70619 docs(discovery): add dcy-034 slot↔account blocking reconcile + sync/verify cold-start (confirmed)
M3 중장기 cold-start 동기화 갭 정식화. 차단형 reconcile(A→B→C) + durable warning(별도 store) + pause∨warning 게이트 + 운영자 sync/verify 명령. OQ-1~5 전부 confirm-discovery에서 Answered. portfolio-hub 현재보유 평단(WAC) read 교차 의존 명시.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-25 21:47:58 +09:00
genichinandClaude Opus 4.8 34700f3035 docs(release): M2 REL-009 confirm-release + batch release-candidate 전이
trex-core의 release-prep:
- 배치 검증 완료 (BAT-047, BAT-048)
- M2 event reliability + fill guard + alarm runbook 문서 (REL-009)
- releases index 업데이트

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-25 12:55:33 +09:00
genichinandClaude Opus 4.8 5bdd72040e docs(operations): 무데이터/죽은 종목 위생 운영자 런북 추가 (dcy-017 후속)
dcy-017 지속 무데이터 알람의 후속 운영 절차를 operations.md §7로 문서화.
- pause 시맨틱 코드 검증 결과 기술(신규 매수만 차단, 보유분 exit는 정상)
- Step 1 알람검증 / Step 2 포지션확인 / Step 3a pause(가역) / Step 3b 영구제거
- 보유 포지션 안전성 + 영구삭제 시 고아 방지 순서 명시
- 코드 변경 없음(기존 trex-core pause/resume 기능 문서화)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-22 10:36:50 +09:00
genichinandClaude Opus 4.8 d4c5fcbba1 feat(alarm): trex-core 알람 emitter + trex.alerts exchange (dcy-033 BAT-049, Implemented)
AlarmEmitter(application, best-effort 비차단)+trex.alerts topic exchange 가산·격리+8 CRITICAL code 배선. 608 passed, opus QC PASS, 팀장 e2e(텔레그램 HTTP200) 통과. REQ-098~101 Implemented.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-21 19:25:55 +09:00
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 0e5ce32f6b chore: track uv.lock
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 17:58:55 +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 24a6017457 fix(reconcile): symbol을 슬롯 생성 시 함께 저장 + NULL 슬롯 backfill
reconcile_universe 시그니처를 set[str] → dict[str, str] (portfolio_id→symbol)로 변경.
기존 symbol=NULL 슬롯은 다음 reconcile 실행 시 자동 backfill.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 21:08:46 +09:00
genichinandClaude Sonnet 4.6 221a16342e fix(smoke): topology API 변경 반영 — snapshot_queue→slots_queue, assets 키 제거
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 20:55:22 +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