test: fix mockGraph.AllEdges signature; add namespace classification probe

mockGraph declared AllEdges() []map[string]interface{} while
governance.GraphStore requires AllEdges(string) []governance.GraphEdge.
go build ./... stayed green because test files are not compiled by
build, so the routes test package could not be compiled at all and the
whole suite silently went unrun - which is why the earlier AllEdges
'compatibility fix' looked done without ever executing.

After fixing the signature the suite runs: all tests pass including
TestCommitConflictGate_E2E (end-to-end commit -> conflict -> distill
gate, 3.70s).

zz_ns_probe_test.go also gives positive evidence for the
classifyNamespace fix: human-side content now resolves to
soulful-xiaowei-main rather than a06-main.

    '牧尘在招商局工作'      -> soulful-xiaowei-main
    '牧尘不在招商局工作'    -> soulful-xiaowei-main
    '画像规则: 牧尘在招商局工作' -> soulful-xiaowei-main
This commit is contained in:
小唯
2026-09-20 08:40:41 +08:00
parent fd699151a8
commit 6c895618f9
2 changed files with 14 additions and 2 deletions
@@ -78,8 +78,10 @@ func (mockGraph) Navigate(entity string, maxHops int, namespace string, relation
func (mockGraph) NavigateBiDir(source, target string, maxHops int, namespace string, relationFilter []string) ([]map[string]interface{}, error) {
return nil, nil
}
func (mockGraph) Query(entity, relation, namespace string) []map[string]interface{} { return nil }
func (mockGraph) AllEdges() []map[string]interface{} { return nil }
func (mockGraph) Query(entity, relation, namespace string) []map[string]interface{} {
return nil
}
func (mockGraph) AllEdges(namespace string) []governance.GraphEdge { return nil }
func (mockGraph) SearchNodes(label string, namespace string) []map[string]interface{} {
return nil
}
@@ -0,0 +1,10 @@
package routes
import "testing"
func TestClassifyNamespaceForMuchen(t *testing.T) {
for _, c := range []string{"牧尘在招商局工作", "牧尘不在招商局工作", "画像规则: 牧尘在招商局工作"} {
got := classifyNamespace("profiles", "a06", c)
t.Logf("content=%q → namespace=%q", c, got)
}
}