willz on Discord: a tool's JSON with "height": 5.13393848347348 went to
the vendor with part of the number as a placeholder. A run of digits
right after the point of a decimal, or right before it, was judged on
its own: 0.13800138000 went as 0.{{PHONE_…}}, 6.4111111111111111e-3 as
6.{{BANK_CARD_…}}e-3, 1.110105194912310038 as 1.{{ID_CARD_…}}, and
13800138000.5 as {{PHONE_…}}.5. The rules' bound only kept digits off
either side, not a point with a digit beyond it.
mask now drops, after noIDs, any span of a personal-data kind (kindCats:
PHONE, BANK_CARD, ID_CARD, SSN, IP, the model's ACCOUNT and PHONE, …)
that starts with a digit after "<digit>." or ends with a digit before
".<digit>" (noDecimals, inDecimal). It is one choke point for every
finder: the rules, the local model's spans and values known from
before. Not changed: secrets (a key or password masked once is masked
wherever it is, a decimal's digits too), the user's words and rules,
and the signed-thinking path, which re-masks only secrets. A phone
number or card standing alone, in text, after a colon, in a JSON
string, or at a sentence's end ("13800138000.") is masked as before.
A number list written "1.13800138000" with no space now goes as
written; a comma decimal (5,13800138000) is not treated as one.
Reporter's literal: at 86254d404 the rules alone leave
5.13393848347348 as written (the 14 fractional digits are too long for
a phone or a card); it is masked when the local model labels the
fraction (TestDecimalDigitsNotMaskedByModel, 5.{{ACCOUNT_…}} on the old
code) or once its digits are a known value, which is how it leaked
into another test's body on the old code. Which finder masked it for
willz is not known; the fix covers all three.
Tests (decimal_test.go): TestDecimalDigitsNotMasked (the reporter's
bytes and siblings: negative, exponent, ID card, whole part, text, many
digits; through Mask and MaskJSON in a tool_result),
TestDecimalDigitsNotMaskedByModel, TestKnownNumberNotInDecimal (plain
and in a signed thinking block), TestStandaloneNumbersStillMasked,
TestKnownSecretInDecimalStillMasked.
Run at 28d191fbe (on origin/main 86254d404):
- old redact.go with the new tests: all four decimal tests FAIL as above
(TestStandaloneNumbersStillMasked too, through the known ACCOUNT).
- broken by hand: without the fraction-side check 12 failing lines;
without the whole-part-side check, {"total": 13800138000.5} and
"13800138000.25" fail; without the personal-kind scope,
TestKnownSecretInDecimalStillMasked fails.
- gofmt -l internal/redact: empty. go vet ./..., GOOS=linux go vet
-tags nogui ./..., GOOS=windows go vet ./...: ok.
- go test -timeout 45m ./... (one suite on the machine, checked with
ps): 68 packages ok, no FAIL; internal/redact, internal/gateway and
internal/agent ok. An earlier full run during the edit also passed.
- after rebasing on fresh origin/main: go test ./internal/redact/... ok.
Not tried: the real local model (internal/pii) on willz's text, a real
gateway request, Windows or Linux runs of the package. No docs page
describes the rules' boundaries, so none changed.