{
  "_comment": "Acme Analytics signal routing, corrected version (fictional). First matching rule wins. Passes invariants I1 to I12 on example-acme-episodes.csv.",
  "policy_id": "acme-signal-routing",
  "version": "2",
  "fallback_owner": "duty-rep",
  "pools": {
    "ae": ["AE-1", "AE-2"],
    "sdr": ["SDR-1", "SDR-2"]
  },
  "rules": [
    {
      "id": "R01",
      "_comment": "A repeat delivery of an event key never acts twice.",
      "when": [{"field": "_replay", "op": "eq", "value": true}],
      "route": "replay",
      "reason": "repeat delivery of an event key"
    },
    {
      "id": "R02",
      "_comment": "Suppressed contacts get no proactive action. Direct requests fall through so a human still replies.",
      "when": [
        {"field": "suppressed", "op": "eq", "value": true},
        {"field": "direct_request", "op": "ne", "value": true}
      ],
      "route": "no_action",
      "reason": "suppressed"
    },
    {
      "id": "R02a",
      "_comment": "Expired evidence creates no work. Direct requests never expire.",
      "when": [
        {"field": "direct_request", "op": "ne", "value": true},
        {"field": "evidence_age_days", "op": "gt", "value_field": "expiry_days"}
      ],
      "route": "no_action",
      "reason": "expired"
    },
    {
      "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": "R05",
      "_comment": "Open opportunities stay with the opportunity owner, before any pool or sequence rule.",
      "when": [{"field": "open_opportunity", "op": "eq", "value": true}],
      "route": "opp_owner_task",
      "owner_from": "opportunity_owner",
      "cover_from": "covering_rep",
      "reason": "open opportunity, note to the opportunity owner"
    },
    {
      "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, hold with candidate IDs"
    },
    {
      "id": "R06c",
      "_comment": "Unknown source date or no expiry: research only. Customers and open opportunities already went to their owners above.",
      "when": [{"field": "direct_request", "op": "ne", "value": true}],
      "when_any": [
        {"field": "evidence_age_days", "op": "empty"},
        {"field": "expiry_days", "op": "empty"}
      ],
      "route": "research",
      "reason": "unknown_source_date"
    },
    {
      "id": "R07",
      "_comment": "Named owners keep their accounts. The covering rep handles the item when the owner is away; ownership does not change.",
      "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": [{"field": "direct_request", "op": "ne", "value": true}],
      "when_any": [
        {"field": "active_sequence", "op": "eq", "value": true},
        {"field": "last_human_reply_days", "op": "lte", "value": 30}
      ],
      "route": "attach_existing",
      "reason": "active conversation, add evidence to the open work"
    },
    {
      "id": "R09a",
      "when": [{"field": "territory", "op": "empty"}],
      "route": "fallback",
      "reason": "territory_missing"
    },
    {
      "id": "R09",
      "when": [{"field": "direct_request", "op": "eq", "value": true}],
      "route": "pool_task",
      "pool": "ae",
      "method": "round_robin",
      "reason": "new-business direct request"
    },
    {
      "id": "R10",
      "_comment": "Sequence only for eligible new business. Inferred signals need corroboration.",
      "when": [
        {"field": "suppressed", "op": "eq", "value": false},
        {"field": "direct_request", "op": "eq", "value": false},
        {"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"}
      ],
      "when_any": [
        {"field": "signal_class", "op": "ne", "value": "inferred"},
        {"field": "corroborated", "op": "eq", "value": true}
      ],
      "route": "sequence",
      "pool": "sdr",
      "method": "round_robin",
      "sequence": "acme-signal-intro-v3",
      "reason": "proactive band, enrollment gate passed"
    },
    {
      "id": "R11",
      "when": [
        {"field": "fit", "op": "gte", "value": 35},
        {"field": "engagement", "op": "gte", "value": 20},
        {"field": "fit_complete", "op": "eq", "value": true},
        {"field": "signal_class", "op": "ne", "value": "inferred"},
        {"field": "evidence_age_days", "op": "not_empty"}
      ],
      "route": "pool_task",
      "pool": "sdr",
      "method": "round_robin",
      "reason": "proactive band, sequence gate not met"
    },
    {
      "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: incomplete fit, inferred or public change"
    },
    {
      "id": "R13",
      "when": [
        {"field": "engagement", "op": "gt", "value": 0},
        {"field": "territory", "op": "not_empty"}
      ],
      "route": "nurture",
      "reason": "below band"
    },
    {
      "id": "R99",
      "route": "fallback",
      "reason": "no other rule matched"
    }
  ]
}
