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

未关闭 适合新手
#3,741 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 2 天内回复

@VISHNU0906 已经在做这个了。

开始于 2026年11月1日。

  • #3771 来自 @VISHNU0906 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
77/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
data

调研方向

阅读 pyrit/output/scenario_result/html.py 第 107–112 行附近的代码,了解 HTML 导出如何在转换后的值和原始值之间进行选择。在现有导出测试旁,添加针对带有 converted_value='' 的原始文本值的 HTML 集成测试。完成标准是:HTML 记录保留显式为空的转换后值,而不是显示原始文本。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Python
星标
4.7k
派生
1k
平均合并
2 天 3 小时
30 天内合并 PR
450

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/PyRIT 的其他 Issue

查看 microsoft/PyRIT 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。