# task-2729+23 — POST_FILE_TOUCH_FINALIZE_CALLBACK_DOGFOOD (finalize/callback 검증, production activation 아님)

## 레벨
Lv.2 (verification-only dogfood. finish-task GOAL-GATE + file_touch_ratio + finalize/callback 정상화 검증. production activation 검증 아님)

## 발번 주석
task-2729+19 dogfood(file_touch SKIP) 후속. #192 GOAL-GATE hardening + #195 file_touch_ratio CODE_ROOT recognition 둘 다 origin/main a311bd69 반영 후 재dogfood. 회장 2026-06-08 dispatch 승인. **이번 task = production activation 검증 아님 — finalize/callback dogfood.**

## ★ FRESH BASE
1. worktree 는 **origin/main `a311bd69`(또는 이후 최신 main)** 분기. canonical(task-2716 계열) 분기 금지.
2. `git worktree add -b task/task-2729+23-<bot> <path> origin/main` (검증 전용, PR 미생성 시 detached 도 가능 — canonical 무손상 필수).
3. 모든 fixture/검증 isolated temp. canonical write 0.

## 사전 확인 (필수 — 회장 verbatim)
1. origin/main a311bd69 이상 fresh base.
2. #192 GOAL-GATE + #195 file_touch_ratio 둘 다 포함 확인.

## 목적 (회장 verbatim)
1. task-2729+19 SKIP 이던 **file_touch_ratio_check 가 selected CODE_ROOT 기준 PASS/ratio 1.00** 되는지.
2. #192 GOAL-GATE placeholder hardening **hang 0** 유지.
3. placeholder skip / normal pass / fail / timeout **4-state 유지**.
4. finish-task 가 **GOAL-GATE → file_touch_ratio → callback/finalize 관련 단계 도달**.
5. robust normal callback 자동수렴 **과장 없이 관측**.
6. callback prereg Phase B = **DEFER**(이번 dogfood 후에도 callback miss 재현 시에만 재검토).

## ★★ 중요 보강 (회장 verbatim — callback 도달 ↔ 발사 분리)
- 이번 dogfood 목표 = **callback/finalize 단계 도달 검증**.
- **callback 단계 도달과 실제 callback 발사는 반드시 분리 기록.**
- **`callback_reached = YES` 와 `real_callback_spawned = NO` 는 허용.**
- **real callback spawn 없이도 `DOGFOOD_PASS_ACTIVE_FALSE` 가능.**
- ★ **real callback spawn 이 필요해지는 순간 즉시 `HOLD_FOR_CHAIR` 중단.**
- robust normal callback 자동수렴 성공으로 **과장 금지.**
- ★ 다음 5필드 **각각 분리 기록**: `callback_reached` / `prereg_created` / `envelope_created` / `result_written` / `real_callback_spawned`.

## 수행 (isolated, production 코드 무수정)
1. fixture task md(isolated temp) `## goal_assertions`: placeholder(`$VAR`/`...`/`<tok>`) skip + normal pass + (가능 시) fail/timeout.
2. fixture worktree 를 **selected CODE_ROOT(env PROJECT_PATH/WORKTREE_PATH/QC_EVIDENCE_ROOT = fixture worktree root)** 로 설정.
3. merged main(a311bd69) finish-task.sh GOAL-GATE 를 fixture 에 실행 → 4-state 관측 + **hang 0**.
4. file_touch_ratio_check 가 **canonical(task-2716) 아닌 fixture worktree diff 기준** 평가 → report changed ↔ worktree changed 일치 시 **ratio 1.00 PASS**(이전 SKIP false-negative 해소 실증). canonical task-2716 diff 가 dogfood 를 막지 않음 확인.
5. finish-task 가 GOAL-GATE → file_touch_ratio → callback/finalize 단계 도달 관측. **real spawn/live callback 발사 지점 = 발사 0, "도달했으나 held" 기록.**
6. 5필드(callback_reached/prereg_created/envelope_created/result_written/real_callback_spawned) 분리 기록.
7. **GOAL_ASSERTION_PLACEHOLDER_SKIPPED = PASS 아님 = 비차단 SKIP** 기록.

