# task-2439 Hidden Path Audit Matrix

**timestamp**: 2026-05-04T02:10:37+09:00
**작성자**: 헤르메스 (개발1팀장 / dev1)
**대상**: production 경로(`scripts/`, `.github/`, `dispatch.py`, 기타 root) — `.worktrees/` 제외

## grep 명령

```
grep -rn "gh pr merge\|git push.*main\|--force-with-lease\|worktree_manager.*finish\|--action merge\|--action auto" \
  --include='*.py' --include='*.sh' --include='*.yml' \
  /home/jay/workspace/scripts /home/jay/workspace/.github /home/jay/workspace/dispatch.py
```

## 호출 location 매트릭스

| # | 파일:라인 | 종류 | 가드 선행 | 비고 |
|---|---|---|---|---|
| 1 | `scripts/anu_confirm_bot/main.py:108` | docstring | — | 메타 텍스트 (실 호출 아님) |
| 2 | `scripts/anu_confirm_bot/main.py:111` | docstring | — | Lock-in 2 메타 텍스트 |
| 3 | `scripts/anu_confirm_bot/main.py:_execute_approve` 내 `gh pr merge` 호출 (`subprocess.run(cmd, ...)`) | 실 호출 | **있음 (Phase 본 task)** — 함수 첫 statement에 `cancelled marker` + `guard.sh pre-push` + `guard.sh qc-check` 강제. 모두 PASS 시에만 진입 |
| 4 | `scripts/anu_confirm_bot/config.py:13` | comment | — | `# gh pr merge 대상` 주석 |
| 5 | `scripts/auto_merge.py:261` | docstring | — | 메타 텍스트 |
| 6 | `scripts/auto_merge.py:264` | docstring | — | Lock-in 2 메타 텍스트 |
| 7 | `scripts/auto_merge.py:execute_merge` 내 `worktree_manager.py finish --action merge` 호출 | 실 호출 | **있음 (Phase 본 task)** — 함수 첫 statement에 `cancelled marker` + `guard.sh pre-push` 강제. 모두 PASS 시에만 진입 |
| 8 | `scripts/finish-task.sh:446` | echo log | — | log 출력만 (`else` 블록 후반) |
| 9 | `scripts/finish-task.sh:447` | 실 호출 (`worktree_manager.py finish --action auto`) | **있음 (Phase 본 task)** — `else` 블록 첫 statement (line 432~444)에 cancelled + `guard.sh pre-push` + `guard.sh qc-check` 강제 |
| 10 | `scripts/finish-task.sh:448` | echo log | — | log 출력만 |
| 11 | `scripts/auto_revert.py:66` | 실 호출 (`git push -u origin <branch> --force-with-lease`) | **N/A — 가드 대상 외**. 본 호출은 `revert/<task-id>` branch를 push (main 직접 push 아님). 후속으로 PR 생성 → main 머지는 PR 경로(가드 적용)로 진행. revert 자체는 fail 시 회복 메커니즘이며 cancelled task와 무관 |
| 12 | `.github/workflows/ci.yml` (신규) | CI step | **본 task가 가드 자체** | PR 단계 kill-switch (cancelled + guard.sh pre-push + qc-check) |
| 13 | `scripts/git-hooks/pre-push` (신규) | git hook | **본 task가 가드 자체** | local push 단계 kill-switch (main direct push 거부 + cancelled + guard.sh pre-push) |

## 결과

- **실 호출 location**: 3건 (#3 anu_confirm_bot._execute_approve, #7 auto_merge.execute_merge, #9 finish-task.sh else 블록)
- **3건 모두 가드 선행 (Lock-in 1 First-line 준수)**
- **가드 미경유 location: 0건**

추가 방어층:
- `pre-push` git hook (local push 차단)
- `.github/workflows/ci.yml` (PR 단계 차단)

## N3 합격 기준

> **"`gh pr merge` / `worktree_manager finish` / `git push.*main` 모든 호출자에 가드 선행 확인. audit 매트릭스 \"가드: 없음\" 행 0건"**

→ **"가드: 없음" 행 0건 PASS** (revert/<branch> push는 main 경로 아님 — 매트릭스 외)
