# task-2553+31 — ANU_RUNTIME_RECONCILE_CHECKPOINT 구현 (회장 GO, 코드/파일 자동화, NO-CRON)

> **Lv**: Lv.4 — ANU runtime 자동 reconcile checkpoint (실행코드/schema/fixture/regression/decision·result JSON). **Executor**: dev2-team 오딘 (key fedf78d1d09509f5) 1회 한정. **TTL**: 2.5h.
> **상태**: 회장 GO — Track C 보류, 본 task 우선. **배경**: +30 에서 dev4 정상완료했으나 NO-CRON 설계로 normal/fallback callback 0 + +29 registry/+30 coordinator 가 ANU runtime 미결선 → ANU 가 완료 자동 인지 실패(dev4 실패 아님, operationalization 미완 구조적 gap). **목표 한 줄**: "도구는 만들어졌지만 자동으로 돌지 않는 문제"를 해결 — 회장 질문이 있어야만 ANU 가 완료를 발견하는 구조를 끝낸다. md 박제만 금지.
> **선행**: +29 registry·+30 generic coordinator(read-only 보조)·batch closeout CLOSED_CONFIRMED·fallback observation. **NO-CRON**(회장 금지 "cron 신규 등록/제거" 상속). **후속**: Track C(policy profile engine 일반화) = 본 checkpoint operationalization 완료 후.

---

## 1. 목표 (회장 verbatim)

ANU 가 active dispatch / NO-CRON task / normal callback 누락 task 를 **회장 질문 없이 자동으로 read-only 감지**하고, batch_state 를 갱신하며, next_action 을 산출하도록 runtime reconcile checkpoint 를 구현한다. 문서화 아님 — 실행 가능한 코드·schema·fixture·regression·decision/result JSON 필수.

## 2. 정상 운영 구조 유지 (회장 verbatim — checkpoint 는 callback 보완, 폐기 아님)

- Primary path: bot completion callback → ANU collector → loop/next phase
- Safety path: fallback / dead-man callback
- Success cleanup: normal collector success → fallback cancel-on-success
- Recovery path: normal/fallback 이 없거나 누락되면 runtime reconcile checkpoint 가 result.json / .done / dispatch log / fallback state 를 read-only 로 감지하여 batch_state 복원
- 즉, checkpoint 는 callback 구조를 **폐기하지 않고 보완**한다.

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

1. active dispatch 목록 감지 2. dispatch log status 감지 3. task result.json 감지 4. task .done 감지 5. report/decision/activation artifact 감지 6. normal callback 존재/부재 감지 7. fallback 존재/부재/발화 상태 감지 8. NO-CRON task 완료 감지 9. RESULT_READY_NO_NORMAL_CALLBACK 자동 분류 10. NORMAL_COLLECTOR_COMPLETED 자동 분류 11. FALLBACK_PENDING 자동 분류 12. DUPLICATE_CALLBACK_IGNORED 자동 분류 13. TRACK_MISMATCH 자동 분류 14. batch_state 자동 갱신 15. consolidated summary 자동 생성 16. next_action recommendation 생성

**분류 taxonomy (9-R.2/9-R.4 — §5/§6 contract 와 정합 완전 enumeration)**: terminal = `NO_CRON_TASK_DONE` · `RESULT_READY_NO_NORMAL_CALLBACK` · `NORMAL_COLLECTOR_COMPLETED` · `DUPLICATE_CALLBACK_IGNORED` · `TRACK_MISMATCH`. nonterminal = `RUNNING` · `WAIT_FOR_RESULT` · `FALLBACK_PENDING` · `STALE_OR_BOT_STUCK_CANDIDATE`. 그 외 분류 0(unknown→HOLD 후보).
**batch_state 출력 경계(9-R.1)**: §3.14 "batch_state 자동 갱신" = **versioned/additive batch_state PROPOSAL artifact 1종 신규 생성만** = `memory/events/task-2553.runtime-reconcile-checkpoint.batch-state.json`(신규·versioned·additive). frozen durable v1 `memory/events/task-2553.parallel-batch-state.json` write **절대 0**(read-only 입력). 기존 batch-state 류 파일 overwrite 0.

