From f1091676f8faed0709dbea1ac78db4f096c61bcd Mon Sep 17 00:00:00 2001 From: JianFeeeee Date: Sat, 12 Sep 2026 08:23:30 +0800 Subject: [PATCH] =?UTF-8?q?style:=20gofmt=20=E4=B8=A4=E5=A4=84=E5=AF=B9?= =?UTF-8?q?=E9=BD=90=EF=BC=88graphmedia=5Ftest.go=20=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E3=80=81tfidf.go=20=E7=BB=93=E6=9E=84=E4=BD=93=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这两处是本次特性分支带入的格式回归(origin/main 上不脏)。 纯空白/对齐调整,无语义变化;不整体重排文件。 --- internal/agent/core/graphmedia_test.go | 2 +- internal/tfidf/tfidf.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/agent/core/graphmedia_test.go b/internal/agent/core/graphmedia_test.go index c13c4a8..c7252ea 100644 --- a/internal/agent/core/graphmedia_test.go +++ b/internal/agent/core/graphmedia_test.go @@ -481,7 +481,7 @@ func TestArchiveColdDocs_KeepsDocWhenGraphWriteEmpty(t *testing.T) { // 精确构造「三元组非空 + Commit 全部拒绝」这个状态: // Source/Summary 都超过 validEntityName 的 50 字符上限, // 于是 docToTriples 产出的两条元数据三元组都被跳过。 - longSource := strings.Repeat("超长来源名", 20) // 100 字 + longSource := strings.Repeat("超长来源名", 20) // 100 字 longSummary := strings.Repeat("超长摘要文本", 20) // >80 字触发长度门槛被跳过 it, _ := ms.Stat(digest) doc := &document.Doc{ diff --git a/internal/tfidf/tfidf.go b/internal/tfidf/tfidf.go index 006a8f9..d058901 100644 --- a/internal/tfidf/tfidf.go +++ b/internal/tfidf/tfidf.go @@ -26,12 +26,12 @@ type Vector map[string]float64 // Embedder 实现 vector.MultimodalEmbedder,将 TF-IDF 稀疏向量投射为固定维度稠密向量。 type Embedder struct { - mu sync.RWMutex - tokenizer Tokenizer - docFreq map[string]int - totalDocs int - dim int - loaded bool + mu sync.RWMutex + tokenizer Tokenizer + docFreq map[string]int + totalDocs int + dim int + loaded bool fingerprint string }