Repository navigation
Make blur the default redaction style - #3
Merged
Merged
Conversation
`box` was the default. It is still the only style that gives nothing away, and it is one option away, but a blurred CV reads as a document rather than a censored file and that is the better thing to hand a reviewer by default. Worth being clear about what this trades, because it is a privacy tool and the unconfigured path is now the leakier one. Every style destroys the text, since the page is rebuilt from pixels either way, so nothing becomes recoverable that was not before. What blur leaks is the shape of what was covered: how many words, how long each one was, where the lines broke. That is enough to tell a short name from a long one. Pass `style: 'box'` when even that is too much. The warning stays. A style that leaves the shape visible should not be applied silently just because it is the default, so a default run now carries exactly one warning. That means `warnings.length === 0` is no longer the test for "nothing went wrong", which the README now says in the place where it tells you to read that field. The test that asserted black pixels at the name now asks for `style: 'box'` explicitly, because it is a test about where the box landed rather than about which style painted it. A new test pins the default: the same run with no style set must paint the same pixels as `style: 'blur'`, must not match `style: 'box'`, and must carry the shape warning. The before and after image in the README was showing box output, so it is regenerated from the default. Signed-off-by: Govind Pandey <govindup63@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
boxwas the default. It is still the only style that gives nothing away, and it is one option away, but a blurred CV reads as a document rather than a censored file, and that is the better thing to hand a reviewer by default.What this trades
Worth stating plainly, because this is a privacy tool and the unconfigured path is now the leakier one.
Every style destroys the text, since the page is rebuilt from pixels either way, so nothing becomes recoverable that was not recoverable before. What
blurleaks is the shape of what was covered: how many words, how long each one was, and where the lines broke. That is enough to tell a short name from a long one.style: 'box'remains for when even that is too much.The warning stays, and that changes an invariant
A style that leaves the shape visible should not be applied silently just because it is the default. So a default run now carries exactly one warning, which means
warnings.length === 0is no longer the test for "nothing went wrong".That matters because
audit.warningsis also how the library reports genuinely skipped targets, and I did not want to quietly devalue that channel. The README now says so in the same place it tells you to read the field: either passstyle: 'box', which warns about nothing, or filter the style entry out before you look.If you would rather the default be silent, that is a one-line change in
apply.tsand I am happy to make it. I left it noisy because silently defaulting to a shape-leaking style seemed like the wrong failure mode for this library.Tests
style: 'box'explicitly. It is a test about where the box landed, not about which style painted it, so pinning the style keeps it testing what it means to test.styleset must paint pixels identical tostyle: 'blur', must not matchstyle: 'box', and must carry the shape warning.boxmust warn about nothing.14/14 pass,
typecheckclean.Docs and assets
assets/redaction-example.pngwas showingboxoutput, so it is regenerated from the default. The caption now notes that the blur is not a smudge over live text: the characters were destroyed before anything was smoothed.