fix: scrub nested privacy structures recursively - #12
Merged
Conversation
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
statescrub-all rule across direct values and nested containersRoot cause
The dictionary scrubber handled nested dictionaries, but it applied list rules only to direct string items. GUI trees can contain dictionaries and lists inside other lists. Text in those nested containers could remain unchanged even when the parent structure required scrubbing.
Impact
Structured GUI observations now apply one scrub state through the complete nested tree. This closes the path where patient or account text inside child elements, nested lists, or state containers could remain in an otherwise scrubbed derivative.
Validation
uv run --extra dev pytest tests/ -v --ignore=tests/test_presidio.py(71 passed, 1 skipped)uv run --extra dev ruff check openadapt_privacy/base.py tests/test_pipelines.pyuv buildpython scripts/check_source_boundary.py --require-distgit diff --check origin/main...HEADThe built wheel and source archive pass source policy
sha256:09e5092a6f84cbad0b588a9aec65cc7d26492dced2ddce26ca288a3ff81992c9.