Skip to content

fix(core): redact complete email addresses with multilabel domains - #404

Draft
MatrixAdventurer wants to merge 2 commits into
matrixorigin:mainfrom
MatrixAdventurer:agent/fix-email-redaction-375
Draft

MatrixAdventurer wants to merge 2 commits into
matrixorigin:mainfrom
MatrixAdventurer:agent/fix-email-redaction-375

Conversation

@MatrixAdventurer

@MatrixAdventurer MatrixAdventurer commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • fix (bug fix)
  • test (adding or updating tests)

Which issue(s) this PR fixes

Fixes #375

What this PR does / why we need it

The MEDIUM-tier email pattern currently captures only one dot in the domain, so bob@mail.example.com becomes [email].com and bob@example.co.uk becomes [email].uk. This leaks part of the domain into stored memories.

Actual RED→GREEN verified. On 8ddf8dd4 (regression only), Rust CI failed specifically in sensitivity::tests::email_redaction_covers_entire_multilabel_domain: memoria-core 22 passed / 1 failed; actual mail [email].com now, expected mail [email] now. The one-line regex fix at 8009d8f7 passes the exact regression and all memoria-core tests (23/23), plus GitHub Check & Clippy and Unit Tests. DB Tests remain in progress; independent review still pending.

  • User-owned fork: MatrixAdventurer/memoria, isolated branch agent/fix-email-redaction-375, based on upstream main@9ead2419.
  • Scope: one source/test file, memoria/crates/memoria-core/src/sensitivity.rs.
  • Focused command after final patch: cd memoria && cargo test -p memoria-core --lib email_redaction_covers_entire_multilabel_domain -- --nocapture.
  • Repository check, clippy, unit and DB tests must pass on the final exact head.
  • Full independent reviewer approval required before merge. Do not auto-merge or deploy.

由LW授权的ChatGPT Business智能体提交。

…atrixorigin#375)

RED regression stage; 由LW授权的ChatGPT Business智能体提交。
@loveRhythm1990

Copy link
Copy Markdown
Collaborator

LGTM on 8009d8f73c0baf3b05fd6961b0e3e857b4462f8a.

The prior email regex left suffixes such as .com or .uk behind for multilabel domains. Repeating the domain-label group fixes those cases without changing the surrounding text or HIGH/MEDIUM tier behavior. The regression checks both multilabel and ordinary domains through the actual sensitivity filter. No findings within this regex's existing supported email syntax. The description can now reflect completed DB CI.

Reviewed all 1 changed files (1/1, 100% coverage, none skipped), including tests/docs excluded by the default file filter. Verified the Rust CI run against this exact head, including the relevant tests in the DB-job log and all three subsequent restore/cleanup regression steps. Check & Clippy, Unit Tests, and DB Tests passed. Rust/MatrixOne tests were not rerun locally for this PR.

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.

[Bug]: email redaction leaves the domain tail for subdomain / multi-label TLD addresses ('[email].com')

3 participants