## 4. 필수 파일 후보 (회장 verbatim — 실제 파일명은 ANU/executor 가 repo 구조 충돌 없게 확정, 문서·마커만 완료 금지, 실행 모듈+regression 필수)

- `anu_v3/runtime_reconcile_checkpoint.py`
- `anu_v3/active_dispatch_scanner.py`
- `anu_v3/task_artifact_detector.py`
- `anu_v3/runtime_batch_state_updater.py`
- `anu_v3/runtime_next_action_resolver.py`
- `schemas/runtime_reconcile_checkpoint.schema.json`
- `schemas/runtime_reconcile_result.schema.json`
- `schemas/runtime_task_observation.schema.json`
- `tests/regression/test_runtime_reconcile_checkpoint_2553plus31.py`
- `memory/fixtures/task-2553.runtime-reconcile.no-cron-30.json`
- `memory/fixtures/task-2553.runtime-reconcile.result-ready-no-normal-26-27.json`
- `memory/events/task-2553.runtime-reconcile-checkpoint.result.json`
- `memory/reports/task-2553.runtime-reconcile-checkpoint.md`

## 5. 필수 fixture (회장 verbatim 1~6)

1. **task-2553+30**: NO-CRON / result.json 존재 / .done 존재 / dispatch ok / normal callback 없음 / fallback 없음 → expected = **NO_CRON_TASK_DONE**
2. **task-2553+26**: result.json 존재 / dispatch ok / normal callback 없음 / fallback pending / actual status MERGED → expected = **RESULT_READY_NO_NORMAL_CALLBACK**
3. **task-2553+27**: result.json 존재 / dispatch ok / normal callback 없음 / fallback pending / actual status PASS/DONE → expected = **RESULT_READY_NO_NORMAL_CALLBACK**
4. normal callback completed case → expected = **NORMAL_COLLECTOR_COMPLETED**
5. fallback duplicate case → expected = **DUPLICATE_CALLBACK_IGNORED**
6. 4-tuple mismatch case → expected = **TRACK_MISMATCH**

(fixture 입력 = +26/+27/+30 실 산출물·reconcile·batch closeout = read/parse/reference 허용, modify·register·overwrite 금지.)

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

1. NO-CRON task result.json+.done 존재 → NO_CRON_TASK_DONE
2. dispatch ok + result exists + normal callback missing → RESULT_READY_NO_NORMAL_CALLBACK
3. dispatch ok + result missing + not stale → RUNNING 또는 WAIT_FOR_RESULT
4. dispatch ok + result missing + stale threshold exceeded → STALE_OR_BOT_STUCK_CANDIDATE
5. normal callback completed → NORMAL_COLLECTOR_COMPLETED
6. fallback pending + result ready → non-blocking
7. fallback fired after result ready → DUPLICATE_CALLBACK_IGNORED
8. task_id mismatch → TRACK_MISMATCH
9. dispatch_cron_id mismatch → TRACK_MISMATCH
10. normal collector belongs to different task → TRACK_MISMATCH
11. fallback belongs to different task → TRACK_MISMATCH
12. checkpoint performs zero write / zero cron / zero merge / zero dispatch
13. batch_state update is additive or versioned
14. frozen coordinator/source artifacts are not mutated
15. next_action is recommendation only, not execution
16. closeout eligible can be proposed but not confirmed without authority
17. callback primary path remains documented and not disabled
18. fallback safety path remains documented and not disabled
19. cancel-on-success path remains compatible
20. +26/+27/+30 fixture batch_state reproduces actual statuses

## 7. 권한 (회장 verbatim)

read-only 감지와 batch_state 제안만 허용한다.

## 8. 허용 (회장 verbatim)

