Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

BUG: within word punctuation insertion can never land at the last two positions of the prompt

オープン 初心者向け
#3,565 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@ManoharPaturi がすでに取り組んでいます。

2026年10月27日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
testing-qa

調査の方向性

まず InsertPunctuationConverter._insert_within_words とそのdocstringを読み、次に InsertPunctuationConverter のテストを確認してください。3文字のプロンプト abc とシード0から299を使って、報告された動作を再現してください。最後の文字の直前と末尾の文字の後を含め、すべての挿入位置に到達できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Description

InsertPunctuationConverter._insert_within_words samples insertion indices from range(len(prompt_list) minus 1), so for a prompt of n characters only positions 0 through n minus 2 are ever chosen. Of the n plus 1 possible insertion points, a punctuation mark can never land immediately before the last character or after the final character, no matter the seed.

For the three character prompt abc, 300 different seeds produce only prefixes at offsets 0 and 1: outputs like ab!c or abc! are unreachable, while the method docstring says punctuation is inserted at any indices in the prompt.

Expected Behavior

Every insertion point of the prompt, before the first character through after the last, should be reachable.

Reproduction Steps

  1. Run InsertPunctuationConverter(between_words=False, word_swap_ratio=1.0, seed=s).convert_async(prompt="abc", ...) for seeds 0 through 299.
  2. Collect the offset of the inserted punctuation.
  3. Only offsets 0 and 1 ever appear on main.

Minimal Reproduction

offsets = set()
for seed in range(300):
    out = await InsertPunctuationConverter(between_words=False, word_swap_ratio=1.0, seed=seed).convert_async(prompt="abc", input_type="text")
    offsets |= {i for i, ch in enumerate(out.output_text) if not ch.isalnum()}
# {0, 1} on main

Environment

PyRIT main. Python 3.11.

主要言語
Python
スター
4.7k
フォーク
980
平均マージ
2日 9時間
マージ済み PR(30日)
433

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/PyRIT のほかの issue

microsoft/PyRIT の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。