Commit Graph
271 Commits
Author SHA1 Message Date
genichin 932991c538 docs(discovery): decide manual ledger endpoint split 2026-07-14 15:26:43 +09:00
genichin 175570d4a4 docs(discovery): start manual ledger API discovery 2026-07-14 14:04:11 +09:00
genichin 6b695b83b8 REQ-055 Implemented (confirm-req-implemented) — bat-023 머지 522a10f, QC PASS-WITH-NOTES(AC 10/10). 잔여: dangling FK 실DB 확인(배포후) 2026-07-04 11:39:04 +09:00
genichin 522a10f26e Merge pull request #20 from fourblocks2020/feat/req-055-portfolios-strategy-market-meta
bat-023: /v1/portfolios 전략·시장 메타 노출 (REQ-055)
2026-07-04 11:37:19 +09:00
genichinandClaude Fable 5 7dba160c0f test(bat-023): add REQ-055 AC-1~10 tests for strategy+market meta fields
10 test cases covering:
- AC-1: bound portfolio returns strategy_name/params
- AC-2: unbound → null/{}
- AC-3: dangling FK → keeps active_strategy_id, null strategy fields
- AC-4: invalid JSON config → strategy_params={} + WARNING log (caplog)
- AC-5/6: markets with values / empty
- AC-7: existing 16-field regression
- AC-8: token-branch invariant (service token)
- AC-9: strategy_params exact key-value match
- AC-10: mixed list individual accuracy

583 passed total (0 failures, 18 new tests).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-07-04 11:05:51 +09:00
genichinandClaude Fable 5 8a07742049 feat(req-055): expose strategy & market meta fields in PortfolioItem response (additive)
Adds 4 additive fields to GET /v1/portfolios (and single-portfolio) response:
- active_strategy_id (str|null): portfolios.active_strategy_id raw value
- strategy_name (str|null): strategy_sets.name via LEFT JOIN
- strategy_params (dict): strategy_sets.config JSON parsed; {} on missing/invalid
- markets (list[str]): assets.markets; [] on missing/empty

