# task-2729+11 — POST_186_CALLBACK_FINALIZE_DOGFOOD_AND_G4_CAP_AUDIT (audit-first)

## 레벨
Lv.3 (audit-first 검증 — production activation 아님, canonical 무손상, isolated temp root)

## 한 줄 목표
#186(merge 7e18ab4d) 이후 start_task_guard/finish-task 가 canonical task-2716 parked 상태에서도 **worktree-root 기준으로 정상 작동**하는지 dogfood 검증하고, **G4_FIX_LOOP_CAP_PATTERN 이 stale residue 인지 live blocker 인지** 분리한다. 정상 callback 자동수렴 성공으로 과장 0 — 실제 증거 있을 때만 기록. **production activation/real ANU spawn 없이.**

## 배경 (단일 소스)
- 상태: `CALLBACK_FINALIZE_PATH_EXPECTED_IMPROVED_NOT_YET_DOGFOODED` (callback_finalize_path_status_correction_260607.json). #186 코드 반영됐으나 dogfood 미수행.
- 반복 증상: task-2729+5/+7/+8/+10 callback 미발사(EXTERNAL_DIRTY_BLOCKER / START_TASK_GUARD #7 canonical=main 가정 / G4 fix_loop_cap). #186 이 #7 + nullglob 해소 후보.
- G4 cap: task-2729+1(P0-A) 은 STALE_RESIDUE 판정. task-2729+10 도 PR 깨끗이 머지됐는데 finalize cap 발생(stale 의심).

## 목표 (회장 verbatim)
1. #186 이후 start_task_guard/finish-task 가 canonical task-2716 parked 에서도 worktree-root 기준 정상 작동 검증.
2. G4_FIX_LOOP_CAP_PATTERN stale residue vs live blocker 분리.
3. `.done`/`.qc-done`/callback preregistration/result.json 경로 정상화 audit-first 확인.
4. 정상 callback 자동수렴 성공 과장 금지 — 실제 증거 있을 때만 기록.
5. production activation/real ANU spawn 없이 검증.

## audit 항목 (read-only + isolated temp root)
### A. callback/finalize dogfood (isolated temp git repo)
- canonical=task-X(non-main) parked + dirty 재현 → worktree task(fresh origin/main base)에서 #186 start_task_guard 가 lock **정상 생성** + finish-task G2 가 worktree-isolated unrelated dirty **면제** + OWN_DIRTY/forbidden/expected 초과는 fail-closed.
- `.done`/`.qc-done`/result.json/callback prereg 경로가 막힘 없이 생성되는지(isolated) 확인. **수동 .done 생성 0.**
### B. G4 cap stale-vs-live 판정
- `scripts/gemini_cli_gate_check.py` `_read/_write_fix_loop_count` + cap 로직 audit.
- task-2729+10 g4-fix-loop-count(=2, mtime 11:40) lineage/mtime/evidence 로 stale residue 여부 판정: PR#186 이 HIGH/CRITICAL 0 으로 머지됐는데 cap 발생 = 실제 결함 미반영 → stale 가능성.
- **stale 면**: 어떤 task lineage/mtime/evidence 로 stale 인지 기록(counter reset 금지). **live blocker 면**: HOLD_FOR_CHAIR.
### C. callback prereg seed vs robust 분리
- callback-envelope registration_result_status 가 seed/REGISTERED placeholder 인지 실제 framework registration 인지 분리(task-2729+9 CALLBACK_DELIVERED_BUT_ACTION_FAIL_CLOSED_SEED_ENVELOPE 선례).

## allowed_resources
```yaml
allowed_resources:
  paths:
    - "scripts/harness/v36/post186_callback_finalize_dogfood_audit.py"
    - "tests/regression/test_post186_callback_finalize_dogfood_2729p11.py"
    - "memory/reports/task-2729+11.md"
    - "memory/plans/p0b-pickup/post186_dogfood_g4_audit_design_260607.md"
    - "memory/events/task-2729+11.*"
    - "memory/tasks/task-2729+11-post186-callback-finalize-dogfood-g4-audit.md"
  read_only_reference:
    - "scripts/start_task_guard.py (#186 worktree-root #7 — read only)"
    - "scripts/finish-task.sh (#186 G2 nullglob-safe — read only)"
    - "scripts/gemini_cli_gate_check.py (G4 fix_loop_count cap — read only)"
    - "memory/events/task-2729+10.g4-fix-loop-count / .g4-fix-loop-cap.json (evidence)"
    - "memory/events/task-2729+1.p0a-g4-supersede-adjudication.json (STALE_RESIDUE 선례)"
  forbidden_paths:
    - "/home/jay/workspace (canonical working tree — reset/clean/stash/switch 금지)"
    - "scripts/start_task_guard.py"
    - "scripts/finish-task.sh"
    - "scripts/gemini_cli_gate_check.py"
    - "memory/events/task-*.g4-fix-loop-count (G4 counter reset 금지)"
    - "memory/events/task-*.result.json (canonical result.json 이동·삭제 금지)"
    - "memory/state/**"
    - "dispatch.py"
    - "dispatch/**"
    - "utils/**"
    - ".github/**"
    - "hooks/**"
    - "/home/jay/.claude/**"
    - "/usr/local/bin/cokacdir"
```

## EXPECTED FILES (정확히 5 — 초과 시 즉시 HOLD_FOR_CHAIR)
1. `scripts/harness/v36/post186_callback_finalize_dogfood_audit.py` — read-only + isolated temp git repo dogfood/G4 audit 하니스
2. `tests/regression/test_post186_callback_finalize_dogfood_2729p11.py` — 회귀
3. `memory/reports/task-2729+11.md` — audit 결과(dogfood + G4 stale/live 판정 + evidence)
4. `memory/plans/p0b-pickup/post186_dogfood_g4_audit_design_260607.md` — 설계
5. (필요 시 evidence artifact 1개)
- ★ 본 task 는 audit-first — start_task_guard/finish-task/gemini_cli_gate_check **수정 0**(read-only). 수정 필요 발견 시 별도 task.

## 필수 확인 (회장 verbatim 10)
1. #186 7e18ab4d start_task_guard #7 worktree-root 실증. 2. finish-task G2 nullglob-safe fail-closed 실증. 3. canonical task-2716 + live memory artifacts 무손상. 4. G4 fix_loop_count=2 cap stale vs live 판정. 5. stale 면 task lineage/mtime/evidence 기록. 6. live 면 HOLD_FOR_CHAIR. 7. callback prereg seed/fail-closed vs 실제 normal callback 분리. 8. raw ANU key 출력 0. 9. ACTIVE=false 유지. 10. production activation 0.

## 금지 (회장 verbatim)
1. systemctl enable --now  2. production ACTIVE 전환  3. activation_epoch 생성  4. real ANU spawn  5. canonical reset/clean/stash -u/checkout -f  6. task-2716 branch 수정  7. live memory artifacts 이동·삭제  8. canonical result.json 이동·삭제·quarantine  9. **G4 counter reset**  10. **수동 .done 생성**  11. PR merge/push/comment 자동 실행  12. ACTIVE=true 선언
- 모든 검증 isolated temp root. canonical 무손상.

## 완료 판정 (회장 verbatim)
- dogfood + G4 audit 모두 안전 → **`CALLBACK_FINALIZE_DOGFOOD_PASS_ACTIVE_FALSE`**.
- G4 live blocker / canonical write 필요 / real spawn 필요 / ACTIVE=true 필요 / systemd enable 필요 / 수동 .done 필요 중 하나라도 → **`HOLD_FOR_CHAIR`**.
- 그 다음에만 pickup production activation approval 판단.

## doctrine
직접 코딩 금지(ANU)/봇 위임 / canonical 무손상 / isolated temp root 검증 / 자동수렴 성공 과장 금지(증거 기반만) / G4 counter reset·수동 .done 금지 / callback ANU key 독립·self-collector 금지.
