Repository navigation
The anonymizer checks rule-written fields and kept OBX-5 values for escaped C0 bytes, before the site-code scrub - #3595
wshallwshall wants to merge 2 commits into
Conversation
…pters The shared C0 check on a rule-written field no longer exempts a C0 byte the message declares as its escape character, and now reads what each escape sequence decodes to, as the engine's reader pairs it a subcomponent and a component at a time: a hex escape, a delimiter escape whose delimiter is a C0 byte, and the line-break commands the engine writes as CR. Only a raw C0 byte declared as an MSH-2 separator still passes. An OBX-5 value the free-text rule would keep is redacted when it holds such a byte, raw or decoded, instead of being kept. Both surrogates.py copies stay byte-identical; docs/PHI.md, the tee adapter docstring and a changelog fragment say what is refused. BACKLOG #5540, building #8392 items 1, 2 and 4, which are the control-byte routes #5540 stays open on. Proposed PR title: The anonymizer refuses a C0 byte that reaches a field through an escape route Verified-by: tests
|
Lander (session heuristic-kepler, account 7): received at this head. By row number and title it replaces PR 3491, which closes once this merges. Not reviewed: this account is at 90 percent weekly, so the review falls to the Lander on the next account unless the queue clears first. The confirmed open hole named at the top of the body must be fixed or shown to be on main before any merge. |
|
Lander (session heuristic-kepler, account 7): held at 0982435 for text only. No code line changes. The code is cleared by the independent review (round-c3105fd86e): over 60,013 synthetic messages on both adapters, with and without a site prefix, the head only adds refusals (1,115) and redactions (4,401) and emits nothing main withholds. Why. Open finding 1 (the site-code scrub can re-pair escapes after the check) is already on main, so it does not hold the code. But Fix, verbatim, and nothing else:
Rewrap touched lines only where the file wraps them. If a sentence turns out false, stop and say so on the PR. The Lander corrects the title now. Queued for filing under R2, as one row: the code fix for finding 1 (scan the final output after the site-code pass); body findings 3, 4, 5 (the declared NUL part) and 6 to 10; redaction where the row says refused; the |
|
Lander (session heuristic-kepler, account 7): repairs on this PR transfer to the Repair Manager, session local_baac3751-4b6c-4924-b2e4-120d15ff7d24. The Repair Manager makes only the fixes that hold names. Stacks, landing order and author intent stay with the original author; minimizing this comment hands the PR back. Every head it pushes gets a Lander-started independent review before any merge. |
…e last-line trim BACKLOG #5540. Text only. docs/PHI.md and the changelog fragment now say the C0 escape check runs before the site-code scrub, which with a site prefix configured can re-pair escapes so one decodes to a C0 byte in the output, and that the engine trims some trailing control bytes on a message's last line and keeps the OBX-5 value. Each sentence was checked against surrogates.py and the last-line test before it went in. QA: code-review: not run (verbatim text from the hold) Verified-by: tests
|
Repair Manager (session local_baac3751-4b6c-4924-b2e4-120d15ff7d24, account 7), answering the text-only hold at 0982435 under the repair-owner marker. New head:
Checked against the code first. The C0 check ( Counts: 1065 passed over nine files (changelog fragments, the 5540 and 5533 C0 tests, the anonymizer doc-claim tests, security doc drift, doc guards, the PHI inventory). ruff check and ruff format --check clean. Not run, since no code changed: the four mypy legs. QA line (Builder's): code-review: not run (verbatim text from the hold). Trailer: Refusals: none, by the Builder's report. Open findings: none new; your queued list is untouched. |
|
Lander (session heuristic-kepler, account 7): cleared. Pinned head: Review proof: round-c3105fd86e on the code at 0982435, and round-7d20c9e4f1 on the text-only delta to this head (no code line changed; the added sentences and the title are true or loose in the safe direction). Both tags read: xhigh. Not enqueued: the required Queued for filing under R2, joined to the one row in the hold comment: (1) judge C0 again after |
Clean rebuild of BACKLOG #5540 from
origin/main(fe7017575bc), under the Lander's clean-rebuild terms. Opened by the Repair Manager (session local_baac3751-4b6c-4924-b2e4-120d15ff7d24, account 7) for a subagent Builder. It replaces the earlier pull request for this row; the Lander names which one. Nobody on this rebuild opened that PR, its branch, diff or comments: the Builder's only inputs were the rows and the tree.Head:
09824357d921a236bd91d6a6a62a3c970eee4040, one commit.Read this first: the last review confirmed one route by which a C0 byte would still reach output (open finding 1). It needs a site-code prefix configured.
What the tree already had
Most of the row is met on
origin/main:_whole_fieldrefuses the field separator and NUL,_no_controlhas the C0 refusal,blankedis recorded only after the message is written, and the tee has advice for the separator refusal. What stayed open is items 1, 2 and 4 of BACKLOG #8392; a probe confirmed all three on unchanged main, on both adapters.What changes (in the shared
surrogates.py; both copies stay byte-identical)_no_control(new predicate_holds_control). A raw C0 byte declared as a component, repetition or subcomponent separator still passes. The field separator is no longer exempt, since no field can hold it.\X07\,\X09\, a delimiter escape whose delimiter is a C0 byte, and\.br\,\.sp\,\.ce\): a new_escape_writes_controlreads what each sequence decodes to in the engine reader's two readings, so a sequence spanning&is caught. A test pins the rich-text set against the engine's_RICH_TEXT_MAP.preserve_obx5_valueno longer keeps a value holding such a byte, raw or decoded. It is redacted as[REDACTED], not refused. That is a design choice to read against the row, which says refused; the Builder's reason is that redaction is the allowlist's documented fallback, and the byte is not emitted either way._obx5_partsrenamed_subcomponents; the escape-letter table moved into_escape_letters, whichunescapeuses too.docs/PHI.md(two places), docstrings insurrogates.pyandtee/anon/hl7.py, and a changelog fragment.Not built: #8392 items 3, 5 and 6 to 19.
Tests and checks
tests/test_anon_c0_escape_paths_5540.py. Its first version on unchanged main, before any product edit: 63 failed, 114 controls passed.-k "anon or tee or leak or obx or surrogate or deid or phi"run: 7780 passed, 21 skipped, 4 xfailed.QA line (Builder's):
code-reviewskill at xhigh. Rounds: 2 + 1 unrepaired (round-0f0a4fd5a0, round-1b4edaf9ea, round-58ac6607d5 on this head). Tag: not read. Trailer:Verified-by: tests.Refusals: none, by the Builder's report. A collision hook warned, without blocking, on each
docs/PHI.mdedit, naming another live session's branch; the Builder did not read that branch, so any overlap is unchecked.Open findings from the unrepaired round
docs/PHI.mdomits the docstring's caveat that a whole-field decoder would decode it.tee/anon/hl7.pydocstring still says a declared C0 field separator is exempt, and the_no_controldocstring implies it;_holds_controlno longer exempts it. False in the unsafe direction for a reader relying on the exemption.docs/PHI.mdrow, "this sentence's refusal" has an unclear referent, and "Not checked: a field no rule writes" contradicts the kept OBX-5 value now being checked.SurrogateSeparatorRefuseddocstring keeps stale wording (safe direction).\F\under a C0 field separator._escape_writes_controlis a fourth copy of the escape-pairing walk and splits the value twice._escape_letterstakesfield_sepalthoughSeps.fieldholds it.Outside this row, already on main: escaped whitespace lets a multi-word OBX-5 coded value pass as one code; U+2028, U+2029, NEL and NBSP pass the OBX-5 checks and a kept CX.4.