MAINT/FIX: Relocate targeted_harm_categories to AttackResult#1995
Merged
Conversation
Phase 14 of the models refactor: restore targeted_harm_categories as a first-class field on AttackResult (regression from microsoft#1951, which deleted it outright instead of relocating it). - Add targeted_harm_categories: list[str] to AttackResult - Add nullable JSON column to AttackResultEntry with read/write round-trip - New Alembic migration c3d5e7f9a1b2 (no backfill; source column already dropped and 0.15.0 is unreleased dev) - Auto-populate from SeedGroup.harm_categories via AttackParameters - Stamp centrally in AttackStrategy success/error paths - Re-add as a first-class (non-deprecated) get_attack_results filter - Tests for round-trip, params capture, central stamping, and filtering Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop historical/decision narrative from comments (e.g. 'replaces the removed per-piece filter', migration 'where it belongs') in favor of present-tense descriptions of current behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ty flagged SeedGroup(seeds=all_prompts): list[SeedPrompt] is not assignable to the invariant list[SeedUnion] parameter. Build all_prompts as an explicitly-typed list[SeedUnion] display so element types are checked against the union directly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
both 3_memory_data_types and 1_sqlite_memory notebooks need to be updated too |
…tion - Include targeted_harm_categories in AttackResult.to_dict()/from_dict() shims so the deprecated round-trip does not silently drop the field. - Restore targeted_harm_categories plumbing through the technique-selection chain (SelectorScope -> epsilon_greedy -> compute_technique_stats) so the re-homed get_attack_results filter is reachable. - Update memory docs: drop stale MessagePiece columns and refresh the 1_sqlite_memory schema output to match the current models. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
Rich agrees with this comment but it is copilot generated: Done. Updated |
hannahwestra25
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
target_harm_categories was prematurely removed in #1951 (it was meant to be moved from messagePiece to AttackResult I think, but instead it was removed).
This adds it back and routes it through. With this, phases 13–15 are complete except labels (scheduled for removal next release)
https://gist.github.com/rlundeen2/3e8daa8e12a11b4b6e52587b3c9b1dca