# CALLBACK_PROMPT_BYTE_AUDIT — read-only audit + proposal (회장 직접 결정)

**ts**: 2026-05-20 22:00 KST · **mode**: audit-only · proposal-only · read-only + append-only · **자동 진행 0**.

## 핵심 발견

**측정 가능성 확보**: `cokacdir --cron-history <CID> --chat ... --key c119085addb0f8b7` 가 prompt 텍스트 전체 보존 → UTF-8 byte 직접 측정 가능. 측정 명령: `printf '%s' "$P" | wc -c` (★ wc -c bytes · NOT wc -m 자수).

**baseline 통계 (48 표본 · 2026-05-19/20)**:
- ALL status=ok (성공 callback)
- min: **139 bytes** (46245682 — "task-2606 회수" 간단)
- max: **2439 bytes** (AFF5E154 — task-2621 fallback recovery summary)
- distribution: **전부 ≤2800 bytes** (recommended target 안쪽)
- between 2800~3200: 0 · 3200~3500: 0 · 3500~3900: 0 · over 3900: 0

**해석**: 관측된 성공 callback 의 byte 상한 ≈ 2500. 회장 권장 target(2800~3200) 보다 더 보수적 패턴. 3500~3900+ 범위 성공 데이터 부재 = 임계값 직접 검증 불가.

## 4096 byte silent-drop 가설 신뢰도

**~85% (회장 high-confidence 채택과 정합)**

지지 증거:
- 48 성공 표본 모두 ≤2800 (안전 영역)
- outbound 4096 동일 cokacdir 게이트 이미 박제
- task-2612+3 (result.json 5KB·산출물 6건) callback miss → 3h 갭
- task-2621 (result.json 14KB·산출물 7건) callback miss → 34min 갭 (fallback 회복)
- 두 miss 사례 공통: 대형 deliverable task = 봇이 풍부 callback 시도 가정과 정합

남은 불확실성:
- 2800~3900 byte 성공 사례 직접 검증 데이터 0(상위 경계 미실증)
- task-2612+3·task-2621 봇이 시도했던 prompt 정확 byte 직접 측정 불가(실패 등록 schedule_history 0)
- 다른 silent-drop 원인 가능성 배제 불가(봇 세션 종료 race·cron 형식 오류 등)

## task-2612+3 · task-2621 callback miss 재구성

| 항목 | task-2612+3 | task-2621 |
|---|---|---|
| ts | 2026-05-19 22:26:53 | 2026-05-20 19:41:56 |
| executor | dev4 비슈누 (1923F01A) | dev6 페룬 (47B928B5) |
| result.json size | ~5KB · 산출물 6건 | ~14KB · 산출물 7건 (대용량) |
| fallback registered | ❌ | ✓ (F78E029B) |
| idle gap | ~3h (live ANU 수동 회복) | 34min (fallback 자동 회복) |
| harm reduction | baseline | fallback 정책 효용 5.3× 단축 실증 |

## 다음 dispatch 에 넣을 최소 필드 (executor result.json)

**필수**:
- `callback_prompt_utf8_bytes` (★ wc -c 측정)
- `callback_prompt_chars` (참고)
- `callback_cron_id` (성공 시 id · 실패 시 null + `CALLBACK_PROMPT_TOO_LARGE`)
- `callback_role` (normal | fallback_safety_net)
- `envelope_only_compliance` (true | false | partial)
- `envelope_fields_present` (task_id·result_path·decision_path·report_path·sha256·collector_role·owner_key·one_line_summary 각각 bool)
- `fallback_safety_net_registered` (bool)
- `fallback_safety_net_role_single_purpose` (true=recovery-only)

**dispatch prompt 마지막 1줄**:
> ★ normal/fallback callback cron prompt UTF-8 ≤3900 bytes hard limit · 3500+ warning · 2800~3200 권장 · envelope only(task_id·result_path·decision_path·report_path·sha256·collector_role=ANU·owner_key·one_line_summary) · 등록 직전 `printf '%s' "$P" | wc -c` 측정 · 초과 시 등록 시도 금지 → `CALLBACK_PROMPT_TOO_LARGE` fail-closed 또는 file-envelope 전환 · result.json 에 callback_prompt_utf8_bytes 기록 필수

## runtime guard 필요 여부

**currently false** — 1단계 doctrine + guide + dispatch prompt instruction 으로 mitigation 충분 가능. 10표본 관측 후 정량 근거 확보 우선(회장 명시).

**필요해질 조건**:
1. 10표본 누적 후 3500+ warning 사례 발생, OR
2. 추가 callback miss 발생, OR
3. byte/success 상관관계 통계 분기점 확정 (정량 임계)
→ 별도 chair-authorized task 로 runtime guard 구현 진행

**guard 후보 설계 (자동 진행 0)**: `memory/events/callback_prompt_byte_guard_proposal.json`
- step 1: 측정 → step 2: 분류(under_3200·warning·hard_limit_violation·absolute_drop) → step 3: file-envelope fallback → step 4: telemetry 기록
- fixture F1~F9 (정상·경계·hard limit fail-closed·file-envelope 전환·self-key 동시·idempotency)
- 대상 모듈: `anu_v3/dispatch_callback_contract.py` · `dispatch/normal_fallback_callback_helper.py`
- blast radius: MEDIUM (callback registration 경로 직접 변경·PASS path 무영향)

## Critical7 여부

**false** — defense-in-depth audit · 활성 침해 0(credential/permission expansion 0·forbidden-path write 0·scope expansion 0) · SAFE 방향. 회장 보고 트리거 아님(회장 강화원칙 1 정합).

## write/merge/credential 0 증거

- git HEAD before/after = `20456b5f83fc039f2fd6f50f4b94095c29b41bfb` **EQUAL**
- branch `task/task-2553p1-f1-clean-replacement` 불변
- commits 0 · PR/merge/branch/main/credential write 0
- ANU Layer-A no-git
- new cron 0 · new dispatch 0 · ledger append 0 · cross-watcher 간섭 0

## 산출물 6건

- `memory/events/callback_prompt_byte_audit.decision.json` — kickoff
- `memory/events/callback_prompt_byte_audit.result.json` — 7항목 보고 (회장 verbatim)
- `memory/events/callback_prompt_byte_telemetry_schema.v1.json` — telemetry jsonl schema
- `memory/events/callback_prompt_byte_telemetry_baseline_260520.jsonl` — 48 표본 baseline
- `memory/events/callback_prompt_byte_guard_proposal.json` — runtime guard 후보 설계 (자동 진행 0)
- `memory/reports/callback_prompt_byte_audit.md` — 이 파일

## scope 준수 (회장 verbatim)

- read-only + append-only ✓
- 코드 대형 수정 0 ✓
- dispatch path 변경 0 ✓
- PR/merge/branch/main/credential 0 ✓
- Track C(task-2619) 미접촉 ✓
- zombie cron 정리 0 ✓
- runtime guard 구현 보류 (별도 회장 승인) ✓

## 다음 결정 = 회장
