# Handover — WP7A — v13.3 Deterministic reinsert helper, pure helper and tests Repository: solidprivacy-nl/scrub Workpackage title: WP7A — v13.3 Deterministic reinsert helper, pure helper and tests Status: implemented; awaiting GitHub Actions and Hugging Face sync ## Summary Added a pure deterministic reinsert helper for the future v13.3 local reinsert workflow. The helper can replace Scrub placeholders in text with original values from a valid Scrub Key and returns an audit summary. This workpackage did not add UI, AI calls, cloud processing, automatic document rehydration or export/download behavior changes. ## Files added - `scrub_key_reinsert.py` - `tests/test_scrub_key_reinsert.py` - `handover/workpackages/20260607_1815_v13_3_reinsert_helper.md` ## Files changed - `WORKPACKAGES.md` - `CHANGELOG.md` ## Tests Added `tests/test_scrub_key_reinsert.py`. The tests cover: - valid reinsert with one placeholder; - valid reinsert with multiple placeholders; - repeated placeholder occurrences in text; - placeholder from key not found in text; - unknown placeholder in text not present in key; - invalid Scrub Key validation issues; - duplicate placeholder detection; - excluded rows not being reinserted; - synthetic Dutch legal values only; - input Scrub Key immutability; - explicit no-AI/no-cloud flags; - deterministic placeholder detection. ## Validation status Local pytest was not run from this connector environment. Recommended validation commands: ```bash PYTHONPATH=. pytest -q tests/test_scrub_key.py PYTHONPATH=. pytest -q tests/test_scrub_key_import.py PYTHONPATH=. pytest -q tests/test_scrub_key_reinsert.py PYTHONPATH=. pytest -q ``` ## GitHub Actions status Pending / not verified by this worker. Relevant commits: - `2f230019de017b80bed42c539fda0d64314338a8` — Add deterministic Scrub Key reinsert helper. - `1b58ecf483ba98c3121a059e2c52ca13c3c45d29` — Add deterministic reinsert helper tests. - `a306fc715b8b380689c58595a65dab014fb1f8c3` — Update workpackage status for deterministic reinsert helper. - `11c7f523879bcd1b20405f96a683f4058913763e` — Record deterministic reinsert helper. ## Hugging Face sync status Pending / not verified by this worker. ## App verification status Not applicable for this helper-only package. No UI behavior was changed. ## Notes / risks - `presidio_streamlit.py` was not changed. - `fix_streamlit_nested_expanders.py` was not changed. - No UI was added. - No AI calls were added. - No cloud processing was added. - No automatic document rehydration was added. - No TXT, CSV, DOCX or PDF export behavior was changed. - No Scrub Key export behavior was changed. - No Scrub Key import UI behavior was changed. - No secrets, tokens or real personal data were stored. - The helper treats duplicate placeholders as ambiguous and excludes them from reinsertion while reporting them in the audit summary. - Excluded Scrub Key items are ignored even if malformed/imported data contains them. ## Next recommended step Verify GitHub Actions and Hugging Face sync. After the helper is green, plan a separate v13.3 UI workpackage for local AI-output reinsert. Keep AI-output UI and any document rehydration behavior separate and explicitly reviewed before integration.