Skip to content

fix(audit): keep UUIDs intact in audit details - #14

Merged
mojtaba-py-code merged 1 commit into
mainfrom
fix/audit-keep-uuid-details
Oct 15, 2026
Merged

mojtaba-py-code merged 1 commit into
mainfrom
fix/audit-keep-uuid-details

Conversation

@mojtaba-py-code

Copy link
Copy Markdown
Owner

Bug: _sanitize_details passes every string through redact(). The phone-number pattern matches a UUID whose middle groups are all digits, so a document id written to the HMAC-chained audit trail can come out as 01a137c3-[REDACTED:PHONE]-3c51a221b759. With time-ordered UUIDs this happens at random. It is why test_search_is_audited_without_content_or_raw_pii failed on #9, even though #9 only changes compose.yaml.

Fix: values that are exactly a canonical UUID are recorded as they are. Any other text, including text that merely contains a UUID, is still redacted as before.

Tests: tests/unit/test_audit_details.py pins a digit-only UUID, so the case no longer depends on chance. It also checks that phones and e-mails next to ids are still redacted. The fix was reproduced and verified against core/redaction.py before pushing.

After this is merged, re-run the CI of #9.

🤖 Generated with Claude Code

The PII filter ran over every string detail, and the phone-number pattern matches a UUID whose middle groups are all digits (01a137c3-6012-7345-8123-...), so a document id on record could become 01a137c3-[REDACTED:PHONE]-.... Canonical UUIDs now pass through unchanged; free text is still redacted. This is also what made test_search_is_audited_without_content_or_raw_pii fail at random (seen on #9).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mojtaba-py-code
mojtaba-py-code merged commit 4a8473f into main Oct 15, 2026
14 checks passed
@mojtaba-py-code
mojtaba-py-code deleted the fix/audit-keep-uuid-details branch October 15, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant