Files
portfolio-hub/docs/batches/bat-006_20260520_token-surface-code-fixes/index.md
T
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

2.7 KiB

BAT-006: token surface 코드 수정 (client 폐지 / rotate index 보강 / daemon_id forward 보정)

  • Status: released
  • Profile: standard
  • Source Discovery: dcy-004
  • Included REQ: REQ-016, REQ-017, REQ-018
  • Excluded REQ: (없음 — dcy-004 코드 수정 3건 전부 포함)

Summary

  • service token rotate 실 DB 실패 결함(REQ-017), HTTP daemon_id silently drop 결함(REQ-018), client token 발급 경로 코드 폐지(REQ-016) 세 가지 auth/token surface 코드 수정을 하나의 배치로 묶어 함께 배포한다.
  • 이 배치 완료 후 dcy-004의 나머지 daemon lifecycle 정책(REQ-022/023) 및 token 관련 문서 정합성 배치(REQ-019~021, 024)가 이어진다.

Scope

  • In Scope:
    • migrations/versions/ — 신규 Alembic revision (rotate unique index WHERE revoked_at IS NULL 조건 보강) (REQ-017)
    • app/repositories/postgres.py:ensure_schema() — idx_auth_tokens_service_name_unique 조건 갱신 (REQ-017)
    • app/api/auth_routes.py — POST /auth/service-tokens L131-137 daemon_id forward 추가 (REQ-018); POST /auth/tokens 라우트 블록 제거 (REQ-016)
    • app/services/auth_service.py — issue_client_token, client 관련 헬퍼 제거 (REQ-016)
    • app/schemas/auth.py — CreateClientTokenRequest, IssuedClientTokenResponse 제거 (REQ-016)
    • tests/test_service_token_rotate_integration.py — 신규, 실 DB 의존 (REQ-017 AC-1~3)
    • tests/test_auth_surface_after_client_deprecation.py — 신규 (REQ-016 AC-1/2/4)
    • tests/test_auth.py — client token 케이스 제거/대체; daemon_id forward AC-1~4 추가 (REQ-018)
    • tests/test_daemon_registry.py — rotate 신규 index 조건 회귀 확인 (REQ-017 AC-4)
  • Out of Scope:
    • daemon lifecycle 정책 변경 (→ REQ-022/023, 별도 배치)
    • token 관련 baseline 문서 갱신 (→ REQ-019, 별도 배치)
    • CLI service-token 동작 (변경 없음)

Documents

Notes

  • R-1 (High): REQ-017 CREATE INDEX CONCURRENTLY는 autocommit block 외부 실행 필요 — Alembic op.execute 직접 SQL + isolation_level="AUTOCOMMIT" 패턴
  • R-2 (Medium): REQ-016 코드 제거 전 release 직전 SELECT COUNT(*) FROM auth_tokens WHERE token_type='client' AND revoked_at IS NULL 재확인 필수 (현재 0건, release plan AC-3)
  • R-3 (Low): REQ-018 fix 후 기존 test_auth.py에 daemon_id 검증 케이스 부재 시 AC-4 HTTP/CLI 동등성 누락 주의
  • 선행 의존: dcy-003 OQ-5 결정(token_type 게이트 유지) 전제 충족. BAT-003~005 모두 release-candidate 상태로 tag 관련 의존 충족