# task-2691 context-notes

## 회장 ANU 지시 (verbatim 2026-05-26)

> "finish-task 지연 개선은 2축으로 진행하라. A축: 실제 병목 계측/단축 / B축: 작업 유형별 종료 프로파일 분리. 1차로 timing 로그 + main preflight + task_mode 종료 프로파일 분리."

## Phase 분리 결정

- Phase 1 (본 task): helper 모듈만 + scripts/finish-task.sh **미수정**
- Phase 2 (task-2691+1, PR #152 머지 후): scripts/finish-task.sh hook 추가

## frozen anchors

1. Phase 1 = helpers + B축 + scripts/finish-task.sh 미수정
2. Phase 2 = scripts/finish-task.sh hook 추가
3. task_mode 6 enum 단일 source = utils/task_mode_classifier.py
4. main_conflict_preflight = 4-step (fetch + ls-remote + rev-parse + gh api)
5. Critical 7 없으면 chair 보고 없이 envelope only
6. PR #149 / #151 / #152 / #150 영역 변경 0

## 참조 사실

- 기존 qc_verify.py 위치: `teams/shared/qc_verify.py` (utils/qc_verify.py 신규 아님 — task 스펙의 path naming 보정)
- task-2689 = read-only watcher 사고 (commit 0 → 잘못된 FAIL 판정)
- 18 stage enum: qc_verify / scope_guard / worktree_manager_finish / gh_pr_check / git_gate / impact_scanner / ci_preflight / bg_cleanup / g3_verifier / g4_gemini_gate / lv4_audit / codex_gate / unresolved_gate / goal_assertions / task_timer_end / token_tracker / notify_completion / extract_followup
- 6 task_mode enum: code / docs_only / read_only_watcher / diagnosis / callback_only / closeout_marker_only

## 금지 영역 (forbidden_paths)

- scripts/finish-task.sh (Phase 2 위임)
- dispatch/__init__.py, dispatch/normal_fallback_callback_helper.py, dispatch/prompt.py
- schemas/anu_normal_callback_envelope_v1.json
- utils/callback_*, utils/anu_codex_micro_refinement_loop.py, utils/pr_watcher_terminal_state_classifier.py
- .github/**, settings.json, hooks/**, dispatch.py, Axis/**
