---
task_id: task-2516+1
type: context
scope: task
created: 2026-05-09
updated: 2026-05-09
status: completed
---

# 맥락 노트: task-2516+1

**task**: task-2516+1

---

## 결정 근거

### 핵심 결정 1 — 옵션 B (clean branch replay) 채택, force-with-lease 거부
- **이유**: 회장 직접 명시 — "이번 케이스는 코드 문제보다 branch ancestry contamination 문제다. 회장 운영 원칙은 clean topology 유지가 우선이며, replacement/replay 철학과 동일하게 clean branch 재생성이 맞다."
- **대안과 기각 이유**:
  - 옵션 A: `git push --force-with-lease`로 stale ancestry 위 head 갱신 → ★ 회장 직접 거부 (history rewrite 위험, ancestry 오염 잔존)
  - 옵션 C: `git rebase` 후 push → 거부 (force-class 동등, audit trail 파괴)
  - 옵션 D: `gh pr merge --admin` override → 거부 (CI bypass = SCOPE-GUARD 무효화)

### 핵심 결정 2 — 기존 task/task-2516-dev3 branch는 보존, 재사용 금지
- **이유**: contaminated ancestry는 그 자체로 dogfooding 사례 박제 가치가 있음. 삭제 시 SCOPE-GUARD 정상 탐지 evidence 소멸.
- **대안 기각**:
  - 기존 branch 재사용 → 회장 §1 정책 위반 (contaminated branch 재활용 금지)
  - 기존 branch 삭제 → 회장 §6 위반 + audit trail 손실
- **적용**: `task/task-2516-dev3` HEAD는 `e9f807e7` 그대로 동결, 새 worktree만 추가 생성

### 핵심 결정 3 — patch 적용 방식 (cherry-pick 금지 정합)
- **이유**: 회장 `cherry_pick_allowed: false` 명시. 하지만 `git format-patch` → `git apply`는 cherry-pick과 다름:
  - cherry-pick = 동일 commit object의 transplant (특정 commit→branch)
  - patch apply = working tree에 텍스트 패치만 적용, 새 commit 작성
- **대안 기각**:
  - `git cherry-pick e9f807e7` → ★ 회장 명시 금지
  - 직접 코드 재작성 (수동) → 동일 결과지만 hash drift 위험. patch apply가 가장 안전.
- **결과**: `git apply /tmp/task-2516-replay.patch` 후 `git commit -m "..."` 으로 새 ancestry에서 동일 코드 commit

### 3 Step Why (회장 결정 정합성 자문)
1. **1st Why (왜 옵션 B가 필요한가?)** → A: stale ancestry 머지 시 audit trail 오염 + automation contract 위반. clean ancestry만이 자동화 안전성 보장.
2. **2nd Why (왜 clean branch replay가 최선인가?)** → B: task-2510 replacement_pr_runner 철학(clean origin/main 기준 + expected_files만 이식)을 그대로 self-host. dogfooding 검증 + 정책 일관성.
3. **3rd Why (왜 cherry-pick/force-with-lease 대비 더 나은가?)** → C: cherry-pick은 ancestry는 정리되지만 commit object hash 변형. force-with-lease는 history rewrite로 reflog/audit 손상. patch apply는 기존 branch HEAD 불변 + 새 branch에 새 commit 생성으로 양쪽 모두 보존.
- **A→B→C 일관성**: ✅ "audit trail 안전성 + clean ancestry + 정책 일관성" 한 축으로 일관됨

## 참조 자료

- 회장 결정 메시지: `memory/tasks/task-2516+1.md` (본 파일)
- 기존 task-2516 결과 commit: `e9f807e7` (`git show e9f807e7`)
- task-2510 replacement_pr_runner 철학: `utils/replacement_pr_runner.py` (본 task의 self-host 사례)
- task-2515 e2e replay harness: commit `05259f81` (origin/main HEAD)
- task-2514 5 모듈 wiring: PR #65 (mergeCommit `4f94e1ad`)

## 주의사항

- ★ **force push 금지** (회장 직접 거부)
- ★ **rebase 금지** (force-class 동등)
- ★ **cherry-pick 금지** (회장 `cherry_pick_allowed: false`)
- ★ **기존 branch delete 금지** (회장 §6)
- ★ **expected_files 외 수정 금지** — 정확히 3 파일만
- ★ **public contract 변경 금지** (`automation_contracts.py` / `merge_queue_executor.py` public / 5 모듈 본체 / `dispatch.py` 미변경)
- ★ **live pilot 직접 시도 금지** — 본 task 완료 후 회장 승인 필요
- patch apply 후 `git diff origin/main...HEAD --name-only` 가 정확히 3건인지 즉시 검증
