---
task_id: task-2514
type: plan
scope: task
created: 2026-05-09
updated: 2026-05-09
status: in-progress
---

# 계획서: task-2514

**task**: task-2514
**목표**: 5 모듈 (merge_queue_executor / replacement_pr_runner / auto_gemini_triage / post_merge_smoke_runner / critical_escalation_reporter) 을 단일 runtime pipeline으로 wiring하여 사람 개입 없이 queue가 자동으로 흐르도록 한다
**승인**: 회장 2026-05-09 "본 task는 새 기능 개발이 아니라 이미 main에 존재하는 5 모듈을 실제 runtime flow로 연결하는 것이다. orchestration determinism 우선."
**근거**: `memory/tasks/task-2514.md`, `memory/feedback/feedback_critical_escalation_only_260508.md`

---

## 목표

queue 선두 PR이 자동 머지 10조건 만족 시 5 모듈 chain을 통해 사람 개입 없이 squash merge + smoke + 후행 stale 재검증까지 완수된다.
- runtime wiring 7건 (W1~W7) 모두 구현
- end-to-end 회귀 14/14 PASS
- 회장 보고는 Critical 7종 발생 시에만 발생 (auto-handled 7항목은 회장 보고 0건)

## 범위

### 포함
- W1: merge_queue_executor에 5 모듈 import wiring
- W2: effective diff 오염 → ReplacementPRRunner.execute() 호출
- W3: Gemini review thread → triage_pr() + to_legacy_gemini_state() 호출
- W4: squash merge 직후 → run_post_merge_smoke() (envelope 패턴) 호출
- W5: Critical 7종 routing → critical_escalation_reporter.process_event() 호출
- W6: 후행 PR stale 재검증 (Critical 7종 시 process_event 라우팅)
- W7: audit/evidence propagation (pipeline_step / replacement_used / triage_summary / smoke_envelope / escalations 필드)
- 회귀 테스트: tests/regression/test_orchestration_runtime_2514.py (14 케이스)

### 제외 (다음 페이즈 이후)
- 5 모듈 본체 수정 (READ ONLY 유지)
- automation_contracts 변경
- merge_topology_gate 재설계
- dispatch.py 대규모 리팩토링
- enum redesign / contract schema 변경
- policy md 보강

## 위임 계획

- W1~W7 구현: **루(백엔드, sonnet)** — merge_queue_executor.py wiring (300~400 LOC 추가, 기존 인터페이스 보존)
- 회귀 테스트 14건: **모리건(테스터, sonnet)** — test_orchestration_runtime_2514.py 작성
- 통합 검증: **다그다(팀장)** — 두 산출물 통합 후 pytest 회귀 실행 + L1 스모크
- Codex G1 / Gemini G2 / 마아트 G3: 게이트별 외부 검증

## 검증 기준

- runtime 회귀: `pytest tests/regression/test_orchestration_runtime_2514.py -q` → 14/14 PASS
- 기존 회귀 보존:
  - `pytest tests/regression/test_merge_queue_executor_2509.py -q`
  - `pytest tests/regression/test_merge_queue_executor_review_gate_2509p1.py -q`
  - `pytest tests/regression/test_automation_contracts_2509_plus_2.py -q`
- CLI: `python3 utils/merge_queue_executor.py --pr <N> --dry-run --task-file <path>` → JSON에 신규 필드 5종 포함
- expected_files = 정확히 2 파일 (merge_queue_executor.py + test_orchestration_runtime_2514.py)

## affected_files

- `utils/merge_queue_executor.py` (modify)
- `tests/regression/test_orchestration_runtime_2514.py` (NEW)
