pub struct Redactor { /* private fields */ }Expand description
What masks every secret in memory wherever a report quotes it, not
only in the secret finding that names it: a duplicate, a stale note,
a note in the wrong scope or a contradiction may quote the same line.
Built from every file an evaluation reads: each token tokens_in
finds, and each line of a private key’s body. Every string that goes
into details, and every note handed to claude, passes through
Redactor::text, which replaces each of them, and any token it finds
itself, with a mask.
Near-linear in the text, however many secrets it knows: each is looked
up by its first ANCHOR_BYTES bytes (all of it, when shorter), so
each position of the text costs a few hash lookups rather than one
comparison per secret. The longest secret starting at a position wins.