{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "schemas/cancel_on_success_audit.schema.json",
  "title": "task-2553+45.cancel-on-success-audit_v1",
  "description": "task-2553+45 회장 §3 — cancel-on-success LIVE integration audit record. 단일 레코드는 live normal collector path 가 (a) durable 4-tuple registry(+44)에서 fallback_cron_id 를 안전 lookup 하고 (b) +37→+25→+23 seam → live cron-state verifier 5조건 AND → bound fallback 1건 cron-remove 한 결정을 전수 기록한다. normal_success_unchanged 는 디커플 절대불변(true) — cron-remove 실패/skip/exception 이 normal collector success 를 뒤집지 않는다 (회장 §3, 9-R.1 Layer A/B).",
  "type": "object",
  "required": [
    "schema",
    "event_id",
    "task_id",
    "target_cron_id",
    "lookup_source",
    "lookup_status",
    "five_condition_results",
    "remove_attempted",
    "remove_result",
    "seam_invoked",
    "skip_reason",
    "already_removed_or_missing",
    "normal_success_unchanged",
    "wired_via_operational_collector_wiring"
  ],
  "properties": {
    "schema": {
      "type": "string",
      "const": "task-2553+45.cancel-on-success-audit_v1"
    },
    "event_id": {
      "type": "string",
      "minLength": 1,
      "description": "seam-entry-time canonical token 또는 lookup-skip event id (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)."
    },
    "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 만 binding 진행. 그 외 → cron-remove 0, fallback 보존 (회장 §3/§4)."
    },
    "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"] }
      }
    },
    "remove_attempted": {
      "type": "boolean",
      "description": "bound·verified single cron-remove 시도 여부. 5조건 미충족/lookup 불가 → false."
    },
    "remove_result": {
      "type": "string",
      "enum": ["CANCELLED", "REMOVE_NONFATAL", "NOT_ATTEMPTED"],
      "description": "REMOVE_NONFATAL/실패는 normal success 를 뒤집지 않음 (디커플)."
    },
    "fallback_cancelled": {
      "type": "boolean"
    },
    "seam_invoked": {
      "type": "boolean",
      "description": "durable-success 후 run_operational_cancel_seam(operational=True) 1회 진입 여부."
    },
    "skip_reason": {
      "type": "string"
    },
    "already_removed_or_missing": {
      "type": "boolean",
      "description": "idempotent — 이미 발화/제거된 fallback 은 no-op (이중 remove 0)."
    },
    "normal_success_unchanged": {
      "type": "boolean",
      "const": true,
      "description": "디커플 절대불변 — cron-remove 실패/skip/exception 이 normal collector success 를 실패로 바꾸지 않는다 (회장 §3)."
    },
    "wired_via_operational_collector_wiring": {
      "type": "boolean",
      "description": "live collector path 가 operational_collector_wiring::run_operational_completion_callback_collector 를 경유함 (회장 §3 결선 증명)."
    },
    "canonical_root": {
      "type": ["string", "null"],
      "description": "+46 canonical-first resolved ANU workspace root (autoset-cwd 단독 false-negative 금지)."
    },
    "ledger_path": {
      "type": ["string", "null"],
      "description": "+44 durable 4-tuple append-only ledger 경로."
    },
    "notes": {
      "type": "array",
      "items": { "type": "string" }
    },
    "ts_utc": {
      "type": "string"
    }
  },
  "additionalProperties": true
}
