Repository navigation
FEAT: Add compute_outcome_repeatability for outcome agreement across reruns - #4652
Open
Adam Amzar (ADAMAMZAR) wants to merge 1 commit into
Open
Adam Amzar (ADAMAMZAR) wants to merge 1 commit into
Adam Amzar (ADAMAMZAR) wants to merge 1 commit into
Conversation
…reruns Compares two or more separately executed runs of the same scenario configuration and reports, for each objective planned in all of them, whether the attack always succeeded, always failed, or changed between runs, overall and per technique. Ports the logic of ASSERT's compute_repeatability. Moves the latest-top-level attempt selection from assert_policy_metrics into scenario_statistics as select_effective_attack_results so both use it. Closes microsoft#4651
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the cross-run outcome repeatability analytics changes.
No open issues 🎉
What changed in this PR
Adds library-only outcome repeatability analytics for separately executed runs of the same scenario, complementing existing within-run comparisons and addressing #4651.
Changes:
- Reports overall and per-technique agreement, per-run success rates, and excluded-unit counts.
- Validates run compatibility and shares latest-result selection with ASSERT policy metrics.
- Adds public exports, unit tests, and usage documentation.
| File | Description |
|---|---|
tests/unit/analytics/test_outcome_repeatability.py |
Tests agreement counts, exclusions, result selection, and input validation. |
pyrit/analytics/scenario_statistics.py |
Extracts shared effective-result selection by execution unit. |
pyrit/analytics/outcome_repeatability.py |
Implements cross-run comparison and report dataclasses. |
pyrit/analytics/assert_policy_metrics.py |
Reuses shared selection while preserving ASSERT technique naming. |
pyrit/analytics/__init__.py |
Lazily exports the new function and report types. |
doc/code/analytics/0_attack_results.md |
Documents rerun comparisons, usage, and metric definitions. |
Review effort: Balanced
This branch has not been deployed
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.
Description
Adds
compute_outcome_repeatability, which compares two or more separately executed runs of the same scenario configuration and reports, for each objective planned in all of them, whether the attack always succeeded, always failed, or changed between runs. It ports the logic of ASSERT'scompute_repeatability. Closes #4651.pyrit/analytics/outcome_repeatability.py, exported frompyrit.analytics, returns a frozenOutcomeRepeatabilitywithrun_count,overallandby_techniquecounts (OutcomeRepeatabilityCounts).ScenarioEvaluationIdentifier(...).eval_hash, the check resume uses; otherwiseValueError. Fewer than two runs, or the same run passed twice (which would read as full agreement), also raise.ScenarioExecutionUnit(atomic_group_id, seed_group_id)from each plan._select_effective_resultsmoved fromassert_policy_metrics.pyintoscenario_statistics.pyasselect_effective_attack_results(scenario_result, *, plan), keyed by unit and without the ASSERT technique naming;assert_policy_metrics.pynow calls it and maps techniques itself.agreement_rate, per-run success counts and rates, andrate_rangeuse the units decided in every run.ERROR,UNDETERMINEDand missing outcomes are counted instead (error_units,undetermined_units,missing_units, which may overlap), as are units planned in only some runs (partially_planned_units). Per-technique counts usetechnique_label, so the baseline isbaseline.0_attack_results.md, whose "separately executed runs are not supported" line now points to it. The module docstring cites ASSERT; no text is copied.