# dispatch: task-2644 ANU_CALLBACK_COLLECTOR_CONTROL_PLANE

## 회장 결정 (2026-05-24 verbatim 승인)
- 승인 범위: RUNTIME_GUARDED 까지. HARNESS_ENFORCED / live activation 본 task 범위 아님.
- 별도 worktree / 별도 branch. PR #146 과 혼합 금지.
- 병렬 Track A/B/C/D fan-out 허용 (봇 내부 자율).
- ANU-Codex loop 로 non-critical finding 자동수렴.

## 단일소스 (반드시 읽고 §9-R / frozen anchor / 회장 보강 5 / §15 fixture 8 / HOLD 명시 모두 준수)
- task md: `/home/jay/workspace/memory/tasks/task-2644.md`
  - sha256: `7b519417aafadf10c11ee8dc0a19fdce5f2f4a9af0ce73ab9021634234a2aaee` (allowed_resources YAML 추가 반영)
- spec md: `/home/jay/workspace/memory/specs/system_anu_callback_collector_control_plane_spec_260524.md`
  - sha256: `b27da557d4245bce476cd63f4ab174aefc8a25d2da07ec2c8d2c83b01ee96153`

PRE-DISPATCH SPEC: 산출물 미존재·baseline sha256 일치를 결함으로 오판 금지(미구현 정상).

## 필수 구현 15 (회장 verbatim · task md §15 산출물 + spec §3 1:1)
1. SessionStart hook draft → `hooks/session_start_anu_callback_collector.py`
2. Stop hook draft → `hooks/stop_anu_callback_collector_verifier.py`
3. UserPromptSubmit .callback safety-net draft → `hooks/user_prompt_submit_hook_callback_inbox.py` (staged)
4. callback adjudicator → `utils/callback_adjudicator.py`
5. next_action runner → `utils/callback_next_action_runner.py`
6. source_attribution_guard → `utils/source_attribution_guard.py`
7. callback_ledger schema → `schemas/callback_ledger_v1.json`
8. next_action_decision schema → `schemas/callback_next_action_decision_v1.json`
9. anu_state schema → `schemas/anu_state_v1.json`
10. batch_aggregation schema → `schemas/callback_batch_aggregation_v1.json`
11. telegram chair report packet → `memory/specs/telegram_chair_report_packet_template_260524.json`
12. fixture 8 포함: `fallback_safety_net_log_recovery_without_control_plane_adjudication` (spec §15)
13. regression tests (각 fixture × adjudicator + next_action + Stop hook + source guard)
14. rollback plan → `memory/specs/task_2644_rollback_plan_260524.md`
15. staged settings template → `memory/specs/staged_settings_template_anu_callback_collector_260524.json`

## 반드시 유지 8 (FAIL gate)
- source enum 8개 유지 (RECEIVED_INBOUND_THIS_SESSION / LOG_LOOKUP_AFTER_CHAIR_QUESTION / LOG_LOOKUP_PROACTIVE / MEMORY_RECALL / INFERENCE_ONLY / CALLBACK_COLLECTOR_PROCESSED / CALLBACK_LEDGER_RECONCILED / **LOG_LOOKUP_OR_SCHEDULE_HISTORY_VERIFICATION**)
- next_action_result 4 필드 (decided / attempted / result / evidence_path) + result enum 6종
- .anu_state state_version / snapshot_id freshness 검증 / stale → SAFE_DEGRADED_MODE 또는 HOLD_FOR_CHAIR fail-closed
- MERGE_READY → REQUEST_CHAIR_MERGE_APPROVAL only
- merge execution = 0 hardcoded
- callback log only without adjudication → FAIL
- next_action_decision 없이 종료 → FAIL
- source attribution 없이 "callback 받았다/도착/수신" → FAIL

## 자동 진행 허용 8 / 금지 12 (task md 그대로 준수)

## 진행 방식
- 별도 worktree / branch (task-2644 prefix)
- PR #146 ↔ task-2644 격리 (ANCHOR-8)
- Track A/B/C/D 병렬 fan-out 봇 내부 자율
- ANU-Codex loop: non-critical Gemini medium / style / quality / test gap → 자동 fix → regression → 재검증
- Critical7 / live infra 변경 / credential·permission expansion → ANU callback 보고

## finalize 프로토콜 (★ BOT App token 부재 — 로컬 한정)
1. base = origin/main 최신 clean (PR #146 merge 후 권장. 별도 worktree)
2. 신규 helper + schema + fixture + regression PASS · 기존 baseline 유지 · full new fail 0
3. **로컬 commit 만** (push/PR/merge 금지)
4. ANU normal callback (★ 본 task = harness enforcement 자체 자기검증 강제):
   - validate_spawn_callback_contract self-check
   - envelope 5축 + canonical_root=/home/jay/workspace 명시
   - REGISTERED + schedule_id non-null + DELIVERED + UNCONFIRMED
   - envelope UTF-8 ≤3900 bytes (한글/JSON-escape 포함 byte 측정 · wc -c · NOT wc -m)
   - result.json 에 callback prompt UTF-8 byte 수 기록
5. ANU collector key: c119085addb0f8b7 (★ executor self-key 금지 · 독립 ANU 세션 spawn 강제)
6. executor 시작/종료 ts + 로컬 commit SHA 명기
7. callback prompt = envelope 만 (task_id / result_path / decision_path / report_path / sha256 / collector_role=ANU / owner_key / one-line summary). 상세는 result.json / report.md 위임

## .done 프로토콜
- 완료 시 `memory/events/task-2644.done` 생성
- 보고서: `memory/reports/task-2644.md`

## 완료 보고 형식 (16 필드 1:1)
- branch:
- commit:
- changed files count:
- expected_files exact:
- regression:
- source enum:
- SessionStart hook:
- Stop hook:
- callback adjudicator:
- next_action runner:
- .callback ledger:
- batch aggregation:
- control-plane fixture 8:
- closeout grade:
- live infra modified:
- PR created: (★ 본 task PR 금지 — 로컬 한정)
- PR number: N/A
- forbidden action count:

## 도메인 doctrine (cron prompt ≤2800자 / 4096 silent drop 한계 박제 — feedback_cron_prompt_4096_limit_260517.md)
- 본 dispatch prompt 길이 사전 wc -c 측정 확인
- inbound callback envelope UTF-8 ≤3900 bytes
- spec 전문 인라인 금지 · task md 경로 + sha256 만 인지

## 추가 doctrine (반드시 준수)
- same-PR push doctrine: Gemini review 후 same-PR push 금지 (본 task 로컬 한정이라 N/A)
- bot trigger 금지: OWNER_TRIGGER_ONLY_CAPABILITY 13 원칙 (회장 손가락만 /gemini review 가능)
- chain limit: attempt-N hard limit doctrine (회장 결정 외 자동 재시도 금지)
- long polling 금지: ANU 직접 CI/Gemini polling 0 (CI_WATCH_HANDOFF 위임)
- D-SPEC-EXACTNESS: 회장 hard prohibition paraphrase 금지
- credential scan 3계층: BLOCKING_SECRET only hard-block / EXISTING_SYSTEM_IDENTIFIER OK / NET_NEW_IDENTIFIER_EXPOSURE 보고

끝