- logs/artifacts/result/.done/report/decision 파일 read
- schedule history / cron list read
- batch_state JSON 생성
- checkpoint result JSON 생성
- consolidated summary 생성
- regression fixture 생성
- Codex audit + ANU-Codex adjudication

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

- cron 신규 등록
- cron 제거
- dev 재가동
- dispatch
- branch / commit / push / PR
- merge
- GitHub write
- closeout 확정
- credential / OWNER PAT 조작
- 기존 task 산출물 수정
- frozen anchor 수정
- result 변조
- pending fallback 강제삭제

## 10. 중요한 설계 원칙 (회장 verbatim)

runtime reconcile checkpoint 는 write executor 가 아니다. collector 를 강제 실행하는 도구도 아니다. merge/closeout/dispatch 를 직접 수행하지 않는다. 오직 read-only 로 현재 상태를 감지하고 batch_state 와 next_action recommendation 을 산출한다.

## 11. ANU runtime 결선 방식 (회장 verbatim)

- active dispatch 가 존재하는 turn boundary 에서 checkpoint 를 자동 실행할 수 있어야 한다.
- 또는 ANU 가 응답 전 read-only checkpoint 를 호출할 수 있는 entrypoint 를 제공한다.
- NO-CRON task 가 완료됐는데 normal callback 이 없는 경우, 회장 질문 없이 감지 가능해야 한다.
- operationalization 전까지는 이 모듈을 수동 호출하더라도, 설계상 자동 결선 가능한 entrypoint 를 제공해야 한다.

## 12. HOLD_FOR_CHAIR (회장 verbatim)

- checkpoint 가 write/cron/merge 권한을 필요로 함
- active dispatch 상태를 안전하게 식별 불가
- task_id / dispatch_id / artifact binding 모호
- callback 4-tuple contamination
- frozen anchor mutation
- Codex HIGH/CRITICAL unresolved
- closeout/merge 확정이 필요하지만 권한이 없음
- registry 가 callback primary path 를 폐기하려고 함
- registry 가 fallback safety path 를 폐기하려고 함

## 13. 완료 후 consolidated summary (회장 verbatim 1~13)

1. 구현 파일 목록 2. NO-CRON task 자동 감지 결과 3. RESULT_READY_NO_NORMAL_CALLBACK 자동 감지 결과 4. normal callback primary path 유지 여부 5. fallback safety path 유지 여부 6. cancel-on-success compatibility 7. zero write / zero cron / zero merge 증거 8. regression 결과 9. Codex audit 결과 10. ANU-Codex adjudication 결과 11. batch_state 갱신 결과 12. Track C 진입 가능 여부 13. HOLD_FOR_CHAIR 여부

## 14. 무변경 anchor (byte-0) + scope

frozen byte-0: `utils/anu_delegation_completion_callback.py`(sha 83b3e307c8207c76a3e311c408aab4951373bd317896e51687d3007907b0c3d4)·`memory/events/task-2553.parallel-batch-state.json`(durable v1, read-only)·`anu_v3/parallel_batch_coordinator.py`·anu_v3 frozen·+22/+24/+25/+26/+27/+28/+29/+30 원본 산출물·기존 generic coordinator/registry API 무변. checkpoint = 신규 별도 모듈(기존 import 결합·mutation 0). live `/home/jay/workspace`(repo root) git tracked HEAD/branch/ref(`task/task-2553p1-f1-clean-replacement` `20456b5f`) 전후 assertEqual(task-2553+31.*·신규 anu_v3/schemas/tests/fixtures=git-untracked, 위반 아님).

## 15. NO-CRON 변형 (callback (a) — 회장 §9 "cron 신규 등록/제거"·"dispatch" 금지 우선)

