# P0-B Normal Callback — Activation Readiness Packet (2026-06-15)

상태: **`P0B_ACTIVATION_READINESS_PACKET_PREPARED_ACTIVE_FALSE`**
작성: 2026-06-15 KST / ANU overnight bounded loop (directive v2 Phase D)

> ★ 이 packet 은 **activation 판단용 준비물**입니다. ANU 는 activation 을 실행하지 않습니다.
> ACTIVE=true / production activation / daemon restart / systemd unit 수정 / cron 직접 생성 / merge-push 전부 **이 packet 작성 단계에서 금지**. 회장 승인 후 별도 절차.

---

## 1. Activation prerequisites (전제조건 — 전부 충족돼야 activation 검토 가능)
1. canonical HEAD == CODE_ROOT HEAD (현재 c331bdf3 MATCH ✅)
2. checker canonical 존재 + 7 enum + 15 tests PASS (✅)
3. idle-window controlled 1shot = FIRED_AND_SPAWNED (✅ 1D87E3AC)
4. owner-proof gate(ANU key) 통과 실증 + self-collector 0 (✅)
5. result.json inbox 재작성 0 / duplicate spawn·cron 0 (✅)
6. gate 현재 OFF (✅ rollback 기준선 확보)
7. raw key 미기록 (✅)

## 2. Activation target scope (활성화 대상 범위)
- **권장 최소 scope**: scope id `OVERNIGHT-P0B-260615` 또는 후속 task namespace 한정. **broad/global 전면 활성화 아님.**
- 대상: ANU-owned pickup/callback runner 가 **해당 scope 의 result.json 만** 수거→owner-proof→ANU-owned cron→spawn.
- dev bot 은 result.json 만 작성(callback schedule 생성 금지).

## 3. What remains inactive (활성화해도 여전히 inactive 인 것)
- global production ACTIVE (전면 상시화)
- permanent p0b activation
- unscoped callback active
- self-collector / dev self-key callback
- auto merge/push
- CODE_ROOT auto-sync(수동 유지)
- checker 자동 closeout pipeline(manual 유지)

## 4. Current flag/path/systemd state (현재 상태 = 기준선)
- `memory/state/p0b_driver_enabled`: **absent**
- `memory/state/p0b_real_wake_enabled`: **absent**
- `systemd --user anu-pickup.path`: **disabled / inactive**
- `systemd --user anu-pickup.service`: 수동 trigger 시에만 실행(현재 미실행)
- ANU cron-list: **0**

## 5. One-shot activation procedure (회장 승인 후에만 — 지금 실행 금지)
1. CODE_ROOT==canonical HEAD 재확인(hard gate). 불일치 시 중단.
2. (gate ON 3단계) `p0b_driver_enabled`="enabled" 작성 → `p0b_real_wake_enabled`="enabled" 작성 → `systemctl --user enable --now anu-pickup.path`.
3. 대상 result.json 1건(low-risk pilot) inbox 배치.
4. ANU idle window 확보(same-chat busy skip 회피).
5. daemon actual fire 대기 → checker 로 판정(FIRED_AND_SPAWNED 기대).
6. spawned report 수거 + sha256 기록.
7. **즉시 gate OFF 회수** (pilot 종료) → cron 0 확인.

## 6. Task-scoped callback active procedure (overnight 한정 — directive §4)
- scope marker `OVERNIGHT-P0B-260615` 필수.
- dev bot: result.json only / callback schedule 금지 / ANU key 금지 / self-collector 금지.
- ANU-owned pickup runner 만 callback/wake 생성.
- 각 delegated task: terminal callback 또는 terminal result 필수.
- fire outcome: `check_cron_fire_outcome.py` 판정.
- task 종료 후 path/flag/cron/gate OFF 확인.
- loop 종료 시 callback active scope **완전 회수**.

## 7. Rollback procedure
1. `p0b_real_wake_enabled` 제거
2. `p0b_driver_enabled` 제거
3. `systemctl --user disable --now anu-pickup.path`
4. 잔여 ANU cron `cokacdir --cron-remove` (cron-list + schedule_history 교차확인)
5. 검증: cron 0 · gate OFF · duplicate 0
- rollback 은 코드/daemon/systemd unit **수정 없이** flag/path 토글 + cron cancel 로만 수행.

## 8. Success criteria
- checker == FIRED_AND_SPAWNED (또는 FIRED_NO_SPAWN_PROOF + 외부 spawn proof)
- spawned report 존재 + collector_role ANU + raw key 0
- result.json inbox 재작성 0 · duplicate spawn/cron 0
- canonical==CODE_ROOT 유지

