Skip to content

Make blur the default redaction style - #3

Merged
govindup63 merged 1 commit into
mainfrom
feat/blur-by-default
Aug 21, 2026
Merged

govindup63 merged 1 commit into
mainfrom
feat/blur-by-default

Conversation

@govindup63

Copy link
Copy Markdown
Contributor

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.

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 blur leaks 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 === 0 is no longer the test for "nothing went wrong".

That matters because audit.warnings is 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 pass style: '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.ts and 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

  • The test that asserted black pixels at the name now passes 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.
  • A new test pins the default itself: the same run with no style set must paint pixels identical to style: 'blur', must not match style: 'box', and must carry the shape warning. box must warn about nothing.

14/14 pass, typecheck clean.

Docs and assets

  • Options table default, the style prose, and the throws-and-warns table all updated.
  • assets/redaction-example.png was showing box output, 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.

`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>
@govindup63
govindup63 merged commit 0223018 into main Aug 21, 2026
6 checks passed
@govindup63
govindup63 deleted the feat/blur-by-default branch August 21, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant