# Phase 2 실행 계획: Evidence Verification (2026-11-01 ~ 11-15)

**목표:** PBO < 20%, DSR > 0.5, OOS < 2.5% 검증  
**전략:** AGENTS.md v16.0 기반 5팀 병렬 실행  
**상태:** 🟢 준비 중

---

## 🎯 실행 구조 (5 Independent Teams + 1 Coordinator)

```
Team PBO (PBO < 20%)
  └─ Task: 252+ day 데이터로 PBO 계산 & 검증
  └─ Owner: Quant 1
  └─ Deliverable: PBO_VERIFICATION_REPORT.md

Team DSR (DSR > 0.5)
  └─ Task: Daily Sharpe Ratio 누적 & 검증
  └─ Owner: Quant 2
  └─ Deliverable: DSR_VERIFICATION_REPORT.md

Team OOS (OOS < 2.5%)
  └─ Task: Out-of-Sample 드리프트 분석
  └─ Owner: Model Lead
  └─ Deliverable: OOS_VERIFICATION_REPORT.md

Team Audit (감시 로그 정상)
  └─ Task: operation_audit_trail 검증 (DEBT-014)
  └─ Owner: Compliance
  └─ Deliverable: AUDIT_VERIFICATION_REPORT.md

Team Debt (DEBT 20% 결제)
  └─ Task: DEBT-014/029/030/032 최종 정리
  └─ Owner: Architecture Lead
  └─ Deliverable: DEBT_PAYDOWN_REPORT.md

Coordinator (Integration)
  └─ Task: 모든 팀 결과 통합 + Go/No-Go 결정
  └─ Owner: Program Manager
  └─ Deliverable: PHASE_2_SIGN_OFF.md
```

---

## 📊 Task Breakdown (Day-by-Day)

### Week 1 (2026-11-01 ~ 11-07)

#### Day 1-2 (11-01 ~ 11-02): 데이터 수집 & 검증

```
All Teams:
□ Phase 1 최종 데이터 확보
□ CSV 내보내기 (Phase 1 52-week 메트릭)
□ 데이터 형식 검증 (null, range 체크)

Coordinator:
□ 팀별 데이터 수신 확인
□ 데이터 통합 (master dataset)
□ Baseline 설정 (comparison 용)
```

**산출물:**
- Phase_1_Raw_Data.csv (master)
- Data_Validation_Report.md (품질 검증)

---

#### Day 3-5 (11-03 ~ 11-05): 개별 검증 (병렬)

**Team PBO:**
```sql
-- Task 1: Phase 1 종료 시점 PBO 계산
SELECT 
  PBO_value,
  Confidence_Interval,
  Pass_Threshold_20_percent
FROM phase_1_metrics
WHERE metric_type = 'PBO'
  AND calculated_date >= DATE_SUB(NOW(), INTERVAL 52 WEEK)
ORDER BY calculated_date DESC
LIMIT 1;

-- Task 2: PBO 공식 검증 (문서화)
-- Formula: PBO = 1 - (OOS_Sharpe / In_Sample_Sharpe) confidence
-- Threshold: < 20% (low overfit probability)

-- Task 3: 결과 해석
VERDICT: PBO < 20% ?
  YES → PASS (Phase 3 진행)
  NO → FAIL (모델 재조정 필요)
```

**Team DSR:**
```sql
-- Task 1: 252일 누적 DSR 계산
SELECT 
  SUM(daily_return * daily_return) / COUNT(*) AS DSR,
  STDDEV(daily_return) AS Volatility,
  Pass_Threshold_0_5
FROM phase_1_returns
WHERE trading_date >= DATE_SUB(NOW(), INTERVAL 52 WEEK)
GROUP BY 1;

-- Task 2: 월별 추이 분석
SELECT 
  DATE_TRUNC(trading_date, MONTH) AS Month,
  DSR_Monthly
FROM phase_1_metrics
WHERE metric_type = 'DSR'
ORDER BY Month;

-- Task 3: 리스크 조정 성과 검증
VERDICT: DSR > 0.5 ?
  YES → PASS
  NO → FAIL (수익성 재평가)
```

**Team OOS:**
```sql
-- Task 1: In-Sample vs Out-of-Sample 비교
SELECT 
  'In-Sample' AS Type,
  Sharpe_Ratio,
  Performance
FROM phase_1_baseline
UNION ALL
SELECT 
  'Out-of-Sample',
  OOS_Sharpe_Ratio,
  OOS_Performance
FROM phase_1_results;

-- Task 2: 일일 드리프트 계산
SELECT 
  trading_date,
  (OOS_Performance - IS_Performance) / IS_Performance AS Daily_Drift_Pct
FROM phase_1_metrics
ORDER BY trading_date;

-- Task 3: 드리프트 통계
VERDICT: Max_Drift < 2.5% ?
  YES → PASS
  NO → FLAG (성능 악화)
```