_SELECT_PORTFOLIO extended with LEFT JOIN strategy_sets; _row_to_portfolio
parses new columns (row[19-21]) with JSON error isolation (WARNING log, no 500).
_portfolio_to_item maps all 4 new fields. Existing 16 fields unchanged.
N+1 prevented: single SQL JOIN for both list and single-item paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-07-04 11:05:51 +09:00
genichinandClaude Fable 5 b2261c4428 docs(bat-023): add batch planning/design/verification documents for REQ-055
BAT-023 batch documents — GET /v1/portfolios strategy+market meta additive
fields. Includes planning, design, verification, and batch index entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-07-04 11:05:51 +09:00
genichin 4e1aa83011 REQ-055 Approved (confirm-req, 팀장) — /v1/portfolios에 active_strategy_id/strategy_name/strategy_params/markets additive 노출. tvr e2e 배관 ① 2026-07-04 10:54:34 +09:00
genichinandClaude Opus 4.8 9dcd00f7a5 docs(rel-003): released 마감 — M3 배포 완료(9d98d47, Step2 적용)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-30 17:03:21 +09:00
genichinandClaude Opus 4.8 7ba618eb30 docs(runbook): Step2 마이그레이션 배포 순서 정정 — 체크아웃 갱신 선행
운영팀 지적: prod=REL-002(bd34450)라 마이그레이션 파일·backfill CLI 부재.
0단계 '체크아웃 갱신(origin/main, 디스크, 재시작X)'를 마이그레이션 앞에 추가,
서비스 재시작은 Step2 후로 분리. freeze 9fe6f3b→9d98d47, 실패모드/게이트 보강.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-30 12:58:01 +09:00
genichinandClaude Opus 4.8 9d98d47e2d docs(rel-003): M3 daemon-scoped 크레덴셜 릴리즈 문서 + Step2 ops 런북
REL-003(dcy-010/011 + WAC #15 동반) draft + Step2 마이그레이션 핸드오프(프리체크·롤백·go/no-go).
내일 ops 윈도우용. 미푸시(사장님 결재 시 release와 함께 push).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 23:02:35 +09:00
genichinandClaude Opus 4.8 9fe6f3b511 docs(req-053): GET /v1/admin/daemons 목록 엔드포인트 핫픽스 거버넌스 백필
핫픽스 2dcbafb(목록 조회 405 갭 해소)를 REQ-053에 change-req로 기록.
스코프 갭(GET-list AC 누락) 정정 + AC-13/14 추가, 라이브 통합검증 근거 기재.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 19:16:20 +09:00
genichinandClaude Opus 4.8 2dcbafb7a8 fix(dcy-011/bat-022): GET /v1/admin/daemons 목록 엔드포인트 추가 — UI 계약 누락(405) 해소 (라이브 통합테스트 결함)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 18:20:13 +09:00
genichinandClaude Opus 4.8 0fbd33b08b docs(dcy-011): confirm-req-implemented — REQ-052/053/054 Implemented (BAT-022 PR#19, Major #3 owner재할당 원자화), bat-022 release-candidate
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 14:58:31 +09:00
genichin 1b78c1823b Merge pull request #19 from fourblocks2020/feat/dcy-011-daemon-crud-self-service-credential-api
dcy-011: 데몬 CRUD + 사용자 self-service 인증정보 관리 API — BAT-022 (REQ-052/053/054)
2026-06-28 14:54:14 +09:00
genichinandClaude Sonnet 4.6 83e6ddead4 fix(bat-022): owner 재할당 credential 무효화 원자화 — leak 방지 (QC Major)
update_daemon_owner()에서 owner UPDATE + credential DELETE를 단일
conn.transaction() 블록으로 묶어 원자성 보장. 실패 시 두 연산 모두
롤백되므로 "새 owner + 이전 credential 잔류" leak 상태(dcy-011 OQ-3)
가 불가능해짐. 실행 순서도 DELETE-first(안전 순서)로 고정.

단위 테스트 3종 추가:
- DELETE-before-UPDATE 실행 순서 검증
- UPDATE 실패 시 rollback(commit 미호출) 검증
- 단일 transaction() 블록 안에서 두 연산 실행 검증

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 14:31:00 +09:00
genichinandClaude Sonnet 4.6 64cc382604 docs(bat-022): implementation, verification, index 문서 추가
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 14:18:37 +09:00
genichinandClaude Sonnet 4.6 d24058d863 feat(bat-022): daemon CRUD admin API + self-service credential management (REQ-052/053/054)
- POST/PATCH/deactivate/activate /v1/admin/daemons — admin-only daemon CRUD (REQ-053)
- GET/PUT/DELETE /v1/daemons/{daemon_id}/credential — user-owned scoped credential management (REQ-052)
- Owner re-assignment auto-invalidates BrokerCredential via update_daemon_owner() (REQ-053 AC-4)
- Deactivation auto-revokes service tokens via revoke_tokens_by_daemon_id() (REQ-022 reuse, REQ-053 AC-6)
- DELETE /v1/admin/daemons/{id} → 405 (hard delete not provided, REQ-053 AC-8)
- All responses exclude app_key/app_secret; Fernet encryption at rest (REQ-054)
- Service-token → 403 on credential endpoints (REQ-052 AC-10)
- Admin ownership scope enforced: admin cannot write other user's credential (REQ-052 AC-9)
- REQ-051 regression: 4 service-token guard tests pass (REQ-054 AC-7)
- 44 new tests, 565 total passed (521 baseline + 44 new), 0 failures

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 14:18:37 +09:00
genichinandClaude Opus 4.8 80d0511d7f docs(dcy-011): draft-req + confirm-req — REQ-052/053/054 Approved
Add three approved requirements documents for dcy-011:
- REQ-052: User-owned credential management API (Interface)
- REQ-053: Admin daemon CRUD API (Interface)
- REQ-054: Credential management security with write-only constraint (Non-Functional)

Update discovery document to reference generated requirements and update index with new REQ IDs and Change Log.

Scope: Self-service credential management + admin daemon CRUD + security-isolated API for portfolio-hub.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 13:55:45 +09:00
genichinandClaude Opus 4.8 a1bde2cf67 docs(dcy-011): confirm-discovery — 데몬 admin CRUD + 사용자 self-service 인증정보 관리 API (소유스코프·쓰기전용·secret 미반환)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 13:44:31 +09:00
genichinandClaude Opus 4.8 29cd86f0e4 docs(dcy-010): confirm-req-implemented — REQ-047 Implemented (BAT-021 PR#18 실DB검증), bat-021 release-candidate
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 10:36:02 +09:00
genichin 7164f9e350 Merge pull request #18 from fourblocks2020/feat/bat-021-req047-step2-finalize
BAT-021: REQ-047 Step2 마무리 — daemon-scoped PK 동반수정 + 실DB 검증 + 런북
2026-06-28 10:32:40 +09:00
genichin 3e1b571906 feat(bat-021): REQ-047 Step2 동반 코드 수정 + 실 DB 통합검증 + 런북
- ensure_schema() broker_credentials: daemon_id NOT NULL, PK=(daemon_id,broker)로 갱신
- _row_to_broker_credential: Step2 컬럼 순서(daemon_id 선두)로 갱신
- upsert_broker_credential: ON CONFLICT (daemon_id,broker)로 수정, fallback try/except 제거
- list_broker_credentials: fallback 제거, SELECT 컬럼 순서 갱신
- test_bat020_broker_credential_domain.py: AC-3/AC-4 행 순서를 Step2 포맷으로 갱신
- tests/test_bat021_step2_ensure_schema_and_upsert.py: 12개 신규 테스트
- docs/runbooks/bat-021-req047-step2-migration-runbook.md: 운영 적용 런북
- docs/batches/bat-021: batch 문서(index/planning/design/implementation/verification)

실 PostgreSQL 통합검증(AC-1~7 전건 PASS):
  Step1 upgrade → backfill → Step2 upgrade → downgrade 시나리오 포함
  NULL 사전검증(upgrade 거부) 및 downgrade 안전장치(중복 시 RuntimeError) 확인

521 passed, 0 failed (기존 509 + 신규 12)
2026-06-28 10:19:27 +09:00
genichinandClaude Opus 4.8 7e3b34287f docs(dcy-010): confirm-req-implemented — REQ-046/048/049/050/051 Implemented, REQ-047 Approved 유지(Step2 결재대기), BAT-020 release-candidate
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 07:49:17 +09:00
genichin d4acfd4a12 Merge pull request #17 from fourblocks2020/feat/dcy-010-daemon-scoped-broker-credential
dcy-010: daemon-scoped 브로커(KIS) 인증정보 — BAT-020 (REQ-046~051)
2026-06-28 07:43:30 +09:00
genichinandClaude Sonnet 4.6 f030621f6b docs(bat-020): verification, implementation, index 문서 추가
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 00:45:46 +09:00
genichinandClaude Sonnet 4.6 51b7cbee35 feat(bat-020): daemon-scoped 브로커 인증정보 (REQ-046~051)
- REQ-046: BrokerCredential.daemon_id 필드 추가, repository 시그니처 갱신
- REQ-047: alembic revision Step1(daemon_id NULL 컬럼 추가), Step2(PK 전환, dev/test DB 한정)
- REQ-048: backfill-daemon-id CLI subcommand (--dry-run/--force/--broker 지원)
- REQ-049: GET /v1/user_info daemon-scoped 단일 broker 전달 (brokers→broker, daemon_id 없으면 403)
- REQ-050: credential set/list/remove --daemon-id 옵션 추가 (daemon_slug 해석)
- REQ-051: 보안 격리 - service-token 전용, web 토큰 차단, 로그 app_secret 비노출, graceful degrade

비가역 결재 게이트: REQ-047 Step2(PK 전환)는 사장님 결재 후 실DB 적용 예정(이 batch는 revision 코드만)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 00:45:46 +09:00
genichinandClaude Opus 4.8 fc99f507a5 docs(dcy-010): draft-req + confirm-req — REQ-046~051 Approved (daemon-scoped broker credential provisioning)
Adds SRS specification documents for daemon-scoped broker credential management:
- REQ-046: Broker credential daemon_id field
- REQ-047: Migration PKv1→PKv2 with daemon_id
- REQ-048: Backfill existing broker credentials with daemon_id
- REQ-049: User info endpoint including daemon-scoped credentials
- REQ-050: Credential CLI --daemon-id option
- REQ-051: Security isolation per daemon boundary

Updates dcy-010 discovery document with generated REQ references and register.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 00:22:02 +09:00
genichinandClaude Opus 4.8 b0dfc42966 docs(dcy-010): confirm-discovery — daemon-scoped 브로커 인증정보 provisioning (PK (daemon_id,broker)·/v1/user_info 확장·1데몬1계좌)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-28 00:06:48 +09:00
genichinandClaude Opus 4.8 233cbc3df6 fix(portfolio): name 검증에 한글+공백 허용 (minor-change, CHG-20260627-03)
_PORTFOLIO_NAME_RE + CLI _NAME_RE를 ^[a-zA-Z0-9가-힣 ._:-]{1,100}$로 완화. name은 (owner,name) 조회 키일 뿐 wire 식별자 아님. 475 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-27 12:03:33 +09:00
genichinandClaude Opus 4.8 853a9bdab8 docs(dcy-009): confirm-req-implemented — REQ-044/045 Implemented, bat-019 confirmed
머지 PR #16(7f15c6b) 반영. 사용자 read 엔드포인트 delivery 완료. REQ-045 env토큰 처리 200+empty로 문서 동기화(change-req).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-27 10:46:35 +09:00
genichin 7f15c6b664 Merge pull request #16 from fourblocks2020/feat/dcy-009-user-read-endpoints
feat(dcy-009): 사용자용 read 엔드포인트 — GET /v1/assets require_read 완화 + GET /v1/daemons
2026-06-27 10:41:50 +09:00
genichinandClaude Sonnet 4.6 7581ec2f27 docs(bat-019): verification 완료 + batch index 업데이트
472 passed, 0 failed. confirm-batch-verification 팀장 대기.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-27 10:36:04 +09:00
genichinandClaude Sonnet 4.6 c5288a8c42 feat(bat-019): REQ-044 GET /v1/assets require_read + REQ-045 GET /v1/daemons caller-scope
REQ-044: list_catalog_assets 의존성을 require_admin → require_read로 완화.
asset 쓰기(POST/PATCH/DELETE)는 require_admin 유지.

REQ-045: GET /v1/daemons 신규 엔드포인트 — caller 소유 데몬만 반환(require_read).
user_id=None(env 토큰)은 빈 목록 200. DaemonResponse/DaemonListResponse 스키마 추가.

기존 테스트(test_v1.py, test_asset_catalog.py, test_daemon_assignment.py, test_tags_master.py)
REQ-044 권한 완화에 맞게 업데이트. test_v1_daemons.py 신규 추가(13 케이스).

pytest 472 passed, 0 failed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-27 10:36:04 +09:00
genichinandClaude Opus 4.8 d43ff430c2 docs(dcy-009): 사용자용 read 엔드포인트 discovery confirmed + REQ-044/045 approved
- dcy-009: GET /v1/assets require_read 완화 + 사용자 가용 데몬 목록 신규 (trex-web 포트폴리오 관리 발원)
- REQ-044(assets 권한 완화) / REQ-045(사용자 데몬 목록) — Approved
- 전부 read 추가(쓰기·데몬관리 제외)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-27 10:16:23 +09:00
genichin 3a6adc98c9 Merge pull request #15 from fourblocks2020/feat/req-041-wac-buy-fee-capitalize
fix(REQ-041): WAC cost basis에 매수 수수료 편입 (dcy-035 연동)
2026-06-26 20:52:12 +09:00
genichinandClaude Sonnet 4.6 d224d716f6 fix(holdings): /holdings/cost-basis WAC row에 fee_amount 편입 (QC보정)
get_holdings_cost_basis 핸들러의 row dict에 fee_amount 누락으로
/holdings/cost-basis의 cost_basis_per_unit이 매수 수수료 미편입값을
반환하던 버그 수정. /pnl/realized 핸들러와 동일하게 e.fee_amount 포함.
테스트: buy fee>0 케이스(1000.5 단언) + fee=0 회귀 케이스 추가.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-26 20:34:03 +09:00
genichinandClaude Sonnet 4.6 73414817e0 fix(pnl): 매수 수수료를 WAC cost basis에 편입 (REQ-041 CHG-20260626-01)
WAC 공식에 buy row의 fee_amount를 분자에 포함해 실현 PnL이 당일 net과 정확히 일치하도록 수정.
calculate_realized_pnl + calculate_current_wac 양 함수 동일 적용.
신규 단위 테스트 9개(TestBuyFeeInCostBasis 5 + TestCurrentWacBuyFeeInCostBasis 4) 추가.
change-req: REQ-041 AC-9/AC-10 추가, REQ-040/REQ-043 Notes 갱신, index 갱신.
전체 456 passed / 0 failed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-26 20:34:03 +09:00
genichinandClaude Sonnet 4.6 bd8ff1bf45 docs(gov): BAT-018/REQ-043 거버넌스 마감 — Implemented + release-candidate 전환
- REQ-043: Approved → Implemented (BAT-018 PR #14 squash d93c0bc, 팀장 QC PASS, origin/main 머지)
- BAT-018: in-progress → release-candidate (배포 별도 — 미배포)
- dcy-008 생성된 REQ 참조에 Implemented 반영
- srs/index.md Requirement Register 및 Recent Change Log Summary 갱신 (최신 5건)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-26 15:52:44 +09:00
genichinandClaude Opus 4.8 d93c0bcaf5 feat(holdings): REQ-043 현재 보유 평단(WAC) read — GET /v1/portfolios/{id}/holdings/cost-basis (BAT-018, PR #14)
dcy-008(confirmed)/REQ-043(Approved)/BAT-018. trex-core dcy-034 FR-7 cold-start seed 의존. AC 11/11, QC PASS. worktree+PR 워크플로 첫 파일럿.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-26 00:07:43 +09:00
genichinandClaude Opus 4.8 8f9865bd8a docs(rel-002): capture M1 release feedback — feedback-captured, smoke 8/9 PASS (1 non-blocking)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-22 14:34:55 +09:00
genichinandClaude Opus 4.8 b1c34068e5 docs: batch 상태 released 동기화(REL-001/002) + README 현행화(거래내역/실현PnL API)
batch drift 정합 — REL-001(BAT-001~016)·REL-002(BAT-017) released에 맞춰
batches/index 및 개별 index 상태를 release-candidate→released 동기화(17건).
README: bootstrap 문구 제거, dcy-007 엔드포인트(GET /trades·/pnl/realized) 추가,
planned-next 현행화. 코드 무변경.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-22 09:51:13 +09:00
genichinandClaude Opus 4.8 16746008cc docs(rel-002): released 전환 — M1 배포 evidence 귀속 (trex-op 2026-06-19)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-19 17:59:36 +09:00
genichinandClaude Opus 4.8 d89f137929 docs(rel-002): M1 신규 릴리즈 — BAT-017 거래내역+실현PnL API (confirm-release)
REQ-039~042 Implemented. Freeze 커밋 bd34450.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-19 16:57:29 +09:00
genichinandClaude Opus 4.8 bd34450ee9 feat(pnl): trade history + realized PnL API (WAC) — BAT-017, REQ-039~042 Implemented
- GET /v1/portfolios/{id}/trades and GET /v1/portfolios/{id}/pnl/realized endpoints
- Weighted Average Cost (WAC) realized PnL calculation in app/domain/pnl.py
- cost_basis and data_completeness_warning returned in pnl API response
- Test coverage: 50 passed (WAC 20 + trades 12 + pnl 18), full 427 passed regression ✓
- WAC validated against 199,300 unit e2e test cases
- DB migration: none required
- QC: qc-reviewer PASS-WITH-NOTES; team lead confirm-batch-verification → release-candidate
- Remaining non-blocking: symbol filter edge case testing, HTTP_422 deprecation

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-18 16:45:01 +09:00
genichinandClaude Opus 4.8 f37ef87c8c docs(dcy-007): draft + approve REQ-039~042 (trade history + realized PnL API)
dcy-007 분해 완료: 체결내역 조회(REQ-039, GET /trades), 실현 PnL 집계(REQ-040, GET /pnl/realized with WAC), WAC 산출 로직(REQ-041, service/domain 격리), 테스트 커버리지(REQ-042).

팀장 confirm-req 완료:
- 4건 모두 Proposed → Approved (dcy-007 결정·발견사항 반영, R-1 경고필드 포함, blocker 없음)
- M1(6/22) fast-track, 단일 batch 예정
- docs/srs/index.md: Next ID REQ-043, Register 4건 Approved, Change Log 갱신
- docs/discovery/dcy-007: 생성된 REQ 참조 업데이트

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-18 16:07:33 +09:00
genichinandClaude Opus 4.8 b3186f14a0 docs(dcy-007): confirm-discovery — daily trade history + realized PnL API
일일 거래내역(GET /trades) + 실현 PnL(GET /pnl/realized) 조회 API.
운영 모니터링 목적으로 issue #11에서 제기된 필요성.
사장님 결정: OQ-1 실현 PnL=weighted average cost(WAC),
OQ-2 전체 portfolio 집계=Out of Scope.
상태 confirmed, Ready for REQ Drafting: true.
M1(6/22) fast-track 대상.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHtM5Ws1HKCKQ4JGi6GRb5
2026-06-18 15:58:54 +09:00
63e4ceffac docs: REL-001 라이브 스모크 evidence 귀속 (trex-op 2026-06-16) (#13)
- [x] ④ legacy buy Deprecation 헤더: HTTP 200 + deprecation:true 확인
- [x] ⑤ ledger/trades 신규: HTTP 201 + cash_balance_after(-63296.1) + asset_quantity_after(1.0)
- [x] ⑥ idempotency duplicate: HTTP 200 + status=duplicate + ledger_entry_id 42 재반환
- [blocked] ③ 태그 mutation: v1_tags token_source guard로 차단, DB bootstrap 미설정
  → Feedback Handoff Discovery Input 이관

Co-authored-by: trex-dev-b <trex-dev-b@trex-team.internal>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 16:41:49 +09:00
de05728edf docs: REL-001 draft→released 정합 (배포 사실 귀속, 검증 처리) (#12)
- Status: draft → released
- Deployment Facts: 코드 6b812b6 + 문서 50beba3, 2026-06-14 13:09 KST, trex-op
- Alembic 마이그레이션: 로그 미보존, health db_enabled:true + 엔드포인트 200으로 적용 확인
- 검증 ①: trex-core cross-repo pending (dev-a/trex-core REL-008 확인 대기)
- 검증 ②: BAT-016 staging dry-run moot (prod 2일+ 가동 성공)
- 검증 ③④⑤⑥: 라이브 스모크 절차 정의 (trex-op 실행 대기)
- Startup/Request Log: 미보존, post-release feedback Discovery Input 이관
- releases/index.md: draft → released

Co-authored-by: trex-dev-b <trex-dev-b@trex-team.internal>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 16:27:03 +09:00
genichinandClaude Opus 4.8 50beba3ff6 docs: fold issue #9 user_info hotfix into REL-001 scope + 2026-06-06 smoke
- Add issue #9 hotfix (GET /v1/user_info 500 on missing broker_credentials) to
  REL-001 Included scope + Revision (6b812b6 as integrated main HEAD).
- Add post-deploy smoke item for /v1/user_info 200 + daemon_id (local verified).
- Record 2026-06-06 local verification: ledger_trades absent / portfolio_ledger
  consolidated schema, legacy buy/sell OpenAPI deprecated, full suite 377 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 17:51:30 +09:00