cs.gohigherlevel

Playbook

The live state graph, label set, and voice rules the engine actually loads — read fresh from disk/DB on every request, never a hand-maintained copy.

State graph, state × label matrix, interrupts

live from cs_policy.py · last modified 2026-08-14 19:55:09 UTC · no separate version-history tracking exists yet — this is the file's on-disk mtime.

"ESCALATE"
"EXECUTE_PROMISE"
"FULL_REFUND"
"OFFER_DISCOUNT_10_KEEP"
"OFFER_DISCOUNT_20_KEEP"
"OFFER_PRICE_MINUS_SHIPPING"
"OFFER_REPLACEMENT"
"REPLY_INFO"
200.0
[
  [
    "LEGAL_THREAT",
    "<function _interrupt_legal_threat at 0x7889678278a0>"
  ],
  [
    "THREATENS_CHARGEBACK",
    "<function _interrupt_chargeback at 0x788966f44a90>"
  ]
]
5
2
3
{
  "0": "NEW",
  "1": "REPLACEMENT_OFFERED",
  "2": "KEEP_10_OFFERED",
  "3": "KEEP_20_OFFERED",
  "4": "PRICE_MINUS_SHIPPING_OFFERED",
  "5": "FULL_REFUND_OFFERED"
}
0
4
1
"_Feature((3, 7, 0, 'beta', 1), None, 16777216)"

Label set (17 active, live from cs_labels)

LabelDescriptionReal example
ACCEPTS_OFFERCustomer agrees to the offer/resolution proposedno example logged yet
ADDRESS_CHANGECustomer requests a shipping address changeno example logged yet
ASKS_REFUNDCustomer explicitly requests a refundno example logged yet
ASKS_REPLACEMENTCustomer explicitly requests a replacement itemno example logged yet
AUTHENTICITY_DOUBTCustomer questions whether the product is authentic/genuineno example logged yet
CANCEL_REQUESTCustomer requests order cancellationno example logged yet
DAMAGEDItem arrived damaged or defectiveno example logged yet
LEGAL_THREATCustomer threatens legal action or invokes a regulator/lawyerno example logged yet
NOT_ARRIVEDOrder has not arrived (lost/delayed, customer reporting non-receipt)no example logged yet
OFF_SCRIPTMessage doesn't fit any other label / needs human judgementno example logged yet
PRODUCT_QUESTIONGeneral question about a product's features/materialsno example logged yet
REFUSES_OFFERCustomer rejects the offer/resolution proposedno example logged yet
SIZING_QUESTIONPre-purchase or general sizing/fit questionno example logged yet
THREATENS_CHARGEBACKCustomer threatens or mentions a chargeback/disputeno example logged yet
WHERE_IS_ORDERCustomer asking for order/shipping status (WISMO)no example logged yet
WRONG_ITEMCustomer received the wrong item entirelyno example logged yet
WRONG_SIZECustomer received the wrong sizeno example logged yet

Label spec (engine-side)

live from cs_labels_spec.py · last modified 2026-08-14 19:55:07 UTC · no separate version-history tracking exists yet — this is the file's on-disk mtime.

[
  "LEGAL_THREAT",
  "THREATENS_CHARGEBACK"
]
[
  "ACCEPTS_OFFER",
  "ADDRESS_CHANGE",
  "ASKS_REFUND",
  "ASKS_REPLACEMENT",
  "AUTHENTICITY_DOUBT",
  "CANCEL_REQUEST",
  "DAMAGED",
  "LEGAL_THREAT",
  "NOT_ARRIVED",
  "OFF_SCRIPT",
  "PRODUCT_QUESTION",
  "REFUSES_OFFER",
  "SIZING_QUESTION",
  "THREATENS_CHARGEBACK",
  "WHERE_IS_ORDER",
  "WRONG_ITEM",
  "WRONG_SIZE"
]
{
  "ACCEPTS_OFFER": {
    "description": "Customer agrees to the offer/resolution proposed",
    "example": "Customer replies 'ok that works, thank you' to a settlement we already offered."
  },
  "ADDRESS_CHANGE": {
    "description": "Customer requests a shipping address change",
    "example": "'Can you ship to my new address instead, I moved.'"
  },
  "ASKS_REFUND": {
    "description": "Customer explicitly requests a refund",
    "example": "'I'd like a refund please, I changed my mind.' No claim of a defect."
  },
  "ASKS_REPLACEMENT": {
    "description": "Customer explicitly requests a replacement item",
    "example": "'Can you send me a replacement in a different colour.'"
  },
  "AUTHENTICITY_DOUBT": {
    "description": "Customer questions whether the product is authentic/genuine",
    "example": "'Is this a real Longchamp bag? It doesn't look right.'"
  },
  "CANCEL_REQUEST": {
    "description": "Customer requests order cancellation",
    "example": "'Please cancel my order, I don't want it anymore.'"
  },
  "DAMAGED": {
    "description": "Item arrived damaged or defective",
    "example": "'The item arrived with a broken zip / stain / tear.'"
  },
  "LEGAL_THREAT": {
    "description": "Customer threatens legal action or invokes a regulator/lawyer",
    "example": "'I will be reporting this to Trading Standards / my solicitor.'"
  },
  "NOT_ARRIVED": {
    "description": "Order has not arrived (lost/delayed, customer reporting non-receipt)",
    "example": "'It's been 3 weeks and nothing has shown up.'"
  },
  "OFF_SCRIPT": {
    "description": "Message doesn't fit any other label / needs human judgement",
    "example": "Anything ambiguous, multi-topic in a way that defeats one label, or clearly unusual."
  },
  "PRODUCT_QUESTION": {
    "description": "General question about a product's features/materials",
    "example": "'What fabric is this made of? Is it machine washable?'"
  },
  "REFUSES_OFFER": {
    "description": "Customer rejects the offer/resolution proposed",
    "example": "'No, that's not good enough, I want my money back.' to an offer we already made."
  },
  "SIZING_QUESTION": {
    "description": "Pre-purchase or general sizing/fit question",
    "example": "'Does this run small? Should I size up?'"
  },
  "THREATENS_CHARGEBACK": {
    "description": "Customer threatens or mentions a chargeback/dispute",
    "example": "'Refund me now or I'm opening a chargeback with my bank.'"
  },
  "WHERE_IS_ORDER": {
    "description": "Customer asking for order/shipping status (WISMO)",
    "example": "'Where is my order? Any tracking update?'"
  },
  "WRONG_ITEM": {
    "description": "Customer received the wrong item entirely",
    "example": "'I ordered the blue jacket but received a black skirt.'"
  },
  "WRONG_SIZE": {
    "description": "Customer received the wrong size",
    "example": "'I ordered a Medium but got a Small.'"
  }
}
"frozenset({'WRONG_SIZE', 'ASKS_REFUND', 'LEGAL_THREAT', 'SIZING_QUESTION', 'WRONG_ITEM', 'ADDRESS_CHANGE', 'OFF_SCRIPT', 'ASKS_REPLACEMENT', 'PRODUCT_QUESTION', 'REFUSES_OFFER', 'AUTHENTICITY_DOUBT', 'WHERE_IS_ORDER', 'NOT_ARRIVED', 'CANCEL_REQUEST', 'ACCEPTS_OFFER', 'DAMAGED', 'THREATENS_CHARGEBACK'})"
"_Feature((3, 7, 0, 'beta', 1), None, 16777216)"

