# task-2553+44/+46 묶음 — callback lifecycle 관측·원장·artifact root 결선 (회장 지시 1, 코드/파일 자동화)

> **Lv**: Lv.4. **Executor**: (ANU 배정 1회 한정). **TTL**: 3h. **상태**: 회장 지시 1 GO. 문서화 아님 — 실행코드·schema·fixture·regression·decision/result JSON 필수. **callback: 정정 표준 (a) MANDATORY.**
> **선행 진단**: memory/events/task-2553-callback-lifecycle-diagnosis_260518.json. **후속**: task-2553+45(cancel-on-success live)는 본 묶음의 durable 4-tuple registry·artifact root resolver 산출에 선행 의존.

---

## 1. 목표 (회장 verbatim)

callback lifecycle의 관측·원장·artifact root 문제를 코드/파일 자동화로 해결한다.

## 2. 해결할 문제 (회장 verbatim)

1. +42/+43은 normal completion callback이 실제로 발사·수신됐지만, 1회성 cron 자동삭제, 별도 spawn 세션, durable 4-tuple 원장 부재 때문에 현재 ANU 세션에서는 normal callback이 없는 것처럼 보였다.
2. +39 fallback/dead-man collector는 처음에 현재 autoset/current workspace 기준 memory/events를 조회해 산출물 부재처럼 판단했으나, 실제 canonical workspace /home/jay/workspace/memory/events에는 result/collector-result가 존재했다.
3. dispatch.py 또는 cokacdir --cron direct path가 +32 executor completion callback mandatory contract를 코드 fail-closed로 강제하지 않고, task md 텍스트와 봇 자발준수에 의존하고 있다.

> 이번 작업은 문서화가 아니다. 반드시 실행 가능한 코드, schema, fixture, regression, decision/result JSON을 포함하라.

## 3. 구현 목표 (회장 verbatim)

**A — dispatch / cron-direct callback guard**: dispatch.py뿐 아니라 실제 사용 중인 cokacdir --cron direct path에서도 normal completion callback mandatory rule을 검증한다. executor normal completion callback clause 누락 시 FAIL/HOLD. callback 4-tuple을 durable registry에 기록한다. task_id / dispatch_id / executor / chat_id / normal_collector_cron_id / fallback_cron_id / role을 기록한다. normal_collector_cron_id 누락 시 FAIL. fallback_cron_id 누락 시 FAIL 또는 명시적 no-fallback 계약 필요. NO-CRON은 registry/checkpoint 자체에만 적용되며, executor completion callback 금지가 아님을 검증한다. +42/+43 세션 불연속 사례를 fixture로 재현하고 해결한다.

**B — durable 4-tuple registry**: callback_4tuple_index durable JSONL 또는 동등한 durable registry 생성. normal callback이 발화 후 consumed되어도 registry에서 task별 callback 이력을 확인 가능해야 한다. fallback/dead-man collector는 registry를 먼저 조회해 normal callback completed 여부를 판정한다. registry가 없거나 불완전하면 schedule_history와 artifact를 보조 조회하되, 오판하지 않도록 fail-safe 처리한다. 4-tuple mismatch는 TRACK_MISMATCH로 분류한다.

**C — artifact root resolver**: normal/fallback/dead-man collector가 autoset/current cwd 기준으로만 artifact missing을 판정하지 않도록 한다. canonical ANU workspace root를 코드로 확정한다. memory/events, memory/reports, schedule_history lookup root를 통합한다. artifact missing 판정 전 canonical root 재조회 필수. +39 fixture를 포함한다: autoset/current cwd에는 memory/events 없음, canonical /home/jay/workspace/memory/events에는 task-2553+39 result/collector-result 존재, 기대 판정 = RESULT_PRESENT 또는 NORMAL_COLLECTOR_COMPLETED, 금지 판정 = RESULT_MISSING / DISPATCH_NOT_RECEIVED.

> canonical anchor (사실): ANU canonical workspace root = `/home/jay/workspace` (CLAUDE.md 주요경로). autoset/current cwd = `/home/jay/.cokacdir/workspace/autoset` (memory/events 부재). +39 result/collector-result 는 canonical 경로에 실재 확인됨.

## 4. 필수 파일 후보 (회장 verbatim — 실제 파일명은 repo 구조에 맞게 조정, 문서/메모리만 완료 금지)

`dispatch/cron_dispatch_guard.py` · `dispatch/executor_completion_contract.py` 보강 필요 시 additive patch · `anu_v3/callback_4tuple_registry.py` · `anu_v3/artifact_root_resolver.py` · `anu_v3/collector_artifact_lookup.py` · `schemas/callback_4tuple.schema.json` · `schemas/artifact_root_resolution.schema.json` · `schemas/cron_dispatch_guard_result.schema.json` · `tests/regression/test_callback_4tuple_registry_2553plus44.py` · `tests/regression/test_artifact_root_resolver_2553plus46.py` · `memory/fixtures/task-2553plus42.normal-callback-consumed.json` · `memory/fixtures/task-2553plus43.normal-callback-consumed.json` · `memory/fixtures/task-2553plus39.artifact-root-false-missing.json` · `memory/events/task-2553+44_46.result.json` · `memory/reports/task-2553+44_46.md`. existing executor_completion_contract.py 는 additive patch만(byte-0 우선, 불가피 시 additive). frozen anchor·+22~+43 원본·기존 +39/+41/+42/+43 산출물 무변.

## 5. 필수 regression (회장 verbatim 1~20)

