{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "anu_v3/schemas/generic_track_runtime_record.schema.json",
  "title": "anu_v3.generic_track_runtime_record.v0",
  "description": "task-2553+30 TRACK B. Per-track runtime record inside a generic batch_state. Reuses the +29 task_runtime_record shape (read-only) and adds the generic terminal_outcome enum that includes ACCEPT (registry track). Single source of per-track runtime truth, derived NO-CRON from result.json/.done existence.",
  "type": "object",
  "required": [
    "task_id",
    "executor",
    "dispatch_cron_id",
    "fallback_callback_cron_id",
    "expected_artifacts",
    "normal_collector_executed",
    "by_design_no_normal_collector",
    "result_present",
    "done_present",
    "fallback_state",
    "classification",
    "recovery_eligible",
    "terminal_outcome",
    "hold_for_chair"
  ],
  "properties": {
    "task_id": { "type": "string" },
    "executor": { "type": "string" },
    "dispatch_cron_id": { "type": "string" },
    "dispatch_status": { "type": "string" },
    "expected_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": ["PENDING", "FIRED", "CANCELLED", "NONE"]
    },
    "fallback_fire_kst": { "type": ["string", "null"] },
    "classification": {
      "type": "string",
      "enum": [
        "RESULT_READY_NO_NORMAL_CALLBACK",
        "NORMAL_COLLECTOR_COMPLETED",
        "WAIT_FOR_FALLBACK",
        "RESULT_MISSING_BOT_STALE",
        "DISPATCH_FAILED",
        "TRACK_MISMATCH"
      ]
    },
    "recovery_eligible": { "type": "boolean" },
    "recovery_note": { "type": "string" },
    "terminal_outcome": {
      "type": "string",
      "enum": ["MERGED", "PASS", "DONE", "ACCEPT", "HOLD", "PENDING", "UNKNOWN"]
    },
    "hold_for_chair": { "type": "boolean" },
    "track_mismatch_reasons": { "type": "array", "items": { "type": "string" } }
  },
  "additionalProperties": true
}
