feat: mask standalone ranks in quotes (v2.6.8)#41
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_rankspass (after the PIB loop):ALL_RANK_FORMS) inside quotes are touched — arbitrary quoted text («важливо»,«138») is untouched.rankmapping.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
https://claude.ai/code/session_01XT6iUWaQgahXDB9TWX9Bq7
Generated by Claude Code