refactor: CB 게이지 pnl_pct 저장 레이어를 L7 → L6_DAILY로 변경
Some checks failed
CI / test (pull_request) Has been cancelled
Some checks failed
CI / test (pull_request) Has been cancelled
portfolio_pnl_pct는 일별 성과 지표이므로 실시간 종목 데이터(L7)보다 일별 P&L 레이어(L6_DAILY)가 더 적합함. (PR #197 코드리뷰 반영) - main.py: L7_REALTIME + ISO timestamp → L6_DAILY + date(YYYY-MM-DD) - app.py: contexts 쿼리 layer/timeframe 조건 동기화 - tests: _seed_cb_context L6_DAILY + today 날짜로 수정 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -85,11 +85,13 @@ def create_dashboard_app(db_path: str) -> FastAPI:
|
||||
"""
|
||||
SELECT key, value
|
||||
FROM contexts
|
||||
WHERE layer = 'L7_REALTIME'
|
||||
WHERE layer = 'L6_DAILY'
|
||||
AND timeframe = ?
|
||||
AND key LIKE 'portfolio_pnl_pct_%'
|
||||
ORDER BY updated_at DESC
|
||||
LIMIT 20
|
||||
"""
|
||||
""",
|
||||
(today,),
|
||||
).fetchall()
|
||||
current_pnl_pct: float | None = None
|
||||
if pnl_pct_rows:
|
||||
|
||||
Reference in New Issue
Block a user