Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

BUG remove_seeds_from_memory(harm_categories=...) deletes seeds whose categories only contain the value as a substring

未关闭
#2,808 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

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

调研方向

Start at remove_seeds_from_memory and the list-filter handling for harm_categories, authors, groups, and parameters; inspect the existing _get_condition_json_array_match helper and the related seed-memory tests. Confirm that remove filters match whole list elements by default while get_seeds keeps substring behavior. Done means the reported hate example removes only the exact category and regression coverage passes.

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

描述

remove_seeds_from_memory(harm_categories=["hate"]) also deletes seeds tagged hate_speech, and even whatever. The list filters (harm_categories, authors, groups, parameters) go through field.contains(value), which is an unescaped LIKE '%value%' on the JSON text.

For get_seeds the substring match looks intentional (there are tests for it). But the remove methods already default value to an exact match so a short value can't wipe out more than you meant, and the list filters never got the same treatment.

seeds = [SeedPrompt(value="a", harm_categories=["hate"]),
         SeedPrompt(value="b", harm_categories=["hate_speech"]),
         SeedPrompt(value="c", harm_categories=["whatever"])]
await memory.add_seeds_to_memory_async(seeds=seeds, added_by="t")
memory.remove_seeds_from_memory(harm_categories=["hate"])  # removes all 3

Suggested fix: when exact=True (the default for removes), match whole list elements using the existing _get_condition_json_array_match helper, and leave get_seeds as is.

主要语言
Python
星标
4.5k
派生
896
平均合并
3 天 5 小时
30 天内合并 PR
200

贡献指南

这个仓库没有索引到贡献指南

从这里开始

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

microsoft/PyRIT 的其他 Issue

查看 microsoft/PyRIT 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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