{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:jay:workspace:schemas:callback_authority_marker_v1",
  "title": "Callback Authority Marker v1",
  "description": "Schema for callback registration authority marker — records the envelope collector key, actual owner key, and authority verdict for a callback registration event (task-2646 CALLBACK_REGISTRATION_AUTHORITY_GATE).",
  "type": "object",
  "properties": {
    "schema": {
      "type": "string",
      "const": "callback.authority.marker.v1",
      "description": "Schema identifier — must be exactly 'callback.authority.marker.v1'."
    },
    "task_id": {
      "type": "string",
      "description": "The task identifier for which the callback was registered."
    },
    "cron_id": {
      "type": ["string", "null"],
      "description": "The cron schedule ID, or null if not yet assigned."
    },
    "authority_marker": {
      "type": "string",
      "enum": [
        "AUTHORITATIVE_CALLBACK_COLLECTOR_PROCESSED",
        "NON_AUTHORITATIVE_SELF_COLLECTOR"
      ],
      "description": "Authority verdict: AUTHORITATIVE if actual owner is ANU key; NON_AUTHORITATIVE if self-key or mismatch."
    },
    "envelope_collector_key": {
      "type": "string",
      "description": "The collector_key as declared in the callback envelope (prompt text)."
    },
    "actual_owner_key": {
      "type": ["string", "null"],
      "description": "The actual schedule owner key as resolved from cron-history or schedule_history; null if not yet verified."
    },
    "executor_key": {
      "type": "string",
      "description": "The executor session key (must differ from actual_owner_key for AUTHORITATIVE)."
    },
    "registered_at_iso": {
      "type": "string",
      "description": "ISO-8601 timestamp of callback registration."
    },
    "verified_at_iso": {
      "type": ["string", "null"],
      "description": "ISO-8601 timestamp of owner key verification, or null if not yet verified."
    },
    "source_attribution": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "SCHEDULE_HISTORY",
          "CRON_HISTORY_ANU_KEY",
          "CRON_HISTORY_SUSPECT_SELF_KEY",
          "ENVELOPE",
          "RESULT_ARTIFACT"
        ]
      },
      "description": "List of sources that contributed to the authority verdict (4-source cross-check, ANCHOR-3)."
    }
  },
  "required": [
    "schema",
    "task_id",
    "authority_marker",
    "envelope_collector_key",
    "executor_key",
    "registered_at_iso"
  ],
  "additionalProperties": false
}
