Quote the match
{ "matched_text": "[clinical phrase]", "filename": "[source name]" }Convenient debugging; duplicated content.
Our classifier needed to explain itself. A design review showed how matched text, snippets, and filenames could turn that explanation into an unnecessary second store of clinical content.
The protected payload was not the only place sensitive text could survive. Evidence strings, debug context, exceptions, and audit events each have their own access and retention lifecycle.
{ "matched_text": "[clinical phrase]", "filename": "[source name]" }Convenient debugging; duplicated content.
{ "rule_id": "physician_order.header", "source": "text", "weight": 3 }Traceable reasoning without repeating the document.
The event points to a versioned rule registry. Reviewers can understand which rule contributed while the clinical source stays inside the system designed to protect it.
A code review convention can drift. The schema and tests reject unknown evidence shapes, free-form snippets, and synthetic canary phrases in serialized audit events.
| Assertion | Protects | Does not prove |
|---|---|---|
| Rule ID exists | Evidence resolves to reviewed logic | The rule itself is clinically valid |
| No free-form content | The contract cannot quote a document | No other log can leak data |
| Canary absent | Known synthetic text is not serialized | Whole-system HIPAA compliance |
Primary guidance supports treating logs as managed records, not disposable exhaust.
A narrated walkthrough of the evidence contract, rule registry, and hygiene test that keep explanation from becoming a shadow clinical record.