{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "schemas/anu_normal_callback_envelope_v1.json",
  "title": "dispatch.anu_normal_callback_envelope.v1",
  "description": "task-2686 ★ ANU normal callback envelope schema with chair-facing session propagation. 회장 verbatim 5번: envelope 에 3 session field 추가 (chair_facing_session_id / collector_session_id / delivery_session_id). 본 schema 는 helper.build_anu_owned_callback_request 가 생성하는 envelope (cokacdir --cron 의 PROMPT 본문) 의 머신 판독 형태를 정의한다. envelope 자체는 key=value 라인 텍스트이지만 본 JSON schema 는 동일 의미 모델로 cross-check 한다. ANCHOR-1: chair_facing_session_id 는 collector_key 와 별개 routing field. ANCHOR-2: key authority != session continuity.",
  "type": "object",
  "required": [
    "task_id",
    "result_path",
    "report_path",
    "collector_role",
    "callback_kind",
    "owner_key",
    "canonical_root",
    "chair_facing_session_id"
  ],
  "properties": {
    "task_id": {
      "type": "string",
      "minLength": 1,
      "description": "Callback 대상 task id (예: task-2686)."
    },
    "result_path": {
      "type": "string",
      "description": "memory/events/<task_id>.result.json 등 결과 artifact 의 canonical_root-상대 경로."
    },
    "report_path": {
      "type": "string",
      "description": "memory/reports/<task_id>.md 보고서 경로."
    },
    "sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$",
      "description": "result_path 의 SHA-256 (선택 — envelope tamper detection)."
    },
    "collector_role": {
      "type": "string",
      "enum": ["ANU"],
      "description": "회장 §10 collector role 단일 enum (★ ANU 만 허용)."
    },
    "callback_kind": {
      "type": "string",
      "enum": ["normal", "fallback"],
      "description": "normal=정상 완료 callback, fallback=10m dead-man recovery."
    },
    "source_attribution": {
      "type": "string",
      "description": "어떤 코드 경로가 envelope 을 발행했는지 라벨 (task-2660 Phase 2 / task-2661 Phase 2b)."
    },
    "owner_key": {
      "type": "string",
      "pattern": "^[0-9a-f]{16}$",
      "const": "c119085addb0f8b7",
      "description": "ANU key 강제 (self-key fail-closed)."
    },
    "canonical_root": {
      "type": "string",
      "pattern": "^/.+$",
      "description": "회장 §5.9 canonical root (절대경로 enforce, 환경 이식성을 위해 const 제거)."
    },
    "at": {
      "type": "string",
      "description": "cokacdir --at 인자 (절대 timestamp 'YYYY-MM-DD HH:MM:SS' 또는 'Nm/Nh/Nd' 상대 suffix)."
    },
    "chat_id": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "description": "Telegram chat id (회장 채팅)."
    },
    "chair_facing_session_id": {
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
      "description": "task-2686 ★ 회장 verbatim 5번 (필드 1/3). ANU 본 (chair-facing) 세션의 SID. cokacdir --session 옵션에 그대로 전달되어 callback 발사 시 본 세션이 resume 된다. ANCHOR-1: collector_key 와 별개 routing field — 혼합 금지."
    },
    "collector_session_id": {
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
      "description": "task-2686 ★ 회장 verbatim 5번 (필드 2/3). 실제 callback 을 처리한 ANU collector 세션의 SID. chair_facing_session_id 와 다르면 AUTHORITATIVE_BUT_SESSION_DISCONTINUITY 분류 강제 (회장 verbatim 6번)."
    },
    "delivery_session_id": {
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
      "description": "task-2686 ★ 회장 verbatim 5번 (필드 3/3). 회장(체어) 에게 최종 메시지를 전달한 세션의 SID. chair_facing_session_id 와 다르면 routing discontinuity."
    },
    "callback_resume_required": {
      "type": "boolean",
      "description": "true 면 cokacdir --session 옵션 강제 (task-2686 dispatch prompt inline doctrine)."
    }
  },
  "additionalProperties": false,
  "$comment": "task-2686 CALLBACK_SESSION_PROPAGATION_WIRING_FIX — RCA: memory/events/task-2684-callback-session-routing-gap-rca-260526.json. spec: memory/specs/system_callback_session_routing_modular_wiring_gap_analysis_260526.md. doctrine: memory/feedback_callback_session_continuity_doctrine_260526.md."
}
