{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://bymoin.com/contracts/cat-01/lead-result.schema.json",
  "title": "CAT-01 lead result",
  "description": "What the qualification step returns for each lead. The CRM write and the owner alert both read it. When the AI call fails or returns something that does not match this contract, CAT-01 floors the lead at WARM and sets requires_human_review to true.",
  "type": "object",
  "required": ["qualification_tier", "qualification_reason", "budget_score", "personalized_reply_draft", "next_recommended_action", "requires_human_review"],
  "properties": {
    "qualification_tier": { "type": "string", "enum": ["HOT", "WARM", "DISQUALIFIED"] },
    "qualification_reason": { "type": "string" },
    "budget_score": { "type": "number", "minimum": 1, "maximum": 10 },
    "personalized_reply_draft": { "type": "string" },
    "next_recommended_action": {
      "type": "string",
      "enum": ["SEND_EMAIL_REPLY", "SEND_WHATSAPP_REPLY", "SYNC_TO_CRM", "BOOK_CALENDAR_SLOT", "ASK_CLARIFYING_QUESTION", "POLITE_DECLINE"]
    },
    "requires_human_review": { "type": "boolean" }
  },
  "additionalProperties": true,
  "examples": [
    {
      "qualification_tier": "HOT",
      "qualification_reason": "Names a volume, a current reply time and a wish to change it this quarter.",
      "budget_score": 8,
      "personalized_reply_draft": "Hi Priya, thanks for the detail. With about 40 enquiries a week, a reply within minutes is realistic. Can we talk tomorrow?",
      "next_recommended_action": "BOOK_CALENDAR_SLOT",
      "requires_human_review": false
    }
  ]
}
