返回 DeepSeek-Reasonix
delivery_classification_test.go
根目录 / internal / agent / delivery_classification_test.go
1 package agent
2
3 import "testing"
4
5 // TestDeliveryClassificationMatrix protects the boundary between advisory
6 // troubleshooting, observable read-only work, and mutation delivery.
7 func TestDeliveryClassificationMatrix(t *testing.T) {
8 tests := []struct {
9 name string
10 input string
11 wantEvidence bool
12 wantMutation bool
13 }{
14 {"make sense", "why does this make sense?", false, false},
15 {"node prose", "why does the node selection matter?", false, false},
16 {"swift prose", "why does Swift concurrency work this way?", false, false},
17 {"go prose", "why does this go wrong so often?", false, false},
18 {"remote url", "why can't I open https://github.com?", false, false},
19 {"remote analysis", "can you analyze why Outlook won't sync?", false, false},
20 {"how to install", "how do I install the plugin?", false, false},
21 {"chinese how to install", "如何安装插件", false, false},
22 {"chinese how to modify", "怎么修改 WPS 设置", false, false},
23 {"python prose", "why is Python popular?", false, false},
24 {"docker prose", "why is Docker popular?", false, false},
25 {"pytest prose", "why is pytest popular?", false, false},
26 {"backtick python prose", "why is `Python` popular?", false, false},
27 {"backtick code identifier", "what does `context.Context` mean?", false, false},
28 {"double dash prose", "why is this -- strangely -- happening?", false, false},
29 {"advisory upgrade", "为什么升级插件后失败", false, false},
30 {"advisory adjustment", "为什么调整设置后没有效果", false, false},
31 {"advisory change application", "为什么申请修改失败", false, false},
32 {"negated change", "please don't make the requested changes", false, false},
33 {"negated chinese", "请勿修改代码", false, false},
34 {"negated inspection", "Explain why it fails. Do not inspect or change files.", false, false},
35 {"negated chinese inspection", "解释失败原因,不要检查或修改文件", false, false},
36 {"review only", "review only and do not fix anything", true, false},
37 {"markdown anchor", "why does README.md render incorrectly?", true, false},
38 {"git command", "why does git diff --check fail?", true, false},
39 {"custom command", "why does mytool --strict fail?", true, false},
40 {"repository anchor", "can you analyze this repository and explain why it fails?", true, false},
41 {"observable audit", "audit the current configuration", true, false},
42 {"make changes", "make the necessary changes", true, true},
43 {"thanks then update", "thanks for fixing that, now update the tests", true, true},
44 {"chinese thanks then update", "谢谢你,请继续修改配置", true, true},
45 {"thanks then review", "thanks for the help; now review this pull request", true, false},
46 {"modify", "please modify the config", true, true},
47 {"push", "push the branch", true, true},
48 {"commit", "commit the fix", true, true},
49 {"move", "move the file", true, true},
50 {"bump", "bump the dependency", true, true},
51 {"advice then fix", "why does it fail and fix it", true, true},
52 {"polite fix before advice", "could you please fix why it fails", true, true},
53 {"chinese polite fix before advice", "请你帮我修复为什么会失败", true, true},
54 {"chinese advice then fix", "为什么失败然后修复它", true, true},
55 {"negated install then patch", "I cannot install dependencies but patch the parser", true, true},
56 {"shared negation", "I cannot install and update dependencies", false, false},
57 {"reset negation", "I cannot install dependencies and please update config", true, true},
58 {"chinese reset", "无法安装依赖请在现有配置中修改", true, true},
59 {"negated request", "不想请团队修改代码", false, false},
60 {"negated application", "禁止申请修改配置", false, false},
61 {"deferred conversation token", "Remember ORBIT-42 and answer on the next turn.", false, false},
62 {"chinese deferred conversation token", "记住 ORBIT-42,下一轮回答", false, false},
63 {"deferred token with durable negation", "Remember ORBIT-42 for the next turn. Do not save it permanently.", false, false},
64 {"chinese deferred token with durable negation", "记住 ORBIT-42,下一轮回答。不要写入文件或长期记忆。", false, false},
65 {"long conversational context", "Please keep this code in mind because I will ask you about it in my next message", false, false},
66 {"durable memory", "Remember ORBIT-42 permanently across sessions", true, true},
67 {"chinese durable memory", "请永久记住 ORBIT-42,跨会话也要保留", true, true},
68 {"durable memory advice", "How do I save a preference permanently across sessions?", false, false},
69 }
70 for _, tt := range tests {
71 t.Run(tt.name, func(t *testing.T) {
72 if got := deliveryTaskNeedsEvidence(tt.input); got != tt.wantEvidence {
73 t.Errorf("deliveryTaskNeedsEvidence(%q) = %v, want %v", tt.input, got, tt.wantEvidence)
74 }
75 if got := deliveryTaskNeedsMutation(tt.input); got != tt.wantMutation {
76 t.Errorf("deliveryTaskNeedsMutation(%q) = %v, want %v", tt.input, got, tt.wantMutation)
77 }
78 })
79 }
80 }
81
81 lines GO