{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "anu_v3/schemas/runtime_task_observation.schema.json",
  "title": "anu_v3.runtime_task_observation.v1",
  "description": "task-2553+31 — single read-only track observation consumed by the runtime reconcile checkpoint. Detection-only; zero write/cron/merge/dispatch.",
  "type": "object",
  "required": [
    "task_id",
    "dispatch_status",
    "result_present",
    "done_present",
    "normal_collector_registered",
    "normal_collector_executed",
    "by_design_no_normal_collector",
    "fallback_state",
    "terminal_outcome"
  ],
  "properties": {
    "task_id": { "type": "string" },
    "executor": { "type": "string" },
    "dispatch_cron_id": { "type": "string" },
    "dispatch_status": { "type": "string", "examples": ["ok", "fired", "failed"] },
    "dispatch_ok": { "type": "boolean" },
    "expected_normal_collector_cron_id": { "type": ["string", "null"] },
    "normal_collector_cron_id": { "type": ["string", "null"] },
    "fallback_callback_cron_id": { "type": "string" },
    "expected_artifacts": { "type": "array", "items": { "type": "string" } },
    "normal_collector_registered": { "type": "boolean" },
    "normal_collector_executed": { "type": "boolean" },
    "by_design_no_normal_collector": { "type": "boolean" },
    "result_present": { "type": "boolean" },
    "done_present": { "type": "boolean" },
    "fallback_state": {
      "type": "string",
      "enum": ["NONE", "PENDING", "FIRED", "CANCELLED"]
    },
    "fallback_fire_kst": { "type": ["string", "null"] },
    "stale": { "type": "boolean" },
    "terminal_outcome": { "type": "string" },
    "hold_for_chair": { "type": "boolean" },
    "track_mismatch": { "type": "boolean" },
    "track_mismatch_reasons": { "type": "array", "items": { "type": "string" } },
    "callback_binding": {
      "type": "object",
      "description": "Optional explicit 4-tuple ownership for TRACK_MISMATCH detection (구현목표 13).",
      "properties": {
        "task_id": { "type": "string" },
        "dispatch_cron_id": { "type": "string" },
        "normal_collector_owner_task": { "type": "string" },
        "fallback_owner_task": { "type": "string" }
      },
      "additionalProperties": true
    },
    "expected": {
      "type": ["string", "null"],
      "description": "Fixture self-check: expected classification (§5).",
      "enum": [
        "NO_CRON_TASK_DONE",
        "RESULT_READY_NO_NORMAL_CALLBACK",
        "NORMAL_COLLECTOR_COMPLETED",
        "DUPLICATE_CALLBACK_IGNORED",
        "TRACK_MISMATCH",
        "RUNNING",
        "WAIT_FOR_RESULT",
        "FALLBACK_PENDING",
        "STALE_OR_BOT_STUCK_CANDIDATE",
        null
      ]
    }
  },
  "additionalProperties": true
}
