BUG: ColloquialWordswapConverter identifier ignores custom substitution values
Mantenedores costumam responder em até 2 dias
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 25/100
Direção de pesquisa
Read ColloquialWordswapConverter's identifier construction and compare it with LeetspeakConverter, which the issue identifies as handling full custom mappings. Check how the converter's identifier is tested; done means configurations with identical keys but different substitution values have different identifiers and both can register. A linked open pull request indicates this work is already underway.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the bug
ColloquialWordswapConverter identifies custom_substitutions only by their keys (substitution_keys). Two converters whose custom dictionaries have the same words but different substitutions produce different output but share one hash.
Because the default registry name comes from that hash, registering a second configuration without a custom name raises a duplicate-name error, and memory and analytics cannot tell the configurations apart. LeetspeakConverter already handles the same case by adding a custom_substitutions_hash of the full mapping. This is the same kind of problem as #3242 and #3244.
Steps/Code to Reproduce
import asyncio
from pyrit.converter import ColloquialWordswapConverter
from pyrit.registry import ConverterRegistry
papa = ColloquialWordswapConverter(deterministic=True, custom_substitutions={"father": ["papa"]})
bapa = ColloquialWordswapConverter(deterministic=True, custom_substitutions={"father": ["bapa"]})
print(papa.get_identifier().unique_name, bapa.get_identifier().unique_name)
print(asyncio.run(papa.convert_async(prompt="my father")).output_text)
print(asyncio.run(bapa.convert_async(prompt="my father")).output_text)
registry = ConverterRegistry()
registry.instances.register(papa)
registry.instances.register(bapa)
Expected Results
The two converters have different identifiers, and both register.
Actual Results
ColloquialWordswapConverter::ab18d07b ColloquialWordswapConverter::ab18d07b
my papa
my bapa
ValueError: Instance 'ColloquialWordswapConverter::ab18d07b' already exists
Screenshots
N/A
Versions
- OS: Windows 11
- Python version: 3.11.9
- PyRIT version: installed from main (5b594e00) in editable mode
- Linguagem predominante
- Python
- Estrelas
- 4.7k
- Forks
- 980
- Merge médio
- 2d 4h
- PRs com merge (30d)
- 438
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Sem guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoft/PyRIT
-
Description-only preset edits split comma-containing exact goals into separate goalsTalvez já em andamento @MRX-72 assumiu hoje. Abertahelp wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 2 dias
-
GUI rejects valid empty-string SearchReplaceConverter settings, preventing deletion convertersTalvez já em andamento @Darshika140 assumiu hoje. Abertahelp wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
microsoft/PyRIT#3749 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
HTML scenario export replaces an intentionally empty converted message with the original textTalvez já em andamento @VISHNU0906 assumiu hoje. Abertahelp wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
microsoft/PyRIT#3741 · 1 comentário · 1 responsável ·
Mantenedores costumam responder em até 2 dias
-
help wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 2 dias
-
Development toolchain includes an audited vulnerable Zod versionTalvez já em andamento @ppcvote assumiu hoje. Abertahelp wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
microsoft/PyRIT#3725 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
Todas as issues de microsoft/PyRIT
Issues semelhantes
-
breaking change
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
check-skill-pages: show fixture build errors when a build failsTalvez já em andamento @ShahadatTest assumiu hoje. Abertagood first issue P2
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
coco-research/coco#439 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
esphome/home-assistant-addon#274 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
endurain-project/endurain#882 ·
Mantenedores costumam responder em até 1 dia
-
good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100