Files
Maven/internal/router/notecapture_test.go
T
claude a97764c5f7 Add seven stage 0 frames and tighten three more (V-720)
MavenHelpGrammar keeps "как отменить напоминание" on SourceSelf, where the
answer names the command Maven accepts, instead of leaking to search.
PublicCurrentVersionGrammar anchors an explicitly current release on
SourceWorld and declines first-person ownership.

AmbiguousFragmentGrammar refuses filler plus an unresolved demonstrative
rather than letting a statistical head invent context.
ImplicitElapsedQueryGrammar reads Russian question word order in "давно я
не тренировался" as recall; the declarative order stays a statement.
ReminderCancellationReportGrammar keeps "я отменил напоминание" in the
non-mutating chat lane.

CommandProhibitionGrammar routes a direct negative command to a sentinel
fn that can never collide with an enabled tool. ActHasEntityTarget stops a
bare verb or a demonstrative-only tail from crossing into Nexus.

Praxis attention now accepts "что там с X" for the four service names only.
taskstatus separates command mood from result words so a first-person
report cannot mutate the board. question.go exports the open-question and
locative shapes the recall gate reads.

--no-verify: master is the working branch this session by the owner's call.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-15 17:18:48 +04:00

42 lines
2.1 KiB
Go

package router
import "testing"
func TestParseNoteCaptureExtractsOnlyALeadingCommandFrame(t *testing.T) {
cases := []struct {
name string
utterance string
want string
ok bool
}{
{"colon", "запомни: запасной ключ лежит в синей коробке", "запасной ключ лежит в синей коробке", true},
{"case and politeness", "Запиши, пожалуйста: Кофе закончился.", "Кофе закончился.", true},
{"wake word", "Maven, remember: backup runs at 03:00", "backup runs at 03:00", true},
{"leading particles", "ну пожалуйста запомни — пароль в сейфе", "пароль в сейфе", true},
{"enclitic", "запиши-ка: ключ у двери", "ключ у двери", true},
{"quoted body", "сохрани: «Ключ — в ящике». ", "«Ключ — в ящике».", true},
{"meaningful conjunction", "запомни: и это важно", "и это важно", true},
{"question word is content", "запиши: что такое TCP?", "что такое TCP?", true},
{"infinitive question is content", "запиши что купить к ужину", "что купить к ужину", true},
{"ordinary note", "кофе закончился", "", false},
{"embedded command", "у меня новый ноутбук, запиши это", "", false},
{"past-tense report", "запомнил пароль от роутера", "", false},
{"empty command", "запомни: ...", "", false},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
got, ok := ParseNoteCapture(tc.utterance)
if ok != tc.ok || got != tc.want {
t.Fatalf("ParseNoteCapture(%q) = %q, %v; want %q, %v", tc.utterance, got, ok, tc.want, tc.ok)
}
})
}
}
func TestParseNoteCaptureDropsProvenRussianComplementizer(t *testing.T) {
got, ok := ParseNoteCapture("запомни, что кофе закончился")
if !ok || got != "кофе закончился" {
t.Fatalf("got %q, %v; want an inflected clause without the capture complementizer", got, ok)
}
}