d850f1f5fd
The subjectless-reminder gate has been dead since V-383. It tested `d.Slots.Text == ""`, and that slot is never empty: fillSlots hands it the utterance when the model names nothing narrower. Measured on the box on 05-08-2026 — "напомни" alone routed to IntentReminder with Text:напомни, reached actionReminder, and answered "не получилось разобрать время напоминания." A parse error for a request he never finished asking about. "ну напомни же" did the same. The test is now what the slot CONTAINS. reminderHasSubject discounts the reminder verb by lemma and the filler particles, and asks whether anything is left. A day or an hour counts as a subject, which is why this does not reuse cmd/mavend/reminderbody.go — that one strips the time words too. filler_particles is the lexicon's 16th set. Not a stopword list: every word in it is one that cannot BE a reminder's subject. Measured against the 87-case fixture with and without the change: 65/87 both ways, identical clarify counts, because no case exercised the shape. So amb-007 "напомни" and amb-008 "ну напомни же" were added, both want_clarify. At 89 cases the cascade scores 67/89 (75.3% full, 79.8% intent-only), 3 false clarifies / 1 missed, p50 1.199s — the two new cases clarify, and nothing else moved. The classifier path still guesses both (62/89, 8 missed clarify); the gate is on the LLM arm only. The box needs a rebuild for this to take effect. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SoL7EBdYC5Mhz3DJd49GJy
41 lines
1.4 KiB
Go
41 lines
1.4 KiB
Go
package router
|
|
|
|
import "testing"
|
|
|
|
func TestReminderHasSubject(t *testing.T) {
|
|
cases := []struct {
|
|
text string
|
|
want bool
|
|
}{
|
|
// The three the box produced, and the reason this file exists.
|
|
{"напомни", false},
|
|
{"ну напомни же", false},
|
|
{"напомни мне", false},
|
|
{"напомни мне пожалуйста", false},
|
|
// Lemma, not literal: none of these forms is the one in the utterance
|
|
// the lexicon lists first.
|
|
{"напоминай", false},
|
|
{"напомнить", false},
|
|
{"remind me", false},
|
|
{"remind me please", false},
|
|
// A real subject, however short.
|
|
{"напомни позвонить маме", true},
|
|
{"напомни про таблетки", true},
|
|
{"напомни выпить воды", true},
|
|
{"remind me to call mom", true},
|
|
// A day is a subject she can ask nothing better about, so she does not
|
|
// ask. This is where reminderBody's stripping would disagree, on purpose.
|
|
{"напомни завтра", true},
|
|
{"напомни в семь", true},
|
|
// A noun that starts like the verb. A stem test would eat it.
|
|
{"напомни про напоминание", true},
|
|
// Empty is subjectless without asking the lexicon anything.
|
|
{"", false},
|
|
}
|
|
for _, c := range cases {
|
|
if got := reminderHasSubject(c.text); got != c.want {
|
|
t.Errorf("reminderHasSubject(%q) = %v, want %v", c.text, got, c.want)
|
|
}
|
|
}
|
|
}
|