From b774e40678b59e3af065c0010d61d7d49cbed94c Mon Sep 17 00:00:00 2001 From: Justin Ko Date: Fri, 5 Jun 2026 22:49:10 +0900 Subject: [PATCH] docs: consolidate REL-001 scope across BAT-001~016 - fold BAT-015 and BAT-016 into REL-001 release scope - mark split REL-002 and REL-003 plans as superseded in discovery docs - update release and batch indexes to match the unified release plan - expand REL-001 rollout, rollback, verification, and evidence notes --- docs/batches/index.md | 2 +- ...y-005_20260601_rel-001-feedback-cleanup.md | 1 + ...dger-trade-write-portfolio-state-return.md | 2 +- docs/releases/index.md | 2 +- .../rel-001_20260521_v1-api-full-surface.md | 65 +++++++++++++------ 5 files changed, 48 insertions(+), 24 deletions(-) diff --git a/docs/batches/index.md b/docs/batches/index.md index 9d46948..e868227 100644 --- a/docs/batches/index.md +++ b/docs/batches/index.md @@ -8,7 +8,7 @@ | BAT ID | Profile | Status | Included REQ | Discovery | Folder | | --- | --- | --- | --- | --- | --- | -| BAT-001 | standard | verified | REQ-009, REQ-011, REQ-014 | dcy-001 | [bat-001](./bat-001_20260519_asset-catalog-db-foundation/) | +| BAT-001 | standard | release-candidate | REQ-009, REQ-011, REQ-014 | dcy-001 | [bat-001](./bat-001_20260519_asset-catalog-db-foundation/) | | BAT-002 | standard | release-candidate | REQ-010, REQ-012, REQ-013, REQ-015 | dcy-001 | [bat-002](./bat-002_20260519_asset-catalog-api-completion/) | | BAT-003 | standard | release-candidate | REQ-001, REQ-002, REQ-003, REQ-006 | dcy-002 | [bat-003](./bat-003_20260519_tags-db-foundation/) | | BAT-004 | standard | release-candidate | REQ-004, REQ-005 | dcy-002 | [bat-004](./bat-004_20260520_tags-http-api/) | diff --git a/docs/discovery/dcy-005_20260601_rel-001-feedback-cleanup.md b/docs/discovery/dcy-005_20260601_rel-001-feedback-cleanup.md index ce8326a..a70cad8 100644 --- a/docs/discovery/dcy-005_20260601_rel-001-feedback-cleanup.md +++ b/docs/discovery/dcy-005_20260601_rel-001-feedback-cleanup.md @@ -141,6 +141,7 @@ - 결정: 별도 **REL-002**로 분리. REL-001은 현 상태(BAT-001~014 + REQ-028 augmentation, verification 완료, smoke 통과)로 배포 진행. dcy-005 3건은 신규 batch(BAT-015 가정) + REL-002로 분리해 sequence를 명확히 한다. - 사유: REL-001 verification 안정성 최우선, 마이그레이션 sequence 분리, dcy-005가 "REL-001 잔여 정리" 묶음 trigger로 독립 추적 가치. REL-001 verification gap(`/health db_enabled` 미노출 [~] 부분 통과)은 우회 검증으로 blocker 아님. - 본문 반영: # 1 해석, # 3 제약사항, # 10 DECIDE 섹션에서 항목 제거 + - **Superseded (2026-06-05)**: 사용자 결정으로 미배포 batch 전체(BAT-001~016)를 단일 REL-001로 통합 → 별도 REL-002는 생성하지 않음. BAT-015는 REL-001에 흡수. ([rel-001](../releases/rel-001_20260521_v1-api-full-surface.md) Scope 통합 노트) ### 오픈 질문 처리 기준 - `Open`: 아직 답이 없고 다음 단계 진행에 영향이 있는 상태다. 문서에 유지한다. diff --git a/docs/discovery/dcy-006_20260605_ledger-trade-write-portfolio-state-return.md b/docs/discovery/dcy-006_20260605_ledger-trade-write-portfolio-state-return.md index 95cd631..f7ecbcb 100644 --- a/docs/discovery/dcy-006_20260605_ledger-trade-write-portfolio-state-return.md +++ b/docs/discovery/dcy-006_20260605_ledger-trade-write-portfolio-state-return.md @@ -191,7 +191,7 @@ - A-1: portfolio.cash_balance / asset_quantity는 ground truth이고 trex-core는 portfolio-hub 값을 신뢰한다(issue 본문 명시). - A-2: 본 워크스페이스는 개발용이며 prod race condition / 트랜잭션 격리 / 마이그레이션 정밀도 검증은 release 단계에서 별도 수행. workspace_purpose 메모리 정합. - A-3: 외부 ledger 호출자(trex-basic 등)는 응답 schema 확장에 backwards-compat 호환된다(JSON parser가 추가 필드 무시). -- A-4: 본 Discovery 결과물은 BAT-015(release-candidate)와 분리된 새 batch + 별도 release(REL-003 등)로 분리한다 — REL-001/REL-002 일정과 충돌 회피. **사용자 confirm-discovery(2026-06-05)로 동의 확정**. +- A-4: 본 Discovery 결과물은 BAT-015(release-candidate)와 분리된 새 batch + 별도 release(REL-003 등)로 분리한다 — REL-001/REL-002 일정과 충돌 회피. **사용자 confirm-discovery(2026-06-05)로 동의 확정**. **Superseded (2026-06-05)**: 이후 사용자 결정으로 미배포 batch 전체(BAT-001~016)를 단일 REL-001로 통합 → 별도 REL-003 미생성, BAT-016은 REL-001에 흡수. ([rel-001](../releases/rel-001_20260521_v1-api-full-surface.md) Scope 통합 노트) ## 오픈 질문 답을 아직 모르는 항목을 적는다. 추정으로 덮지 말고 REQ 초안 작성 이전에 확인할 질문으로 남긴다. diff --git a/docs/releases/index.md b/docs/releases/index.md index 232041e..a8eaa16 100644 --- a/docs/releases/index.md +++ b/docs/releases/index.md @@ -8,4 +8,4 @@ | REL ID | Profile | Status | Included Batch | Date | Doc | | --- | --- | --- | --- | --- | --- | -| REL-001 | app-service | draft | BAT-001~013 | 2026-05-21 | [rel-001](./rel-001_20260521_v1-api-full-surface.md) | +| REL-001 | app-service | draft | BAT-001~016 (전체 통합) | 2026-05-21 | [rel-001](./rel-001_20260521_v1-api-full-surface.md) | diff --git a/docs/releases/rel-001_20260521_v1-api-full-surface.md b/docs/releases/rel-001_20260521_v1-api-full-surface.md index f41bfbb..e61364e 100644 --- a/docs/releases/rel-001_20260521_v1-api-full-surface.md +++ b/docs/releases/rel-001_20260521_v1-api-full-surface.md @@ -1,8 +1,10 @@ -# REL-001: v1 API full surface +# REL-001: v1 API full surface + ledger accounting consolidation - Status: draft - Profile: app-service -- Included Batch: BAT-001, BAT-002, BAT-003, BAT-004, BAT-005, BAT-006, BAT-007, BAT-008, BAT-009, BAT-010, BAT-011, BAT-012, BAT-013, REQ-028 CHG-20260601-01 (BAT-009 augmentation, no separate batch) +- Included Batch: BAT-001, BAT-002, BAT-003, BAT-004, BAT-005, BAT-006, BAT-007, BAT-008, BAT-009, BAT-010, BAT-011, BAT-012, BAT-013, BAT-014, BAT-015, BAT-016, REQ-028 CHG-20260601-01 (BAT-009 augmentation, no separate batch) + +> **Scope 통합 (2026-06-05)**: 아직 released 되지 않은 모든 batch(BAT-001~016)를 단일 release로 통합. 이로써 dcy-005 OQ-3(BAT-015용 REL-002 분리)와 dcy-006 A-4(BAT-016용 REL-003 분리) 결정은 **superseded** — 별도 REL-002/REL-003은 생성하지 않고 본 REL-001로 흡수한다. 외부 의존성(trex-basic 신 ledger path + trex-core 신 응답 명세)이 단일 배포에 결합됨에 유의(Rollout Plan 참조). ## Scope - Included: @@ -20,21 +22,30 @@ - BAT-012 (REQ-002 재정의, REQ-010 augmentation): assets.tag_ids UUID[] 컬럼 + idx_assets_tag_ids_gin + GET /v1/assets admin catalog 재정의(token_type 분기 제거) + AssetCatalogResponse tag_ids/archived 합성. 기존 smoke의 GET /v1/assets 403 불일치를 해소. - BAT-013 (REQ-005 CHG-20260521-02): `POST/DELETE /v1/assets/{asset_id}/tags` 라우트 SQL 대상 정합화 — `append_asset_tag_id`/`remove_asset_tag_id` 메서드 신규 + 라우트 호출 교체. BAT-012로 도입된 `assets.tag_ids` 컬럼이 비로소 정상 채워지도록 apply/remove 경로 정합화. HTTP contract·DB 스키마 무변. - REQ-028 CHG-20260601-01 (BAT-009 augmentation): GET /v1/portfolios 응답 schema에 `display_name` 필드 추가. `Portfolio` dataclass + `PortfolioItem` schema + `_SELECT_PORTFOLIO` JOIN `a.display_name` 보강. AC-13 신설, 368 passed 회귀, 로컬 smoke로 응답 노출 확인. 별도 BAT 미할당(BAT-009 verification 재실행 누적). + - BAT-014 (REQ-025/026/027/028/032 재검증): `PortfolioItem.symbol` 응답 계약 명문화 + `GET /v1/portfolios`의 asset join 기반 응답(`portfolios JOIN assets` → `assets.symbol`). trex-orbit 팀 이슈 후속. + - BAT-015 (REQ-033/034/035, dcy-005): `ledger_trades.asset_id` → `portfolio_id` 컬럼명 정합화(마이그레이션 `20260601_0024`) + `LoginRequest` extra="forbid"(session no_expiry 거부) + `GET /health` 응답에 `db_enabled` 필드 추가 + runtime-flows baseline 갱신. + - BAT-016 (REQ-036/037/038, dcy-006): ledger 회계 책임 단일화 — `POST /v1/portfolios/{id}/ledger/trades`가 portfolio cash/quantity를 트랜잭션 갱신하고 응답에 `cash_balance_after`/`asset_quantity_after` 반환. `portfolio_ledger`/`ledger_trades` 단일 원장 통합(마이그레이션 `20260605_0025`, ledger_trades DROP) + 레거시 buy/sell deprecated 표기. idempotency는 hypertable 제약으로 application-level(SELECT-before-insert under FOR UPDATE)로 구현(REQ-036/037 CHG-20260605-03). 실 DB 통합 테스트 포함 376 passed. - Excluded: - REQ-013 (Deprecated): GET /v1/assets 토큰 타입별 분기 재정의 — dcy-003 옵션 B 결정으로 무효화 - - trex-basic 내부 코드 변경 (별도 레포 — 본 릴리즈와 동시 배포 필요) + - trex-basic 내부 코드 변경 (별도 레포 — 본 릴리즈와 동시 배포 필요: 신 ledger path) + - trex-core(slot-core) 내부 코드 변경 (별도 레포 — BAT-016 신 응답 명세 채택 필요. issue #8 comment로 명세 공유됨) + - 레거시 `POST /portfolios/{id}/buy`·`/sell` 실제 제거 (BAT-016은 deprecated 표기만, 코드 제거는 후속 트랙) ## Rollout Plan -1. **사전 확인**: trex-basic 신 path(`POST /v1/portfolios/{id}/ledger/trades`) 빌드 완료 및 배포 준비 확인 -2. **DB 마이그레이션**: `alembic upgrade head` — BAT-001/003/006/007/012 관련 revision 순차 적용 - - assets 테이블, portfolios.asset_id FK, tags 마스터, portfolios.tag_ids 컬럼, **assets.tag_ids 컬럼 + idx_assets_tag_ids_gin (20260521_0023)**, auth_tokens.runtime_id/daemon_id, daemons 테이블, ledger_trades +1. **사전 확인**: trex-basic 신 path(`POST /v1/portfolios/{id}/ledger/trades`) 빌드 완료 + **trex-core(slot-core) 신 응답 명세(`cash_balance_after`/`asset_quantity_after`) 채택 빌드 완료** 확인 +2. **DB 마이그레이션**: `alembic upgrade head` — 전 revision 순차 적용 (head = `20260605_0025`) + - BAT-001/003/006/007/012: assets 테이블, portfolios.asset_id FK, tags 마스터, portfolios/assets.tag_ids 컬럼 + GIN, auth_tokens.runtime_id/daemon_id, daemons, ledger_trades + - BAT-015: `20260601_0024` — ledger_trades.asset_id → portfolio_id rename + - **BAT-016: `20260605_0025` — portfolio_ledger 통합(broker 컬럼 order_id/execution_id NULL + side + executed_at + ledger_entry_id Identity, DOUBLE→NUMERIC(20,8), action→side) + `ledger_trades` DROP**. ⚠ `portfolio_ledger`는 TimescaleDB hypertable이라 partial unique index/PK 불가 — idempotency는 application layer. ⚠ ensure_schema가 이미 실행된 환경은 alembic 경로와 충돌 가능(개발 DB 한정, prod fresh-DB는 정상). prod 적용 전 staging dry-run 필수. 3. **portfolio-hub 서비스 배포**: 신규 이미지 rolling restart - - 신 API surface: `/v1/portfolios/*`, `/v1/tags`, `/v1/assets` (catalog), `/v1/portfolios/{id}/ledger/trades` + - 신 API surface: `/v1/portfolios/*`, `/v1/tags`, `/v1/assets` (catalog), `/v1/portfolios/{id}/ledger/trades`(회계 동반) - 구 path `/v1/assets/{id}/ledger/trades` → HTTP 404 (BAT-011) - - `POST/DELETE /v1/assets/{id}/tags` 내부 SQL이 `assets` 테이블 대상으로 정합화됨 (BAT-013) — HTTP contract 무변, DB 스키마 무변 -4. **trex-basic 배포**: 신 path로 전환된 클라이언트 배포 - - **이 단계가 완료되기 전까지 구 path 호출 불가 — portfolio-hub 배포 후 즉시 trex-basic 배포 수행** -5. **배포 후 smoke 검증**: health endpoint + 신 path 동작 확인 + - `GET /health` 응답에 `db_enabled` 노출 (BAT-015 REQ-035) + - 레거시 `POST /portfolios/{id}/buy`·`/sell` → `Deprecation: true` 헤더 + OpenAPI deprecated (BAT-016 REQ-038, 동작 보존) +4. **trex-basic 배포 + trex-core 배포**: 신 path/신 응답 명세로 전환된 클라이언트 배포 + - **trex-basic**: portfolio-hub 배포 후 즉시 — 구 path 호출 불가 + - **trex-core**: ledger write 응답으로 스냅샷 갱신(drift 방지) — 신 응답 명세 채택 버전. 미채택 시 write 직후 read 우회로 동작(degraded, 하지만 호환은 유지 — 비파괴 응답 확장) +5. **배포 후 smoke 검증**: health(db_enabled) + 신 path 회계 동작(cash_balance_after) + 레거시 deprecated 헤더 확인 ## Rollback Plan - **트리거 조건**: portfolio-hub 배포 후 health 실패, 신 API 500/401 대규모 발생, trex-basic 배포 실패 @@ -43,13 +54,16 @@ 2. trex-basic → 구 path 사용 버전으로 동반 롤백 (portfolio-hub 롤백 완료 후) - **BAT-011 단독 부분 롤백 불가** — 신/구 path 동시 서빙은 설계상 없음 - **DB 마이그레이션 롤백**: 데이터 손실 리스크를 평가한 뒤 DBA 판단 하에 수행. tag_ids 컬럼(portfolios/assets 양쪽)·ledger_trades·daemons 테이블은 마이그레이션 downgrade 시 데이터 소실 가능성 존재 — 사전 DB 스냅샷 필수. assets.tag_ids(20260521_0023) downgrade는 컬럼·인덱스 drop으로 안전. +- **BAT-016 마이그레이션(20260605_0025) 롤백 주의**: downgrade는 `ledger_trades` 테이블 재생성 + portfolio_ledger broker 컬럼 drop + action 컬럼 복원이나, DROP된 `ledger_trades` 데이터는 복구 불가하고 NUMERIC→DOUBLE 정밀도 변환·side→action 복원에 손실 가능. 본 통합 release의 ledger 부분 롤백은 DB 스냅샷 복원으로 처리 권장. trex-core도 구 응답 의존 버전으로 동반 롤백. ## Verification Checklist - **배포 전**: - [x] trex-basic 신 path 빌드 완료 확인 - [x] DB 스냅샷(백업) 생성 완료 - [x] `alembic upgrade head` dry-run 또는 revision 목록 점검 - - [x] 전체 테스트 suite pass 확인 (BAT-001~011: 340 passed @ main 4bf6b55; BAT-012 추가 후: 362 passed @ 2026-05-21 BAT-012 confirm-batch-verification; BAT-013 추가 후: **369 passed @ 2026-05-21 BAT-013 confirm-batch-verification** — +7 신규 회귀: assets 테이블 mutation 정합성 검증) + - [x] 전체 테스트 suite pass 확인 (BAT-001~011: 340 passed @ main 4bf6b55; BAT-012: 362; BAT-013: 369; BAT-015: 372; **BAT-016: 376 passed @ 2026-06-05** — 실 DB ledger 통합 테스트 3건 포함. main HEAD `2a19b7f`) + - [ ] **trex-core 신 응답 명세 채택 빌드 완료 확인** (BAT-016 — 별도 레포) + - [ ] **BAT-016 마이그레이션 staging dry-run**: `20260605_0025` fresh-DB 적용 + DOUBLE→NUMERIC 정밀도 + action 분포 매핑 확인 (개발 DB는 ensure_schema 선적용으로 검증 불가 — staging 필수) - **배포 직후 (portfolio-hub)**: - [~] `GET /health` → HTTP 200 + `db_enabled: true` (DB 연결 정상) — **로컬 smoke (2026-05-21 17:08 KST)**: HTTP 200 응답, 단 `HealthResponse` 모델([app/api/health.py:17-21](app/api/health.py#L17-L21))에 `db_enabled` 필드 미노출. DB 연동은 `PORTFOLIOHUB_DB_ENABLED=true` + `alembic upgrade head` head revision 적용 + 본 smoke의 다른 항목들이 DB 의존 동작으로 통과한 것으로 우회 확인. - [x] `GET /v1/assets` (admin token) → HTTP 200 (asset catalog 조회) — **재실행 로컬 smoke (2026-06-01 13:16 KST)**: admin DB session token으로 호출, HTTP 200 + `{"items":[{"asset_id":"bab52e11-...","symbol":"005930","display_name":"삼성전자","status":"active","tag_ids":[],...}],"total":1}` catalog 응답 확인. REQ-010 CHG-20260521-02 augmentation + BAT-012/013 verification 정합. portfolio 관련 필드 미포함, AC-9 충족. (이전 2026-05-21 smoke에서 HTTP 403 발생했던 불일치는 해소.) @@ -58,8 +72,14 @@ - [x] **(추가)** `GET /v1/portfolios` (session token) → HTTP 200 + 응답 portfolio item에 `display_name` 필드 포함 — **재실행 로컬 smoke (2026-06-01 13:18 KST)**: admin DB session token으로 호출, portfolios 2건 모두 `display_name:"삼성전자"` (joined `assets.display_name`)로 응답. REQ-028 CHG-20260601-01 AC-13 충족. - [ ] `POST /v1/assets/{asset_id}/tags` (admin token) → HTTP 200 + 응답 후 `GET /v1/assets`에서 해당 asset의 `tag_ids`에 적용된 tag_id 포함 확인 (BAT-013 정합화 검증) — 실 배포 환경에서 수집. unit-level은 cursor-mock SQL 검증으로 1차 안전망 확보. - [ ] `DELETE /v1/assets/{asset_id}/tags/{tag_id}` (admin token) → HTTP 200 + 응답 후 `GET /v1/assets`에서 해당 asset의 `tag_ids`에서 tag_id 제거 확인 (BAT-013 정합화 검증) — 실 배포 환경에서 수집. -- **trex-basic 배포 직후**: + - [ ] **(BAT-015)** `GET /health` → 응답 본문에 `db_enabled: true` 포함 (REQ-035 — 응답 모델 확장 확인; 위 db_enabled 미노출 [~] 항목 해소) + - [ ] **(BAT-015)** `POST /auth/login` body에 `no_expiry: true` → HTTP 422 (REQ-034 extra="forbid") + - [ ] **(BAT-016)** 레거시 `POST /portfolios/{id}/buy` → 응답 헤더 `Deprecation: true` (REQ-038) +- **trex-basic / trex-core 배포 직후**: - [ ] `POST /v1/portfolios/{id}/ledger/trades` (service token) → HTTP 201 + `status="new"` (신 path 동작 확인) + - [ ] **(BAT-016)** 위 응답 본문에 `cash_balance_after`/`asset_quantity_after` 포함 + 거래 반영 후 portfolio 잔고 갱신 확인 (REQ-037) + - [ ] **(BAT-016)** 같은 (portfolio_id, order_id, execution_id) 재호출 → HTTP 200 + `status="duplicate"` + 현재 권위 상태 반환, ledger row 재생성 없음 + - [ ] **(BAT-016)** `ledger_trades` 테이블 부재 + portfolio_ledger 단일 원장 확인 - [ ] daemon assignment 인가 3단계 정상 동작 확인 ## Release Execution Evidence @@ -75,11 +95,12 @@ - Operator: - (배포 수행자 — 배포 시 기록) - Revision or Artifact: - - main branch commit: `4bf6b55` (feat: v1 portfolio mutation, sub-resources, ledger path migration BAT-008~011) - - + BAT-012 commit: `9038f41` (feat: REQ-002/REQ-010 implementation — assets.tag_ids column + GET /v1/assets admin catalog) - - + BAT-013 commit: (assets 테이블 tag apply/remove SQL 정합화 — 본 release 진입 시 commit hash 기록) + - main branch commit: `4bf6b55` (BAT-008~011), `9038f41` (BAT-012), `58899b1` (BAT-013) + - BAT-014: `136ae16` (PortfolioItem symbol response contract) + - BAT-015: `2470c0a`/`84de34c` (rel-001 feedback cleanup — ledger rename, login extra=forbid, health db_enabled) + - **BAT-016: `2a19b7f` (ledger accounting consolidation + idempotency fix)** — 본 통합 release의 main HEAD - Commands or Procedure: - - `alembic upgrade head` → portfolio-hub rolling restart → trex-basic 배포 + - `alembic upgrade head`(head `20260605_0025`) → portfolio-hub rolling restart → trex-basic + trex-core 배포 ### Profile-Specific Checks - app-service: @@ -119,10 +140,12 @@ - Observation Summary: - (운영 관찰 후 기록) - Discovery Input: - - ledger_trades.asset_id 컬럼명이 portfolio_id를 가리키는 혼용 상태 잔존 (REQ-029 Notes) — 컬럼명 정합화 후속 REQ 후보 - - session token의 no_expiry 코드 enforcement 미구현 (REQ-021 follow-up) — 후속 REQ 후보 - - ~~**GET /v1/assets token_type 게이트와 admin catalog 재정의 미정합**~~: **Resolved by BAT-012** (2026-05-21). REQ-010 CHG-20260521-02 augmentation(AC-9~12)을 BAT-012에서 구현 — GET /v1/assets가 `require_admin` 의존성으로 단일화되고 admin catalog 응답을 반환. session token이 admin permission을 가진 경우 정상 통과. 자동 회귀 9건 추가(test_get_v1_assets_*). - - **/health 응답 모델에 `db_enabled` 필드 부재**: 운영 관점에서 health probe 결과로 DB 연결 상태를 외부 관찰자에게 노출하지 않는 상태. 체크리스트의 의도와 응답 모델 간 gap. `HealthResponse`([app/api/health.py:17-21](app/api/health.py#L17-L21)) 보강 또는 별도 readiness endpoint 분리 후보. + - ~~ledger_trades.asset_id 컬럼명 혼용~~: **Resolved by BAT-015** (REQ-033, dcy-005) — `portfolio_id`로 rename. 본 통합 release에 포함. + - ~~session token no_expiry 코드 enforcement 미구현~~: **Resolved by BAT-015** (REQ-034, dcy-005) — `LoginRequest` extra="forbid". 본 통합 release에 포함. + - ~~**GET /v1/assets token_type 게이트와 admin catalog 재정의 미정합**~~: **Resolved by BAT-012** (2026-05-21). REQ-010 CHG-20260521-02 augmentation(AC-9~12). 자동 회귀 9건. + - ~~**/health 응답 모델에 `db_enabled` 필드 부재**~~: **Resolved by BAT-015** (REQ-035, dcy-005) — `HealthResponse`에 `db_enabled` 추가 + runtime-flows 명문화. 본 통합 release에 포함. + - **ledger_trades.asset_id 컬럼이 회계 잔고를 추적하지 않던 audit-only 결함**: **Resolved by BAT-016** (REQ-036/037, dcy-006) — portfolio_ledger 단일 회계 원장 통합 + 신 path 회계 책임. 본 통합 release에 포함. + - **잔여**: 레거시 `POST /portfolios/{id}/buy`·`/sell` 실제 제거(BAT-016은 표기만) + `pfhub tag apply/remove` CLI mismatch — 후속 Discovery 후보. - ~~**`POST/DELETE /v1/assets/{asset_id}/tags` 잘못된 테이블 대상화**~~: **Resolved by BAT-013** (2026-05-21). REQ-005 CHG-20260521-02 (AC-1/AC-5 명문화) + CHG-20260521-03 (Implemented 전환). `PostgresPortfolioRepository.append_asset_tag_id`/`remove_asset_tag_id` 메서드 신규 + 라우트([app/api/v1_assets.py:175,200](../../app/api/v1_assets.py#L175))의 호출 교체. 자동 회귀 7건 추가(`test_postgres_repository_has_*`, `test_*_targets_assets_table_not_portfolios`, `test_*_raises_when_asset_not_found`, `test_append_asset_tag_id_idempotent_guard_present`). 실 PostgreSQL `assets.tag_ids` mutation 검증은 본 release 배포 직후 smoke 항목으로 추가됨. - **`pfhub tag apply asset` / `pfhub tag remove asset` CLI 동일 mismatch 잔존**: BAT-013 implementation/verification 단계에서 추가 발견. CLI 측도 `repo.append_portfolio_tag_id`/`repo.remove_portfolio_tag_id`를 호출하여 portfolios 테이블을 대상화 ([docs/runtime-flows.md:67-77](../runtime-flows.md#L67-L77)). REQ-005 본 batch scope는 HTTP API에 한정. **REQ-007/008 augmentation 또는 신규 REQ 후보**. - REQ Input: