FEAT: GUI view existing scores#2189
Conversation
|
Love this already but haven't reviewed in depth yet :) |
behnam-o
left a comment
There was a problem hiding this comment.
agreed with other comments, approved as long as those are resolved.
| <AttackVerdictChip | ||
| outcome={outcome} | ||
| score={lastScore} | ||
| appliesToActiveConversation={activeConversationId === conversationId} |
There was a problem hiding this comment.
I don't think we should render the verdict here at all when a related (non-main) conversation is active, rather than dimming it and adding a caveat. outcome/last_score are attack-level, computed on the main conversation's final turn — so putting a colored success/failure badge in the ribbon next to a different conversation's messages is misleading. Someone scanning the ribbon reads the badge color first; the "this is attack-level, not this conversation" note in the popover is easy to miss and only shows after a click.
The dimming + appliesToActiveConversation machinery is really working around the fact that this value doesn't belong on a related-conversation view. I'd gate it so the chip only shows on the main conversation (activeConversationId === conversationId) and drop the dimmed/attack-level-note branch entirely — simpler component, and no misleading state.
(If we do want related conversations to show their verdict eventually, the per-piece scores are already in the API — MessagePieceView.scores — so that'd be a separate, more accurate feature rather than surfacing the main conversation's score everywhere.)
[For attacks, it's not unreasonable to think that we might have an attack result page at some point, too. ]
Description
Surfaces the attack objectives and scores from existing conversations in the DB into the GUI/CoPyRIT chat view.
Whats new:
utils/attackOutcomehelper so the chat and history views stay consistentScreenshots:

(see the new objective and score)
Click on score for details:

Tests and Documentation
New unit tests for the score chip, objective header, and the color. Existing full frontend test suite passes.