| 1 | package thin |
| 2 | |
| 3 | import ( |
| 4 | "strings" |
| 5 | "testing" |
| 6 | ) |
| 7 | |
| 8 | // The coordinator's standing prompt keeps chat at the outcome level and |
| 9 | // names tasks as links (Paul, 2026-11-07): details live on the task. |
| 10 | func TestOpeningOutcomeLevelVoice(t *testing.T) { |
| 11 | o := opening("p@example.com", nil) |
| 12 | for _, want := range []string{ |
| 13 | "Speak at the outcome level", |
| 14 | "No file paths, line numbers or code mechanics in your replies", |
| 15 | "the diagnosis goes on the task with add_finding", |
| 16 | "name a task as a markdown link with its title", |
| 17 | `never as "the task card"`, |
| 18 | "Equipo's merge rules decide whether it merges on its own", |
| 19 | "call hold_merge with that reason", |
| 20 | "call set_merge_policy with their words", |
| 21 | "never ask the person to merge", |
| 22 | } { |
| 23 | if !strings.Contains(o, want) { |
| 24 | t.Fatalf("opening lacks %q", want) |
| 25 | } |
| 26 | } |
| 27 | if strings.Contains(o, "reply in two or three lines: what you found") { |
| 28 | t.Fatal("opening still asks for the diagnosis in chat") |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | // The coordinator never relays technical detail (Paul, 2026-11-07): for |
| 33 | // specifics it points the person at the task, where they ask the |
| 34 | // specialist who did the work. |
| 35 | func TestOpeningPointsToAskTheImplementer(t *testing.T) { |
| 36 | o := opening("p@example.com", nil) |
| 37 | for _, want := range []string{ |
| 38 | "do not explain them yourself", |
| 39 | "You can ask Engineering on [", |
| 40 | "or Review, about the review", |
| 41 | } { |
| 42 | if !strings.Contains(o, want) { |
| 43 | t.Fatalf("opening lacks %q", want) |
| 44 | } |
| 45 | } |
| 46 | if strings.Contains(o, "unless the person asks") { |
| 47 | t.Fatal("the opening still offers technical detail on request") |
| 48 | } |
| 49 | if houseRule == "2026-11-07.7" { |
| 50 | t.Fatal("the rule changed: its version must move so sessions read it") |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | // Paul's coordinator filed one bug three times (2026-11-07): the rule |
| 55 | // sends a repeat report to the open task, never a duplicate; and Equipo |
| 56 | // merges, so the person is never asked to. |
| 57 | func TestOpeningReusesOpenTasks(t *testing.T) { |
| 58 | o := opening("p@example.com", nil) |
| 59 | for _, want := range []string{ |
| 60 | "Never file the same problem twice", |
| 61 | "If record_task returns similar open tasks", |
| 62 | "call add_report on it with their words", |
| 63 | "record a separate task only when it is clearly a different problem", |
| 64 | } { |
| 65 | if !strings.Contains(o, want) { |
| 66 | t.Fatalf("opening lacks %q", want) |
| 67 | } |
| 68 | } |
| 69 | if strings.Contains(o, "nobody merges without the person") { |
| 70 | t.Fatal("the opening still says the person merges") |
| 71 | } |
| 72 | if houseRule == "2026-11-07.8" { |
| 73 | t.Fatal("the rule changed: its version must move so sessions read it") |
| 74 | } |
| 75 | var tools []string |
| 76 | for _, tool := range converseTools { |
| 77 | tools = append(tools, tool.(map[string]any)["name"].(string)) |
| 78 | } |
| 79 | if !strings.Contains(strings.Join(tools, ","), "add_report") { |
| 80 | t.Fatalf("add_report is not offered: %v", tools) |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | // What the person may need to paste comes in its own fenced block, which |
| 85 | // the chat shows as a paste box with Copy (Paul, 2026-11-11). The line is |
| 86 | // static, in the opening, so the cached prefix stays the same between |
| 87 | // turns. |
| 88 | func TestOpeningPutsPastesInFences(t *testing.T) { |
| 89 | o := opening("p@example.com", nil) |
| 90 | 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") { |
| 91 | t.Fatal("the opening lacks the paste rule") |
| 92 | } |
| 93 | if o != opening("p@example.com", nil) { |
| 94 | t.Fatal("the opening is not static") |
| 95 | } |
| 96 | if houseRule == "2026-11-07.9" { |
| 97 | t.Fatal("the rule changed: its version must move so sessions read it") |
| 98 | } |
| 99 | } |
| 100 | |