Skip to content

fix: unify SplitMind redaction source of truth - #10

Merged
Mby159 merged 1 commit into
mainfrom
fix/privacy-redaction-contract-base
Jun 21, 2026
Merged

Mby159 merged 1 commit into
mainfrom
fix/privacy-redaction-contract-base

Conversation

@Mby159

@Mby159 Mby159 commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

This is the first small step of SplitMind privacy routing round 2. It fixes the redaction contract base before touching provider prompt injection, restoration metadata, MCP, or larger orchestration.

The read-only review found two privacy paths:

  • PrivacyHandler generated the privacy report
  • TaskSplitter independently performed the actual subtask redaction

They could disagree. For example, TaskSplitter falsely redacted 手机号是 as [REDACTED_NAME_CN_0], while PrivacyHandler correctly reported only email + phone.

Changes

  • TaskSplitter now uses PrivacyHandler.detect() as the source of truth for detection/redaction
  • Redaction is position-ordered and deterministic
  • Repeated sensitive values are preserved by occurrence instead of collapsed by set(matches)
  • Type normalization keeps existing placeholder style (id_card_cn -> id_card, address_cn -> address)
  • Custom patterns are also registered with PrivacyHandler

Tests

Added coverage for:

  • no false name_cn redaction on 手机号是
  • stable placeholder ordering by text position
  • repeated sensitive values get repeated occurrence placeholders
  • engine privacy_report and actual subtask sensitive_info agree on basic types

Validation

python -m compileall -q splitmind
python -m pytest -q tests

Result:

22 passed in 0.13s

Review notes:

  • ~/pip/reviews/splitmind-privacy-routing-round2-readonly-2026-06-21.md
  • ~/pip/reviews/splitmind-redaction-contract-base-2026-06-21.md

Not included

  • no MCP changes
  • no provider prompt injection yet
  • no restoration validation metadata yet
  • no larger orchestration rewrite

@Mby159
Mby159 merged commit 49be3b4 into main Jun 21, 2026
5 checks passed
@Mby159
Mby159 deleted the fix/privacy-redaction-contract-base branch June 21, 2026 18:09
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