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>
This commit is contained in:
2026-06-16 13:59:26 +09:00
co-authored by Claude Opus 4.8
parent 00ce5d95bb
commit 9e35467336
3 changed files with 39 additions and 30 deletions
+5 -5
View File
@@ -49,8 +49,8 @@
| BAT-039 | standard | released | REQ-011 (CHG-20260612-01) | 없음 (issue #4) | [bat-039](./bat-039_20260612_paper-seq-redis-persistence/) |
| BAT-040 | standard | released | REQ-002 (CHG-20260612-01), REQ-006 (CHG-20260612-01), REQ-073 (CHG-20260612-02) | 없음 (issue #25) | [bat-040](./bat-040_20260612_slots-rpc-db-filter/) |
| BAT-041 | standard | released | REQ-076, REQ-077, REQ-078 | dcy-027 (issue #20 이월) | [bat-041](./bat-041_20260612_long-term-instance-profile/) |
| BAT-042 | standard | release-candidate | REQ-079, REQ-080, REQ-081, REQ-082, REQ-073 (CHG-20260615-01), REQ-074 (CHG-20260615-01) | dcy-028 (issue #26) | [bat-042](./bat-042_20260615_slot-strategy-state-store/) |
| BAT-043 | batch-lite | release-candidate | REQ-007 (CHG-20260615-01) | 없음 (issue #27) | [bat-043](./bat-043_20260615_sell-intent-retryable-flag/) |
| BAT-044 | standard | release-candidate | REQ-083, REQ-070 (CHG-20260616-01) | dcy-030 (issue #28) | [bat-044](./bat-044_20260616_slippage-tick-size-snapping/) |
| BAT-045 | standard | release-candidate | REQ-084, REQ-085, REQ-087 | dcy-029 (issue #29, P0) | [bat-045](./bat-045_20260616_observability-logging-foundation/) |
| BAT-046 | standard | release-candidate | REQ-086, REQ-088, REQ-089, REQ-090 | dcy-029 (issue #29, P1) | [bat-046](./bat-046_20260616_observability-classification-pnl-runbook/) |
| BAT-042 | standard | released | REQ-079, REQ-080, REQ-081, REQ-082, REQ-073 (CHG-20260615-01), REQ-074 (CHG-20260615-01) | dcy-028 (issue #26) | [bat-042](./bat-042_20260615_slot-strategy-state-store/) |
| BAT-043 | batch-lite | released | REQ-007 (CHG-20260615-01) | 없음 (issue #27) | [bat-043](./bat-043_20260615_sell-intent-retryable-flag/) |
| BAT-044 | standard | released | REQ-083, REQ-070 (CHG-20260616-01) | dcy-030 (issue #28) | [bat-044](./bat-044_20260616_slippage-tick-size-snapping/) |
| BAT-045 | standard | released | REQ-084, REQ-085, REQ-087 | dcy-029 (issue #29, P0) | [bat-045](./bat-045_20260616_observability-logging-foundation/) |
| BAT-046 | standard | released | REQ-086, REQ-088, REQ-089, REQ-090 | dcy-029 (issue #29, P1) | [bat-046](./bat-046_20260616_observability-classification-pnl-runbook/) |
+1 -1
View File
@@ -15,4 +15,4 @@
| REL-005 | app-service | feedback-captured | BAT-024, BAT-025 | dcy-016 후속/issue #17 (operator enter --forced-close-at) + dcy-019/issue #18 (slot entry_count + closed 슬롯 재할당) — 통합 릴리즈 | [rel-005](rel-005_20260609_operator-forced-close-and-slot-reallocation.md) |
| REL-006 | app-service | feedback-captured | BAT-026, BAT-027, BAT-028, BAT-029, BAT-030, BAT-031, BAT-032, BAT-033, BAT-034, BAT-035, BAT-036 | dcy-020 (자산 중심 영구 슬롯 α~δ cutover) + dcy-021 (포지션 사이징/issue #1·#5) + dcy-022 (실행 정책/issue #21) + dcy-023 (allocated_capital 제거/issue #22) + dcy-024 (safety_sell_enabled/issue #15) + dcy-025 (slots.req 교체·REQ-028 Deprecated) + REQ-048·010 CHG (config-dir) + REQ-032 CHG (enter --qty/issue #23) — 통합 릴리즈 | [rel-006](rel-006_20260611_asset-centric-sizing-execution-policy.md) |
| REL-007 | app-service | feedback-captured | BAT-037, BAT-038, BAT-039, BAT-040, BAT-041 | dcy-025 (REQ-073 CHG — available_slots hint) + dcy-026/issue #24 (매도세 정정) + issue #4 (paper seq Redis) + issue #25 (slots RPC DB 필터) + dcy-027/issue #20 (중장기 인스턴스 프로파일) — 통합 릴리즈 | [rel-007](rel-007_20260612_slots-rpc-fee-paper-longterm.md) |
| REL-008 | app-service | confirmed | BAT-044, BAT-045, BAT-046 | dcy-030/issue #28 (호가단위 스냅, P0 체결 복구) + dcy-029/issue #29 (운영 관측성 — 구조화 로깅·주문결과·거부ERROR·reason+actor·PnL CLI·런북) — 통합 릴리즈 | [rel-008](rel-008_20260616_tick-snap-and-observability.md) |
| REL-008 | app-service | feedback-captured | BAT-042, BAT-043, BAT-044, BAT-045, BAT-046 | dcy-028/issue #26 (slot strategy-state) + issue #27 (sell retryable) + dcy-030/issue #28 (호가단위 스냅, P0 체결 복구) + dcy-029/issue #29 (운영 관측성 — 구조화 로깅·주문결과·거부ERROR·reason+actor·PnL CLI·런북) — 통합 릴리즈 | [rel-008](rel-008_20260616_tick-snap-and-observability.md) |
@@ -1,11 +1,13 @@
# REL-008: 호가단위 스냅(#28) + 운영 관측성(#29) 통합 릴리즈
# REL-008: 호가단위 스냅(#28) + 운영 관측성(#29) + slot strategy-state(#26)·retryable(#27) 통합 릴리즈
- Status: confirmed
- Status: feedback-captured
- Profile: app-service
- Included Batch: BAT-044, BAT-045, BAT-046
- Included Batch: BAT-042, BAT-043, BAT-044, BAT-045, BAT-046
## Scope
- Included:
- **BAT-042** (dcy-028 / issue #26): slot strategy-state 저장소 — `slot_strategy_state` 테이블 + StrategyStateStore(occupancy_seq·version CAS) + write RPC `trex.slots.strategy_state.set` + occupancy_seq 가드/close 삭제 + slots.req strategy_state·occupancy_seq additive (REQ-079·080·081·082, REQ-073/074 CHG). **마이그레이션 014/015**.
- **BAT-043** (issue #27): rejected SellIntent 응답 additive `retryable: bool` (REQ-007 CHG-20260615-01).
- **BAT-044** (dcy-030 / issue #28, P0): slippage 보호 지정가 KRX 호가단위 스냅. `domain/pricing.py`(tick 유틸, REQ-083) + `execution.py` 스냅(REQ-070 CHG-20260616-01) — 상한 준수(매수 floor/매도 ceil) + band<1tick 하한/상한 보장 + 부동소수 epsilon 가드. slippage_pct>0 매수의 호가단위 위반 전량 거부 해소.
- **BAT-045** (dcy-029 P0): 구조화 로깅 기반 — ISO8601(KST) 타임스탬프·레벨, Loki JSON 출력(`TREX_LOG_FORMAT`), correlation id(slot_id)(REQ-084); 주문 결과 로깅 `event=order_submit|order_fill|order_reject`(REQ-085); 거부 ERROR 가시화(REQ-087).
- **BAT-046** (dcy-029 P1): 청산 reason+actor 동반 노출(REQ-086); 운영 조회 CLI `trex-core report`(보유·오늘 체결·실현 PnL net·대기, direct-DB)(REQ-088); 운영자 런북 `docs/operations.md`(REQ-089); baseline 정합(REQ-090).
@@ -13,7 +15,8 @@
- 알림 전송 채널(dcy-029 OQ-3 Deferred — 후속 반복).
- ETF/ETN 비주식 호가체계(dcy-030 OQ-1 — 주식 전용).
- 실현 PnL의 cost-basis 매칭(net 매매 현금흐름 정의 채택).
- dcy-028 BAT-042/043(strategy-state·retryable) — 별도 release 트랙(release-candidate 유지).
- Scope Note:
- BAT-042/043은 단일 main 브랜치상 배포 HEAD(`00ce5d9`)의 조상으로 함께 배포되는 release-candidate 배치다. 초안 시 제외했으나, "남아있는 배치 전부를 REL-008로" 지시에 맞춰 본 릴리스에 포함하도록 정정(배포 현실 = main 통째 배포와 일치). 마이그레이션 014/015는 BAT-042 소속.
## Rollout Plan
1. 배포 전: 전체 테스트 green 확인(537 passed/47 skipped), ruff clean, DB 스키마 변경 없음 확인(마이그레이션 불필요).
@@ -46,7 +49,7 @@
| 전체 테스트 green | `.venv/bin/python -m pytest -q` → **537 passed, 47 skipped**(47 skip = 실 DB/RabbitMQ 게이트), 회귀 0 | ✅ |
| Lint | `.venv/bin/ruff check trex_core/ tests/` → All checks passed | ✅ |
| Batch 검증 완료 | BAT-044/045/046 `verification.md` 모두 Ready for Release: true, Blocking Issues 없음 | ✅ |
| DB 스키마 변경 | 없음 — 신규 마이그레이션 0개(`sql/` 변경 없음) → 롤백 무손실 | ✅ |
| DB 스키마 변경 | **마이그레이션 014/015**(BAT-042 소속, 본 릴리스 포함) — 기동 시 자동 적용(additive·idempotent: `daily_slot.occupancy_seq`, `slot_strategy_state` 테이블). 구버전은 두 객체 미참조라 롤백 무손실 | ✅ |
| 호가단위 스냅(#28) | issue #28 케이스 단위 검증(147,700→148,400 / 54,500→54,700), 상한 미초과·유효 호가 불변식 테스트 | ✅ |
| 로깅 포맷(REQ-084) | text/json·ISO8601(KST)·correlation id 포맷터 단위 검증, `configure_logging` idempotent | ✅ |
| 주문 결과·거부 ERROR | `event=order_submit\|fill\|reject` + 거부 ERROR 레벨 단위 검증(caplog) | ✅ |
@@ -61,53 +64,59 @@
### Deployment Facts
- Executed At:
- <배포 시 기록>
- 2026-06-16 13:41:22 KST
- Completed At:
- <배포 시 기록>
- 2026-06-16 13:41:26 KST
- Environment:
- <배포 대상 환경 — 예: /root/release 운영, instance_key=trex-admin-daily-trading>
- `/root/release` 운영, instance_key=`trex-admin-daily-trading` (실거래 KIS 계좌 91254)
- Operator:
- <배포 수행자>
- 배포 에이전트
- Revision or Artifact:
- 커밋 `d8d9021` 이상(REL-008 내용 포함) — 배포 시 확정
- `1f59322`(REL-007) → **`00ce5d9`(REL-008)**. PID 1778 → 193867.
- Commands or Procedure:
- <배포 절차 요약>
- `scripts/deploy-trex-core.sh --update-only`(git pull) → `--restart-only`(데몬 재기동). 마이그레이션 014/015는 데몬 기동 시 `apply_migrations` 자동 적용. 배포 전 포지션 0(재시작 안전).
### Profile-Specific Checks
- app-service:
- Health Endpoint:
- N/A(데몬은 HTTP 표면 없음 — BAT-007). "ready" = 4 워커 스레드 + RabbitMQ 토폴로지 선언, 로그 ERROR/traceback 0. (배포 후 확인)
- Startup Log Fields:
- 배포 전 근거: `runtime/logging_setup.configure_logging` 단위 검증으로 기동 로그가 ISO8601(KST)+레벨 prefix를 갖도록 보장(`test_configure_text_default`/`test_configure_json_format`). 배포 후 실제 기동 로그 1줄 확인.
- ✅ 배포 후 확인: 기동 로그가 `2026-06-16T13:41:24.044+09:00 INFO pika...` 형태로 **ISO8601(KST)+레벨** prefix 전환(이전 `INFO:pika:` 타임스탬프 없음). ERROR/CRITICAL/Traceback 0.
- Request Log Fields:
- 배포 전 근거: 주문 결과 로그 `event=order_submit|order_fill|order_reject` + correlation_id(slot_id) 단위 검증(`TestOrderResultLogging`). 배포 후 실거래 주문 1건의 submit→fill 로그 cid 일치 확인.
- 배포 후 포지션 0이라 실거래 주문 미발생 — 단위 검증(`TestOrderResultLogging`, cid=slot_id submit→fill)으로 보장. 다음 거래일(06-17) 실거래 주문에서 재확인.
- Smoke or Manual Verification:
- 배포 전 근거: slippage 매수 유효 호가 스냅(issue #28 케이스) + 거부 ERROR + `operator_report` 집계 단위 검증(537 passed). 배포 후 실거래 slippage 매수가 호가단위 거부 0으로 체결 + `trex-core report` 출력 확인.
- ✅ #28 호가단위 스냅: 배포된 `domain/pricing.py`로 어제 거부 2건 재계산 — 000720 entry 147,700 → 148,400(유효), 006800 entry 54,500 → 54,700(유효). ✅ `trex-core report` 동작(보유 0/대기 0/오늘 체결 0/실현 PnL 0). ✅ slots RPC 145개 정상, RabbitMQ ESTABLISHED 5. 실거래 slippage 매수 거부 0 체결은 06-17 거래일 확인.
### Rollback Outcome
- Rollback Required:
- <yes 또는 no>
- no
- Rollback Trigger:
- none
- none (기동 정상, #28 스냅·로깅·report 검증 통과)
- Rollback Action:
- none
### Release Decision Evidence
- Released Decision:
- confirmed (배포 승인) — 실 운영 released 전환은 capture-release-feedback 단계에서 배포 근거와 함께 기록
- **released** (2026-06-16 13:41 KST 운영 배포 완료, `00ce5d9`, PID 193867)
- Rationale:
- BAT-044/045/046 전 verification confirmed(Ready for Release: true, Blocking Issues 없음). 537 passed/47 skipped 회귀 0, ruff clean. DB 스키마 변경 없어 롤백 무손실. 호가단위 스냅(#28)·로깅·주문 결과·거부 ERROR·reason+actor·PnL CLI 단위/통합 검증 완료. 비파괴적 additive 중심(로그 포맷 text 기본, report/reason+actor additive, slippage 미사용 경로 회귀 없음)으로 회귀 위험 낮음.
- BAT-044/045/046 전 verification confirmed. 운영 배포 후 #28 호가단위 스냅(147,700→148,400 / 54,500→54,700)·구조화 로깅(ISO8601 KST prefix)·`trex-core report`·데몬 건강(ERROR 0, slots RPC 145) 실환경 검증. 마이그레이션 014/015 자동 적용(additive·idempotent). 롤백 불요.
- Recorded By:
- Justin Ko
- Justin Ko (confirm) / 배포 에이전트 (운영 배포 근거)
- Recorded At:
- 2026-06-16 13:25 KST
- 2026-06-16 13:25 KST (confirm) / 2026-06-16 13:43 KST (배포 완료 근거)
## Feedback Handoff
- Observation Summary:
- <배포 후 기록>
- (2026-06-16 13:43 KST, 배포 에이전트) REL-008 운영 배포 완료(`00ce5d9`, PID 193867, `--restart-only`). **#28 호가단위 스냅 라이브 검증**(어제 거부 2건 재계산: 147,700→148,400 / 54,500→54,700, 유효 호가·상한 준수), **구조화 로깅 전환**(`...+09:00 INFO` KST prefix), **`trex-core report` 동작**, 마이그레이션 014/015 자동 적용 확인, 데몬 ERROR 0·slots RPC 145 정상.
- 사전 테스트: 537 passed/46 skipped/1 failed. 1 failed = `test_sandbox_token_and_submit` — 운영 `.env`(:9443)가 샌드박스 테스트에 새어든 **환경 아티팩트, REL-008 회귀 아님**.
- **거버넌스 정정(§4)**: main 단일 브랜치라 HEAD 배포 시 dcy-028(BAT-042/043, #26/#27) 코드가 동반 배포됨. 초안 시 본 릴리스에서 제외했으나 사용자 지시("남아있는 배치 전부")에 맞춰 **BAT-042/043을 REL-008에 정식 포함하도록 정정** → 추적 갭 해소(운영 실체 = 배포 HEAD와 일치). `occupancy_seq` 코어 활성, `slot_strategy_state` 핸들러는 전략 호출 시만 동작(orb-v1 미사용)→저위험.
- Discovery Input:
- <후속 discovery 후보>
- **#30 Loki push 핸들러**: 현재 구조화 로그 text/json stdout만. Loki 적재(push)는 후속(이슈 #30 등록됨) — dcy-029 OQ-2/A-4(배포측 수집기) 연장선.
- REQ Input:
- <후속 req 후보>
- none (관측성·호가단위는 REQ-070/083/084~090로 처리 완료)
- Change Request Input:
- <기존 req 변경 후보>
- none
- Follow-up Actions (비차단):
- **BAT-042/043(dcy-028 #26/#27) 운영 동반 배포 정식화** — 별도 release(REL-009 후보)로 retroactive 추적 권장(아래 사용자 결정 필요).
- 실거래 #28 검증: 06-17 거래일 slippage 매수가 호가단위 거부 0으로 체결되는지 확인.
- GitHub #28(수정 반영)·#29(기반 반영) close — 사용자 승인 후.