{"name": "min_total_chars-inclusive-boundary","note": "A 25-byte assistant turn plus a 15-byte user turn totals exactly 40 bytes; min_total_chars:40 is inclusive (>=), so it matches even though the 15-byte routing input is far below the bound.","request": {"model": "user.Conditions-TotalCharBounds","messages": [{"role": "assistant","content": "abcdefghijklmnopqrstuvwxy"},{"role": "user","content": "0123456789abcde"}]},"decision": {"version": "1","route_to": "cloud","matched_rule": "min_total_chars-rule","default_used": false,"outputs": {}}}
{"name": "min_total_chars-below-boundary","note": "One byte short of the bound: 24 + 15 = 39 bytes misses min_total_chars:40, is above max_total_chars:6, and the 15-byte routing input misses min_chars:40, so it falls through to default.","request": {"model": "user.Conditions-TotalCharBounds","messages": [{"role": "assistant","content": "abcdefghijklmnopqrstuvwx"},{"role": "user","content": "0123456789abcde"}]},"decision": {"version": "1","route_to": "local","matched_rule": "","default_used": true,"outputs": {}}}
{"name": "max_total_chars-inclusive-boundary","note": "A single 6-byte message totals 6 bytes; max_total_chars:6 is inclusive (<=), so it matches.","request": {"model": "user.Conditions-TotalCharBounds","messages": [{"role": "user","content": "012345"}]},"decision": {"version": "1","route_to": "cloud","matched_rule": "max_total_chars-rule","default_used": false,"outputs": {}}}
{"name": "total_chars-utf8-byte-count","note": "Each 'é' is 1 character but 2 UTF-8 bytes, so 'éééé' totals 8 bytes. 8 misses max_total_chars:6 -> default (local); counting characters (4 <= 6) would match -> cloud. Routing to local proves the total is measured in bytes, not characters.","request": {"model": "user.Conditions-TotalCharBounds","messages": [{"role": "user","content": "éééé"}]},"decision": {"version": "1","route_to": "local","matched_rule": "","default_used": true,"outputs": {}}}
{"name": "long-history-short-last-turn","note": "The motivating case: 102 bytes of history ending in a 5-byte 'go on'. min_total_chars:40 matches on the conversation while min_chars:40 cannot see past the final turn. Were the total measured on the routing input alone it would read 5 bytes and this request would instead match max_total_chars:6, so matched_rule discriminates the two implementations.","request": {"model": "user.Conditions-TotalCharBounds","messages": [{"role": "system","content": "You are a helpful assistant."},{"role": "user","content": "Explain how a B-tree index works."},{"role": "assistant","content": "A B-tree keeps keys sorted in nodes."},{"role": "user","content": "go on"}]},"decision": {"version": "1","route_to": "cloud","matched_rule": "min_total_chars-rule","default_used": false,"outputs": {}}}
{"name": "total_chars-counts-every-role","note": "system 14 + user 15 + assistant 11 + tool 11 = 51 bytes, no single message reaching 40. Counting only user turns would total 15 and fall through to default, so matching min_total_chars:40 proves every role counts.","request": {"model": "user.Conditions-TotalCharBounds","messages": [{"role": "system","content": "You are terse."},{"role": "user","content": "Summarize this."},{"role": "assistant","content": "Sure thing."},{"role": "tool","content": "{\"ok\":true}"}]},"decision": {"version": "1","route_to": "cloud","matched_rule": "min_total_chars-rule","default_used": false,"outputs": {}}}
{"name": "prompt-form-total-equals-chars","note": "A legacy completions prompt carries no history, so its total equals the routing input: 40 bytes matches min_total_chars:40. A total that ignored the prompt form would leave min_chars:40 to match instead, changing matched_rule.","request": {"model": "user.Conditions-TotalCharBounds","prompt": "0123456789abcdefghijklmnopqrstuvwxyzABCD"},"decision": {"version": "1","route_to": "cloud","matched_rule": "min_total_chars-rule","default_used": false,"outputs": {}}}
{"name": "responses-input-array-sums-all-items","note": "Responses `input` array: a 25-byte assistant item plus a 15-byte user item totals 40. Counting only the last user item would total 15 and fall through to default.","request": {"model": "user.Conditions-TotalCharBounds","input": [{"role": "assistant","content": [{"type": "input_text","text": "abcdefghijklmnopqrstuvwxy"}]},{"role": "user","content": [{"type": "input_text","text": "0123456789abcde"}]}]},"decision": {"version": "1","route_to": "cloud","matched_rule": "min_total_chars-rule","default_used": false,"outputs": {}}}
{"name": "min_total_chars-trace","note": "route_trace:true records the matching leaf under condition 'min_total_chars', not the 'min_chars' it shares an implementation with.","request": {"model": "user.Conditions-TotalCharBounds","route_trace": true,"messages": [{"role": "assistant","content": "abcdefghijklmnopqrstuvwxy"},{"role": "user","content": "0123456789abcde"}]},"decision": {"version": "1","route_to": "cloud","matched_rule": "min_total_chars-rule","default_used": false,"outputs": {},"trace": [{"condition": "min_total_chars","result": true}]}}
{"name": "max_total_chars-trace","note": "Both earlier rules miss (traced false under their own condition names), then max_total_chars-rule matches under condition 'max_total_chars'.","request": {"model": "user.Conditions-TotalCharBounds","route_trace": true,"messages": [{"role": "user","content": "012345"}]},"decision": {"version": "1","route_to": "cloud","matched_rule": "max_total_chars-rule","default_used": false,"outputs": {},"trace": [{"condition": "min_total_chars","result": false},{"condition": "min_chars","result": false},{"condition": "max_total_chars","result": true}]}}
