yapechan (Discord #feedback): with masking on, a person's name sometimes
came back as letters that are no one's, with no {{…}} braces. A user name
in a home folder goes to the vendor as eight made-up lowercase letters
(standInOf). When the login name is the user's own name (yaobin), a model
takes those letters for the user's name and writes them as a name is
written, "作者:Tmhdfetm", "Hi Tmhdfetm,". restoreShapes put a stand-in
back only as written, so a capitalised or upper-case one reached the user
as garbage. An IP stand-in (public-ip-…), a host name that is the same in
any case, had the same gap.
Now a USERNAME or IP stand-in is put back in any ASCII case: in Restore,
RestoreJSON (hasShapes), a stream's held tail (shapeTail) and
outsideShapes. Matching uses an ASCII-lowered copy of the same length
(lowerASCII, which now returns s itself with no capital in it, so there
is no copy), and strings.Index runs once per stand-in as before. An IP
stand-in is still put back only as a whole name. A key's made-up form
(Options.Shape) is still put back only as written, because a key's case
is part of it.
The restart question: the placeholder-to-value map is in memory only.
But a placeholder is an HMAC of its value under a key kept on disk
(redact.key, 0600, SetKeyPath from the gateway), and an agent resends its
history with the values on every turn. So after a restart the same value
goes as the same placeholder and the reply comes back whole.
TestPlaceholdersOutliveARestart now guards that, using the reporter's
姚斌 as a user word. Nothing new is written to disk.
Not found in magpie: a homophone (姚斌 -> 姚兵). Nothing in redact, pii
or restore maps a name by sound. A value goes back only for its own
placeholder or stand-in. The test records that 姚兵 goes back as the
vendor wrote it. Most likely the vendor model wrote it from a
romanisation it saw (a login name, an address); this is not reproduced.
Run at 19e9f7a82 (rebased on 4fc34828e), on mote:
- go test ./internal/redact ./internal/masking ./plugins/redact: ok
- go test -run 'Redact|Mask|Placeholder|Restore' ./internal/gateway: ok
- before the rebase, the whole ./internal/gateway (-timeout 45m): one red,
TestCodexPoolSaysTheClientsVersion, which is #4807 (another test's
Codex identity reaches it in a full run). It passes alone -count=3 at
this head, and it does not touch masking.
- GOOS=linux and GOOS=windows go vet ./internal/redact ./internal/gateway: ok
- gofmt -l: clean
Broken by hand: with the old shape.go, both InAnyCase tests are red
(Restore, RestoreJSON and the stream at every cut). With loadKey ignoring
the key file, TestPlaceholdersOutliveARestart is red (new placeholders,
reply left as {{TERM_…}}).
Not tried: a real vendor writing a capitalised stand-in. The reporter's
own session and records were not seen. The GUI was not run (no GUI
change).