# HARNESS_LIVE_ACTIVATION_ORDER (task-2647)

- version: v1
- recorded_at: 2026-05-24
- live_change_count: 0
- chair_signature_required: true

## 1. Dependency DAG

```
        ┌────────────────────────────────────────┐
        │ 축 1: task-2646 callback authority gate│
        │  (helper 3종 · 의존 0)                  │
        └────────────────────────┬────────────────┘
                                 │ import
                                 ▼
        ┌────────────────────────────────────────┐
        │ 축 2: task-2644+1 control plane v2     │
        │  (callback_collector_helper_integration│
        │   이 축 1 3개 helper 동적 import)       │
        └─────────────────────────────────────────┘

        ┌────────────────────────────────────────┐
        │ 축 3: task-2643 PreToolUse runtime     │
        │  guard (stdlib only · 의존 0 · main    │
        │  baseline 직접)                         │
        └─────────────────────────────────────────┘
```

- 축 1 → 축 2: 강한 의존 (코드 import). 축 1 미머지 시 축 2 fail-closed.
- 축 3: 축 1/2와 import 의존 0. 단, 같은 settings.json을 수정하므로 settings.json 머지 시 conflict 가능 (operational dependency).

## 2. Activation Phase 정의

각 Phase는 회장 verbatim 서명 후 별도 dispatch로만 실행 가능.

- **Phase A** = 축 1 live merge + smoke
- **Phase B** = 축 2 live merge + settings.json hook 3 entry 추가 + smoke
- **Phase C** = 축 3 live merge + settings.json PreToolUse Bash hook entry 추가 + ENV gate 활성화 + smoke

## 3. Per-axis Activation Steps (회장 서명 후 별도 dispatch)

### 3.A Phase A — 축 1 (task-2646)
1. main에서 fresh branch 생성 `task/task-2646-live-activation`
2. task/task-2646-dev3 워크트리에서 finalize commit 09372a41 cherry-pick (또는 PR 생성 후 squash)
3. PR open · CI gate 통과 (gemini-review-gate · qc-check · lock-in-check · phase3-merge-gate · merge-safety-check · hidden-path-audit · ci/guard · guard · taskctl-state-guard · cancel-kill-switch · 11/11 동일 gate)
4. PR merge (squash 권장 — 단일 helper 도입)
5. main에서 helper.selftest 실행 (smoke 6/6 PASS)
6. closeout marker `memory/events/task-2646.live-activation-{date}.json` 생성

### 3.B Phase B — 축 2 (task-2644+1) ★ Phase A 머지 후에만
1. Phase A 머지 확인 + main에서 helper 3종 import 가능 검증
2. main에서 fresh branch 생성 `task/task-2644+1-live-activation`
3. task/task-2644+1-dev4 워크트리에서 finalize commit f4bded9c cherry-pick
4. PR open · CI 11/11 gate 통과 + `pytest tests/regression/callback_control_plane_v2/ -v` 66 test PASS
5. PR merge
6. ★ settings.json 3 hook entry 추가 (별도 회장 verbatim 추가 서명 필요 — 본 packet에는 template 포함, 실제 추가는 axis 2 서명에 포함)
   - SessionStart matcher=* command=python3 hooks/session_start_anu_callback_collector_v2.py timeout=10
   - Stop matcher=* command=python3 hooks/stop_anu_callback_collector_verifier_v2.py timeout=10
   - UserPromptSubmit matcher=* command=python3 hooks/user_prompt_submit_hook_callback_inbox_v2.py timeout=5
7. smoke: 8 fixture replay + selftest + hook entry stdin echo
8. closeout marker `memory/events/task-2644+1.live-activation-{date}.json` 생성

### 3.C Phase C — 축 3 (task-2643) ★ Phase A/B 무관 (병렬 가능)
1. PR #146 head 33c51992 재확인 (만약 rebase 필요 시 별도 dispatch)
2. ★ 별도 회장 서명: PR #146 live merge 허락
3. PR #146 merge (squash 권장 — 49 file)
4. ★ settings.json PreToolUse Bash hook entry 추가 + ENV gate `CLAUDE_PRE_TOOL_USE_HOOK_ENABLED=1` 활성화
   - PreToolUse matcher=Bash command=python3 hooks/pre_tool_use_anu_guard.py --mode=stdin timeout=5
5. smoke: 5 forbidden pattern fixture replay (deny 확인) + 정상 Bash allow + fail-closed exception test
6. ★ ENV gate 비활성 상태로 30분 모니터링 후 활성화 권장 (false positive 0 확인)
7. closeout marker `memory/events/task-2643.live-activation-{date}.json` 생성

## 4. Order 옵션 비교

### 옵션 1 (권장) — 축 1 → 축 2 → 축 3
- 장점: import 의존 자연 충족 · risk 점진 증가 · 축 3 마지막 = bottleneck 최후 활성화
- 단점: 총 머지까지 3 단계 / 회장 서명 3회
- 권장 이유: 축 3 PreToolUse는 모든 Bash tool 영향 → 축 1/2 live merge 검증 후 도입이 안전

### 옵션 2 — 축 3 → 축 1 → 축 2
- 장점: 축 3가 forbidden polling 차단 → CI/Gemini 폴링 즉시 봉쇄
- 단점: 축 1/2 live merge 시 PR review 단계의 watcher 호출이 차단될 위험. PreToolUse 정의의 5 forbidden pattern 중 GROUP_2/4가 watcher dispatch 명령과 충돌 가능
- 비권장: watcher contract 호환성 별도 검증 필요

### 옵션 3 — 축 1 + 축 3 병렬 → 축 2 통합
- 장점: 시간 단축
- 단점: 회장 서명 추적이 복잡. 축 3가 축 1 PR review 단계에서 watcher를 막을 가능성
- 비권장

## 5. 권장 선택 — 옵션 1

- 축 1 (P1, 가장 isolated, 의존 0) 먼저
- 축 2 (P2, 축 1 의존 명확) 다음
- 축 3 (P3, risk 최고, fail-closed 정책으로 신중) 마지막

추정 lead time (회장 서명 + smoke 포함): 축 1 = 1 day · 축 2 = 2 day · 축 3 = 3 day (모니터링 포함)

## 6. 본 task에서 한 일 / 안 한 일

- ✅ DAG 도식화
- ✅ Phase 정의 + 옵션 비교
- ✅ Phase별 single source command 정리
- ❌ 실제 cherry-pick / PR / merge → 0 (회장 서명 후 별도 dispatch)
- ❌ settings.json 수정 → 0
- ❌ ENV gate 활성화 → 0

끝
