Write the router: triggers_hit(t) and route(t), then run the five
tickets through it.
triggers_hit(t) returns the list of trigger names that fire, checked
in this order:
emotional→"emotional language"legal→"legal or chargeback threat"amountoverREFUND_LINE(strictly greater) →"over the refund line"contactsof 3 or more (default 1) →"third contact"regulator→"regulator or media mention"
route(t) applies the three lists: any trigger → "human-only";
otherwise a refund ask → "draft+approver"; otherwise
"ai-may-draft".
Use .get() with defaults everywhere — real tickets arrive with
fields missing, and a KeyError in the router takes the whole queue
down with it.
Expected output:
T-21: draft+approver
T-22: human-only
T-23: ai-may-draft
T-24: human-only
T-25: human-only