---
task_id: task-2513
type: plan
scope: task
created: 2026-05-09
updated: 2026-05-09
status: completed
---

# 계획서: task-2513 — critical_escalation_reporter

**task**: task-2513
**목표**: Critical 7종만 회장 보고 packet으로 가공하고, 그 외는 audit-only로 suppress하는 escalation reporter 구현
**승인**: 회장 2026-05-09 — 5 모듈 #5 직접 발행
**근거**: `memory/feedback/feedback_critical_escalation_only_260508.md` + `utils/automation_contracts.py` (PR #60 freeze)

---

## 목표

`utils/critical_escalation_reporter.py` 신규 작성 + 회귀 테스트 12건.

- Critical 7종 (`CriticalEscalationType` enum) 정확 매칭만 reportable
- Critical 7종 외 모든 사례는 `audit-only` 로 suppress (회장 보고 packet 생성 X)
- 동일 (escalation_type, task_id, evidence_hash)는 dedup window(기본 1h) 내 중복 제거
- audit log: `memory/orchestration-audit/critical-escalations.jsonl` (global) + `memory/events/{task_id}.escalation.json` (per-task)
- CLI: `python3 utils/critical_escalation_reporter.py --event-file <path> [--dry-run|--apply] [--no-audit]`
- replay fixture 11건 (critical 6 + auto-handled 5) 회귀 PASS

## 범위

### 포함
- `utils/critical_escalation_reporter.py` (신규)
- `tests/regression/test_critical_escalation_reporter_2513.py` (신규)

### 제외 (다음 페이즈 = task-2514 wiring)
- `merge_queue_executor.py` 수정/wiring 금지
- `dispatch.py` 수정 금지
- `replacement_pr_runner.py` / `auto_gemini_triage.py` 수정 금지
- `post_merge_smoke_runner.py` 구현 (= task-2512 영역) 금지
- 실제 Telegram 발송 (hook은 plug 만 노출, 실 호출 X)
- 자동 cherry-pick / auto merge 실행

## 위임 계획

- 단일 파일 구현 + 테스트라 한 명에게 분배해도 충분하지만, 테스트 fixture 11건 + 핵심 로직 분리를 고려해 위임은 다음과 같이 수행:
- **MT-1 (구현)**: **토르(백엔드)** — `utils/critical_escalation_reporter.py` 본체
- **MT-2 (테스트)**: **헤임달(테스터)** — `tests/regression/test_critical_escalation_reporter_2513.py` (replay fixture 11건 + 단위 테스트)
- 두 MT는 의존 관계 있음(토르 산출물 → 헤임달 입력). 직렬 실행.

## 검증 기준

- `python3 utils/critical_escalation_reporter.py --event-file <fixture.json> --dry-run` → 정상 stdout JSON 또는 `SUPPRESSED`
- `pytest tests/regression/test_critical_escalation_reporter_2513.py -q` → 12/12 PASS
- pyright(strict) → 0 errors on the two files
- replay fixture: critical 6건 모두 EscalationPacket 생성 + auto-handled 5건 모두 suppression
- audit log JSONL 파싱 가능 (line-by-line json.loads)
- Merge Topology Gate effective_diff = 정확히 expected_files 2건
- forbidden path 0건
