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

# 계획서: task-2511

**task**: task-2511 — auto_gemini_triage: Gemini review thread 자동 분류/resolve
**목표**: review thread state machine 자동화 코드(`utils/auto_gemini_triage.py`) + 회귀 테스트 16건으로 PR #61류 unresolved-thread blocker를 사람 개입 없이 자동 해소 가능하게 만든다.
**승인**: 회장 2026-05-09 — task 직접 발행 (PR #61 학습 후)
**근거**: `memory/tasks/task-2511.md`, `memory/feedback/feedback_critical_escalation_only_260508.md`

---

## 목표

1. `utils/auto_gemini_triage.py` 신규 작성 — 7-state thread classifier + auto resolve mutation + scope expansion 감지 + ReviewGateStatus 반환.
2. `tests/regression/test_auto_gemini_triage_2511.py` 신규 작성 — 회장 명시 16건 회귀 (PR #55/#56/#57/#61 fixture replay 포함).
3. CLI: `python3 utils/auto_gemini_triage.py --pr <N> --dry-run` 동작 가능.
4. PR #61 fixture (5 unresolved → 5 auto-resolved → mergeStateStatus 가상 CLEAN 전환) 회귀 PASS.

## 범위

### 포함
- `utils/auto_gemini_triage.py` (NEW)
- `tests/regression/test_auto_gemini_triage_2511.py` (NEW)
- `automation_contracts.py` import (수정 X)

### 제외 (다음 페이즈)
- `merge_queue_executor.py` wiring → task-2514
- `dispatch.py` wiring → 금지
- `replacement_pr_runner.py` 수정 → 금지 (task-2510 영역)
- 실제 GraphQL 호출 default 활성화 → `--apply` opt-in만

## 위임 계획

- 백엔드 코드 + 테스트: **루 (백엔드)** — automation_contracts 정합성 유지, classifier 7-state + resolveReviewThread mutation payload 빌더 + ReviewGateStatus 반환 인터페이스 일관 구현 필요. 단일 작성자가 코드+테스트 페어 작성하는 것이 contracts 정합성 보호에 유리.
- 검증: **모리건 (테스터)** — 16건 회귀 실행 + replay fixture 4종 PASS 검증, edge case 추가 점검.

## 검증 기준

- `pytest tests/regression/test_auto_gemini_triage_2511.py -q` → 16/16 PASS
- `python3 utils/auto_gemini_triage.py --pr 61 --dry-run` → ReviewGateStatus JSON + non-zero exit (dry-run = unresolved 5 합성 fixture 결과)
- effective diff = `utils/auto_gemini_triage.py` + `tests/regression/test_auto_gemini_triage_2511.py` (정확히 2 파일)
- forbidden path 0건
- Codex 사전 검증 PASS
- G3 독립 검증 PASS

## 3 Step Why (Lv.3+)

- **1st Why** (A): review thread state machine 자동화로 PR #61류 stuck 사고를 사람 개입 없이 해소. CI/자동 머지 10조건의 마지막 capability gap을 채운다.
- **2nd Why** (B): 정책 md가 아닌 실행 가능 Python 코드 + freeze contracts 사용이 task-2514 wiring 시 단일 인터페이스로 plug 가능. 회장 명시 "정책 md만 작성하고 종료 금지" 부합.
- **3rd Why** (C): 별도 module 분리가 대안(merge_queue_executor inline / 정책 md only)보다 우월 — `merge_queue_executor 대규모 수정 금지` 회피 + serial_only policy 부합 + replacement_pr_runner와 동일 프레임 유지.
- A→B→C 일관성: "회장 명시 + freeze contracts + 후속 wiring 단일 인터페이스"로 논리 일관.
