From 6c895618f93d4a4359a8dcfa550384f765fad64a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=94=AF?= Date: Sun, 20 Sep 2026 08:40:41 +0800 Subject: [PATCH] test: fix mockGraph.AllEdges signature; add namespace classification probe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- go/internal/api/routes/zz_commit_conflict_gate_test.go | 6 ++++-- go/internal/api/routes/zz_ns_probe_test.go | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 go/internal/api/routes/zz_ns_probe_test.go diff --git a/go/internal/api/routes/zz_commit_conflict_gate_test.go b/go/internal/api/routes/zz_commit_conflict_gate_test.go index 063542d..6381fd1 100644 --- a/go/internal/api/routes/zz_commit_conflict_gate_test.go +++ b/go/internal/api/routes/zz_commit_conflict_gate_test.go @@ -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 } diff --git a/go/internal/api/routes/zz_ns_probe_test.go b/go/internal/api/routes/zz_ns_probe_test.go new file mode 100644 index 0000000..a519b16 --- /dev/null +++ b/go/internal/api/routes/zz_ns_probe_test.go @@ -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) + } +}