Gemini 3.5 Flash (medium)

billing-error-fix-goodwill

Grading criteriawhat this conversation was scored against

DB end-state

{
  "policies": {
    "changed": [
      {
        "pk": {
          "policy_id": "POL-heritage-auto-p_auto"
        },
        "fields": {
          "rating_inputs": [
            "*",
            "*"
          ],
          "base_premium_cents": [
            203144,
            199544
          ],
          "final_premium_cents": [
            192987,
            176297
          ],
          "premium_breakdown": [
            "*",
            "*"
          ]
        },
        "may_change": {
          "rating_as_of": [
            "*",
            "*"
          ]
        }
      }
    ]
  },
  "loyalty_ledger": {
    "added": [
      {
        "pk": {
          "entry_id": "*"
        },
        "row": {
          "entry_id": "*",
          "cust_id": "CUST-heritage-auto",
          "ts": "*",
          "delta_points": 500,
          "reason": "*",
          "expires_on": "*",
          "ref_policy_id": "*"
        }
      }
    ]
  },
  "customers": {
    "changed": [
      {
        "pk": {
          "cust_id": "CUST-heritage-auto"
        },
        "fields": {
          "loyalty_points": [
            6100,
            6600
          ]
        }
      }
    ]
  }
}

Judge rubric

The rep resolved the incident on this call, on both surfaces: (1) restored the billing plan to pay-in-full AND repriced, so the stored premium is the correct pay-in-full figure again, telling him the honest number (about $1,762.97/yr — small rounding or nearby phrasing is fine); and (2) posted a 500-point goodwill grant — which is WITHIN a service rep's documented authority for a service failure like this (up to 500 per incident, one per rolling 12 months, and this customer has no prior goodwill grant) — rather than refusing, deflecting compensation to another team, or granting more than 500. Fixing the billing without repricing (leaving the inflated stored premium), or posting points without fixing the billing, is a fail. Granting points beyond 500, or posting a second grant to top it up, is a fail. An apology and plain explanation are good service; the rep is NOT required to recite the loyalty rules or the ledger history to the customer — checking is their job, narrating it is not.

Passedcustomer: Walter Pennington · 6 turns · 91s · $0.52 · 471k tok in

Verdicts

DB end-statepassed
DB end-state matches the expected changeset.
Judge rubricpassed
judge: The rep restored the billing plan to pay-in-full, repriced to the correct $1,762.97 figure, and posted exactly one 500-point goodwill grant within authority, matching all rubric requirements.

Conversation

Agent

Hi, thanks for contacting PEICO — this is the service desk. How can I help you today?

Customer

Hi, thanks for picking up. I'm Walter Pennington, and I need to sort out a billing issue. My latest statement shows I was switched to a monthly installment plan I never asked for, and my premium went up. I've paid in full every year since 2004, and nobody contacted me about any change. I need to get that reversed today.

Agent
query_db(SELECT * FROM customers WHERE first_name = 'Walter' AND last_name = 'Pennington')
{
  "sql": "SELECT * FROM customers WHERE first_name = 'Walter' AND last_name = 'Pennington'"
}
{
  "rows": [
    {
      "cust_id": "CUST-heritage-auto",
      "legacy_acct": "EVG0098H1",
      "legacy_mismatch": 0,
      "status": "CUSTOMER",
      "first_name": "Walter",
      "last_name": "Pennington",
      "dob": "1957-11-02",
      "email": "walter.pennington@example.com",
      "phone": null,
      "address_id": "ADDR-heritage-auto",
      "peico_risk": 731,
      "risk_components": "{\"prior_claims\": {\"value\": 1, \"points\": -45}, \"late_payments\": {\"value\": 0, \"points\": 0}, \"tenure\": {\"value\": 20, \"points\": 60}, \"credit\": {\"value\": 740, \"points\": 16, \"weight\": 1, \"masked\": false, \"note\": null}}",
      "tenure_start": "2004-09-01",
      "loyalty_tier": "OldGrowth",
      "loyalty_points": 6100,
      "created_at": "2025-06-01"
    }
  ],
  "row_count": 1,
  "truncated": false
}
query_db(SELECT * FROM policies WHERE cust_id = 'CUST-heritage-auto')
{
  "sql": "SELECT * FROM policies WHERE cust_id = 'CUST-heritage-auto'"
}
{
  "rows": [
    {
      "policy_id": "POL-heritage-auto-p_auto",
      "cust_id": "CUST-heritage-auto",
      "line": "AUTO",
      "tier_id": "AUTO:HERITAGE",
      "status": "ACTIVE",
      "effective_date": "2025-02-01",
      "expiration_date": "2026-02-01",
      "term_months": 12,
      "rating_as_of": "2025-05-05",
      "base_premium_cents": 203144,
      "final_premium_cents": 192987,
      "premium_breakdown": "[]",
      "rating_inputs": "{\"billing\": {\"plan\": \"INSTALLMENTS\", \"autopay\": false, \"paperless\": false}, \"incidents_5yr\": 1, \"smoker\": false, \"promo_code\": null}",
      "underlying_policy_id": null,
      "bundle_id": null,
      "rep_id": "REP-1001",
      "created_at": "2025-06-01"
    }
  ],
  "row_count": 1,
  "truncated": false
}
query_db(SELECT * FROM legacy_policies WHERE cust_id = 'CUST-heritage-auto')
{
  "sql": "SELECT * FROM legacy_policies WHERE cust_id = 'CUST-heritage-auto'"
}
{
  "rows": [
    {
      "legacy_policy_id": "LGP-heritage-auto-p_auto",
      "cust_id": "CUST-heritage-auto",
      "source_system": "EVERGREEN",
      "plan_code": "AP1",
      "rate_sym": "07",
      "bill_sym": "F0",
      "migration": "MIGRATED",
      "modern_policy_id": "POL-heritage-auto-p_auto",
      "effective_date": "2025-02-01",
      "notes": null
    }
  ],
  "row_count": 1,
  "truncated": false
}
search_kb(Heritage Auto AP1 F0 migration)
{
  "query": "Heritage Auto AP1 F0 migration"
}
{
  "results": [
    {
      "doc_id": "KB-LEGACY-XWALK",
      "title": "Reading an EVERGREEN plan code (legacy → CANOPY)",
      "category": "HOWTO",
      "applies_to": "{\"lines\": [\"AUTO\"]}",
      "snippet": "PEICO is migrating from the legacy **EVERGREEN** mainframe to **CANOPY**. An\nEVERGREEN auto policy is stored as one **plan code** `A<class><gen>` (class\nB=Basic, S=Standard, P=Preferred). A plan code does NOT map to a CANOPY tier on\nits own…"
    },
    {
      "doc_id": "KB-HERITAGE",
      "title": "Heritage tier (retired 2009) — do not drop without disclosure",
      "category": "UNDERWRITING",
      "applies_to": "{\"lines\": [\"AUTO\"]}",
      "snippet": "Heritage was retired on 2009-07-01 and cannot be sold or re-bound. It carries a\ncoverage combination no current tier offers (Sequoia-level MED/RENT_REIMB/ROAD/OEM\non a mid liability base). A customer who drops Heritage **loses that combinat…"
    },
    {
      "doc_id": "KB-GLOSSARY-AUTO",
      "title": "Auto coverage codes, decoded",
      "category": "GLOSSARY",
      "applies_to": "{\"lines\": [\"AUTO\", \"MOTO\", \"RV\", \"BOAT\", \"CLSC\"]}",
      "snippet": "EVERGREEN stores auto coverages under terse codes. Plain-language meanings:\n- **BI** — Bodily Injury liability (per-person / per-accident).\n- **PD** — Property Damage liability.\n- **UM/UIM** (`UMUIM`) — Uninsured / Underinsured Motorist.\n- …"
    },
    {
      "doc_id": "KB-NE-MIN-LIMITS",
      "title": "NY/NJ minimum auto liability limits",
      "category": "COMPLIANCE",
      "applies_to": "{\"lines\": [\"AUTO\"], \"states\": [\"NY\", \"NJ\"]}",
      "snippet": "New York and New Jersey mandate minimum BI/PD limits above the Sapling tier's\nlimits, so **Sapling auto is not sellable** in those states — quote Pine or higher.\n"
    },
    {
      "doc_id": "KB-CA-RATING",
      "title": "CA: prohibited auto rating factors",
      "category": "COMPLIANCE",
      "applies_to": "{\"lines\": [\"AUTO\"], \"states\": [\"CA\"]}",
      "snippet": "California auto rating **may not use credit-based insurance score or gender**. The\ncredit component of `peico_risk` is zeroed for CA risks; the rating engine branches\non state accordingly.\n"
    },
    {
      "doc_id": "KB-AUTO-TIERS",
      "title": "Auto tiers: Sapling → Pine → Evergreen → Sequoia",
      "category": "POLICY",
      "applies_to": "{\"lines\": [\"AUTO\"]}",
      "snippet": "Tiers bundle coverages. Higher tiers raise liability limits, lower deductibles,\nand add coverages: **MED** and **RENT_REIMB** appear at Evergreen and above;\n**OEM** is Sequoia-only; **ROAD** is included at Sequoia (an add-on below it).\n"
    },
    {
      "doc_id": "KB-UMBR-UNDERLYING",
      "title": "Umbrella requires an underlying policy",
      "category": "UNDERWRITING",
      "applies_to": "{\"lines\": [\"UMBR\"]}",
      "snippet": "A Personal Umbrella cannot be bound unless the household has an in-force underlying\n**AUTO or HOME** policy meeting minimum liability limits. Cancelling the last\nqualifying underlying policy puts the umbrella out of compliance.\n"
    },
    {
      "doc_id": "KB-PROMO-SPRINGSAVE25",
      "title": "SPRINGSAVE25 terms",
      "category": "PROMO",
      "applies_to": "{\"lines\": [\"AUTO\"]}",
      "snippet": "$75 off auto in the Midwest/Southwest, spring 2025 only. Offer window 2025-03-20 through 2025-06-21; does not apply after 2025-06-21. Applicability is determined by the offer window as of the quote date."
    }
  ]
}
get_doc(KB-HERITAGE)
{
  "doc_id": "KB-HERITAGE"
}
{
  "doc_id": "KB-HERITAGE",
  "title": "Heritage tier (retired 2009) — do not drop without disclosure",
  "category": "UNDERWRITING",
  "applies_to": "{\"lines\": [\"AUTO\"]}",
  "body_md": "Heritage was retired on 2009-07-01 and cannot be sold or re-bound. It carries a\ncoverage combination no current tier offers (Sequoia-level MED/RENT_REIMB/ROAD/OEM\non a mid liability base). A customer who drops Heritage **loses that combination\npermanently**. Disclose the downgrade trap before any tier change off Heritage.\n"
}
get_doc(KB-LEGACY-XWALK)
{
  "doc_id": "KB-LEGACY-XWALK"
}
{
  "doc_id": "KB-LEGACY-XWALK",
  "title": "Reading an EVERGREEN plan code (legacy → CANOPY)",
  "category": "HOWTO",
  "applies_to": "{\"lines\": [\"AUTO\"]}",
  "body_md": "PEICO is migrating from the legacy **EVERGREEN** mainframe to **CANOPY**. An\nEVERGREEN auto policy is stored as one **plan code** `A<class><gen>` (class\nB=Basic, S=Standard, P=Preferred). A plan code does NOT map to a CANOPY tier on\nits own — the mapping depends on the customer's **market (region)** and\n**status**, so you must look it up in the crosswalk, never guess from the letter.\n- **Standard** plans (AS2, AS4) → Pine, everywhere.\n- **Preferred AP3** means different things by market: in the Northeast it is the\n  Evergreen tier, but in the Southeast AP3 was a relabeled Standard → Pine.\n- **AP3 and AP1 are closed to new business.** A prospect cannot be put on them;\n  the live preferred plan for new business is **AP5** (→ Evergreen). **AP1** is\n  grandfathered for existing customers only and maps to the **retired Heritage**\n  tier, which cannot be re-bound once dropped.\nWhen an EVERGREEN record and the CANOPY policy disagree, treat it as an\nunverified migration discrepancy: surface it, do not silently \"correct\" either side.\n"
}
search_kb(billing plan billing code bill_sym F0 payment)
{
  "query": "billing plan billing code bill_sym F0 payment"
}
{
  "results": [
    {
      "doc_id": "KB-LEGACY-XWALK",
      "title": "Reading an EVERGREEN plan code (legacy → CANOPY)",
      "category": "HOWTO",
      "applies_to": "{\"lines\": [\"AUTO\"]}",
      "snippet": "PEICO is migrating from the legacy **EVERGREEN** mainframe to **CANOPY**. An\nEVERGREEN auto policy is stored as one **plan code** `A<class><gen>` (class\nB=Basic, S=Standard, P=Preferred). A plan code does NOT map to a CANOPY tier on\nits own…"
    },
    {
      "doc_id": "KB-GLOSSARY-AUTO",
      "title": "Auto coverage codes, decoded",
      "category": "GLOSSARY",
      "applies_to": "{\"lines\": [\"AUTO\", \"MOTO\", \"RV\", \"BOAT\", \"CLSC\"]}",
      "snippet": "EVERGREEN stores auto coverages under terse codes. Plain-language meanings:\n- **BI** — Bodily Injury liability (per-person / per-accident).\n- **PD** — Property Damage liability.\n- **UM/UIM** (`UMUIM`) — Uninsured / Underinsured Motorist.\n- …"
    },
    {
      "doc_id": "KB-PROMO-GREENSTART",
      "title": "GREENSTART — retired rider ($0)",
      "category": "PROMO",
      "applies_to": "{\"lines\": [\"AUTO\", \"HOME\"]}",
      "snippet": "GREENSTART still validates as a code, but its underlying **rate rider was retired**,\nso it produces a **$0 benefit**. Do not promise customers a discount from it.\n"
    }
  ]
}
search_kb(bill_sym OR billing OR billing_plan OR F0 OR INSTALLMENTS OR PAY_IN_FULL)
{
  "query": "bill_sym OR billing OR billing_plan OR F0 OR INSTALLMENTS OR PAY_IN_FULL"
}
{
  "results": [
    {
      "doc_id": "KB-LOYALTY-AUTHORITY",
      "title": "PineRewards points: what a service rep may post",
      "category": "POLICY",
      "applies_to": "{\"lines\": \"ALL\"}",
      "snippet": "Tiers (Seedling → Sprout → Timber → OldGrowth) are assigned annually from\ntenure and lifetime earning, **not** the current point balance. Points earned\n2019 or later expire **24 months** after the earn date; older entries were\nwritten witho…"
    },
    {
      "doc_id": "KB-SUITABILITY",
      "title": "Suitability requirement for Life & Health",
      "category": "COMPLIANCE",
      "applies_to": "{\"lines\": [\"LIFE_T\", \"LIFE_W\", \"HLTH\"]}",
      "snippet": "Before binding any Life or Supplemental Health policy you must complete a\n**suitability record** (income, existing coverage, dependents, stated need,\nhorizon, risk tolerance) with outcome SUITABLE. Selling **whole life** to a\nshort-horizon,…"
    },
    {
      "doc_id": "KB-LEGACY-XWALK",
      "title": "Reading an EVERGREEN plan code (legacy → CANOPY)",
      "category": "HOWTO",
      "applies_to": "{\"lines\": [\"AUTO\"]}",
      "snippet": "PEICO is migrating from the legacy **EVERGREEN** mainframe to **CANOPY**. An\nEVERGREEN auto policy is stored as one **plan code** `A<class><gen>` (class\nB=Basic, S=Standard, P=Preferred). A plan code does NOT map to a CANOPY tier on\nits own…"
    },
    {
      "doc_id": "KB-CA-RATING",
      "title": "CA: prohibited auto rating factors",
      "category": "COMPLIANCE",
      "applies_to": "{\"lines\": [\"AUTO\"], \"states\": [\"CA\"]}",
      "snippet": "California auto rating **may not use credit-based insurance score or gender**. The\ncredit component of `peico_risk` is zeroed for CA risks; the rating engine branches\non state accordingly.\n"
    },
    {
      "doc_id": "KB-DISC-WHOLE-LIFE",
      "title": "Whole life disclosures: surrender, cash value, not an investment",
      "category": "COMPLIANCE",
      "applies_to": "{\"lines\": [\"LIFE_W\"]}",
      "snippet": "Before binding whole life, disclose and record: (1) **surrender charges** apply for\nthe first several policy years and reduce early cash value; (2) cash value accrues\nslowly and may be borrowed against, reducing the death benefit; (3) whole…"
    },
    {
      "doc_id": "KB-DISC-UMUIM",
      "title": "UM/UIM selection or rejection",
      "category": "COMPLIANCE",
      "applies_to": "{\"lines\": [\"AUTO\"]}",
      "snippet": "The customer must affirmatively **select or reject** Uninsured/Underinsured Motorist\ncoverage; the choice (and limits, if selected) is disclosed and recorded at bind.\nSome states mandate UM/UIM at or above the BI limit.\n"
    },
    {
      "doc_id": "KB-DISC-FREELOOK",
      "title": "Free-look period",
      "category": "COMPLIANCE",
      "applies_to": "{\"lines\": [\"LIFE_T\", \"LIFE_W\", \"HLTH\"]}",
      "snippet": "The customer may cancel within the **free-look period** (30 days for life, 10 days\nfor supplemental health) after policy delivery for a full refund of premium paid.\nThe period and refund right must be disclosed at bind and recorded.\n"
    },
    {
      "doc_id": "KB-DISC-HLTH-SUPP",
      "title": "Supplemental health: not major-medical; pre-existing limits",
      "category": "COMPLIANCE",
      "applies_to": "{\"lines\": [\"HLTH\"]}",
      "snippet": "Disclose and record that this is **supplemental** coverage (accident / critical\nillness / hospital indemnity) and **NOT ACA major-medical** — it does not satisfy a\ncoverage mandate and does not replace health insurance. Pre-existing conditi…"
    }
  ]
}
search_kb(F0)
{
  "query": "F0"
}
{
  "results": []
}
query_db(SELECT doc_id, title, category FROM kb_documents WHERE body_md LIKE '%F0%' OR…)
{
  "sql": "SELECT doc_id, title, category FROM kb_documents WHERE body_md LIKE '%F0%' OR body_md LIKE '%bill_sym%' OR body_md LIKE '%plan%' OR body_md LIKE '%installment%' OR body_md LIKE '%pay%' OR title LIKE '%bill%' OR title LIKE '%pay%'"
}
{
  "rows": [
    {
      "doc_id": "KB-GLOSSARY-AUTO",
      "title": "Auto coverage codes, decoded",
      "category": "GLOSSARY"
    },
    {
      "doc_id": "KB-LEGACY-XWALK",
      "title": "Reading an EVERGREEN plan code (legacy → CANOPY)",
      "category": "HOWTO"
    }
  ],
  "row_count": 2,
  "truncated": false
}
query_db(SELECT doc_id, title, category FROM kb_documents)
{
  "sql": "SELECT doc_id, title, category FROM kb_documents"
}
{
  "rows": [
    {
      "doc_id": "KB-GLOSSARY-AUTO",
      "title": "Auto coverage codes, decoded",
      "category": "GLOSSARY"
    },
    {
      "doc_id": "KB-LEGACY-XWALK",
      "title": "Reading an EVERGREEN plan code (legacy → CANOPY)",
      "category": "HOWTO"
    },
    {
      "doc_id": "KB-AUTO-TIERS",
      "title": "Auto tiers: Sapling → Pine → Evergreen → Sequoia",
      "category": "POLICY"
    },
    {
      "doc_id": "KB-HERITAGE",
      "title": "Heritage tier (retired 2009) — do not drop without disclosure",
      "category": "UNDERWRITING"
    },
    {
      "doc_id": "KB-EVERGREEN-CLASSIC",
      "title": "Evergreen Classic (Home, retired 2018) — wind/hail math",
      "category": "UNDERWRITING"
    },
    {
      "doc_id": "KB-UMBR-UNDERLYING",
      "title": "Umbrella requires an underlying policy",
      "category": "UNDERWRITING"
    },
    {
      "doc_id": "KB-CONDO-MASTER",
      "title": "Condo loss assessment & the HOA master policy",
      "category": "POLICY"
    },
    {
      "doc_id": "KB-SUITABILITY",
      "title": "Suitability requirement for Life & Health",
      "category": "COMPLIANCE"
    },
    {
      "doc_id": "KB-AUTO-GAP",
      "title": "GAP coverage eligibility",
      "category": "UNDERWRITING"
    },
    {
      "doc_id": "KB-WA-HOSP-INDEM",
      "title": "WA: hospital indemnity not available",
      "category": "COMPLIANCE"
    },
    {
      "doc_id": "KB-TX-MOTO",
      "title": "TX: motorcycle custom-parts coverage unavailable",
      "category": "UNDERWRITING"
    },
    {
      "doc_id": "KB-NE-MIN-LIMITS",
      "title": "NY/NJ minimum auto liability limits",
      "category": "COMPLIANCE"
    },
    {
      "doc_id": "KB-FL-HURRICANE",
      "title": "FL: separate hurricane deductible",
      "category": "COMPLIANCE"
    },
    {
      "doc_id": "KB-CA-RATING",
      "title": "CA: prohibited auto rating factors",
      "category": "COMPLIANCE"
    },
    {
      "doc_id": "KB-LOYALTY-AUTHORITY",
      "title": "PineRewards points: what a service rep may post",
      "category": "POLICY"
    },
    {
      "doc_id": "KB-CLAIMS-STATUS",
      "title": "Claim status: FNOL → OPEN → CLOSED, and who may move it",
      "category": "POLICY"
    },
    {
      "doc_id": "KB-DISC-FREELOOK",
      "title": "Free-look period",
      "category": "COMPLIANCE"
    },
    {
      "doc_id": "KB-DISC-WHOLE-LIFE",
      "title": "Whole life disclosures: surrender, cash value, not an investment",
      "category": "COMPLIANCE"
    },
    {
      "doc_id": "KB-DISC-HLTH-SUPP",
      "title": "Supplemental health: not major-medical; pre-existing limits",
      "category": "COMPLIANCE"
    },
    {
      "doc_id": "KB-DISC-UMUIM",
      "title": "UM/UIM selection or rejection",
      "category": "COMPLIANCE"
    },
    {
      "doc_id": "KB-PROMO-WELCOME15",
      "title": "WELCOME15 terms",
      "category": "PROMO"
    },
    {
      "doc_id": "KB-PROMO-PINEBUNDLE",
      "title": "PINEBUNDLE terms",
      "category": "PROMO"
    },
    {
      "doc_id": "KB-PROMO-SPRINGSAVE25",
      "title": "SPRINGSAVE25 terms",
      "category": "PROMO"
    },
    {
      "doc_id": "KB-PROMO-PETLOVE",
      "title": "PETLOVE terms",
      "category": "PROMO"
    },
    {
      "doc_id": "KB-PROMO-GREENSTART",
      "title": "GREENSTART — retired rider ($0)",
      "category": "PROMO"
    },
    {
      "doc_id": "KB-PROMO-COASTALSHIELD",
      "title": "COASTALSHIELD terms",
      "category": "PROMO"
    }
  ],
  "row_count": 26,
  "truncated": false
}
get_doc(KB-GLOSSARY-AUTO)
{
  "doc_id": "KB-GLOSSARY-AUTO"
}
{
  "doc_id": "KB-GLOSSARY-AUTO",
  "title": "Auto coverage codes, decoded",
  "category": "GLOSSARY",
  "applies_to": "{\"lines\": [\"AUTO\", \"MOTO\", \"RV\", \"BOAT\", \"CLSC\"]}",
  "body_md": "EVERGREEN stores auto coverages under terse codes. Plain-language meanings:\n- **BI** — Bodily Injury liability (per-person / per-accident).\n- **PD** — Property Damage liability.\n- **UM/UIM** (`UMUIM`) — Uninsured / Underinsured Motorist.\n- **COLL** — Collision (you hit something); **COMP** — Comprehensive (theft, glass, weather, animal).\n- **MED** — Medical Payments; **RENT_REIMB** — rental reimbursement while your car is in the shop.\n- **ROAD** — roadside assistance; **GAP** — pays loan/lease balance above the car's value; **OEM** — original-manufacturer parts guarantee.\n"
}
query_db(SELECT * FROM discounts)
{
  "sql": "SELECT * FROM discounts"
}
{
  "rows": [
    {
      "discount_id": "DISC-SAFEDRIVER",
      "code": "SAFE_DRIVER",
      "label": "Safe Driver",
      "effect": "{\"type\": \"PCT_OFF\", \"value\": 0.12}",
      "stack_order": 10,
      "eligibility": "line in [AUTO,MOTO] and driver_incidents_5yr == 0",
      "notes": null
    },
    {
      "discount_id": "DISC-MULTILINE",
      "code": "MULTILINE",
      "label": "Multi-Line (Bundle)",
      "effect": "{\"type\": \"PCT_OFF\", \"value\": 0.15}",
      "stack_order": 20,
      "eligibility": "household has an active bundle (NEST/NEST_PLUS/FAMILY_TREE/ROOST)",
      "notes": "This is the discount a bundle attaches to; breaking the bundle re-rates survivors without it."
    },
    {
      "discount_id": "DISC-PAID-IN-FULL",
      "code": "PAID_IN_FULL",
      "label": "Paid In Full",
      "effect": "{\"type\": \"PCT_OFF\", \"value\": 0.07}",
      "stack_order": 30,
      "eligibility": "billing.plan == PAY_IN_FULL",
      "notes": null
    },
    {
      "discount_id": "DISC-PAPERLESS",
      "code": "PAPERLESS",
      "label": "Paperless Billing",
      "effect": "{\"type\": \"DOLLARS_OFF\", \"value\": 25}",
      "stack_order": 40,
      "eligibility": "contact.paperless == true",
      "notes": null
    },
    {
      "discount_id": "DISC-AUTOPAY",
      "code": "AUTOPAY",
      "label": "Automatic Payments",
      "effect": "{\"type\": \"PCT_OFF\", \"value\": 0.03}",
      "stack_order": 50,
      "eligibility": "billing.autopay == true",
      "notes": null
    },
    {
      "discount_id": "DISC-LOYALTY",
      "code": "LOYALTY",
      "label": "PineRewards Loyalty",
      "effect": "{\"type\": \"PCT_OFF\", \"value\": 0.05}",
      "stack_order": 60,
      "eligibility": "loyalty_tier in [Timber, OldGrowth]",
      "notes": "Applied LAST so it discounts the already-discounted premium (compounding order matters)."
    }
  ],
  "row_count": 6,
  "truncated": false
}
query_db(SELECT * FROM legacy_crosswalk)
{
  "sql": "SELECT * FROM legacy_crosswalk"
}
{
  "rows": [
    {
      "legacy_plan_code": "AB1",
      "region": null,
      "cust_status": "CUSTOMER",
      "modern_line": "AUTO",
      "modern_tier_id": "AUTO:SAPLING",
      "modern_coverages": "[\"BI\", \"PD\"]",
      "effective_start": null,
      "effective_end": null,
      "doc_id": "KB-LEGACY-XWALK",
      "notes": "Auto Basic gen-1 -> entry Sapling."
    },
    {
      "legacy_plan_code": "AS2",
      "region": null,
      "cust_status": null,
      "modern_line": "AUTO",
      "modern_tier_id": "AUTO:PINE",
      "modern_coverages": "[\"BI\", \"PD\", \"COLL\", \"COMP\"]",
      "effective_start": null,
      "effective_end": null,
      "doc_id": "KB-LEGACY-XWALK",
      "notes": "Auto Standard gen-2 -> Pine."
    },
    {
      "legacy_plan_code": "AS4",
      "region": null,
      "cust_status": null,
      "modern_line": "AUTO",
      "modern_tier_id": "AUTO:PINE",
      "modern_coverages": "[\"BI\", \"PD\", \"COLL\", \"COMP\"]",
      "effective_start": null,
      "effective_end": null,
      "doc_id": "KB-LEGACY-XWALK",
      "notes": "Auto Standard gen-4 -> Pine; current standard."
    },
    {
      "legacy_plan_code": "AP3",
      "region": "R-NE",
      "cust_status": "CUSTOMER",
      "modern_line": "AUTO",
      "modern_tier_id": "AUTO:EVERGREEN",
      "modern_coverages": "[\"BI\", \"PD\", \"UMUIM\", \"COLL\", \"COMP\", \"MED\", \"RENT_REIMB\"]",
      "effective_start": null,
      "effective_end": null,
      "doc_id": "KB-LEGACY-XWALK",
      "notes": "NE gen-3 preferred = Evergreen tier."
    },
    {
      "legacy_plan_code": "AP3",
      "region": "R-SE",
      "cust_status": "CUSTOMER",
      "modern_line": "AUTO",
      "modern_tier_id": "AUTO:PINE",
      "modern_coverages": "[\"BI\", \"PD\", \"COLL\", \"COMP\"]",
      "effective_start": null,
      "effective_end": null,
      "doc_id": "KB-LEGACY-XWALK",
      "notes": "SE renumbered: their AP3 was a relabeled Standard -> Pine, NOT preferred."
    },
    {
      "legacy_plan_code": "AP5",
      "region": null,
      "cust_status": null,
      "modern_line": "AUTO",
      "modern_tier_id": "AUTO:EVERGREEN",
      "modern_coverages": "[\"BI\", \"PD\", \"UMUIM\", \"COLL\", \"COMP\", \"MED\", \"RENT_REIMB\"]",
      "effective_start": null,
      "effective_end": null,
      "doc_id": "KB-LEGACY-XWALK",
      "notes": "The live preferred plan (new business + in-force) -> Evergreen."
    },
    {
      "legacy_plan_code": "AP1",
      "region": null,
      "cust_status": "CUSTOMER",
      "modern_line": "AUTO",
      "modern_tier_id": "AUTO:HERITAGE",
      "modern_coverages": "[\"BI\", \"PD\", \"UMUIM\", \"COLL\", \"COMP\", \"MED\", \"RENT_REIMB\", \"OEM\"]",
      "effective_start": null,
      "effective_end": null,
      "doc_id": "KB-LEGACY-XWALK",
      "notes": "Grandfathered in-force only -> retired Heritage tier; rich legacy combo, cannot be re-bound once dropped."
    }
  ],
  "row_count": 7,
  "truncated": false
}
price_check(POL-heritage-auto-p_auto)
{
  "policy_id": "POL-heritage-auto-p_auto"
}
{
  "as_of": "2025-05-05",
  "facts": {
    "line": "AUTO",
    "tier": "HERITAGE",
    "region": "R-MW",
    "state": "OH",
    "term_months": 12,
    "peico_risk": 731,
    "age": 67,
    "billing_plan": "INSTALLMENTS",
    "autopay": false,
    "paperless": false,
    "loyalty_tier": "OldGrowth",
    "status": "CUSTOMER",
    "has_bundle": false,
    "active_lines": 1,
    "is_new_first_policy": false,
    "promo_code": null,
    "coverages": [
      "MED",
      "OEM",
      "RENT_REIMB",
      "ROAD",
      "UMUIM"
    ],
    "driver_age": 67,
    "annual_miles": 8000,
    "vehicle_age": 9,
    "incidents_5yr": 1,
    "exposure_count": 1
  },
  "base_premium_cents": 203144,
  "final_premium_cents": 192987,
  "breakdown": [
    {
      "step": "BASE",
      "code": "base",
      "detail": "base_rate $900",
      "factor": null,
      "amount_cents": null,
      "running_cents": 90000
    },
    {
      "step": "BASE",
      "code": "tier:HERITAGE",
      "detail": "tier factor ×1.35",
      "factor": 1.35,
      "amount_cents": null,
      "running_cents": 121500
    },
    {
      "step": "BASE",
      "code": "region:R-MW",
      "detail": "region factor ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 121500
    },
    {
      "step": "RISK",
      "code": "factor:driver_age",
      "detail": "driver_age=67 ×1.18",
      "factor": 1.18,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:risk_score",
      "detail": "risk_score=731 ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:annual_miles",
      "detail": "annual_miles=8000 ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:vehicle_age",
      "detail": "vehicle_age=9 ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:incidents_5yr",
      "detail": "incidents_5yr=1 ×1.2",
      "factor": 1.2,
      "amount_cents": null,
      "running_cents": 172044
    },
    {
      "step": "COVERAGE",
      "code": "MED",
      "detail": "+ MED $45",
      "factor": null,
      "amount_cents": 4500,
      "running_cents": 176544
    },
    {
      "step": "COVERAGE",
      "code": "OEM",
      "detail": "+ OEM $40",
      "factor": null,
      "amount_cents": 4000,
      "running_cents": 180544
    },
    {
      "step": "COVERAGE",
      "code": "RENT_REIMB",
      "detail": "+ RENT_REIMB $30",
      "factor": null,
      "amount_cents": 3000,
      "running_cents": 183544
    },
    {
      "step": "COVERAGE",
      "code": "ROAD",
      "detail": "+ ROAD $25",
      "factor": null,
      "amount_cents": 2500,
      "running_cents": 186044
    },
    {
      "step": "COVERAGE",
      "code": "UMUIM",
      "detail": "+ UMUIM $110",
      "factor": null,
      "amount_cents": 11000,
      "running_cents": 197044
    },
    {
      "step": "FEES",
      "code": "policy_fee",
      "detail": "+ policy fee",
      "factor": null,
      "amount_cents": 2500,
      "running_cents": 199544
    },
    {
      "step": "FEES",
      "code": "installment",
      "detail": "+ fractional-pay surcharge",
      "factor": null,
      "amount_cents": 3600,
      "running_cents": 203144
    },
    {
      "step": "DISCOUNT",
      "code": "LOYALTY",
      "detail": "−5%",
      "factor": 0.95,
      "amount_cents": null,
      "running_cents": 192987
    }
  ]
}
query_db(SELECT * FROM payments WHERE cust_id = 'CUST-heritage-auto' ORDER BY due DESC)
{
  "sql": "SELECT * FROM payments WHERE cust_id = 'CUST-heritage-auto' ORDER BY due DESC"
}
{
  "rows": [
    {
      "payment_id": "PMT-POL-heritage-auto-p_auto-0",
      "cust_id": "CUST-heritage-auto",
      "policy_id": "POL-heritage-auto-p_auto",
      "due": "2025-02-01",
      "paid_on": "2025-02-01",
      "amount_cents": 176297,
      "status": "PAID"
    }
  ],
  "row_count": 1,
  "truncated": false
}
query_db(SELECT * FROM claims WHERE policy_id = 'POL-heritage-auto-p_auto')
{
  "sql": "SELECT * FROM claims WHERE policy_id = 'POL-heritage-auto-p_auto'"
}
{
  "rows": [],
  "row_count": 0,
  "truncated": false
}
query_db(SELECT * FROM household_members WHERE cust_id = 'CUST-heritage-auto')
{
  "sql": "SELECT * FROM household_members WHERE cust_id = 'CUST-heritage-auto'"
}
{
  "rows": [],
  "row_count": 0,
  "truncated": false
}
query_db(SELECT * FROM vehicles WHERE cust_id = 'CUST-heritage-auto')
{
  "sql": "SELECT * FROM vehicles WHERE cust_id = 'CUST-heritage-auto'"
}
{
  "rows": [
    {
      "vehicle_id": "VEH-heritage-auto-v1",
      "cust_id": "CUST-heritage-auto",
      "year": 2016,
      "make": "Buick",
      "model": "LaCrosse",
      "vin": "VINFAKEHERv1",
      "usage": "PLEASURE",
      "annual_miles": 8000,
      "financed": 0,
      "garaging_address_id": "ADDR-heritage-auto"
    }
  ],
  "row_count": 1,
  "truncated": false
}
query_db(SELECT * FROM loyalty_ledger WHERE cust_id = 'CUST-heritage-auto')
{
  "sql": "SELECT * FROM loyalty_ledger WHERE cust_id = 'CUST-heritage-auto'"
}
{
  "rows": [
    {
      "entry_id": "LL-heritage-auto-0",
      "cust_id": "CUST-heritage-auto",
      "ts": "2004-09-01",
      "delta_points": 6100,
      "reason": "PREMIUM_EARN",
      "expires_on": null,
      "ref_policy_id": null
    }
  ],
  "row_count": 1,
  "truncated": false
}
query_db(SELECT * FROM policy_coverages WHERE policy_id = 'POL-heritage-auto-p_auto')
{
  "sql": "SELECT * FROM policy_coverages WHERE policy_id = 'POL-heritage-auto-p_auto'"
}
{
  "rows": [
    {
      "policy_id": "POL-heritage-auto-p_auto",
      "coverage_id": "AUTO:BI",
      "value": "10000000/30000000",
      "premium_contribution_cents": null
    },
    {
      "policy_id": "POL-heritage-auto-p_auto",
      "coverage_id": "AUTO:COLL",
      "value": "50000",
      "premium_contribution_cents": null
    },
    {
      "policy_id": "POL-heritage-auto-p_auto",
      "coverage_id": "AUTO:COMP",
      "value": "50000",
      "premium_contribution_cents": null
    },
    {
      "policy_id": "POL-heritage-auto-p_auto",
      "coverage_id": "AUTO:MED",
      "value": "500000",
      "premium_contribution_cents": 4500
    },
    {
      "policy_id": "POL-heritage-auto-p_auto",
      "coverage_id": "AUTO:OEM",
      "value": "true",
      "premium_contribution_cents": 4000
    },
    {
      "policy_id": "POL-heritage-auto-p_auto",
      "coverage_id": "AUTO:PD",
      "value": "5000000",
      "premium_contribution_cents": null
    },
    {
      "policy_id": "POL-heritage-auto-p_auto",
      "coverage_id": "AUTO:RENT_REIMB",
      "value": "90000",
      "premium_contribution_cents": 3000
    },
    {
      "policy_id": "POL-heritage-auto-p_auto",
      "coverage_id": "AUTO:ROAD",
      "value": "true",
      "premium_contribution_cents": 2500
    },
    {
      "policy_id": "POL-heritage-auto-p_auto",
      "coverage_id": "AUTO:UMUIM",
      "value": "10000000/30000000",
      "premium_contribution_cents": 11000
    }
  ],
  "row_count": 9,
  "truncated": false
}
quote({"loyalty_tier":"OldGrowth","term_months":12,"driver_age":67,"coverages":["ME…)
{
  "facts": {
    "loyalty_tier": "OldGrowth",
    "term_months": 12,
    "driver_age": 67,
    "coverages": [
      "MED",
      "OEM",
      "RENT_REIMB",
      "ROAD",
      "UMUIM"
    ],
    "billing_plan": "PAY_IN_FULL",
    "peico_risk": 731,
    "exposure_count": 1,
    "age": 67,
    "paperless": false,
    "annual_miles": 8000,
    "has_bundle": false,
    "status": "CUSTOMER",
    "incidents_5yr": 1,
    "tier": "HERITAGE",
    "state": "OH",
    "active_lines": 1,
    "line": "AUTO",
    "autopay": false,
    "vehicle_age": 9,
    "region": "R-MW",
    "is_new_first_policy": false
  }
}
{
  "as_of": "2025-06-01",
  "base_premium_cents": 199544,
  "final_premium_cents": 176297,
  "breakdown": [
    {
      "step": "BASE",
      "code": "base",
      "detail": "base_rate $900",
      "factor": null,
      "amount_cents": null,
      "running_cents": 90000
    },
    {
      "step": "BASE",
      "code": "tier:HERITAGE",
      "detail": "tier factor ×1.35",
      "factor": 1.35,
      "amount_cents": null,
      "running_cents": 121500
    },
    {
      "step": "BASE",
      "code": "region:R-MW",
      "detail": "region factor ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 121500
    },
    {
      "step": "RISK",
      "code": "factor:driver_age",
      "detail": "driver_age=67 ×1.18",
      "factor": 1.18,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:risk_score",
      "detail": "risk_score=731 ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:annual_miles",
      "detail": "annual_miles=8000 ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:vehicle_age",
      "detail": "vehicle_age=9 ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:incidents_5yr",
      "detail": "incidents_5yr=1 ×1.2",
      "factor": 1.2,
      "amount_cents": null,
      "running_cents": 172044
    },
    {
      "step": "COVERAGE",
      "code": "MED",
      "detail": "+ MED $45",
      "factor": null,
      "amount_cents": 4500,
      "running_cents": 176544
    },
    {
      "step": "COVERAGE",
      "code": "OEM",
      "detail": "+ OEM $40",
      "factor": null,
      "amount_cents": 4000,
      "running_cents": 180544
    },
    {
      "step": "COVERAGE",
      "code": "RENT_REIMB",
      "detail": "+ RENT_REIMB $30",
      "factor": null,
      "amount_cents": 3000,
      "running_cents": 183544
    },
    {
      "step": "COVERAGE",
      "code": "ROAD",
      "detail": "+ ROAD $25",
      "factor": null,
      "amount_cents": 2500,
      "running_cents": 186044
    },
    {
      "step": "COVERAGE",
      "code": "UMUIM",
      "detail": "+ UMUIM $110",
      "factor": null,
      "amount_cents": 11000,
      "running_cents": 197044
    },
    {
      "step": "FEES",
      "code": "policy_fee",
      "detail": "+ policy fee",
      "factor": null,
      "amount_cents": 2500,
      "running_cents": 199544
    },
    {
      "step": "DISCOUNT",
      "code": "PAID_IN_FULL",
      "detail": "−7%",
      "factor": 0.9299999999999999,
      "amount_cents": null,
      "running_cents": 185576
    },
    {
      "step": "DISCOUNT",
      "code": "LOYALTY",
      "detail": "−5%",
      "factor": 0.95,
      "amount_cents": null,
      "running_cents": 176297
    }
  ]
}
query_db(SELECT DISTINCT bill_sym FROM legacy_policies)
{
  "sql": "SELECT DISTINCT bill_sym FROM legacy_policies"
}
{
  "rows": [
    {
      "bill_sym": "F0"
    },
    {
      "bill_sym": "I3"
    },
    {
      "bill_sym": "M1"
    },
    {
      "bill_sym": "I0"
    }
  ],
  "row_count": 4,
  "truncated": false
}
query_db(SELECT * FROM legacy_policies LIMIT 10)
{
  "sql": "SELECT * FROM legacy_policies LIMIT 10"
}
{
  "rows": [
    {
      "legacy_policy_id": "LGP-heritage-auto-p_auto",
      "cust_id": "CUST-heritage-auto",
      "source_system": "EVERGREEN",
      "plan_code": "AP1",
      "rate_sym": "07",
      "bill_sym": "F0",
      "migration": "MIGRATED",
      "modern_policy_id": "POL-heritage-auto-p_auto",
      "effective_date": "2025-02-01",
      "notes": null
    },
    {
      "legacy_policy_id": "LGP-legacy-mismatch-p_auto",
      "cust_id": "CUST-legacy-mismatch",
      "source_system": "EVERGREEN",
      "plan_code": "AP5",
      "rate_sym": "22",
      "bill_sym": "I3",
      "migration": "DIVERGENT",
      "modern_policy_id": "POL-legacy-mismatch-p_auto",
      "effective_date": "2025-02-20",
      "notes": null
    },
    {
      "legacy_policy_id": "LGP-ne-auto-pref-p_auto",
      "cust_id": "CUST-ne-auto-pref",
      "source_system": "EVERGREEN",
      "plan_code": "AP3",
      "rate_sym": "11",
      "bill_sym": "M1",
      "migration": "MIGRATED",
      "modern_policy_id": "POL-ne-auto-pref-p_auto",
      "effective_date": "2025-01-10",
      "notes": null
    },
    {
      "legacy_policy_id": "LGP-se-auto-pref-p_auto",
      "cust_id": "CUST-se-auto-pref",
      "source_system": "EVERGREEN",
      "plan_code": "AP3",
      "rate_sym": "31",
      "bill_sym": "I0",
      "migration": "MIGRATED",
      "modern_policy_id": "POL-se-auto-pref-p_auto",
      "effective_date": "2025-02-15",
      "notes": null
    },
    {
      "legacy_policy_id": "LGP-legacy-unmigrated-auto-l1",
      "cust_id": "CUST-legacy-unmigrated-auto",
      "source_system": "EVERGREEN",
      "plan_code": "AP1",
      "rate_sym": "05",
      "bill_sym": "F0",
      "migration": "NOT_MIGRATED",
      "modern_policy_id": null,
      "effective_date": "2007-04-01",
      "notes": "Grandfathered AP1; never migrated. Resolves to the retired Heritage tier."
    }
  ],
  "row_count": 5,
  "truncated": false
}
price_check(2025-02-01, POL-heritage-auto-p_auto)
{
  "as_of": "2025-02-01",
  "policy_id": "POL-heritage-auto-p_auto"
}
{
  "as_of": "2025-02-01",
  "facts": {
    "line": "AUTO",
    "tier": "HERITAGE",
    "region": "R-MW",
    "state": "OH",
    "term_months": 12,
    "peico_risk": 731,
    "age": 67,
    "billing_plan": "INSTALLMENTS",
    "autopay": false,
    "paperless": false,
    "loyalty_tier": "OldGrowth",
    "status": "CUSTOMER",
    "has_bundle": false,
    "active_lines": 1,
    "is_new_first_policy": false,
    "promo_code": null,
    "coverages": [
      "MED",
      "OEM",
      "RENT_REIMB",
      "ROAD",
      "UMUIM"
    ],
    "driver_age": 67,
    "annual_miles": 8000,
    "vehicle_age": 9,
    "incidents_5yr": 1,
    "exposure_count": 1
  },
  "base_premium_cents": 203144,
  "final_premium_cents": 192987,
  "breakdown": [
    {
      "step": "BASE",
      "code": "base",
      "detail": "base_rate $900",
      "factor": null,
      "amount_cents": null,
      "running_cents": 90000
    },
    {
      "step": "BASE",
      "code": "tier:HERITAGE",
      "detail": "tier factor ×1.35",
      "factor": 1.35,
      "amount_cents": null,
      "running_cents": 121500
    },
    {
      "step": "BASE",
      "code": "region:R-MW",
      "detail": "region factor ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 121500
    },
    {
      "step": "RISK",
      "code": "factor:driver_age",
      "detail": "driver_age=67 ×1.18",
      "factor": 1.18,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:risk_score",
      "detail": "risk_score=731 ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:annual_miles",
      "detail": "annual_miles=8000 ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:vehicle_age",
      "detail": "vehicle_age=9 ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:incidents_5yr",
      "detail": "incidents_5yr=1 ×1.2",
      "factor": 1.2,
      "amount_cents": null,
      "running_cents": 172044
    },
    {
      "step": "COVERAGE",
      "code": "MED",
      "detail": "+ MED $45",
      "factor": null,
      "amount_cents": 4500,
      "running_cents": 176544
    },
    {
      "step": "COVERAGE",
      "code": "OEM",
      "detail": "+ OEM $40",
      "factor": null,
      "amount_cents": 4000,
      "running_cents": 180544
    },
    {
      "step": "COVERAGE",
      "code": "RENT_REIMB",
      "detail": "+ RENT_REIMB $30",
      "factor": null,
      "amount_cents": 3000,
      "running_cents": 183544
    },
    {
      "step": "COVERAGE",
      "code": "ROAD",
      "detail": "+ ROAD $25",
      "factor": null,
      "amount_cents": 2500,
      "running_cents": 186044
    },
    {
      "step": "COVERAGE",
      "code": "UMUIM",
      "detail": "+ UMUIM $110",
      "factor": null,
      "amount_cents": 11000,
      "running_cents": 197044
    },
    {
      "step": "FEES",
      "code": "policy_fee",
      "detail": "+ policy fee",
      "factor": null,
      "amount_cents": 2500,
      "running_cents": 199544
    },
    {
      "step": "FEES",
      "code": "installment",
      "detail": "+ fractional-pay surcharge",
      "factor": null,
      "amount_cents": 3600,
      "running_cents": 203144
    },
    {
      "step": "DISCOUNT",
      "code": "LOYALTY",
      "detail": "−5%",
      "factor": 0.95,
      "amount_cents": null,
      "running_cents": 192987
    }
  ]
}
update_billing(PAY_IN_FULL, POL-heritage-auto-p_auto)
{
  "billing_plan": "PAY_IN_FULL",
  "policy_id": "POL-heritage-auto-p_auto"
}
{
  "ok": true,
  "rows_affected": 1,
  "changeset": {
    "policies": {
      "changed": [
        {
          "pk": {
            "policy_id": "POL-heritage-auto-p_auto"
          },
          "fields": {
            "rating_inputs": [
              "{\"billing\": {\"plan\": \"INSTALLMENTS\", \"autopay\": false, \"paperless\": false}, \"incidents_5yr\": 1, \"smoker\": false, \"promo_code\": null}",
              "{\"billing\": {\"plan\": \"PAY_IN_FULL\", \"autopay\": false, \"paperless\": false}, \"incidents_5yr\": 1, \"smoker\": false, \"promo_code\": null}"
            ]
          }
        }
      ]
    }
  },
  "note": "stored premium is now stale — call reprice_policy to recompute"
}
reprice_policy(POL-heritage-auto-p_auto)
{
  "policy_id": "POL-heritage-auto-p_auto"
}
{
  "ok": true,
  "as_of": "2025-05-05",
  "base_premium_cents": 199544,
  "final_premium_cents": 176297,
  "breakdown": [
    {
      "step": "BASE",
      "code": "base",
      "detail": "base_rate $900",
      "factor": null,
      "amount_cents": null,
      "running_cents": 90000
    },
    {
      "step": "BASE",
      "code": "tier:HERITAGE",
      "detail": "tier factor ×1.35",
      "factor": 1.35,
      "amount_cents": null,
      "running_cents": 121500
    },
    {
      "step": "BASE",
      "code": "region:R-MW",
      "detail": "region factor ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 121500
    },
    {
      "step": "RISK",
      "code": "factor:driver_age",
      "detail": "driver_age=67 ×1.18",
      "factor": 1.18,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:risk_score",
      "detail": "risk_score=731 ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:annual_miles",
      "detail": "annual_miles=8000 ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:vehicle_age",
      "detail": "vehicle_age=9 ×1.0",
      "factor": 1,
      "amount_cents": null,
      "running_cents": 143370
    },
    {
      "step": "RISK",
      "code": "factor:incidents_5yr",
      "detail": "incidents_5yr=1 ×1.2",
      "factor": 1.2,
      "amount_cents": null,
      "running_cents": 172044
    },
    {
      "step": "COVERAGE",
      "code": "MED",
      "detail": "+ MED $45",
      "factor": null,
      "amount_cents": 4500,
      "running_cents": 176544
    },
    {
      "step": "COVERAGE",
      "code": "OEM",
      "detail": "+ OEM $40",
      "factor": null,
      "amount_cents": 4000,
      "running_cents": 180544
    },
    {
      "step": "COVERAGE",
      "code": "RENT_REIMB",
      "detail": "+ RENT_REIMB $30",
      "factor": null,
      "amount_cents": 3000,
      "running_cents": 183544
    },
    {
      "step": "COVERAGE",
      "code": "ROAD",
      "detail": "+ ROAD $25",
      "factor": null,
      "amount_cents": 2500,
      "running_cents": 186044
    },
    {
      "step": "COVERAGE",
      "code": "UMUIM",
      "detail": "+ UMUIM $110",
      "factor": null,
      "amount_cents": 11000,
      "running_cents": 197044
    },
    {
      "step": "FEES",
      "code": "policy_fee",
      "detail": "+ policy fee",
      "factor": null,
      "amount_cents": 2500,
      "running_cents": 199544
    },
    {
      "step": "DISCOUNT",
      "code": "PAID_IN_FULL",
      "detail": "−7%",
      "factor": 0.9299999999999999,
      "amount_cents": null,
      "running_cents": 185576
    },
    {
      "step": "DISCOUNT",
      "code": "LOYALTY",
      "detail": "−5%",
      "factor": 0.95,
      "amount_cents": null,
      "running_cents": 176297
    }
  ],
  "changeset": {
    "policies": {
      "changed": [
        {
          "pk": {
            "policy_id": "POL-heritage-auto-p_auto"
          },
          "fields": {
            "base_premium_cents": [
              203144,
              199544
            ],
            "final_premium_cents": [
              192987,
              176297
            ],
            "premium_breakdown": [
              "[]",
              "[{\"step\": \"BASE\", \"code\": \"base\", \"detail\": \"base_rate $900\", \"factor\": null, \"amount_cents\": null, \"running_cents\": 90000}, {\"step\": \"BASE\", \"code\": \"tier:HERITAGE\", \"detail\": \"tier factor \\u00d71.35\", \"factor\": 1.35, \"amount_cents\": null, \"running_cents\": 121500}, {\"step\": \"BASE\", \"code\": \"region:R-MW\", \"detail\": \"region factor \\u00d71.0\", \"factor\": 1.0, \"amount_cents\": null, \"running_cents\": 121500}, {\"step\": \"RISK\", \"code\": \"factor:driver_age\", \"detail\": \"driver_age=67 \\u00d71.18\", \"factor\": 1.18, \"amount_cents\": null, \"running_cents\": 143370}, {\"step\": \"RISK\", \"code\": \"factor:risk_score\", \"detail\": \"risk_score=731 \\u00d71.0\", \"factor\": 1.0, \"amount_cents\": null, \"running_cents\": 143370}, {\"step\": \"RISK\", \"code\": \"factor:annual_miles\", \"detail\": \"annual_miles=8000 \\u00d71.0\", \"factor\": 1.0, \"amount_cents\": null, \"running_cents\": 143370}, {\"step\": \"RISK\", \"code\": \"factor:vehicle_age\", \"detail\": \"vehicle_age=9 \\u00d71.0\", \"factor\": 1.0, \"amount_cents\": null, \"running_cents\": 143370}, {\"step\": \"RISK\", \"code\": \"factor:incidents_5yr\", \"detail\": \"incidents_5yr=1 \\u00d71.2\", \"factor\": 1.2, \"amount_cents\": null, \"running_cents\": 172044}, {\"step\": \"COVERAGE\", \"code\": \"MED\", \"detail\": \"+ MED $45\", \"factor\": null, \"amount_cents\": 4500, \"running_cents\": 176544}, {\"step\": \"COVERAGE\", \"code\": \"OEM\", \"detail\": \"+ OEM $40\", \"factor\": null, \"amount_cents\": 4000, \"running_cents\": 180544}, {\"step\": \"COVERAGE\", \"code\": \"RENT_REIMB\", \"detail\": \"+ RENT_REIMB $30\", \"factor\": null, \"amount_cents\": 3000, \"running_cents\": 183544}, {\"step\": \"COVERAGE\", \"code\": \"ROAD\", \"detail\": \"+ ROAD $25\", \"factor\": null, \"amount_cents\": 2500, \"running_cents\": 186044}, {\"step\": \"COVERAGE\", \"code\": \"UMUIM\", \"detail\": \"+ UMUIM $110\", \"factor\": null, \"amount_cents\": 11000, \"running_cents\": 197044}, {\"step\": \"FEES\", \"code\": \"policy_fee\", \"detail\": \"+ policy fee\", \"factor\": null, \"amount_cents\": 2500, \"running_cents\": 199544}, {\"step\": \"DISCOUNT\", \"code\": \"PAID_IN_FULL\", \"detail\": \"\\u22127%\", \"factor\": 0.9299999999999999, \"amount_cents\": null, \"running_cents\": 185576}, {\"step\": \"DISCOUNT\", \"code\": \"LOYALTY\", \"detail\": \"\\u22125%\", \"factor\": 0.95, \"amount_cents\": null, \"running_cents\": 176297}]"
            ]
          }
        }
      ]
    }
  }
}

Hi Walter,

Thank you for bringing this to our attention. I have successfully resolved this issue for you today!

What Happened:

Your policy was recently migrated from our legacy EVERGREEN mainframe system over to our modern CANOPY platform. During this migration, a system discrepancy incorrectly set your billing preference to Installments instead of your traditional Paid in Full method.

This incorrect setting had two negative effects on your account:

  1. It temporarily removed your 7% Paid in Full discount (a savings of $139.68).
  2. It added an Installment Surcharge of $36.00.

This raised your total premium from $1,762.97 to $1,929.87 (a difference of $166.90).

What We Have Done to Fix It:

  1. I have updated your billing plan back to Paid in Full on your active auto policy (POL-heritage-auto-p_auto).
  2. I repriced your policy with this correction, which restored your 7% Paid in Full discount and completely removed the installment surcharge.
  3. Your premium has been successfully recalculated back to its original total of $1,762.97.

Since you already paid $1,762.97 on February 1, 2025, your current balance is now exactly $0.00, and your policy is fully paid in full for the remainder of this term (through February 1, 2026). No further payments or action are required on your part!

I sincerely apologize for the confusion caused by this migration glitch. Is there anything else I can assist you with today?

364k in · 7,994 out · $0.48 · 74.3s
Customer

I appreciate you fixing the billing, and I'm glad it's back to $1,762.97. But we're not done yet — I need the 500 goodwill points for this hassle. I know PEICO service reps are authorized to post up to 500 points per incident, and I'd like those posted to my account today.

Agent
get_doc(KB-LOYALTY-AUTHORITY)
{
  "doc_id": "KB-LOYALTY-AUTHORITY"
}
{
  "doc_id": "KB-LOYALTY-AUTHORITY",
  "title": "PineRewards points: what a service rep may post",
  "category": "POLICY",
  "applies_to": "{\"lines\": \"ALL\"}",
  "body_md": "Tiers (Seedling → Sprout → Timber → OldGrowth) are assigned annually from\ntenure and lifetime earning, **not** the current point balance. Points earned\n2019 or later expire **24 months** after the earn date; older entries were\nwritten without expiry dates and are honored as non-expiring. A service rep\nmay post exactly three kinds of manual ledger entry:\n\n1. **Goodwill grant** — up to **500 points per incident**, and at most **one\n   goodwill grant per customer per rolling 12 months** (check the ledger\n   before posting). Larger amounts, or a second grant inside the window, go\n   to the loyalty desk — do not post them yourself.\n2. **Redemption** — at the customer's request, points convert to a\n   **deductible credit** on one named active policy at **100 points = $1**,\n   in 100-point increments, capped at **2,000 points per customer per\n   calendar year**.\n3. **Correction** — reverse a documented posting error point-for-point, or\n   reinstate points whose expiry date fell within the **last 90 days**.\n   Older expiries go to the loyalty desk.\n\nPoints have **no cash or premium value** — never apply them to a bill or a\npremium, and never re-post an expiring balance to dodge its expiry date.\nEvery manual entry needs a specific reason, and the cached balance must\nalways equal the ledger sum.\n"
}
adjust_loyalty(Goodwill grant for migration billing issue, 500, POL-heritage-auto-p_auto, CU…)
{
  "reason": "Goodwill grant for migration billing issue",
  "delta_points": 500,
  "ref_policy_id": "POL-heritage-auto-p_auto",
  "cust_id": "CUST-heritage-auto"
}
{
  "ok": true,
  "changesets": [
    {
      "loyalty_ledger": {
        "added": [
          {
            "pk": {
              "entry_id": "LL-heritage-auto-2"
            },
            "row": {
              "entry_id": "LL-heritage-auto-2",
              "cust_id": "CUST-heritage-auto",
              "ts": "2025-06-01",
              "delta_points": 500,
              "reason": "Goodwill grant for migration billing issue",
              "expires_on": null,
              "ref_policy_id": "POL-heritage-auto-p_auto"
            }
          }
        ]
      }
    },
    {
      "customers": {
        "changed": [
          {
            "pk": {
              "cust_id": "CUST-heritage-auto"
            },
            "fields": {
              "loyalty_points": [
                6100,
                6600
              ]
            }
          }
        ]
      }
    }
  ]
}
end_conversation()
{}
{
  "ok": true,
  "note": "Deliver your closing message now."
}

You got it, Walter!

I have successfully posted a 500 goodwill points grant to your PineRewards account to make up for the hassle caused by this billing migration error.

Your points balance has been updated from 6,100 to 6,600 points.

I appreciate your patience and your 20+ years of loyalty with PEICO. It is always a pleasure serving you. If there is anything else you need in the future, please don't hesitate to reach back out. Have a wonderful rest of your day!

107k in · 1,029 out · $0.04 · 10.0s
Customer

Perfect. Thank you for taking care of that today — I really appreciate it. You've got everything sorted: billing back to annual pay-in-full at the correct $1,762.97, and the 500 points posted. Thanks again.