Skip to content

Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.

guard: TestModelFinds keeps what masking keeps, at MinScore

yetone31abac2a9f19
diff --git a/internal/pii/guard/guard_test.go b/internal/pii/guard/guard_test.go
index 1f5b6eaf3..39eed0a81 100644
--- a/internal/pii/guard/guard_test.go
+++ b/internal/pii/guard/guard_test.go
@@ -94,9 +94,13 @@ func TestModelFinds(t *testing.T) {
}
text := "联系人:张三,电话 13800138000,邮箱 [email protected]。\n" +
"go 1.26\nrequire github.com/clipperhouse/uax29/v2 v2.2.0\n"
+ // what masking keeps at the publisher's threshold: Find gives down
+ // to Floor (the module path is a common_secret at .79)
have := map[string]string{}
for _, s := range m.Find(text) {
- have[text[s.Start:s.End]] = s.Label
+ if s.Score >= MinScore {
+ have[text[s.Start:s.End]] = s.Label
+ }
}
want := map[string]string{"张三": "private_person", "13800138000": "phone", "[email protected]": "email"}
if !reflect.DeepEqual(have, want) {