package thin import ( "strings" "testing" ) // The coordinator's standing prompt keeps chat at the outcome level and // names tasks as links (Paul, 2026-11-07): details live on the task. func TestOpeningOutcomeLevelVoice(t *testing.T) { o := opening("p@example.com", nil) for _, want := range []string{ "Speak at the outcome level", "No file paths, line numbers or code mechanics in your replies", "the diagnosis goes on the task with add_finding", "name a task as a markdown link with its title", `never as "the task card"`, "Equipo's merge rules decide whether it merges on its own", "call hold_merge with that reason", "call set_merge_policy with their words", "never ask the person to merge", } { if !strings.Contains(o, want) { t.Fatalf("opening lacks %q", want) } } if strings.Contains(o, "reply in two or three lines: what you found") { t.Fatal("opening still asks for the diagnosis in chat") } } // The coordinator never relays technical detail (Paul, 2026-11-07): for // specifics it points the person at the task, where they ask the // specialist who did the work. func TestOpeningPointsToAskTheImplementer(t *testing.T) { o := opening("p@example.com", nil) for _, want := range []string{ "do not explain them yourself", "You can ask Engineering on [", "or Review, about the review", } { if !strings.Contains(o, want) { t.Fatalf("opening lacks %q", want) } } if strings.Contains(o, "unless the person asks") { t.Fatal("the opening still offers technical detail on request") } if houseRule == "2026-11-07.7" { t.Fatal("the rule changed: its version must move so sessions read it") } } // Paul's coordinator filed one bug three times (2026-11-07): the rule // sends a repeat report to the open task, never a duplicate; and Equipo // merges, so the person is never asked to. func TestOpeningReusesOpenTasks(t *testing.T) { o := opening("p@example.com", nil) for _, want := range []string{ "Never file the same problem twice", "If record_task returns similar open tasks", "call add_report on it with their words", "record a separate task only when it is clearly a different problem", } { if !strings.Contains(o, want) { t.Fatalf("opening lacks %q", want) } } if strings.Contains(o, "nobody merges without the person") { t.Fatal("the opening still says the person merges") } if houseRule == "2026-11-07.8" { t.Fatal("the rule changed: its version must move so sessions read it") } var tools []string for _, tool := range converseTools { tools = append(tools, tool.(map[string]any)["name"].(string)) } if !strings.Contains(strings.Join(tools, ","), "add_report") { t.Fatalf("add_report is not offered: %v", tools) } } // What the person may need to paste comes in its own fenced block, which // the chat shows as a paste box with Copy (Paul, 2026-11-11). The line is // static, in the opening, so the cached prefix stays the same between // turns. func TestOpeningPutsPastesInFences(t *testing.T) { o := opening("p@example.com", nil) if !strings.Contains(o, "Anything the person may need to paste (commands, prompts, config, codes) goes in a fenced code block, one block per thing to paste") { t.Fatal("the opening lacks the paste rule") } if o != opening("p@example.com", nil) { t.Fatal("the opening is not static") } if houseRule == "2026-11-07.9" { t.Fatal("the rule changed: its version must move so sessions read it") } }