A greeting is not a failed answer (V-663)
classifyTurnRole read "спасибо" and "привет" as answers to whatever was parked, so she re-asked "В какой день?" at a man saying thank you and spent one of three attempts doing it. That attempt is a bound meant to end the ride, so the pleasantry both produced the worst reply in the corpus and paid for the privilege. They are asides now: answered as themselves, the question resumed on the tail, no attempt spent, one ride counted. The set is a new closed lexicon entry, matched as WHOLE utterances. Every token rule tried was wrong on something. "вечер" answers "это утра или вечера?" and "нет" answers a confirm, so anything that could fill a slot stays out. The control words stay out too, because isCancel owns them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ptwopxyo3Z2kwFckHkLvN
This commit is contained in:
+14
-13
@@ -411,22 +411,23 @@ func TestTwoBoundsCannotRearmEachOther(t *testing.T) {
|
||||
t.Fatalf("after two asides: %+v", q)
|
||||
}
|
||||
|
||||
// A failed answer. It spends an attempt and puts Suspends back to zero, so
|
||||
// the old bound starts over. Rides does not.
|
||||
h.handleText(ctx, "web", "спасибо")
|
||||
if q = h.clarifyStore.Get(id, h.now()); q == nil || q.Suspends != 0 {
|
||||
t.Fatalf("the failed answer did not rearm the old bound: %+v", q)
|
||||
// A pleasantry. It used to read as a failed answer, so she re-asked the
|
||||
// question at a man saying thank you and spent an attempt doing it. Now it
|
||||
// is an aside: answered as itself, question on the tail, one more ride.
|
||||
reply := h.handleText(ctx, "web", "спасибо")
|
||||
if !strings.HasSuffix(reply, resumed) {
|
||||
t.Fatalf("a pleasantry lost the parked question: %q", reply)
|
||||
}
|
||||
if q.Rides != 2 {
|
||||
t.Fatalf("the rides it already took were forgotten: %+v", q)
|
||||
q = h.clarifyStore.Get(id, h.now())
|
||||
if q == nil || q.Attempts != 1 {
|
||||
t.Fatalf("a pleasantry spent an attempt: %+v", q)
|
||||
}
|
||||
if q.Rides != 3 {
|
||||
t.Fatalf("a pleasantry rode free: %+v", q)
|
||||
}
|
||||
|
||||
// Three more asides. Suspends only reaches three, one short of firing, and
|
||||
// would go back to zero on the next pleasantry. Rides passes MaxRides and
|
||||
// the request goes, out loud.
|
||||
h.handleText(ctx, "web", "какие у меня напоминания?")
|
||||
h.handleText(ctx, "web", "какие у меня напоминания?")
|
||||
reply := h.handleText(ctx, "web", "какие у меня напоминания?")
|
||||
// One more ride of any kind and the request goes, out loud.
|
||||
reply = h.handleText(ctx, "web", "какие у меня напоминания?")
|
||||
if !strings.Contains(reply, clarifyDropped) {
|
||||
t.Fatalf("the question rode four asides and was let go in silence: %q", reply)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user