# Phase 5.2: Graduated Auto-Gate 3-Layer 구현

## 배경
시스템3문서 Phase 5.2 항목. 병렬 위임 완료 후 자동 통합 검증 파이프라인.

## 작업 내용

### L1: Batch Watchdog
파일: `/home/jay/workspace/scripts/auto_merge.py` (신규)

- 1분 cron으로 `memory/events/*.done` 파일 수집
- batch_id 기준 전팀 완료 여부 체크 (`task-timers.json`에서 동일 batch_id 조회)
- TTL 2시간 초과 시 Telegram 경고
- 전팀 완료 감지 시 L2로 자동 진행

### L2: Pre-flight Check
- git merge --no-commit 시뮬레이션으로 기계적 충돌 검증
- 충돌 파일 목록 생성
- FAIL 시 충돌 목록 → 아누 Telegram 알림
- PASS 시 L3로 자동 진행

### L3: Integration Test 자동 실행
- `pytest tests/integration/` 실행
- 결과 리포트 생성
- PASS 시 자동 완료 보고 (아누 Telegram)
- FAIL 시 실패 로그 → 아누 판단

### systemd timer 등록
- `auto-merge.timer` + `auto-merge.service` 생성
- 1분 간격 실행

## 영향 파일
- `/home/jay/workspace/scripts/auto_merge.py` — 신규
- systemd user unit 파일 — 신규

## 검증 시나리오
- batch_id로 3팀 병렬 완료 → L1 감지 → L2 충돌 없음 → L3 테스트 PASS → 자동 보고