diff --git a/internal/router/dumpprompt_test.go b/internal/router/dumpprompt_test.go new file mode 100644 index 0000000..ae37f18 --- /dev/null +++ b/internal/router/dumpprompt_test.go @@ -0,0 +1,22 @@ +package router + +import ( + "os" + "testing" +) + +// TestDumpPrompt writes the router prompt and grammar to disk so the training +// workspace labels with the daemon's own contract rather than a retyped copy. +// It is inert unless MAVEN_DUMP_PROMPT names a directory. +func TestDumpPrompt(t *testing.T) { + dir := os.Getenv("MAVEN_DUMP_PROMPT") + if dir == "" { + t.Skip("MAVEN_DUMP_PROMPT unset") + } + if err := os.WriteFile(dir+"/route_system.txt", []byte(routeSystem), 0o644); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(dir+"/route_grammar.gbnf", []byte(routeGrammar), 0o644); err != nil { + t.Fatal(err) + } +}