From edc975f76e997c93fb6af1afe376a2705baf37a1 Mon Sep 17 00:00:00 2001 From: Juniper Bevensee Date: Wed, 17 Jun 2026 14:32:01 +1200 Subject: [PATCH] sanitization: sync intl-phone detector + messaging-identifier example from template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Carries the template's gate improvements into the live package: an E.164 intl-phone deterministic detector (us-phone only caught NA formatting) and a semantic flag example for messaging/user identifiers (Signal/Telegram UUID, contact phone). Directly relevant — Matilde is about to receive a scientist's real international contact + Signal UUID, which must never land in the package. TDD: test_detects_international_phone added; 75 passed / 6 skipped. Co-Authored-By: Claude Opus 4.8 (1M context) --- sanitize.config.json | 3 ++- scripts/check_sanitization.py | 3 +++ tests/test_check_sanitization.py | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sanitize.config.json b/sanitize.config.json index 580af1b..63c9c4a 100644 --- a/sanitize.config.json +++ b/sanitize.config.json @@ -21,7 +21,8 @@ "a specific dataset accession ID, file path, or repository tied to one private/in-progress study (e.g. an embargoed OpenNeuro dataset)", "names of collaborators, PIs, reviewers, or institutions tied to one active engagement (not public co-author lists)", "grant numbers, IRB/ethics protocol numbers, or funding details specific to one engagement", - "a codename or label that identifies one particular study (e.g. used as a skill name or heading)" + "a codename or label that identifies one particular study (e.g. used as a skill name or heading)", + "a messaging or account identifier tied to a real person — a Signal/Telegram UUID, a contact phone, an allowlisted user ID (these belong in deployment config/secrets, never in the package)" ], "do_not_flag_examples": [ "generic methodology (\"how to verify a citation\", \"how to grade a source\")", diff --git a/scripts/check_sanitization.py b/scripts/check_sanitization.py index 55213fc..ab33baa 100644 --- a/scripts/check_sanitization.py +++ b/scripts/check_sanitization.py @@ -59,6 +59,9 @@ def load_config(root="."): ("private-key-block", re.compile(r"-----BEGIN (?:RSA |EC |OPENSSH |DSA |PGP )?PRIVATE KEY-----")), ("email", re.compile(r"\b[A-Za-z0-9._%+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}\b")), ("us-phone", re.compile(r"(?