**Team Audit:**
```sql
-- Task 1: operation_audit_trail 데이터 분석
SELECT 
  event_type,
  COUNT(*) AS Event_Count,
  COUNT(DISTINCT correlation_id) AS Unique_Correlations
FROM compliance.operation_audit_trail
WHERE published_at >= DATE_SUB(NOW(), INTERVAL 52 WEEK)
GROUP BY event_type;

-- Task 2: 중복 감지 로그 분석
SELECT 
  COUNT(*) AS Duplicate_Events,
  COUNT(*) / (SELECT COUNT(*) FROM compliance.operation_audit_trail) * 100 AS False_Positive_Rate
FROM compliance.operation_audit_trail
WHERE event_type = 'DUPLICATE_DETECTED'
  AND published_at >= DATE_SUB(NOW(), INTERVAL 52 WEEK);

-- Task 3: 감시 검증
VERDICT: False_Positive_Rate < 0.1% ?
  YES → PASS (시스템 안정)
  NO → FLAG (감지 알고리즘 검토)
```

**Team Debt:**
```
Task 1: DEBT 현황 정리
□ DEBT-014: ✅ Complete
□ DEBT-029: ✅ Complete
□ DEBT-030: ✅ Complete
□ DEBT-032: ✅ Complete
Total Paydown: 275% ✅ (Target: 20%)

Task 2: 미결제 DEBT 식별
□ 다른 미결제 항목 있는가?
□ 있으면 Priority 부여

Task 3: DEBT 문서 정리
VERDICT: All DEBT accounted for ?
  YES → PASS
  NO → Add to Next Quarter
```

**병렬 실행 예상 시간:**
- Day 3: 데이터 준비
- Day 4: 계산 실행
- Day 5: 결과 검증

---

#### Day 6-7 (11-06 ~ 11-07): 개별 보고서 작성

**각 팀:**
```markdown
# {Team}_VERIFICATION_REPORT.md

## Executive Summary
- Metric: PBO/DSR/OOS
- Target: < 20% / > 0.5 / < 2.5%
- Result: ✅ PASS / ❌ FAIL
- Confidence: 95%+

## Methodology
- Data source: Phase 1 (52 weeks)
- Calculation: [공식]
- Validation: [재현 방법]

## Results
[상세 데이터 + 그래프]

## Recommendation
- Go/No-Go: YES/NO
- Risk factors: [식별된 위험]
- Mitigation: [필요시 조치]

## Approval
- Reviewer: [이름]
- Date: 2026-11-07
- Signature: [승인]
```

---

### Week 2 (2026-11-08 ~ 11-15)

#### Day 8-10 (11-08 ~ 11-10): 통합 검증 + 최종 판단

**Coordinator:**
```
Task 1: 모든 보고서 수신 (Day 8)
□ PBO_VERIFICATION_REPORT.md ✅
□ DSR_VERIFICATION_REPORT.md ✅
□ OOS_VERIFICATION_REPORT.md ✅
□ AUDIT_VERIFICATION_REPORT.md ✅
□ DEBT_PAYDOWN_REPORT.md ✅

Task 2: 교차 검증 (Day 9)
□ 서로 다른 팀의 결과 일관성 확인
□ 상충 항목 식별 & 해결
□ 최종 데이터셋 확정

Task 3: Go/No-Go 판단 (Day 10)
PBO < 20% ✅ AND
DSR > 0.5 ✅ AND
OOS < 2.5% ✅ AND
Audit Pass ✅ AND
DEBT 20% ✅
→ VERDICT: GO PHASE 3 ✅
```

---

#### Day 11-12 (11-11 ~ 11-12): CTO/CFO 검토 & 승인

```
Day 11: CTO Review
□ Technical soundness 확인
□ 가정 & 제약 조건 검토
□ 리스크 평가

Day 12: CFO/CEO Sign-Off
□ Business readiness 확인
□ Budget & timeline 확인
□ Go-Live 최종 승인
```

---

#### Day 13-15 (11-13 ~ 11-15): Phase 3 준비

```
Day 13: Phase 3 준비 회의
□ 배포 팀 브리핑
□ 배포 체크리스트 최종 검토
□ DB 마이그레이션 계획 확정
□ Rollback 절차 테스트

Day 14-15: Phase 3 Go-Live 준비
□ 배포 스크립트 최종 검증 (sandbox)
□ 모니터링 대시보드 준비
□ 팀 교육 & 예행 연습
```

---

## 🎯 성공 기준 (Go/No-Go)

### PASS (Go Phase 3)
```
✅ PBO < 20%
✅ DSR > 0.5
✅ OOS 드리프트 < 2.5%
✅ Audit trail false positive < 0.1%
✅ 기술부채 20% 결제 확인
✅ 모든 팀 보고서 제출
✅ CTO 승인 확인
✅ CFO 최종 승인
```

### FAIL (Re-evaluate)
```
❌ PBO >= 20% → 모델 재조정 (2-3주)
❌ DSR <= 0.5 → 전략 재평가 (2-3주)
❌ OOS 드리프트 >= 2.5% → 성능 분석 (2-3주)
❌ Audit 이상 → 시스템 검토 (1-2주)

Action: 문제 해결 후 Phase 2 재시작
```

---

## 📋 Deliverables Checklist

```
Week 1:
□ Phase_1_Raw_Data.csv (Day 3)
□ Data_Validation_Report.md (Day 3)
□ PBO_VERIFICATION_REPORT.md (Day 7)
□ DSR_VERIFICATION_REPORT.md (Day 7)
□ OOS_VERIFICATION_REPORT.md (Day 7)
□ AUDIT_VERIFICATION_REPORT.md (Day 7)
□ DEBT_PAYDOWN_REPORT.md (Day 7)

Week 2:
□ PHASE_2_INTEGRATION_REPORT.md (Day 10)
□ PHASE_2_SIGN_OFF.md (Day 12)
□ Phase_3_Readiness_Checklist.md (Day 15)
```

---

## 🔄 스크립트 & 도구

### Python 스크립트 (계산 자동화)

**calculate_pbo.py:**
```python
import pandas as pd
import numpy as np

def calculate_pbo(returns_data):
    """
    Calculate Probability of Backtest Overfit (PBO)
    Formula: PBO = 1 - (OOS_Sharpe / IS_Sharpe)
    """
    is_sharpe = calculate_sharpe(returns_data['is_returns'])
    oos_sharpe = calculate_sharpe(returns_data['oos_returns'])
    pbo = 1 - (oos_sharpe / is_sharpe) if is_sharpe != 0 else 1.0
    
    return {
        'pbo': pbo,
        'is_sharpe': is_sharpe,
        'oos_sharpe': oos_sharpe,
        'pass': pbo < 0.20
    }

if __name__ == '__main__':
    data = pd.read_csv('Phase_1_Raw_Data.csv')
    result = calculate_pbo(data)
    print(f"PBO: {result['pbo']:.4f}")
    print(f"Status: {'PASS' if result['pass'] else 'FAIL'}")
```

**calculate_dsr.py:**
```python
def calculate_dsr(returns_data):
    """
    Calculate Daily Sharpe Ratio (DSR)
    DSR = mean(returns) / std(returns)
    """
    mean_return = np.mean(returns_data)
    std_return = np.std(returns_data)
    dsr = mean_return / std_return if std_return != 0 else 0
    
    return {
        'dsr': dsr,
        'mean': mean_return,
        'std': std_return,
        'pass': dsr > 0.5
    }
```

**analyze_oos_drift.py:**
```python
def calculate_oos_drift(is_performance, oos_performance):
    """
    Calculate Out-of-Sample Performance Drift
    Drift = (OOS_Perf - IS_Perf) / IS_Perf
    """
    drift = (oos_performance - is_performance) / is_performance
    drift_pct = abs(drift * 100)
    
    return {
        'drift_pct': drift_pct,
        'is_perf': is_performance,
        'oos_perf': oos_performance,
        'pass': drift_pct < 2.5
    }
```

---

## 📅 Schedule & Ownership

| Date | Task | Owner | Status |
|------|------|-------|--------|
| 11-01 | Data Collection | All Teams | ⏳ Ready |
| 11-03 | PBO Calculation | Team PBO | ⏳ Ready |
| 11-04 | DSR Calculation | Team DSR | ⏳ Ready |
| 11-05 | OOS Analysis | Team OOS | ⏳ Ready |
| 11-05 | Audit Verification | Team Audit | ⏳ Ready |
| 11-06 | DEBT Review | Team Debt | ⏳ Ready |
| 11-07 | Report Writing | All Teams | ⏳ Ready |
| 11-10 | Integration & Go/No-Go | Coordinator | ⏳ Ready |
| 11-12 | CTO/CFO Approval | Management | ⏳ Ready |
| 11-15 | Phase 3 Prep | All Teams | ⏳ Ready |

---

## 🚨 Risks & Mitigation

| Risk | Probability | Impact | Mitigation |
|------|-------------|--------|-----------|
| PBO >= 20% | Low | High | 모델 재조정 계획 준비 |
| DSR <= 0.5 | Low | High | 전략 재평가 계획 |
| Data corruption | Very Low | Critical | Backup & validation |
| Team delay | Medium | Medium | Daily standup, 병렬 추진 |
| Approval delay | Low | Medium | 사전 검토 회의 |

---

## ✅ AGENTS.md v16.0 준수

```
✅ 정공법: 근본 원인 분석 (각 메트릭 검증)
✅ 과유불급: 필요한 검증만 (추가 테스트 금지)
✅ 재현성: 모든 계산 문서화 + SQL 저장
✅ 이력성: 모든 결과 git에 저장
✅ 안정성: Go/No-Go 명확한 기준
✅ 현장감: 실제 Phase 1 데이터 사용
✅ 컴포넌트화: 5개 팀 독립 실행
✅ 기술부채: DEBT 최종 정리
```

---

**Version:** 1.0  
**Status:** 🟢 READY FOR EXECUTION  
**Target Start:** 2026-11-01  
**Target Completion:** 2026-11-15  
**Go-Live:** 2026-11-20 (Subject to Phase 2 passing)
