Repository navigation
docs: lead the README with what the package does and a quick start - #23
Merged
Merged
Conversation
…label The spaCy model read common field labels as entities, so "SSN: 923-45-6789" came back as "<ORGANIZATION>: <US_SSN>" and "Email: john@example.com" as "<PERSON>: <EMAIL_ADDRESS>". The README showed this as a surprise to work around. A PERSON or ORGANIZATION span is now dropped when its whole text is a known label (SSN, Email, DOB, MRN, and similar) and another finding starts right after it. The identifier is still redacted; a label with nothing after it, and a name in front of an identifier, are still redacted. The street-address recognizer only fired after "Home address:" or "Mail to", so "Address: 42 Elm Road" passed through. It now fires after any label that ends in "address:". The synthetic recall set grows from 26 to 27 cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PrivacyConfig documented the default SCRUB_FILL_COLOR (0x0000FF) as blue. Pillow reads an integer colour as 0xBBGGRR, so the default fills red, which is what the demo screenshot shows. The docstring and comment now say so. openadapt-privacy-scan --help printed the module docstring, including notes for maintainers. It now describes what the scan checks and lists the exit codes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rewrite the README for a developer who finds the package on GitHub or PyPI. The first screen says what it removes, who it is for, and a two-command install with a one-line example. Every Python example was run against the current code, and tests/test_readme.py checks the quick start, scrub_dict, and recording outputs against the scrubber. - Put the limits in one Limits section: synthetic test data, English only, context-dependent labels, labelled street addresses only, OCR misses, and a regex-only CI scan. - Move operator material (fail-closed behavior, the provenance record, review steps, and the repository lifecycle link) to docs/COMPLIANCE.md, linked once from the README. - Document configuration through the config object. The old example built a PrivacyConfig that nothing read. - Say that screenshot scrubbing needs the Tesseract binary. - Regenerate the scrubbed demo screenshot with the current code; the old one came from the first release and showed the card number unredacted. - Use absolute image and link URLs so they render on PyPI. - Replace the README text pin in tests/test_scan.py with tests/test_readme.py. - Fix the class name in CLAUDE.md (PresidioScrubber does not exist) and sharpen the PyPI summary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The field-label filter dropped a PERSON span whose whole text was a label in front of another finding. "Ip" and "Sin" were in the label list, and both are surnames, so "Dr. Sin: 555-123-4567" came back as "Dr. Sin: <PHONE_NUMBER>" and "Sin john@example.com" as "Sin <EMAIL_ADDRESS>". Release 1.1.1 redacted the name in both. Remove "ip" and "sin" from the list. "IP address" and "social insurance number" stay. "SIN:" and "IP:" labels go back to being redacted along with the identifier after them, which over-redacts but leaks nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
openadapt-privacy-scan printed "PHI / clinic-path scan failed:" on a hit, and scan_tree's docstring referred to an internal scanner. The message is now "PHI scan failed:" and the docstring says what each line holds. The help text says the scan checks the files in a directory, since it also runs outside a git repository. The config module docstring still said you could create a new PrivacyConfig. Nothing reads one, so it now points to the module-level config instance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Limits said a card number that fails the Luhn check is still redacted as <DATE_TIME>. "4111 1111 1111 1112" comes back as "4111 1111 <DATE_TIME>". The README now gives both cases, and tests/test_readme.py checks them. - The scan section said it checks "a git tree". It checks the files in a directory, and in a git repository the tracked and unignored untracked files, not the history. - gitleaks.toml and phi-patterns.txt carry the text patterns, not the file-type checks, so they aren't "the same rules". - Spell out RPA, say the scan runs without Presidio instead of "needs no other packages", and explain the `uv pip install pip` step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
abrichr
added a commit
that referenced
this pull request
Oct 18, 2026
* fix: keep field labels readable and find addresses after any address label The spaCy model read common field labels as entities, so "SSN: 923-45-6789" came back as "<ORGANIZATION>: <US_SSN>" and "Email: john@example.com" as "<PERSON>: <EMAIL_ADDRESS>". The README showed this as a surprise to work around. A PERSON or ORGANIZATION span is now dropped when its whole text is a known label (SSN, Email, DOB, MRN, and similar) and another finding starts right after it. The identifier is still redacted; a label with nothing after it, and a name in front of an identifier, are still redacted. The street-address recognizer only fired after "Home address:" or "Mail to", so "Address: 42 Elm Road" passed through. It now fires after any label that ends in "address:". The synthetic recall set grows from 26 to 27 cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: correct the fill colour docs and give the scan CLI real help text PrivacyConfig documented the default SCRUB_FILL_COLOR (0x0000FF) as blue. Pillow reads an integer colour as 0xBBGGRR, so the default fills red, which is what the demo screenshot shows. The docstring and comment now say so. openadapt-privacy-scan --help printed the module docstring, including notes for maintainers. It now describes what the scan checks and lists the exit codes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: lead the README with what the package does and a quick start Rewrite the README for a developer who finds the package on GitHub or PyPI. The first screen says what it removes, who it is for, and a two-command install with a one-line example. Every Python example was run against the current code, and tests/test_readme.py checks the quick start, scrub_dict, and recording outputs against the scrubber. - Put the limits in one Limits section: synthetic test data, English only, context-dependent labels, labelled street addresses only, OCR misses, and a regex-only CI scan. - Move operator material (fail-closed behavior, the provenance record, review steps, and the repository lifecycle link) to docs/COMPLIANCE.md, linked once from the README. - Document configuration through the config object. The old example built a PrivacyConfig that nothing read. - Say that screenshot scrubbing needs the Tesseract binary. - Regenerate the scrubbed demo screenshot with the current code; the old one came from the first release and showed the card number unredacted. - Use absolute image and link URLs so they render on PyPI. - Replace the README text pin in tests/test_scan.py with tests/test_readme.py. - Fix the class name in CLAUDE.md (PresidioScrubber does not exist) and sharpen the PyPI summary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: keep a surname that matches a label abbreviation redacted The field-label filter dropped a PERSON span whose whole text was a label in front of another finding. "Ip" and "Sin" were in the label list, and both are surnames, so "Dr. Sin: 555-123-4567" came back as "Dr. Sin: <PHONE_NUMBER>" and "Sin john@example.com" as "Sin <EMAIL_ADDRESS>". Release 1.1.1 redacted the name in both. Remove "ip" and "sin" from the list. "IP address" and "social insurance number" stay. "SIN:" and "IP:" labels go back to being redacted along with the identifier after them, which over-redacts but leaks nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: drop internal wording from the scan output and config docs openadapt-privacy-scan printed "PHI / clinic-path scan failed:" on a hit, and scan_tree's docstring referred to an internal scanner. The message is now "PHI scan failed:" and the docstring says what each line holds. The help text says the scan checks the files in a directory, since it also runs outside a git repository. The config module docstring still said you could create a new PrivacyConfig. Nothing reads one, so it now points to the module-level config instance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: make the README's card, scan, and setup claims match the code - Limits said a card number that fails the Luhn check is still redacted as <DATE_TIME>. "4111 1111 1111 1112" comes back as "4111 1111 <DATE_TIME>". The README now gives both cases, and tests/test_readme.py checks them. - The scan section said it checks "a git tree". It checks the files in a directory, and in a git repository the tracked and unignored untracked files, not the history. - gitleaks.toml and phi-patterns.txt carry the text patterns, not the file-type checks, so they aren't "the same rules". - Spell out RPA, say the scan runs without Presidio instead of "needs no other packages", and explain the `uv pip install pip` step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.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.
Summary
Rewrites the README for a developer who finds openadapt-privacy on GitHub or PyPI, and fixes the small issues the old README described instead of fixing.
README
tests/test_readme.pychecks the quick start,scrub_dict, and recording outputs against the scrubber, so the README can't drift from the code.4111 1111 1111 1112keeps its first eight digits), labelled street addresses only, OCR misses, and a regex-only CI scan.docs/COMPLIANCE.md, linked once.configobject. The old example built aPrivacyConfigthat nothing read.Code fixes
fix:Field labels stay readable:SSN: 923-45-6789now scrubs toSSN: <US_SSN>instead of<ORGANIZATION>: <US_SSN>, andEmail: ...toEmail: <EMAIL_ADDRESS>. A label is dropped from the findings only when its whole text is a known label and another finding starts right after it, so the identifier is always still redacted. Labels that are also surnames (Ip,Sin) are not in the list, soDr. Sin: 555-123-4567still redacts the name, as 1.1.1 did.fix:The street-address recognizer fired only afterHome address:orMail to, soAddress: 42 Elm Roadpassed through unredacted. It now fires after any label ending inaddress:. The synthetic recall set grows from 26 to 27 cases.fix:TheSCRUB_FILL_COLORdocstring said the default was blue; it fills red (Pillow reads the integer as 0xBBGGRR).fix:openadapt-privacy-scan --helpprinted maintainer notes from the module docstring. It now describes the scan and its exit codes, and a failed scan printsPHI scan failed:instead ofPHI / clinic-path scan failed:.CLAUDE.mdused a class name that doesn't exist (PresidioScrubber). The PyPI summary is clearer.Testing
uv run pytest: 178 passed (Python 3.12, Presidio anden_core_web_sminstalled).pip install "openadapt-privacy[presidio]"andpython -m spacy download en_core_web_sm, then the quick start, using the published 1.1.1.openadapt-privacy-scan --self-testand--rooton a fresh install.uv build,scripts/check_source_boundary.py --require-dist, andtwine check: all pass.Notes
fix:commits, merging triggers the semantic-release workflow to publish a patch release, which is also what updates the README on PyPI.🤖 Generated with Claude Code