Skip to content

[DRAFT] Remove unused fields in message_piece#1616

Draft
behnam-o wants to merge 8 commits intomicrosoft:mainfrom
behnam-o:dev/message-piece-unused
Draft

[DRAFT] Remove unused fields in message_piece#1616
behnam-o wants to merge 8 commits intomicrosoft:mainfrom
behnam-o:dev/message-piece-unused

Conversation

@behnam-o
Copy link
Copy Markdown
Contributor

Remove unused fields from message_piece

@rlundeen2 rlundeen2 requested a review from Copilot April 15, 2026 20:45
@rlundeen2 rlundeen2 self-assigned this Apr 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and targeted_harm_categories from MessagePiece serialization and memory storage.
  • Changed scores hydration to occur post-construction via MessagePiece._set_scores() (memory layer + tests updated).
  • Removed targeted_harm_categories filtering capability from MemoryInterface.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.

Comment thread tests/unit/prompt_normalizer/test_prompt_converter_configuration.py Outdated
Comment thread pyrit/models/message_piece.py Outdated
Comment thread pyrit/models/message_piece.py
Comment thread pyrit/models/message_piece.py Outdated
Comment thread pyrit/memory/memory_interface.py
Comment thread doc/code/memory/3_memory_data_types.md Outdated
Comment thread doc/code/executor/attack/1_prompt_sending_attack.ipynb Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants