{"name": "trace-omitted-when-not-requested","note": "Without route_trace the Decision carries no trace key: the matched-request trace is empty and route_decision_to_json drops the field.","request": {"model": "user.Trace","messages": [{"role": "user","content": "alpha"}]},"decision": {"version": "1","route_to": "cloud","matched_rule": "any-rule","default_used": false,"outputs": {}}}
{"name": "trace-omitted-when-explicitly-false","note": "An explicit route_trace:false behaves exactly like omitting it — no trace key.","request": {"model": "user.Trace","route_trace": false,"messages": [{"role": "user","content": "alpha"}]},"decision": {"version": "1","route_to": "cloud","matched_rule": "any-rule","default_used": false,"outputs": {}}}
{"name": "trace-any-short-circuits-on-first-true","note": "route_trace:true records one entry per evaluated leaf; 'alpha' makes the any's first child true, so the regex child is never evaluated and the deterministic leaf carries no score/label/rationale.","request": {"model": "user.Trace","route_trace": true,"messages": [{"role": "user","content": "alpha"}]},"decision": {"version": "1","route_to": "cloud","matched_rule": "any-rule","default_used": false,"outputs": {},"trace": [{"condition": "keywords_any","result": true}]}}
{"name": "trace-accumulates-across-missed-rule","note": "The trace accumulates every leaf up to the match: missed any-rule contributes both false children, then all-rule matches and the not(max_chars) child is still traced with its own raw result (false).","request": {"model": "user.Trace","route_trace": true,"messages": [{"role": "user","content": "charlie please"}]},"decision": {"version": "1","route_to": "cloud","matched_rule": "all-rule","default_used": false,"outputs": {},"trace": [{"condition": "keywords_any","result": false},{"condition": "regex","result": false},{"condition": "keywords_any","result": true},{"condition": "max_chars","result": false}]}}
{"name": "trace-all-short-circuits-and-default-carries-trace","note": "all-rule's first child ('charlie') is false, so the all short-circuits and the not(max_chars) child is dropped from the trace; fail-open to default still carries the accumulated trace.","request": {"model": "user.Trace","route_trace": true,"messages": [{"role": "user","content": "zulu"}]},"decision": {"version": "1","route_to": "local","matched_rule": "","default_used": true,"outputs": {},"trace": [{"condition": "keywords_any","result": false},{"condition": "regex","result": false},{"condition": "keywords_any","result": false}]}}
