feat: group stacked redaction leaks into one recoverable block - #2
Merged
Merged
Conversation
Redaction tools draw one black box per line, so a poorly-redacted paragraph surfaced as a dozen separate findings with its recovered text split across all of them. checkPage now merges leak findings that stack into a single block (same check, overlapping columns, vertical gap up to ~1.25 line-heights so double-spaced filings like the Manafort response merge correctly). The merged finding spans the whole block and carries the recovered text joined in reading order, so a hidden passage reads back in full and the overlay frames the whole thing. Also updates the real-world regression set: - add the 2005 Calipari/Sgrena US Army report (a textbook black-box-over- live-text failure; grade F, hundreds of recovered names/details); - reclassify the TSA SOP fixture from failure to control — the fetchable cryptome copy is a reveal edition (once-hidden text shown openly with a red outline, nothing actually covered), so grade A is correct and it now guards that exact false positive; - rebaseline Manafort/JPMorgan leak counts for the per-passage merge. Adds tests/merge-findings.test.ts and gitignores scan working dirs and downloaded releases so they can never be committed.
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.
Description
Redaction tools draw one black box per line, so a poorly-redacted paragraph surfaced in the results view as a dozen separate cards with its recovered text split across all of them.
checkPagenow merges leak findings that stack into a single block — same check, horizontally-overlapping columns, and a vertical gap up to ~1.25 line-heights (so double-spaced filings like the Manafort response merge correctly, where consecutive redaction boxes sit a full line-height apart). The merged finding spans the whole block (so the "show in document" overlay frames the passage) and carries the recovered text joined top-to-bottom, left-to-right.Result on the Manafort fixture: page 5 goes from 9 fragment cards to 2 readable paragraphs, and the recovered text reads back in full.
This is the only change that affects the shipped bundle (
src/lib/analyzer/checks.ts); the rest is tests, fixtures, and docs.Regression set updates
minLeaksfor the per-passage merge.Also
tests/merge-findings.test.ts(7 cases pinning the merge geometry: double-spacing, indents, paragraph-break gaps, side-by-side columns, cross-check isolation)..gitignorenow coversscans/,election-integrity/, anddni-scan/so a straygit add -Acan't commit a downloaded release.Testing
npm test→ 24 pass (12 synthetic examples, 7 merge-geometry, 5 real-world incl. the new Calipari fixture).npm run lintclean;npm run buildsucceeds.npm run examples:real) and skip in CI when absent, so the suite stays green without them.