{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "schemas/cancel_on_success_live_adoption_2604.schema.json",
  "title": "task-2604.cancel-on-success-live-adoption-audit_v1",
  "description": "task-2604 Track A 회장 §1/§3 — CANCEL_ON_SUCCESS LIVE ADOPTION audit. 단일 레코드는 (a) durable 4-tuple registry(+44, callback_4tuple_index.jsonl read-only consume)에서 normal-callback durable-success 1건이 식별되고 (b) unrelated cron 제거 방지 4-tuple ownership(task_id/chat_id/role/fallback_cron_id) 교차검증을 통과하여 (c) +45 run_cancel_on_success_live_wiring 경유(+37→+25→+23 seam → live verifier 5조건 AND → +9a remover)로 bound fallback 1건이 ① 실제 cancel/remove(CANCEL_ADOPTED) ② remove 실패 안전 분류(CANCEL_FAILED_CLASSIFIED) ③ verifier 미충족·미식별·ownership mismatch 시 명시 보존(NON_BLOCKING) 중 하나로 처리됨을 전수 기록한다. normal_success_unchanged 는 디커플 절대불변(true) — 채택 분류·cancel 실패·skip·예외 무엇이든 normal collector durable-success 를 뒤집지 않는다(회장 §3). callback_4tuple_index.jsonl 은 track 미소유 공유 durable 인프라(read-only) — 본 track 직접 write 0.",
  "type": "object",
  "required": [
    "schema",
    "event_id",
    "task_id",
    "target_cron_id",
    "adoption_classification",
    "normal_callback_durable_success_identified",
    "identification",
    "lookup_source",
    "lookup_status",
    "five_condition_results",
    "seam_invoked",
    "remove_attempted",
    "remove_result",
    "cron_remove_invoked",
    "fallback_cancelled",
    "cancel_adopted",
    "cancel_failed_classified",
    "non_blocking_marked",
    "fallback_preserved",
    "normal_success_unchanged",
    "decouple_invariant_held",
    "wired_via_operational_collector_wiring"
  ],
  "properties": {
    "schema": {
      "type": "string",
      "const": "task-2604.cancel-on-success-live-adoption-audit_v1"
    },
    "event_id": {
      "type": "string",
      "minLength": 1,
      "description": "task_id|target_cron_id|adoption_classification|<+45 event_id> canonical token (result.json 재독 의존 0)."
    },
    "task_id": { "type": "string", "minLength": 1 },
    "target_cron_id": {
      "type": "string",
      "minLength": 1,
      "description": "durable 4-tuple registry 에서 lookup·식별된 bound fallback_callback_cron_id. lookup/식별 불가 시 '<UNBOUND>' (remove 0)."
    },
    "adoption_classification": {
      "type": "string",
      "enum": [
        "CANCEL_ADOPTED",
        "CANCEL_FAILED_CLASSIFIED",
        "NON_BLOCKING"
      ],
      "description": "회장 §1/§3 — exactly 3 terminal outcomes. CANCEL_ADOPTED=5조건 통과+실제 cancel/remove(또는 idempotent already-gone/fired). CANCEL_FAILED_CLASSIFIED=remove 시도 실패 안전 분류(normal success 무효화 0). NON_BLOCKING=verifier 미충족/미식별/lookup 불가/ownership mismatch → fallback 보존(안전망·진행 트리거 아님)."
    },
    "normal_callback_durable_success_identified": {
      "type": "boolean",
      "description": "durable 4-tuple registry 에서 normal-callback durable-success(classify==NORMAL_CALLBACK_COMPLETED·status==COMPLETED) 1건 식별 + 4-tuple ownership 일치 여부."
    },
    "identification": {
      "type": "object",
      "description": "durable-success 식별 + unrelated cron 제거 방지 4-tuple ownership 교차검증 전수 기록.",
      "required": [
        "schema",
        "identified",
        "ident_status",
        "ledger_classification",
        "ownership_crosscheck"
      ],
      "properties": {
        "schema": {
          "type": "string",
          "const": "task-2604.durable_success_identification_v1"
        },
        "identified": { "type": "boolean" },
        "ident_status": { "type": "string" },
        "ledger_classification": { "type": "string" },
        "record_status": { "type": ["string", "null"] },
        "task_id": { "type": "string" },
        "bound_fallback_cron_id": { "type": ["string", "null"] },
        "ownership_crosscheck": {
          "type": "object",
          "required": [
            "own_task_id_match",
            "own_chat_id_owned",
            "own_role_fallback",
            "own_cron_id_bound",
            "ownership_all_satisfied"
          ],
          "properties": {
            "own_task_id_match": { "type": "boolean" },
            "own_chat_id_owned": { "type": "boolean" },
            "own_role_fallback": { "type": "boolean" },
            "own_cron_id_bound": { "type": "boolean" },
            "ownership_all_satisfied": { "type": "boolean" }
          }
        },
        "chat_id": { "type": ["string", "null"] },
        "role": { "type": ["string", "null"] },
        "ledger_path": { "type": ["string", "null"] },
        "canonical_root": { "type": ["string", "null"] },
        "reason": { "type": "string" }
      },
      "additionalProperties": true
    },
    "lookup_source": {
      "type": "string",
      "const": "durable_4tuple_registry",
      "description": "fallback_cron_id 는 항상 +44 durable append-only 4-tuple registry 에서 lookup (binding/marker 단독 아님 — 세션 불연속 내성, 회장 §3)."
    },
    "lookup_status": {
      "type": "string",
      "enum": [
        "LOOKUP_VERIFIED",
        "LOOKUP_NO_LEDGER_RECORD",
        "LOOKUP_NO_FALLBACK_BOUND",
        "LOOKUP_TRACK_MISMATCH",
        "LOOKUP_CHAT_MISMATCH",
        "LOOKUP_ROLE_MISMATCH",
        "LOOKUP_ERROR",
        "NOT_INVOKED",
        "DELEGATED"
      ],
      "description": "LOOKUP_VERIFIED 만 cancel 진행. 그 외 → cron-remove 0, fallback 보존(NON_BLOCKING)."
    },
    "five_condition_results": {
      "type": "object",
      "description": "+23 live cron-state verifier 5조건 AND 결과 (lookup/식별 skip 시 전부 null).",
      "required": [
        "c1_task_id_match",
        "c2_chat_id_owned",
        "c3_role_fallback",
        "c4_marker_id_crosscheck",
        "c5_pending_not_fired_not_removed"
      ],
      "properties": {
        "c1_task_id_match": { "type": ["boolean", "null"] },
        "c2_chat_id_owned": { "type": ["boolean", "null"] },
        "c3_role_fallback": { "type": ["boolean", "null"] },
        "c4_marker_id_crosscheck": { "type": ["boolean", "null"] },
        "c5_pending_not_fired_not_removed": { "type": ["boolean", "null"] }
      }
    },
    "seam_invoked": {
      "type": "boolean",
      "description": "durable-success 후 +45→+25 run_operational_cancel_seam 1회 진입 여부."
    },
    "seam_classification": {
      "type": ["string", "null"],
      "description": "+25 seam 결과 분류 (SKIP_DURABLE_*/SKIP_LIVE_*/PLUS9A_*/SKIP_SEAM_EXCEPTION). 미진입 시 null."
    },
    "remove_attempted": {
      "type": "boolean",
      "description": "bound·verified single cron-remove 시도 여부. 5조건 미충족/lookup 불가/미식별 → false."
    },
    "remove_result": {
      "type": "string",
      "enum": [
        "CANCELLED",
        "REMOVE_IDEMPOTENT",
        "REMOVE_FAILED_CLASSIFIED",
        "NOT_ATTEMPTED"
      ],
      "description": "REMOVE_FAILED_CLASSIFIED/실패는 normal success 를 뒤집지 않음(디커플 — CANCEL_FAILED_CLASSIFIED)."
    },
    "cron_remove_invoked": { "type": "boolean" },
    "fallback_cancelled": { "type": "boolean" },
    "cancel_adopted": {
      "type": "boolean",
      "description": "adoption_classification==CANCEL_ADOPTED 동치."
    },
    "cancel_failed_classified": {
      "type": "boolean",
      "description": "adoption_classification==CANCEL_FAILED_CLASSIFIED 동치 — remove 실패 안전 분류."
    },
    "non_blocking_marked": {
      "type": "boolean",
      "description": "adoption_classification==NON_BLOCKING 동치 — fallback 보존 명시 마크(안전망·진행 트리거 아님)."
    },
    "fallback_preserved": {
      "type": "boolean",
      "description": "cron-remove 0 인 경우 fallback cron 보존(예정대로 안전망 발화 가능)."
    },
    "normal_success_unchanged": {
      "type": "boolean",
      "const": true,
      "description": "디커플 절대불변 — 채택 분류·cancel 실패/skip/exception 이 normal collector durable-success 를 실패로 바꾸지 않는다(회장 §3)."
    },
    "decouple_invariant_held": {
      "type": "boolean",
      "description": "normal_success_unchanged 가 +45/+37/+25 권위 그대로 True 유지됨을 본 모듈이 재확인(불변 보존 증명)."
    },
    "durable_success": {
      "type": "boolean",
      "description": "+45/+37/+25 가 반환한 normal collector durable-success 값 그대로(채택 분류로 변경 0 — 디커플 디스플레이)."
    },
    "wired_via_operational_collector_wiring": {
      "type": "boolean",
      "description": "live collector path 가 operational_collector_wiring 를 경유함(회장 §3 결선 증명)."
    },
    "underlying_cancel_audit": {
      "type": "object",
      "description": "+45 cancel-on-success-audit 레코드 그대로(read-only consume — 변형 0).",
      "additionalProperties": true
    },
    "underlying_cancel_audit_path": { "type": ["string", "null"] },
    "canonical_root": {
      "type": ["string", "null"],
      "description": "+46 canonical-first resolved ANU workspace root."
    },
    "ledger_path": {
      "type": ["string", "null"],
      "description": "+44 durable 4-tuple append-only ledger(callback_4tuple_index.jsonl) 경로 — read-only consume."
    },
    "skip_reason": { "type": "string" },
    "notes": {
      "type": "array",
      "items": { "type": "string" }
    },
    "ts_utc": { "type": "string" }
  },
  "additionalProperties": true
}
