---
task_id: task-2152
type: plan
scope: task
created: 2026-04-24
updated: 2026-04-24
status: completed
---

# 계획서: task-2152

**task**: task-2152
**목표**: finish-task.sh에 4개 품질 게이트(Impact Scanner, CI Preflight, Unresolved Issue, Goal Assertions) 삽입 + .done gate_results 추가
**승인**: 자동 dispatch
**근거**: P1 5개 컴포넌트 완료 → 통합 단계

---

## 목표

1. finish-task.sh에 Step 2.6 (Impact Scanner), 2.6.5 (CI Preflight), 2.11 (Unresolved Issue), 2.12 (Goal Assertions) 삽입
2. .done JSON에 gate_results 딕셔너리 추가
3. task-timer.py가 gate_results를 보존하도록 수정
4. 기존 동작 회귀 없음

## 범위

### 포함
- scripts/finish-task.sh: 4개 신규 step 삽입 + .done gate_results
- memory/task-timer.py: _write_event_file에서 기존 .done의 추가 필드(gate_results) 보존

### 제외 (다음 페이즈 이후)
- impact_scanner.py, ci_preflight.sh, gate_config_loader.py 수정 (이미 완료된 컴포넌트)
- 대시보드 gate_results 시각화

## Codex 리스크 반영 설계

1. **set -euo pipefail 대응**: 각 게이트를 `set +e ... set -e` 블록으로 감싸 non-zero exit을 캡처
2. **변수 초기화**: PROJ_DIR, COMMIT_COUNT를 Git 게이트 바깥에서 기본값으로 초기화
3. **task-timer.py .done 보존**: _write_event_file에서 기존 .done의 gate_results 등 추가 필드 merge
4. **Goal Assertions 보안**: allowed_commands 화이트리스트 검증 추가, eval 대신 안전한 실행
5. **ci_preflight exit code**: exit 0=PASS, 1=FAIL, 2=WARN으로 3단계 매핑
6. **l1_smoketest 결과**: .qc-result에서 l1_smoketest_check 결과 추출

## 위임 계획

- finish-task.sh 수정: **루(백엔드, Sonnet)** — bash 스크립팅
- task-timer.py 수정: **루(백엔드, Sonnet)** — Python 수정
- 테스트: **모리건(테스터, Sonnet)** — 6개 시나리오 검증

## 검증 기준

- `grep -c "IMPACT-GATE" scripts/finish-task.sh` → 1 이상
- `grep -c "CI-PREFLIGHT" scripts/finish-task.sh` → 1 이상
- `grep -c "UNRESOLVED-GATE" scripts/finish-task.sh` → 1 이상
- `grep -c "GOAL-GATE" scripts/finish-task.sh` → 1 이상
- `grep -c "gate_results" scripts/finish-task.sh` → 1 이상
- `grep -c "gate_results" memory/task-timer.py` → 1 이상
