Repository navigation
feat: Add role-aware Scenario target-attempt accounting (#3043) - #3062
Nimit Jain (Nimit3418) wants to merge 15 commits into
Conversation
Interpret saved outcome counts through an async SDK with shared loop-bound admission, cooperative cancellation, and deterministic cleanup. Match bounded Unicode profile aggregation to the complete SQL fallback, with exact drilldowns, focused compatibility coverage, and SDK lifecycle documentation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve cancellation when admission races with a slot grant on Python 3.11. Release unscheduled operation capacity and close rejected coroutines, keep shutdown retryable, and log failures that race with caller cancellation. Add deterministic lifecycle regressions and verify raw-result analytics remains distinct from scenario-unit statistics and explicit result-role policy. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Expose decided-only and all-outcome success rates through one calculator and shared model. Keep raw saved-result selection distinct from scenario latest-unit selection while reusing count validation, rates, shares, and percentage formatting. Preserve legacy defaults and carry both rates through scenario progress and JSON projections. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reject contradictory scenario totals and outcome breakdowns, including mutated inputs at aggregation boundaries. Expose an explicit read-only success_rate_decided alias in shared statistics and JSON. Add typed include_outcome_statistics opt-ins to maintained result and async technique analytics while preserving the six-field default and existing deprecation schedules. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@microsoft-github-policy-service agree |
|
Hi Roman Lutz (@romanlutz), thanks for the guidance and the heads-up on the overlapping changes! I've updated the PR to coordinate with the shared OutcomeStatistics calculation from #3059 and fully addressed the role-aware accounting constraints you outlined. Here’s a breakdown of how it was implemented in this update:
Let me know if there's anything else you'd like adjusted. Otherwise, it should be good for another look whenever you have time! |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Thanks for the detailed review! I've addressed all 4 review comments, rebased onto the latest Here is a summary of the updates:
All linters ( |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Count saved producers by recorded attack name independently of planned logical units. Cover unknown and missing hashes, duplicate names, role errors/retries, report totals and conservative progress attribution. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Description
Implements the role-aware Scenario producer accounting requested in #3043. Latest main is merged, including the shared analytics SDK/calculators from #3059; this PR adds the role projection rather than a second outcome calculator.
ScenarioProducerCountsfor target-facing, orchestration, and unknown-role attempts, errors, and persisted retries. A target-facing producer result is not proof of a physical target request: preparation failures remain target-facing attempts.Closes #3043.
No intentional breaking change to existing outcome denominators or planned completion. No hierarchy endpoints, new request tracing, schema migration, or attack/scorer behavior change.
Tests and Documentation
Validated on Windows / Python 3.14.4 after integrating main. The new regressions reproduced the defect before the fix (3 failed, 1 passed), then all four cases passed. Final-head targeted validation:
Result: 1,113 passed, 1 skipped (existing Azure-only skip).
uv run --frozen --no-sync pre-commit run --all-files: passed, including formatting, lint, documentation, import/naming checks, migrations, and the configured full production type check. Normal commit hooks also passed without skips.uv run --frozen --no-sync ty check pyrit\analytics\scenario_statistics.py pyrit\models\scenario_progress.py pyrit\backend\services\scenario_progress_read_model.py: passed.git diff --check: passed.Updated analytics documentation and model/progress descriptions to distinguish producer populations from logical-unit populations. SQLite tests use isolated databases; Azure SQL coverage is compilation/offline only. No live targets, dataset downloads, notebook execution, or local full-repository test run was performed. Final-head hosted CI is enabled and pending; the targeted results above are not a claim that every hosted check has passed.
JupyText was not run because the effective changeset updates Markdown documentation, not paired notebook/Python examples.