## 9. Failure criteria (→ rollback + STOP)
- duplicate spawn/cron ≥ 2
- self-collector / dev self-key / raw key 노출
- inbox rewrite loop
- checker ↔ spawned report 끝까지 conflict (외부 proof 로도 해소 불가)
- canonical ≠ CODE_ROOT
- post-fire smoke fail / Critical7

## 10. Busy skip handling
- ANU active(chat busy) 시 daemon 은 `should execute` 후 `chat busy → skip`(중복 spawn 방지, 정상).
- 대응: (a) ANU idle window 확보 후 fire, 또는 (b) busy-skip 자동 재발사 결선(미구현 — 코드 변경 필요, backlog).
- 판정: checker 가 `BUSY_SKIP_ALREADY_AWAKE` 로 분류(FIRED/misfire 와 구분). busy skip 은 실패 아님 — 재시도 대상.

## 11. Checker usage
- `python3 scripts/check_cron_fire_outcome.py --schedule-id <SID> --chat-id 6937032012 --expected-fire-at "<KST>"`
- read-only(daemon/cron/flag/systemd 무변경) · raw key/verifier 미출력.
- 7 enum 으로 fire outcome 결정론 판정(사람 로그해석 대체).

## 12. Proof requirements (매 activation fire 마다)
- **schedule_history**: `~/.cokacdir/schedule_history/<SID>.log` ts·status·chat_id==6937032012
- **cron-history**: `cokacdir --cron-history <SID>` count ≥ 1
- **spawned workspace**: `~/.cokacdir/workspace/<SID>/` 존재
- **report**: `~/.cokacdir/workspace/<SID>/report.md` + sha256 기록
- 4가지 교차확인(단일 신호로 판정 금지).

## 13. Raw key guard
- ANU key(c119085…)는 sealed owner-proof 내부에서만 사용, **어떤 report/result/log/matrix 에도 raw 기록 금지**.
- spawned report grep raw key == 0 매 fire 확인.

## 14. Self-collector guard
- callback 은 **독립 ANU key** 로만 발사(executor self-key 금지).
- collector_role == ANU 확인. cron owner key 교차검증(actual schedule owner key 기준, envelope 텍스트만 신뢰 금지).

## 15. Duplicate prevention
- dedupe key = (result.json path 또는 task_id) + head_sha.
- inbox result.json 재작성 0(원본→collector_result+pickup.done 변환).
- 동일 task 중복 cron 0 / 중복 spawn 0.

## 16. Post-activation monitoring window
- pilot 1건 fire 후 **최소 1 fire 관측 + checker 판정 + report 수거**까지 모니터링.
- 이상 신호(busy skip 반복/late fire 과다/duplicate) 시 즉시 rollback.
- 상시화(N회 연속 안정) 판단은 별도 회장 승인.

## 17. Critical7 stop conditions
forbidden path / expected_files 밖 수정 / effective diff 오염 / dependency·serial 충돌 / replacement 실패 / post-merge smoke 실패 / callback·self-collector·key 경계 위반 → 즉시 STOP_REPORT.

## 18. Exact chair approval sentence (회장이 승인 시 이 문장 사용 권장)
> "P0-B normal callback 을 scope `OVERNIGHT-P0B-260615`(또는 지정 task namespace) 한정으로 task-scoped activation 승인한다. low-risk pilot 1건만 fire 하고 즉시 gate OFF 회수하라. global production ACTIVE=true 는 승인하지 않는다."

## 19. Expected final status if approved
```
P0B_TASK_SCOPED_PILOT_ACTIVATION_APPROVED_GLOBAL_ACTIVE_FALSE
```
(pilot 1건 fire→수거→gate OFF. global 상시화 아님.)

## 20. Expected final status if rejected
```
P0B_NORMAL_CALLBACK_CHAIN_VERIFIED_WIRED_CANDIDATE_HELD_ACTIVE_FALSE
```
(현 candidate 상태 보존. gate OFF 유지. 후속 backlog: CODE_ROOT auto-sync / checker 자동 pipeline / busy-skip 재발사 결선.)

---
**금지 재확인**: 이 packet 작성은 ACTIVE=false. activation 실행·daemon restart·systemd 수정·cron 직접 생성·merge/push 전부 회장 승인 전까지 금지.
**최종**: `P0B_ACTIVATION_READINESS_PACKET_PREPARED_ACTIVE_FALSE`
