{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "dispatch.spawn_verification_result.v1",
  "title": "Spawn verification result v1",
  "description": "task-2645 회장 verbatim §17.11 — 4 항목 verification + 4신호 silent drop 판정.",
  "type": "object",
  "required": ["cron_id", "signals", "verified", "silent_drop", "history_state", "next_status"],
  "properties": {
    "schema": {
      "const": "dispatch.spawn_verification_result.v1"
    },
    "cron_id": {
      "type": "string",
      "minLength": 1
    },
    "signals": {
      "type": "object",
      "required": [
        "workspace_dir_exists",
        "workspace_dir_has_activity",
        "executor_process_present",
        "schedule_visible_in_cron_list",
        "schedule_accepted_marker_present",
        "schedule_history_log_present"
      ],
      "properties": {
        "workspace_dir_exists": {
          "type": "boolean",
          "description": "(1) /home/jay/.cokacdir/workspace/<cron_id>/ 존재"
        },
        "workspace_dir_has_activity": {
          "type": "boolean",
          "description": "(1) 보강 — workspace dir 내부 활동 흔적 ≥1"
        },
        "executor_process_present": {
          "type": "boolean",
          "description": "(2) ps -ef | grep claude 매칭 process 존재"
        },
        "schedule_visible_in_cron_list": {
          "type": "boolean",
          "description": "(3) cokacdir --cron-list 에 노출"
        },
        "schedule_accepted_marker_present": {
          "type": "boolean",
          "description": "(3) 1회성 자동삭제 schedule 의 accepted marker"
        },
        "schedule_history_log_present": {
          "type": "boolean",
          "description": "(4) schedule_history/<cron_id>.log 존재"
        }
      },
      "additionalProperties": false
    },
    "verified": {
      "type": "boolean"
    },
    "silent_drop": {
      "type": "boolean",
      "description": "4신호 모두 hit 시 true — DISPATCH_SILENT_DROP_HOLD."
    },
    "history_state": {
      "type": "string",
      "enum": [
        "HISTORY_PRESENT",
        "HISTORY_ABSENT_IN_PROGRESS",
        "HISTORY_ABSENT_AFTER_COMPLETION",
        "HISTORY_ABSENT_SILENT_DROP"
      ],
      "description": "schedule_history 부재 3 상태 분리 (단독 단정 금지 doctrine)"
    },
    "next_status": {
      "type": "string",
      "enum": [
        "DISPATCH_SUBMITTED_UNVERIFIED",
        "DISPATCH_VERIFIED_SPAWN",
        "DISPATCH_SILENT_DROP_HOLD"
      ]
    },
    "reasons": {
      "type": "array",
      "items": { "type": "string" }
    }
  },
  "additionalProperties": true
}