본 task 어떤 cron 도 신규 등록·제거 0(executor normal-collector cron 0, ANU fallback cron 0). 회수 = 정상종료 시 `memory/events/task-2553.runtime-reconcile-checkpoint.result.json` + `memory/events/task-2553+31.done` 산출. **본 task 가 빌드하는 checkpoint 가 곧 자기 완료 감지 메커니즘(ultimate dogfooding)** — operationalization 전까지 ANU 가 checkpoint entrypoint 를 수동 호출하여 +31 완료를 회장 질문 없이 감지(§11 결선방식). callback (a) 시스템 아키텍처(primary/safety/cancel-on-success) 폐기·변경 0(§2).

## 16. ANU-Codex loop + callback (자동, 중간보고 0)

batch plan(§3§4§5§6) → Codex lint → ANU refine(9-R) → re-lint → **ANU(orchestrator) 1회 위임**(loop 기계; executor 자기작업중 신규 dispatch·cron·delegation·handoff 0, 필요 시 HOLD_FOR_CHAIR) → checkpoint/scanner/detector/state-updater/next-action-resolver 코드 + schema + fixture(§5) + regression(§6 1~20) + entrypoint(§11) → post-result audit → adjudication → result.json + report. **callback (a) +31 NO-CRON 변형(§15)**: cron 0, 회수 = result.json+`.done`+checkpoint dogfooding(ANU 수동 호출). +26/+27/+30 산출물 read/parse/reference 허용·modify/register/overwrite 금지, batch 통합 ANU 사후. §12 트리거만 회장 보고, 그외 LOW/MED·fixture·regression·false-positive 자동 수렴. 9-R 이 본문에 우선.

## 17. 9-R — Codex lint 반영 (agent a47c4046266f67396: C0/H2/M2/L0 → 자동 수렴)

### 9-R.1 (HIGH §3.14/§7/§8/§10/§14/§6.13) batch_state = versioned/additive PROPOSAL 신규 파일 only
"batch_state 자동 갱신" = **versioned/additive batch_state PROPOSAL artifact 신규 생성만**: 출력 경로 = `memory/events/task-2553.runtime-reconcile-checkpoint.batch-state.json`(신규·versioned·additive). frozen durable v1 `memory/events/task-2553.parallel-batch-state.json` 및 기존 batch-state 류 파일 write/overwrite **절대 0**. read-only 경계 봉합(§7/§10 정합).

### 9-R.2 (HIGH §3/§5.1/§6.1) NO_CRON_TASK_DONE 분류 taxonomy 명시
§3 분류 목표에 `NO_CRON_TASK_DONE` 명시 추가(§5.1 fixture·§6.1 regression contract 와 완전 정합). 누락 status 0.

### 9-R.3 (MED §9/§11/§16) 1회 위임 = ANU-only precondition
ANU(orchestrator) 1회 위임은 **executor 행위 밖 ANU 단독 precondition**. executor 는 어떤 dispatch·delegation 도 initiate·request 0(§9 "dispatch" 금지 = checkpoint/executor runtime 행위 한정, ANU 전달 채널과 무관).

### 9-R.4 (MED §3/§6.3/§6.4) nonterminal observation state enumeration
§3 에 nonterminal observation state 전부 명시: `RUNNING` · `WAIT_FOR_RESULT` · `FALLBACK_PENDING` · `STALE_OR_BOT_STUCK_CANDIDATE`(§6.3 RUNNING/WAIT_FOR_RESULT·§6.4 STALE_OR_BOT_STUCK_CANDIDATE contract 정합). resolver↔test 불일치 0.

→ 9-R.1~9-R.4 로 H2+M2 해소. CRITICAL0. 9-R 이 본문에 우선. Codex re-lint GO_READY 시 ANU 1회 위임.

## 18. task-2553 계열

+26 MERGED / +27 PASS / +28 DONE / +29 ACCEPT(registry) / +30 PASS(generic coordinator) / **+31(본건)=ANU_RUNTIME_RECONCILE_CHECKPOINT**(operationalization — 자동 결선 entrypoint) / Track C(profile engine 일반화)=+31 operationalization 완료 후.
