{
  "$format": "thethinkloop.template/v1",
  "slug": "support-escalation",
  "title": "Support escalation",
  "decides": "Whether a conversation should move from a frontline agent to a senior one.",
  "question": {
    "name": "decision",
    "type": "predicate",
    "instructions": "Should this conversation be escalated to a senior agent?"
  },
  "evidenceChecks": [
    {
      "name": "factor_1",
      "label": "Repeat contact",
      "type": "predicate",
      "instructions": "The customer has contacted us about this before."
    },
    {
      "name": "factor_2",
      "label": "Negative sentiment",
      "type": "predicate",
      "instructions": "The customer expresses frustration or dissatisfaction."
    },
    {
      "name": "factor_3",
      "label": "Legal or chargeback risk",
      "type": "predicate",
      "instructions": "The customer mentions a chargeback, bank dispute, or legal action."
    }
  ],
  "inputs": [
    {
      "name": "conversation",
      "type": "string",
      "required": true,
      "description": "The customer's latest message, ideally with the previous two or three turns."
    },
    {
      "name": "contact_count",
      "type": "number",
      "required": false,
      "description": "How many times the customer has contacted you about this issue."
    }
  ],
  "expectedOutput": "A probability from 0 to 1 that the conversation should be escalated, plus one probability per evidence check.",
  "examples": [
    {
      "title": "Third contact, asking for a manager",
      "input": "This is the third time I'm asking. Nobody has replied in two weeks and this is unacceptable. I want to speak to a manager today.",
      "expected": "Yes"
    },
    {
      "title": "A thank-you after a fix",
      "input": "Thanks for the quick fix yesterday. Everything works now. Appreciate it!",
      "expected": "No"
    }
  ],
  "startingPolicy": {
    "automateAt": 0.8,
    "abstainBelow": 0.55,
    "note": "A starting point for exploration, not a recommendation. Calibrate against your own labeled examples."
  }
}