1 normal callback clause 포함 dispatch→PASS / 2 clause 누락 dispatch→FAIL / 3 4-tuple normal_collector_cron_id 누락→FAIL / 4 fallback_cron_id 누락→FAIL 또는 명시적 no-fallback 계약 필요 / 5 NO-CRON registry/checkpoint task도 executor completion callback 유지→PASS / 6 legacy/cokacdir direct path가 contract 우회→FAIL / 7 +42 fixture: normal callback consumed but no durable registry→기존 gap 재현 / 8 +42 fixture 수정 후→registry로 NORMAL_CALLBACK_COMPLETED / 9 +43 fixture 수정 후→registry로 NORMAL_CALLBACK_COMPLETED / 10 +39 fixture: autoset memory/events 없음+canonical root result 존재→RESULT_PRESENT / 11 autoset missing만으로 RESULT_MISSING 판정 금지 / 12 canonical root absent+schedule missing+stale dispatch→RESULT_MISSING/BOT_STALE candidate / 13 task_id mismatch→TRACK_MISMATCH / 14 dispatch_id mismatch→TRACK_MISMATCH / 15 chat_id mismatch→TRACK_MISMATCH / 16 unrelated task callback 인용 금지 / 17 dispatch.py import/help smoke PASS / 18 existing +32 mandatory callback regression 무회귀 / 19 callback/fallback/cancel-on-success 구조 유지 / 20 runtime checkpoint remains recovery layer, primary callback 대체 금지.

## 6. 허용 (회장 verbatim)

read-only logs/artifacts/schedule_history/cron-list fixture화 · dispatch path 코드 분석 및 guard 추가 · canonical root resolver 추가 · durable 4-tuple registry 추가 · schema/fixture/regression/result/report 추가 · Codex audit + ANU-Codex adjudication.

## 7. 금지 (회장 verbatim — D-SPEC-EXACTNESS 원문 박제)

신규 unrelated dispatch · dev 재가동 · cron 신규 등록 · cron 제거 · live cron 강제삭제 · branch/commit/push/PR/merge · GitHub write · credential/OWNER PAT 조작 · 기존 +39/+41/+42/+43 산출물 수정 · callback 구조 폐기 · fallback safety path 제거 · runtime checkpoint를 primary callback 대체물로 격상 · 문서/메모리만으로 완료 처리.

## 8. HOLD_FOR_CHAIR (회장 verbatim)

actual cron-direct path를 특정할 수 없음 · 4-tuple durable binding이 안전하지 않음 · canonical workspace root를 안전하게 확정할 수 없음 · artifact root resolver가 false RESULT_MISSING을 만들 가능성 · existing +32 regression 깨짐 · Codex unresolved HIGH/CRITICAL · credential/permission expansion 필요.

## 9. 완료 후 보고 (회장 verbatim — consolidated 입력, 단독·중간 0)

1 +44/+46 PASS/HOLD / 2 dispatch/cron-direct guard 적용 위치 / 3 durable 4-tuple registry 동작 여부 / 4 +42/+43 normal callback consumed fixture 해결 여부 / 5 +39 artifact-root false-missing fixture 해결 여부 / 6 canonical root resolver 결과 / 7 regression 결과 / 8 Codex audit / ANU-Codex adjudication / 9 다음 task-2553+45 진행 가능 여부 / 10 HOLD_FOR_CHAIR 여부. `memory/events/task-2553+44_46.result.json` + `memory/reports/task-2553+44_46.md`.

## 10. callback (a) — 정정 표준 MANDATORY (+32 복원·+37 wired, NO-CRON 불가)

executor 작업 완료 직후 ANU에 normal completion callback cron 발사(MANDATORY) + ANU dispatch 시 fallback 등록. 4-tuple={task-2553+44_46, dispatch_cron, normal_collector_cron(필수), fallback_cron}. 본 task 의 dispatch+callback cron 은 정정 표준 (a) lifecycle(외부 cron tooling)이며 §7 "cron 신규 등록/제거 금지"(=deliverable guard/registry/resolver 모듈이 자체 로직으로 임의 cron 추가/제거하지 않음)와 별개 layer(9-R.1). 회장 ★★★ 정정: executor completion callback 금지 아님.

## 11. 9-R — Codex lint 반영 (lint 후 ANU append)

### 9-R.1 (HIGH 예방 §10↔§7 callback cron ↔ "cron 신규 등록/제거 금지" 2-layer)
**Layer A (deliverable module 경계 §3/§4/§7)**: cron_dispatch_guard·callback_4tuple_registry·artifact_root_resolver·collector_artifact_lookup 모듈은 cron 을 **자체 로직으로 추가/제거하지 않는다**(registry=append-only 기록만, resolver=read-only, guard=검증·기록·FAIL/HOLD만). §7 "cron 신규 등록·제거·live cron 강제삭제"는 이 산출 모듈 행위를 구속. **Layer B (executor lifecycle §10)**: 본 task dispatch cron + executor normal completion callback + ANU fallback 등록은 정정 표준 (a) lifecycle(외부 cokacdir tooling, 회장 ★★★ + (a) STANDARDIZED 명시 carve-out). §7 "신규 unrelated dispatch 금지"의 *unrelated* 가 본 task 관련 dispatch 를 배제하지 않음. 두 layer 직교. regression 은 Layer A 모듈 무-cron-side-effect 만 증명. → CRITICAL0. 9-R 본문 우선. re-lint GO_READY 시 ANU 1회 위임.
