diff --git a/nanoclaude/tests/test_classifier_io.py b/nanoclaude/tests/test_classifier_io.py index 30d4838..f876f6d 100644 --- a/nanoclaude/tests/test_classifier_io.py +++ b/nanoclaude/tests/test_classifier_io.py @@ -156,3 +156,19 @@ def test_actual_bug_payload_detected(): '추론 모델에게 전달할게요!", "prompt": "노래 가사를 분석해주세요."}' ) assert looks_like_router_json(text) is True + + +# ---------- combined: normal direct path stays out of fallback ---------- + + +def test_normal_direct_response_takes_direct_path(): + """Spec contract: a normal direct response with non-empty natural text + must be classified `direct` AND survive the leak guard, so the worker's + direct-path elif fires (not the chat_fallback branch).""" + raw = '{"action": "direct", "response": "안녕하세요! 무엇을 도와드릴까요?", "prompt": ""}' + parsed = parse_classification(raw) + assert parsed["action"] == "direct" + assert parsed["response"] + assert looks_like_router_json(parsed["response"]) is False + # The two assertions above together replicate the elif condition in + # worker.py: action=="direct" and response_text and not router-shaped.