{"v":"<p dir=\"auto\"><strong>Progress, 2026-10-25: step 2 (the redactor) is built<\/strong> \u2014 commit 0d77910.<\/p>\n<h2 id=\"user-content-fax-redact-py\" dir=\"auto\"><code>fax\/redact.py<\/code><\/h2>\n<p dir=\"auto\">Runs on the box where the faxes are; nothing leaves it.<\/p>\n<ul dir=\"auto\">\n<li><strong>Pages that aren&#39;t a recognised 2101\/2067 are dropped<\/strong>, never redacted. A cover sheet has no template to say where the name is.<\/li>\n<li><strong>The transport banner<\/strong> across the top is filled.<\/li>\n<li><strong>Layer 1<\/strong>: each template field marked <code>&#34;phi&#34;: true<\/code> (new key in <code>fax\/templates\/*_roi.json<\/code>) is blacked out whole, plus any OCR&#39;d word spilling past one. The 2067 also gains <code>redact_regions<\/code> for the Response section&#39;s To\/From, which has no field. A page that can&#39;t be registered gets 12pt padding instead of 3pt, and the report says so.<\/li>\n<li><strong>Layer 2<\/strong>: Presidio (spaCy <code>en_core_web_lg<\/code>, on-prem) plus our own recognizers over everything else. The recognizers cover ID numbers of 7+ digits, phone numbers, BJN\/license-style ids, contract names, a labelled date of birth, and email. <code>DATE_TIME<\/code> is not requested.<\/li>\n<li><strong>Kept<\/strong>: dates, units, codes, RUG, 2060 score, check marks and the printed form.<\/li>\n<li><strong>The output is image-only<\/strong>: rasterised and filled, no text layer, no metadata. Named <code>{forms}_{sha12}.pdf<\/code>.<\/li>\n<li><strong>Leftover check<\/strong>: every output page is OCR&#39;d again. If any value Layer 1 read, or any Layer 2 hit, can still be read, the fax is refused and nothing is written. Words printed on the blank forms (<code>printed_words<\/code>, hand-checked) never count as survivors.<\/li>\n<li><strong>The report<\/strong> (JSON on stdout) carries counts, entity types and field keys only. It never carries values or the input path, so it can be shared.<\/li>\n<\/ul>\n<p dir=\"auto\">Tests: <code>fax\/test_redact_rules.py<\/code> (pure, standalone) has 56 checks. <code>fax\/test_redact.py<\/code> has 34 end-to-end checks on synthetic faxes built from the blank forms with invented values, in clean, shifted+rotated and stretched variants. No invented identifier survives in any variant, and the dates stay readable.<\/p>\n<h3 id=\"user-content-to-run-it-on-the-secure-box\" dir=\"auto\">To run it on the secure box<\/h3>\n<pre class=\"code-block\"><code class=\"chroma language-text display\">venv\/bin\/pip install -r fax\/requirements.txt -r fax\/requirements-redact.txt\nvenv\/bin\/python -m spacy download en_core_web_lg\nvenv\/bin\/python fax\/redact.py \/path\/*.pdf --out-dir \/path\/redacted &gt; report.jsonl\n<\/code><\/pre><p dir=\"auto\"><code>requirements-redact.txt<\/code> pins <code>preshed&lt;3.0.13<\/code>, because 3.0.14 breaks spaCy&#39;s tokenizer on load. A person still pages through each sample before it is copied to <code>fax\/corpus\/<\/code> on dev, which is gitignored.<\/p>\n<h2 id=\"user-content-claude-is-kept-off-phi-by-a-hook\" dir=\"auto\">Claude is kept off PHI by a hook<\/h2>\n<p dir=\"auto\"><code>.claude\/settings.json<\/code> adds Read deny rules and a <code>PreToolUse<\/code> hook, <code>.claude\/hooks\/phi-guard.py<\/code>, with 52 tests. It refuses any tool call that names any of these:<\/p>\n<ul dir=\"auto\">\n<li><code>faxes\/<\/code>, <code>fax\/output\/<\/code> or <code>fax\/corpus\/<\/code><\/li>\n<li><code>downloads\/<\/code>, <code>hhstore\/<\/code> or <code>docstore\/<\/code><\/li>\n<li><code>.env*<\/code><\/li>\n<li>the directories <code>.env<\/code> sets for the fax and document pipelines<\/li>\n<li>Tesseract&#39;s <code>\/tmp<\/code> crops<\/li>\n<li>the fax review screens<\/li>\n<\/ul>\n<p dir=\"auto\">It is a seatbelt, not a sandbox: a script that opens files itself is not seen. The OS sandbox (<code>sandbox.filesystem.denyRead<\/code>) is not enabled yet.<\/p>\n<h2 id=\"user-content-found-for-step-4-calibration-not-fixed\" dir=\"auto\">Found for step 4 (calibration), not fixed<\/h2>\n<ul dir=\"auto\">\n<li>The classifier can&#39;t read &#34;Form 2101&#34; on the binarised blank 2101 scan (&#34;FOFM Z1Ut&#34;). <code>ExampleFax.pdf<\/code> reads fine.<\/li>\n<li>A 0.8\u00b0 rotation made it miss a 2067; deskew read \u22121.97\u00b0 on one run. A 0.5\u00b0 rotation lost 2101 registration.<\/li>\n<li>The redactor drops pages it can&#39;t recognise. That is safe, but each dropped page is one fewer sample, so the step 4 perturbation test matters.<\/li>\n<\/ul>\n<p dir=\"auto\"><strong>Next:<\/strong> step 1 (faxes flowing on prod) and step 3 (run the redactor, check, copy 30\u201350 per form to dev).<\/p>\n"}