## expected_files (최소)
1. `memory/reports/task-2729+23.md`
2. (필요 시) `tests/regression/test_post_file_touch_finalize_dogfood_2729p23.py` — isolated fixture 회귀
3. (선택) `memory/plans/p0b-pickup/post_file_touch_finalize_callback_dogfood_result_260608.md`
- ★ **production code(finish-task.sh / file_touch_ratio_check / dispatch.py / callback prereg / git_evidence) 무수정** — 수정 필요 판명 시 즉시 HOLD_FOR_CHAIR.

## 필수 검증 (회장 verbatim 10, isolated temp)
1. origin/main a311bd69 이상 fresh base. 2. #192 + #195 포함. 3. GOAL-GATE hang 0. 4. file_touch_ratio selected CODE_ROOT 기준 PASS/ratio 1.00. 5. canonical task-2716 diff false-negative 가 dogfood 안 막음. 6. placeholder skip + normal pass 필수. 7. 가능 시 fail+timeout 4-state. 8. GOAL_ASSERTION_PLACEHOLDER_SKIPPED = SKIP(PASS 아님). 9. finish-task GOAL-GATE→file_touch→callback/finalize 도달 가능. 10. callback_reached/prereg_created/envelope_created/result_written/real_callback_spawned 각각 분리 기록.

## PASS 조건 (회장 verbatim 10)
1. GOAL-GATE hang 0. 2. file_touch_ratio PASS. 3. callback/finalize 단계 도달 확인. 4. raw key 0. 5. ACTIVE=false. 6. systemd enable 0. 7. activation_epoch absent. 8. real spawn 0. 9. canonical task-2716 branch 무손상. 10. canonical result.json mutation 0.

## 판정 (회장 verbatim)
- 위 조건 충족 → **`DOGFOOD_PASS_ACTIVE_FALSE`** (real_callback_spawned=NO 라도 가능).
- file_touch_ratio 여전히 실패 → **`HOLD_FOR_CHAIR`**.
- callback prereg 수정 필요 → **`HOLD_FOR_CHAIR`**.
- production activation 없이 검증 불가 → **`HOLD_FOR_CHAIR`**.
- real callback spawn 필요해지는 순간 → 즉시 **`HOLD_FOR_CHAIR`** 중단.

## 금지 (회장 verbatim 10)
1. production ACTIVE 전환  2. systemctl enable  3. ACTIVE=true 선언  4. activation_epoch 생성  5. real ANU spawn  6. **live callback cron 발사**  7. callback prereg Phase B 착수  8. canonical reset/clean/stash -u/checkout -f  9. task-2716 branch 수정  10. production 코드 수정.
- 모든 검증 isolated temp. canonical 무손상.

## 완료 후 callback (★ 분리 명확)
- 봇 완료 시 ANU(c119085addb0f8b7)로 **완료보고 normal callback cron 발사**(envelope only, UTF-8 ≤3900 bytes, collector=ANU): task_id/result_path/report_path/terminal_state/sha256/one-line summary. envelope 에 full key literal 박지 말 것(.env.keys COKACDIR_KEY_ANU sealed).
- ★ 이 **봇→ANU 완료보고 callback(정상)** 과 **dogfood fixture 내부의 callback 단계 도달 관측(held)** 은 별개 — 혼동 금지. fixture 내부에서 real spawn/activation 트리거 0.

## doctrine
직접 코딩 금지(ANU)/봇 위임 / fresh origin/main a311bd69 / isolated temp / production 코드 무수정 / activation 0 / raw key 0 / callback 도달↔발사 분리 / 과장 금지(robust callback 자동수렴 단정 금지·real_callback_spawned=NO 허용·live callback 승인 범위 밖이면 held) / callback prereg Phase B DEFER.
```yaml
callback_envelope_byte_limit: 3900
callback_collector_role: ANU
callback_owner_key_source: ".env.keys COKACDIR_KEY_ANU (sealed, literal 출력 0)"
```
