HTML scenario export replaces an intentionally empty converted message with the original text

Đang mở Phù hợp với người mới
#3,741 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@VISHNU0906 đang làm issue này rồi.

Từ ngày 1/11/2026.

  • #3771 của @VISHNU0906 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
77/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
data

Hướng nghiên cứu

Đọc pyrit/output/scenario_result/html.py quanh dòng 107–112, nơi quá trình xuất HTML chọn giữa các giá trị đã chuyển đổi và giá trị gốc. Bổ sung kiểm thử tích hợp HTML cho một giá trị văn bản gốc có converted_value='', bên cạnh các bài kiểm thử xuất hiện có. Hoàn thành khi bản ghi HTML giữ nguyên giá trị đã chuyển đổi được để trống một cách tường minh thay vì hiển thị văn bản gốc.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

help wanted
Describe the bug

The HTML scenario report uses truthiness to choose converted content, so an intentional empty conversion is displayed as the original input and the export misrepresents what was sent.

Steps/Code to Reproduce

Build a scenario result containing original text ORIGINAL_WAS_REMOVED and converted_value='', then export HTML.

Expected Results

Render the explicit empty converted value. If original text is shown for comparison, label it separately.

Actual Results

Memory and JSON preserve converted_value='', but HTML transcript renders <div class="piece">ORIGINAL_WAS_REMOVED</div> because both text and media branches use converted_value or original_value.

Verified source reference: HTML scenario export.

Proposed fix/regression: fallback only for None/missing values; add HTML integration coverage for original text plus explicit empty converted text.

Screenshots

Not applicable; rendered snippet is inline.

Versions

Tested commit d3446e045960b5ebee4641aa70fdeb03af186587, PyRIT 1.2.0.dev0, offline real SQLite/export fixtures; no live inference or Azure SQL. Evidence: files/evidence/round7/full-report.html and export-inconsistencies.json; local paths are not attachments.

Ngôn ngữ chính
Python
Star
4.7k
Fork
1k
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
450

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/PyRIT

Tất cả issue của microsoft/PyRIT

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.