Skip to content

Document target choice and output verification, redraw the logo - #1

Merged
govindup63 merged 1 commit into
mainfrom
docs/readme-visuals-and-logo
Aug 21, 2026
Merged

govindup63 merged 1 commit into
mainfrom
docs/readme-visuals-and-logo

Conversation

@govindup63

Copy link
Copy Markdown
Contributor

What this is

A pass over the README against the actual code, plus two visuals and a redrawn logo. No source changes.

Four agents reviewed the repo: code, docs and usefulness, and the logo from a craft lens and a concept lens. This PR applies the documentation findings. The code findings are listed at the bottom and are not addressed here.

Corrections, each verified by running it

Claim Reality
"warnings is empty when nothing was skipped" False. patterns-only, and text mode with only visual targets, skip every model target in silence. {targets:['name','address','photo','email'], mode:'patterns-only'} returns warnings: [] and finds only the email.
redact-identifying leaves "an employer's site alone" It matches on URL host with no judgement. On a real CV "Embeddings Co" and "Aspora (Vance)" are hidden because both link to linkedin.com/company/...; "CloudSEK" survives because it links to cloudsek.com. It also only fires for targets that have patterns, so it is a no-op on ['name','photo'].
phone redacts "with their labels" It does not, and prompts.ts tells the model the opposite.
grid default 24x36 Not a passable value. It is { cols: 24, rows: 36, opacity: 0.35, snapToWords: true }.
ocrLanguage Was missing from the Options table.
"409 KB against 109 KB" Not reproducible. Measured 122 KB in, 457 KB out at 150 dpi, and it scales with dpi.
"runs the suite against dist" It compiles to dist-test.
"a new backend is about forty lines" The adapters are ~105 lines. Thirteen with customProvider.

Added

  • Checking the output — how to verify the three claims the file makes, with real output. The fixture goes from 21 text items and 2 links to 0 and 0; a real resume from 379 and 21 to 0 and 0.
  • What throws and what warns — a throw means there is no PDF at all, and that was not written down anywhere.
  • Found by column on the targets table, and a Choosing targets section. employer and school need a provider, and leaving them off is a deliberate trade rather than an oversight.
  • Calls scale with pages, not findings: a three page CV with photo is six calls, not two.
  • A page with no text layer and neither OCR nor a vision provider comes back unredacted, which is the quietest way to get a useless result out of this library.
  • The alternatives are named instead of implied.
  • Re-identification moves from the last section to the top. Keywords now say pseudonymisation.

Visuals

Both carry their own light ground, so they hold on either GitHub theme.

  • assets/redaction-example.png — before and after, generated from the repo's own test fixture, so there is no real PII in it.
  • assets/pipeline.svg — the four detection layers, with which ones cost a model call.

Logo

Both design reviewers independently concluded the same thing: three bars inset from both page margins is the universal "lines of text" glyph, so at 32px and below the mark read as file-text, not as redaction. It collided with TextEdit, Material description, Lucide file-text, Font Awesome file-lines, and the GitHub file octicon.

They disagreed on the fix. The concept reviewer wanted a negative-space hole; the craft reviewer argued a rectangular hole reads as a gap. I built both and rendered them at 16/32/48/96/256 on both themes: the hole goes ambiguous below 48px and reads as an odd silhouette, so the ink version won on the evidence.

Two bars now, uneven, running past the page edge, because ink applied afterwards does not respect the text block. Every value is a multiple of 8 so the edges land on whole pixels down to 16px. Container, page, fold and palette are unchanged, so it still reads as rsparse's sibling.

Code findings from the review, NOT in this PR

Verified defects, worth separate issues. Most severe first:

  1. Rotated text is painted in the wrong place (document/pdf.ts:135). Text drawn at 90 degrees, as sidebar CV templates do for the name, has its rotation discarded. Measured overlap between the box and the glyphs: under 2%. The name stays readable and warnings is empty.
  2. A malformed or refusing model reply is indistinguishable from a clean page (detect/llm-text.ts:69). {}, null, a refusal string, and a sub-minConfidence detection all yield zero detections and zero warnings.
  3. redact-identifying runs target regexes over URLs without the false-positive guards (detect/links.ts:31). With targets:['phone'], 14 of 21 links on a real CV matched PHONE via digits in the path, wiping the whole certifications section.
  4. buildLines fabricates a space between adjacent runs (detect/lines.ts:33). An email split across runs stops matching, and in two-column layouts one box spans the gutter.
  5. Prompt injection: page text is interpolated into the prompt unfenced, and finding 2 makes a successful injection look like a clean run.
  6. url false positives: deploy.sh, socket.io, Node.js/Express, Makefile.in all redact.
  7. DOB matches the bare word "born" and sweeps the following 40 characters.
  8. advance-widths.ts indexes by code point while the cursor indexes by UTF-16 code unit, so one emoji in a run shifts every later box (measured 17px).
  9. Off-grid vision cells like Y5 produce a zero-width box that is dropped with no warning.
  10. A two-character LLM quote matches page-wide: quote "an" produced 48 boxes on one page.
  11. dpi: 0 and dpi: -150 return a degenerate PDF and report success; Uint8Array input is rejected with a misleading error.

Tests still 13/13, typecheck clean.

The README made three claims a reader had no way to check, and a few that
were wrong. Reviewed the whole file against the code and fixed what did not
hold up.

Corrections, all verified by running them:

- "warnings is empty when nothing was skipped" was false. patterns-only,
  and text mode with only visual targets, skip every model target in
  silence. Say so, and point at detectionCounts instead.
- redact-identifying matches on URL host with no judgement, so an employer
  linking to its LinkedIn company page loses its name while one linking to
  its own domain keeps it. Measured on a real CV: "Embeddings Co" and
  "Aspora (Vance)" go, "CloudSEK" stays. It also only ever fires for
  targets that have patterns, so it is a no-op on a model-only target set.
- phone does not take the "Mobile:" label with it. The prompt tells the
  model the opposite of what the table claimed.
- grid default is an object, not "24x36". ocrLanguage was missing.
- The size figures were not reproducible. Replaced with measured numbers.
- npm test compiles to dist-test, not dist.
- A provider adapter is about a hundred lines, not forty.

Additions:

- Checking the output: how to verify the three claims, with real command
  output. 379 text items and 21 links in, 0 and 0 out.
- What throws and what warns, because a throw means no PDF at all and a
  batch caller cannot work that out from prose.
- Found by column on the targets table, and a Choosing targets section:
  employer and school need a provider, and leaving them off is a choice.
- Calls scale with pages, not findings, so a three page CV with photo is
  six calls rather than two.
- A page with no text layer and neither OCR nor vision comes back
  unredacted. This is the quietest way to get a useless result.
- Named the alternatives instead of implying there are none.

The re-identification limitation moves from a footnote to the top. Blacking
out the contact block is the easy half; a distinctive project or metric is
one search from a name and no target matches it. Keywords say
pseudonymisation now, because anonymisation is not what this does.

Visuals: a before and after built from the test fixture, and the four
detection layers as a diagram. Both carry their own light ground so they
hold up on either GitHub theme.

The logo was a text-file icon. Three bars inset from both page margins is
how every document glyph has been drawn for thirty years, and at 16px that
is all it said. Two bars now, uneven, running past the page edge the way
ink applied afterwards does not respect the text block, with every value on
a multiple of 8 so the edges land on whole pixels down to 16px. Same
container, page, fold and palette as rsparse.

Signed-off-by: Govind Pandey <govindup63@gmail.com>
@govindup63
govindup63 merged commit 428690d into main Aug 21, 2026
6 checks passed
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