Voice rules

live from cs_voice.py · last modified 2026-08-14 20:00:43 UTC · no separate version-history tracking exists yet — this is the file's on-disk mtime.

{
  "REPLY_INFO": "Answer their question directly using the facts given.",
  "OFFER_REPLACEMENT": "Offer to send a replacement in the correct size/item, free of charge.",
  "OFFER_DISCOUNT_10_KEEP": "Offer the exact percentage off given in FACTS ('offer_percentage') as a thank-you for keeping the item, instead of a return. Use that number exactly — never a different percentage, never a cash figure.",
  "OFFER_DISCOUNT_20_KEEP": "Offer the exact percentage off given in FACTS ('offer_percentage') for keeping the item, instead of a return. Use that number exactly — never a different percentage, never a cash figure.",
  "OFFER_PRICE_MINUS_SHIPPING": "Offer to settle for the exact amount given in FACTS ('settlement_amount') — the order value minus return shipping — customer keeps the item, nothing to send back. Use that figure exactly, never a different number.",
  "FULL_REFUND": "Confirm a full refund to the original payment method. If FACTS gives a 'settlement_amount', you may cite it; otherwise just confirm the refund without stating a figure you weren't given.",
  "EXECUTE_PROMISE": "Follow through on the commitment already made to this customer, exactly as described in FACTS — do not alter the figure or the remedy.",
  "ESCALATE": "Acknowledge the message warmly and let them know a member of the team is personally looking into it — do not promise a timeline or outcome, and do not state any figure at all."
}
"Write a complete, ready-to-send email reply: a brief greeting using the customer's name if given, the body, and a sign-off with the given signature. No subject line (the thread already has one). Plain text only."
[
  "Never use an em dash or en dash (replace with a comma, period, or 'and').",
  "Never offer a return address or a shipping label of any kind.",
  "Never charge, mention, or imply a shipping fee, restocking fee, or \"small contribution\" for a return, exchange, or replacement — it is always free to the customer.",
  "Never claim we have contacted, heard from, or are checking with the manufacturer/supplier/warehouse/courier unless that is explicitly true in the facts you were given.",
  "Never cite a consumer-protection statute, regulation, clause number, or any specific law.",
  "Never call our own listing, product, or the way we sell it unlawful, mis-sold, counterfeit, or fake — even defensively.",
  "Never say a parcel 'has shipped' or is 'on its way' unless the tracking facts you were given show a carrier checkpoint past 'information received'/'label created'.",
  "Never state a cash amount in a cashback/keep-the-item offer — percentages only (e.g. 'a percentage off' or 'X%'), never a converted currency figure.",
  "Never promise to 'chase', 'follow up with', 'investigate', 'escalate to management', 'look into it', or 'come back to you' about something you are not immediately resolving in this reply — state plainly what you can and cannot do right now instead.",
  "Never say a refund, cashback, or replacement 'has been issued/sent/processed/arranged' unless the facts you were given say it was actually executed — an offer that hasn't been accepted and executed is an offer, not a done deal.",
  "Never use markdown, asterisks, bullet characters, or code formatting — plain prose only, this is an email.",
  "Never open with 'Hi there' if a customer name is given in the facts — use their name."
]
"You are writing as the customer support voice for the store. Warm, direct, human — never corporate-sounding, never robotic, never over-apologetic filler. Short paragraphs. Address the customer's actual question or complaint first, in plain language, before anything else. Sign off with the signature name and role you're given in the facts."
"_Feature((3, 7, 0, 'beta', 1), None, 16777216)"