# 대시보드 시스템뷰 — 와치독 로그 섹션 추가

## Lv.1 작업

## 요구사항
시스템뷰 탭에 "와치독" 섹션을 추가하여, 세션 와치독 로그를 실시간 확인 가능하게 함.

### 표시 정보
1. **와치독 상태**: timer active/inactive, 마지막 실행 시각, 다음 실행 시각
2. **최근 로그**: session-watchdog.service의 최근 journalctl 출력 (최대 50줄)
3. **이력 요약**: 오늘 실행 횟수, STALLED 감지 횟수, 재위임 횟수

### 서버 API
`/api/system/watchdog` (GET)

```python
{
    "timer_active": true,
    "last_run": "2026-04-13T10:29:13",
    "next_run": "2026-04-13T10:31:12",
    "logs": [
        "[2026-04-13 10:29:13] checking task-1772.1...",
        "[2026-04-13 10:29:13] heartbeat OK (2s ago)",
        ...
    ],
    "today_stats": {
        "total_runs": 45,
        "stalled_detected": 0,
        "redelegated": 0
    }
}
```

구현 방법:
- timer 상태: `systemctl --user show session-watchdog.timer --property=...`
- 로그: `journalctl --user -u session-watchdog.service --since today --no-pager -n 50`
- 이력: 로그에서 grep으로 STALLED/REDELEGATED 카운트

### UI
시스템뷰 탭에서 기존 섹션 아래에 접이식 "와치독" 섹션:

```
▼ 와치독
  ● 활성 (2분 주기)    마지막: 10:29:13    다음: 10:31:12
  오늘: 실행 45회 | STALLED 0건 | 재위임 0건
  
  ▼ 최근 로그 (접이식)
  [10:29:13] checking task-1772.1... heartbeat OK
  [10:27:13] checking task-1772.1... heartbeat OK
  [10:25:13] no active tasks
  ...
```

- 페이지 로드 시 1회 fetch + 수동 새로고침 버튼
- 로그는 최신순 (역순)

## 참조
- SystemView.js: `/home/jay/workspace/dashboard/components/SystemView.js`
- server.py: `/home/jay/workspace/dashboard/server.py`
- 와치독 스크립트: `/home/jay/workspace/scripts/session-watchdog.sh`
- systemd 서비스: `session-watchdog.timer`, `session-watchdog.service`

## 검증 시나리오
1. 대시보드 시스템뷰 → "와치독" 섹션 존재 확인
2. timer_active가 true로 표시
3. 최근 로그에 실제 journalctl 출력 표시
4. `curl http://localhost:8000/api/system/watchdog` → JSON 응답 확인
5. 로그 접이식 토글 동작 확인

## 수정 후
- 대시보드 재시작: `systemctl --user restart dashboard`

## 보고서
`/home/jay/workspace/memory/reports/task-{TASK_ID}.md`
