feat: 대시보드 Circuit Breaker 게이지 추가 #196

Closed
opened 2026-02-21 21:11:04 +09:00 by agentson · 0 comments
Collaborator

배경

종합 논의 우선순위 4위 (WAL/인덱스는 #194에서 완료, 미구현 API 연결은 #196으로 별도 추적).
헤더에 CB 현황을 게이지로 표시하여 위험 수준을 즉시 파악할 수 있게 한다.

구현 내용

src/main.py

  • trading_cycle()의 L7 context 저장 블록에 portfolio_pnl_pct_{market} 키 추가
  • 대시보드가 최신 pnl_pct를 조회할 수 있게 됨

src/dashboard/app.py

  • /api/status 응답에 circuit_breaker 섹션 추가
    • threshold_pct: CIRCUIT_BREAKER_PCT 환경변수 (기본 -3.0)
    • current_pnl_pct: L7 context 최신 portfolio_pnl_pct_* 값
    • status: ok / warning(-2.0% 이하) / tripped(-3.0% 이하)

src/dashboard/static/index.html

  • 헤더에 CB 게이지 표시
    • 색상: ok=녹색, warning=오렌지, tripped=빨간
    • 진행 바: 0% ~ -3.0% 시각화

완료 기준

  • /api/status에 circuit_breaker 섹션 포함
  • 대시보드 헤더에 게이지 표시
  • 테스트 통과
## 배경 종합 논의 우선순위 4위 (WAL/인덱스는 #194에서 완료, 미구현 API 연결은 #196으로 별도 추적). 헤더에 CB 현황을 게이지로 표시하여 위험 수준을 즉시 파악할 수 있게 한다. ## 구현 내용 ### src/main.py - trading_cycle()의 L7 context 저장 블록에 portfolio_pnl_pct_{market} 키 추가 - 대시보드가 최신 pnl_pct를 조회할 수 있게 됨 ### src/dashboard/app.py - /api/status 응답에 circuit_breaker 섹션 추가 - threshold_pct: CIRCUIT_BREAKER_PCT 환경변수 (기본 -3.0) - current_pnl_pct: L7 context 최신 portfolio_pnl_pct_* 값 - status: ok / warning(-2.0% 이하) / tripped(-3.0% 이하) ### src/dashboard/static/index.html - 헤더에 CB 게이지 표시 - 색상: ok=녹색, warning=오렌지, tripped=빨간 - 진행 바: 0% ~ -3.0% 시각화 ## 완료 기준 - /api/status에 circuit_breaker 섹션 포함 - 대시보드 헤더에 게이지 표시 - 테스트 통과
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#196