Repository navigation
FIX: Preserve word-selection parameters in converter identifiers - #3000
Merged
Roman Lutz (romanlutz) merged 8 commits intoOct 12, 2026
Merged
Roman Lutz (romanlutz) merged 8 commits into
Roman Lutz (romanlutz) merged 8 commits into
Conversation
Signed-off-by: Zhibo Lin <147509942+LE0-Lin@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Zhibo Lin <147509942+LE0-Lin@users.noreply.github.com>
Zhibo Lin (LE0-Lin)
marked this pull request as ready for review
October 10, 2026 05:43
Contributor
Author
|
I included the other five converter overrides and kept the legacy default hashes. The related 321 tests and pre-commit checks pass locally. This is now ready for review, Roman Lutz (@romanlutz). Thanks! |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Roman Lutz (romanlutz)
requested changes
Oct 11, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Roman Lutz (romanlutz)
approved these changes
Oct 12, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 12, 2026
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.
Description
Fixes #2995. Different word selections can produce different text but the same converter identifier, causing the second default registry registration to fail.
I extended the BinAscii fix to CharSwap, FirstLetter, Leetspeak, UnicodeReplacement, and Zalgo. They now include the parent word-selection parameters. Existing default identities are preserved, including CharSwap's default 20% selection and the other converters' all-words configurations. Non-default selections intentionally receive corrected hashes; previously saved hashes for those configurations can differ.
WordIndexSelectionStrategyalso retains the supplied index order in its identity. Reordering indices can change which random values are used for each word. The fix preserves existing conversion order and outputs rather than sorting execution.This follows the maintainer invitation to continue in this PR. Constructor APIs and conversion methods are unchanged.
Tests and Documentation
uv run --frozen --all-extras ty checkon the five files changed for review: passed, including the test files. The fixture now narrowsrequest.parambefore returning it.pre-commit run --fileson those five files: passed, including full-treety check pyrit.git diff --checkpassed.The WordIndex selection docstrings now describe conversion order. Full repository tests and real-model integrations were not run locally.
AI assistance was used.