[DRAFT] Remove unused fields in message_piece#1616
Draft
behnam-o wants to merge 8 commits intomicrosoft:mainfrom
Draft
[DRAFT] Remove unused fields in message_piece#1616behnam-o wants to merge 8 commits intomicrosoft:mainfrom
behnam-o wants to merge 8 commits intomicrosoft:mainfrom
Conversation
rlundeen2
approved these changes
Apr 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Removes several unused MessagePiece fields and associated memory/query surface area, and updates tests/docs to match the simplified model.
Changes:
- Removed
originator,scorer_identifier, andtargeted_harm_categoriesfromMessagePieceserialization and memory storage. - Changed
scoreshydration to occur post-construction viaMessagePiece._set_scores()(memory layer + tests updated). - Removed
targeted_harm_categoriesfiltering capability fromMemoryInterface.get_attack_results()and DB-specific implementations.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
pyrit/models/message_piece.py |
Removes unused fields; introduces score hydration via _set_scores; updates to_dict() output. |
pyrit/memory/memory_models.py |
Drops targeted_harm_categories persistence and sets scores via _set_scores() when hydrating MessagePiece. |
pyrit/memory/memory_interface.py |
Removes targeted_harm_categories from get_attack_results() and deletes abstract hook for harm-category query conditions. |
pyrit/memory/sqlite_memory.py |
Removes SQLite harm-category attack-result filtering helper. |
pyrit/memory/azure_sql_memory.py |
Removes Azure SQL harm-category attack-result filtering helper. |
pyrit/score/conversation_scorer.py |
Stops copying removed originator field when creating derived pieces. |
tests/unit/models/test_message_piece.py |
Updates tests for removed fields and new score-hydration pathway; deletes scorer/harm-category tests. |
tests/unit/memory/memory_interface/test_interface_attack_results.py |
Updates helper signature and removes harm-category filtering tests. |
tests/unit/executor/attack/component/test_conversation_manager.py |
Updates tests to attach scores via _set_scores() instead of constructor. |
tests/integration/memory/test_azure_sql_memory_integration.py |
Removes integration test for harm-category filtering. |
tests/unit/prompt_normalizer/test_prompt_converter_configuration.py |
Changes how mock converter “name” is set. |
doc/code/memory/3_memory_data_types.md |
Removes docs for some fields (but not all—see comments). |
doc/code/memory/1_sqlite_memory.ipynb / doc/code/memory/9_exporting_data.ipynb / doc/code/executor/attack/1_prompt_sending_attack.ipynb |
Updates notebook outputs to reflect new schema/fields and new execution environment. |
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.
Remove unused fields from message_piece