{
  "_comment": "Acme Analytics signal routing, first draft (fictional). It contains deliberate defects for the worked example. Do not copy it; start from routing-policy-template.json.",
  "policy_id": "acme-signal-routing",
  "version": "1",
  "fallback_owner": "duty-rep",
  "pools": {
    "ae": ["AE-1", "AE-2"],
    "sdr": ["SDR-1", "SDR-2"]
  },
  "rules": [
    {
      "id": "R01",
      "when": [{"field": "_replay", "op": "eq", "value": true}],
      "route": "replay",
      "reason": "repeat delivery of an event key"
    },
    {
      "id": "R02",
      "when": [
        {"field": "suppressed", "op": "eq", "value": true},
        {"field": "direct_request", "op": "ne", "value": true}
      ],
      "route": "no_action",
      "reason": "suppressed"
    },
    {
      "id": "R03",
      "when": [{"field": "service_intent", "op": "eq", "value": true}],
      "route": "service",
      "reason": "support or billing request"
    },
    {
      "id": "R04",
      "when": [{"field": "customer", "op": "eq", "value": true}],
      "route": "cs_task",
      "owner_from": "account_owner",
      "cover_from": "covering_rep",
      "reason": "existing customer, account team"
    },
    {
      "id": "R06a",
      "when": [
        {"field": "identity_status", "op": "ne", "value": "matched"},
        {"field": "direct_request", "op": "eq", "value": true}
      ],
      "route": "fallback",
      "reason": "direct request without a matched account"
    },
    {
      "id": "R06b",
      "when": [{"field": "identity_status", "op": "ne", "value": "matched"}],
      "route": "hold",
      "reason": "identity unresolved"
    },
    {
      "id": "R09",
      "when": [{"field": "direct_request", "op": "eq", "value": true}],
      "route": "pool_task",
      "pool": "ae",
      "method": "round_robin",
      "reason": "direct request"
    },
    {
      "id": "R07",
      "when": [{"field": "account_owner", "op": "not_empty"}],
      "route": "owner_task",
      "owner_from": "account_owner",
      "cover_from": "covering_rep",
      "reason": "named account owner"
    },
    {
      "id": "R08",
      "when_any": [
        {"field": "active_sequence", "op": "eq", "value": true},
        {"field": "last_human_reply_days", "op": "lte", "value": 30}
      ],
      "route": "attach_existing",
      "reason": "active conversation"
    },
    {
      "id": "R10",
      "when": [
        {"field": "fit", "op": "gte", "value": 35},
        {"field": "engagement", "op": "gte", "value": 20},
        {"field": "fit_complete", "op": "eq", "value": true},
        {"field": "email_validation", "op": "eq", "value": "valid"},
        {"field": "message_version_approved", "op": "eq", "value": true},
        {"field": "evidence_age_days", "op": "lte", "value_field": "expiry_days"},
        {"field": "territory", "op": "not_empty"}
      ],
      "route": "sequence",
      "pool": "sdr",
      "method": "round_robin",
      "sequence": "acme-signal-intro-v3",
      "reason": "proactive band"
    },
    {
      "id": "R11",
      "when": [
        {"field": "fit", "op": "gte", "value": 35},
        {"field": "engagement", "op": "gte", "value": 20},
        {"field": "fit_complete", "op": "eq", "value": true},
        {"field": "territory", "op": "not_empty"}
      ],
      "route": "pool_task",
      "pool": "sdr",
      "method": "round_robin",
      "reason": "proactive band, SDR task"
    },
    {
      "id": "R05",
      "when": [{"field": "open_opportunity", "op": "eq", "value": true}],
      "route": "opp_owner_task",
      "owner_from": "opportunity_owner",
      "cover_from": "covering_rep",
      "reason": "open opportunity"
    },
    {
      "id": "R12",
      "when_any": [
        {"field": "fit_complete", "op": "eq", "value": false},
        {"field": "signal_class", "op": "eq", "value": "inferred"},
        {"field": "signal_class", "op": "eq", "value": "public_change"}
      ],
      "route": "research",
      "reason": "research band"
    },
    {
      "id": "R13",
      "when": [
        {"field": "engagement", "op": "gt", "value": 0},
        {"field": "territory", "op": "not_empty"}
      ],
      "route": "nurture",
      "reason": "below band"
    }
  ]
}
