Skip to content

FIX: make value kind labels exhaustive - #3472

Merged
Roman Lutz (romanlutz) merged 4 commits into
microsoft:mainfrom
huong8373tt-beep:fix/p311-03-analytics-dispatch
Oct 23, 2026
Merged

Roman Lutz (romanlutz) merged 4 commits into
microsoft:mainfrom
huong8373tt-beep:fix/p311-03-analytics-dispatch

Conversation

@huong8373tt-beep

@huong8373tt-beep Slai.life (huong8373tt-beep) commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • handle every AttackAnalyticsValueKind explicitly when formatting analytics labels
  • retain the existing display behavior for text-bearing values and legacy Operation names
  • use assert_never so a future enum member is surfaced by type checking

Validation

  • python -m pytest tests/unit/analytics/test_attack_result_analytics.py -q
  • python -m ty check pyrit/analytics/attack_result_analytics.py tests/unit/analytics/test_attack_result_analytics.py
  • python -m ruff format --check pyrit/analytics/attack_result_analytics.py tests/unit/analytics/test_attack_result_analytics.py
  • python -m ruff check pyrit/analytics/attack_result_analytics.py tests/unit/analytics/test_attack_result_analytics.py
  • git diff --check

Part of P311-03 in #3166.

Slai Agent Runtime assisted with investigation, implementation, and testing. The account owner reviewed and authorized this contribution.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Type-check the real enum and label dispatch with current and extended members. Require an unhandled member to fail at assert_never on Python 3.11.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@romanlutz Roman Lutz (romanlutz) changed the title fix(analytics): make value kind labels exhaustive FIX: make value kind labels exhaustive Oct 23, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 23, 2026
Merged via the queue into microsoft:main with commit 9dbd5e8 Oct 23, 2026
62 of 65 checks passed
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.

2 participants