Skip to content

feat: mask standalone ranks in quotes (v2.6.8)#41

Merged
click0 merged 1 commit into
mainfrom
claude/refactor-data-masking-lIcWN
Jul 5, 2026
Merged

feat: mask standalone ranks in quotes (v2.6.8)#41
click0 merged 1 commit into
mainfrom
claude/refactor-data-masking-lIcWN

Conversation

@click0

@click0 click0 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Standalone quoted ranks were not masked

Ranks are only masked when paired with a PIB. In log formats a rank appears as its own quoted value with no PIB — звання «1258963214» → «молодший сержант» — and was left in the clear.

Change

New _mask_quoted_ranks pass (after the PIB loop):

  • Masks a rank wrapped in quotes even without a PIB.
  • Only exact known forms (ALL_RANK_FORMS) inside quotes are touched — arbitrary quoted text («важливо», «138») is untouched.
  • Already-used rank masks are skipped (no double-masking of the pair-with-PIB case).
  • Quotes stay in place; unmask restores through the existing rank mapping.

Known limitation (documented)

If a masked rank collides with a different, unmasked bare rank in the same line (капітан «майор» where майоркапітан), roundtrip is ambiguous — inherent to deterministic masking on collisions, not specific to quotes. One quoted rank, or several distinct quoted ranks, round-trip correctly.

Test plan

  • 458 tests pass (+4: data-ipn rank log roundtrip, quoted-rank label, two distinct quoted ranks, non-rank-in-quotes untouched)

https://claude.ai/code/session_01XT6iUWaQgahXDB9TWX9Bq7


Generated by Claude Code

A rank in quotes as its own value («молодший сержант», log lines
'… → «молодший сержант»') is now masked even without a PIB. New
_mask_quoted_ranks pass runs after the PIB loop; only exact ALL_RANK_FORMS
inside quotes are touched, already-masked forms are skipped. Quotes stay;
unmask restores via rank mapping. +4 tests. Documented collision edge case.

https://claude.ai/code/session_01XT6iUWaQgahXDB9TWX9Bq7
@click0 click0 merged commit 2cdedab into main Jul 5, 2026
1 check passed
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.

2 participants