Files
magpie/internal/redact
yetoneandggbdpq e737dff447 redact: a dotted name a call is made on is no secret to the masking model (#4444)
kewab's redaction shot: gctx.GetInt64("user_id") went out with
gctx.GetInt64 replaced by a made-up key. No rule reaches such a span;
the local model called it a SECRET, and modelFits let it through.

modelFits's SECRET case now turns away an identifier path (identPath)
that a '(' touches: the name a call is made on. ggbdpq's patch (via
gua2100) asked notCode there, the rules' check, which also skips a name
with a space before its '(' and one after a colon that a comma follows.
The model is asked about prose too, and there those are secrets: with
notCode, "tell Bob it is Pw7nK4xQ9rTe (rotated today)" and "note:
hunterTwoThree, keep it" went out as written. Only the touching '(' is
taken.

Run at this tree on mote: go test ./internal/redact ./internal/usage
-count=1: ok. gofmt -l clean.
Broken by hand: the guard gone: TestModelMisreadsNotMasked red on
gctx.GetInt64; the patch's notCode in its place: TestModelFindsStill
Masked red on the three prose secrets above.
Not tried: the real local masking model (the tests use the stand-in
model the suite's other model finds use).

Co-authored-by: ggbdpq <ggbdpq@gmail.com>
2026-11-03 05:08:39 +08:00
..