{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "schemas/callback_event_trigger.schema.json",
  "title": "anu_v3.callback_event_trigger.v1",
  "description": "task-2553+47 §3/§4.2 — read-only event-driven next_action verdict. The resolver detects a registry COMPLETED event and computes the next_action WITHOUT a fixed-time gate or a dead-man fallback as the progress trigger (9-R.1 Layer A; 회장 §6 verbatim). trigger_source is ALWAYS registry_completed_event when ready. fixed_time_used / dead_man_used are explicit FALSE evidence (회장 §9-4). A pending fallback is non-blocking (§8.3); an absent fallback is never a cancel target (§8.7). The emitted next_action is a PROPOSAL ONLY — no write/dispatch/merge/closeout authority (회장 §3/§6). Repeated scans are idempotent (§8.6).",
  "type": "object",
  "required": [
    "schema",
    "task_id",
    "verdict",
    "ready",
    "trigger_source",
    "fixed_time_used",
    "dead_man_used",
    "fallback_pending_non_blocking",
    "summary_candidate",
    "summary_inputs_completed",
    "next_action",
    "reasons"
  ],
  "properties": {
    "schema": {
      "type": "string",
      "const": "anu_v3.callback_event_trigger.v1"
    },
    "task_id": { "type": "string", "minLength": 1 },
    "verdict": {
      "type": "string",
      "enum": [
        "NEXT_ACTION_READY",
        "NEXT_ACTION_DEFERRED",
        "NEXT_ACTION_BLOCKED",
        "TRACK_MISMATCH",
        "FORBIDDEN_TRIGGER_SOURCE",
        "NO_LEDGER_RECORD"
      ]
    },
    "ready": {
      "type": "boolean",
      "description": "True only on NEXT_ACTION_READY (a registry COMPLETED event was detected and identity matched)."
    },
    "trigger_source": {
      "oneOf": [
        { "type": "null" },
        { "type": "string", "const": "registry_completed_event" }
      ],
      "description": "The ONLY permitted progress trigger. Never fixed_time_gate / dead_man_fallback (9-R.1 Layer A). null when not ready."
    },
    "fixed_time_used": {
      "type": "boolean",
      "const": false,
      "description": "Always false — a fixed-time gate is NEVER used as a progress/dependency-stage trigger (회장 §6 verbatim)."
    },
    "dead_man_used": {
      "type": "boolean",
      "const": false,
      "description": "Always false — a dead-man fallback is a missed-callback safety net only, NEVER a primary/progress trigger (§8.4, 회장 §6)."
    },
    "fallback_pending_non_blocking": {
      "type": "boolean",
      "description": "True when a fallback binding is pending; recorded as NON-BLOCKING — the completed task still proceeds (§8.3)."
    },
    "summary_candidate": {
      "type": "boolean",
      "description": "True when all declared consolidated inputs are COMPLETED — a summary candidate is emitted immediately (회장 §3)."
    },
    "summary_inputs_completed": {
      "type": "array",
      "items": { "type": "string" }
    },
    "next_action": {
      "description": "A write-authority-free PROPOSAL (or null when not ready). authority=none, action_mode=proposal, auto_executed=false — never auto-dispatched / merged / closed out (회장 §3/§6).",
      "oneOf": [
        { "type": "null" },
        {
          "type": "object",
          "required": [
            "schema",
            "authority",
            "action_mode",
            "auto_executed",
            "kind",
            "source_task_id",
            "trigger_source",
            "binding"
          ],
          "properties": {
            "schema": { "type": "string" },
            "authority": { "type": "string", "const": "none" },
            "action_mode": { "type": "string", "const": "proposal" },
            "auto_executed": { "type": "boolean", "const": false },
            "kind": { "type": "string" },
            "source_task_id": { "type": "string" },
            "trigger_source": {
              "type": "string",
              "const": "registry_completed_event"
            },
            "binding": {
              "type": "object",
              "required": [
                "task_id",
                "dispatch_id",
                "dispatch_cron_id",
                "normal_collector_cron_id",
                "fallback_callback_cron_id",
                "chat_id",
                "role"
              ],
              "additionalProperties": true
            },
            "summary_candidate": { "type": "boolean" },
            "summary_inputs_completed": {
              "type": "array",
              "items": { "type": "string" }
            },
            "payload": { "type": "object" },
            "note": { "type": "string" }
          },
          "additionalProperties": true
        }
      ]
    },
    "reasons": {
      "type": "array",
      "items": { "type": "string" }
    }
  },
  "additionalProperties": false
}
