(t *testing.T)
| 207 | } |
| 208 | |
| 209 | func TestClassifyIntent_SubsystemMatching(t *testing.T) { |
| 210 | cfg := config.ProjectConfig{ |
| 211 | Routing: config.RoutingConfig{ |
| 212 | Retrieval: config.RetrievalConfig{Strategy: "keyword", TopK: 3}, |
| 213 | Subsystems: []config.Subsystem{ |
| 214 | {ID: "watching", Keywords: []string{"hook", "daemon", "events"}}, |
| 215 | {ID: "scanning", Keywords: []string{"ast-grep", "dependency", "imports"}}, |
| 216 | }, |
| 217 | }, |
| 218 | } |
| 219 | |
| 220 | intent := classifyIntent("fix the hook timeout in the daemon", nil, nil, cfg) |
| 221 | if len(intent.Subsystems) == 0 { |
| 222 | t.Error("expected subsystem match for 'hook' and 'daemon' keywords") |
| 223 | } |
| 224 | found := false |
| 225 | for _, s := range intent.Subsystems { |
| 226 | if s == "watching" { |
| 227 | found = true |
| 228 | } |
| 229 | } |
| 230 | if !found { |
| 231 | t.Errorf("expected 'watching' subsystem in %v", intent.Subsystems) |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | func TestClassifyIntent_NilInfoSafe(t *testing.T) { |
| 236 | // Should not panic with nil hubInfo |
nothing calls this directly
no test coverage detected