{"v":[{"id":2851,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/205#issuecomment-2851","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/205","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"Decisions (Charles, 2026-10-21):\n\n- **Keep the dates** in redacted samples. DOB is still blacked out. Units, codes, RUG and the 2060 score are kept as well, so the corpus can measure OCR accuracy on the fields the flag compares.\n- **Samples may come to dev** once a person has checked them: gitignored, never committed, never sent to an outside service. With dates kept they're a limited data set, not de-identified.\n- **An accepted fax raises a flag against VESTA.** Step 6 in the description now has the design: match through the resolver, refuse on ambiguity, flag only after a grace period, auto-resolve when VESTA agrees.\n\nStill open: the grace period length, and the mailbox consent status.","assets":[],"created_at":"2026-10-21T17:44:45-05:00","updated_at":"2026-10-21T17:44:45-05:00"},{"id":2863,"html_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/205#issuecomment-2863","pull_request_url":"","issue_url":"https:\/\/www-s01.apinet.com\/codeforge\/apiintl\/hhmanager\/issues\/205","user":{"id":1,"login":"charles","login_name":"","source_id":0,"full_name":"Charles Willgren","email":"charles@noreply.www-s01.apinet.com","avatar_url":"https:\/\/www-s01.apinet.com\/codeforge\/avatars\/d3c894f7297c5a18eb3f6ac837c335b11a00aa9cc0961323771632b1e2d61bb2","html_url":"https:\/\/www-s01.apinet.com\/codeforge\/charles","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2025-12-08T10:03:41-06:00","restricted":false,"active":false,"prohibit_login":false,"location":"","pronouns":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"charles"},"original_author":"","original_author_id":0,"body":"**Progress, 2026-10-25: step 2 (the redactor) is built** \u2014 commit 0d77910.\n\n## `fax\/redact.py`\nRuns on the box where the faxes are; nothing leaves it.\n\n- **Pages that aren't a recognised 2101\/2067 are dropped**, never redacted. A cover sheet has no template to say where the name is.\n- **The transport banner** across the top is filled.\n- **Layer 1**: each template field marked `\"phi\": true` (new key in `fax\/templates\/*_roi.json`) is blacked out whole, plus any OCR'd word spilling past one. The 2067 also gains `redact_regions` for the Response section's To\/From, which has no field. A page that can't be registered gets 12pt padding instead of 3pt, and the report says so.\n- **Layer 2**: Presidio (spaCy `en_core_web_lg`, 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. `DATE_TIME` is not requested.\n- **Kept**: dates, units, codes, RUG, 2060 score, check marks and the printed form.\n- **The output is image-only**: rasterised and filled, no text layer, no metadata. Named `{forms}_{sha12}.pdf`.\n- **Leftover check**: every output page is OCR'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 (`printed_words`, hand-checked) never count as survivors.\n- **The report** (JSON on stdout) carries counts, entity types and field keys only. It never carries values or the input path, so it can be shared.\n\nTests: `fax\/test_redact_rules.py` (pure, standalone) has 56 checks. `fax\/test_redact.py` 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.\n\n### To run it on the secure box\n```\nvenv\/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 > report.jsonl\n```\n`requirements-redact.txt` pins `preshed<3.0.13`, because 3.0.14 breaks spaCy's tokenizer on load. A person still pages through each sample before it is copied to `fax\/corpus\/` on dev, which is gitignored.\n\n## Claude is kept off PHI by a hook\n`.claude\/settings.json` adds Read deny rules and a `PreToolUse` hook, `.claude\/hooks\/phi-guard.py`, with 52 tests. It refuses any tool call that names any of these:\n- `faxes\/`, `fax\/output\/` or `fax\/corpus\/`\n- `downloads\/`, `hhstore\/` or `docstore\/`\n- `.env*`\n- the directories `.env` sets for the fax and document pipelines\n- Tesseract's `\/tmp` crops\n- the fax review screens\n\nIt is a seatbelt, not a sandbox: a script that opens files itself is not seen. The OS sandbox (`sandbox.filesystem.denyRead`) is not enabled yet.\n\n## Found for step 4 (calibration), not fixed\n- The classifier can't read \"Form 2101\" on the binarised blank 2101 scan (\"FOFM Z1Ut\"). `ExampleFax.pdf` reads fine.\n- 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.\n- The redactor drops pages it can't recognise. That is safe, but each dropped page is one fewer sample, so the step 4 perturbation test matters.\n\n**Next:** step 1 (faxes flowing on prod) and step 3 (run the redactor, check, copy 30\u201350 per form to dev).","assets":[],"created_at":"2026-10-25T11:37:41-05:00","updated_at":"2026-10-25T11:37:41-05:00"}]}