docs(nanoclaude): assert direct-path elif condition in tests
Spec contract test #4: a normal direct response with non-empty natural text must classify as direct AND pass the leak guard, so the worker's direct-path elif fires instead of the chat_fallback branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user