From 0499c829650fa3062fa90d9d3855fdfb6cf5057e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=80=A1?= Date: Mon, 26 Oct 2026 00:28:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(eval):=20RunGolden=20=E6=94=AF=E6=8C=81=20?= =?UTF-8?q?all=5Fnamespaces=EF=BC=88=E8=B7=A8=20ns=20=E8=AF=84=E6=B5=8B?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 旧逻辑 ns 为空强制 shared ⇒ 评的是「只看 shared 的召回」,与线上跨 ns 不是同一系统 (实测前 15 条金标里 15 条 top 结果不同)。新增 all_namespaces=true ⇒ ns=""(等同线上默认); 不传 = 旧行为,向后兼容。 --- go/internal/api/routes/eval.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/go/internal/api/routes/eval.go b/go/internal/api/routes/eval.go index 0822b83..80df231 100644 --- a/go/internal/api/routes/eval.go +++ b/go/internal/api/routes/eval.go @@ -384,13 +384,20 @@ func (ea *EvalAPI) RunGolden(w http.ResponseWriter, r *http.Request) { var req struct { Namespace string `json:"namespace"` GoldenPath string `json:"golden_path"` // 可选,默认 testdata/golden-set.json + // AllNamespaces(2026-10-26)跨 namespace 评测开关。 + // 背景:旧逻辑 ns 为空 ⇒ 强制 "shared",而真实金标分散在 hermes-main/wiki/HUB 等多个 ns + // ⇒ 评测跑的是"只看 shared"的召回,与线上跨 ns 召回不是同一个系统(实测前 15 条里 15 条结果不同)。 + // 语义:true ⇒ ns = ""(全库跨 ns,等同线上默认);false ⇒ 保持旧行为(默认 shared,向后兼容)。 + AllNamespaces bool `json:"all_namespaces"` } if err := json.NewDecoder(r.Body).Decode(&req); err != nil { respondError(w, 400, "invalid body") return } ns := req.Namespace - if ns == "" { + if req.AllNamespaces { + ns = "" + } else if ns == "" { ns = "shared" } gs, err := LoadGoldenSet(req.GoldenPath)