MAINT Extract scenario-history aggregate queries and record construction
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Wait for #2766 and #2768 to land before starting. Then read pyrit/memory/memory_interface.py and the scenario-history entry points, followed by tests/unit/memory/memory_interface/test_interface_scenario_history.py and tests/unit/backend/test_scenario_run_service.py. Done means the public delegate and return shape remain unchanged, aggregation stays database-side, and the existing history coverage passes with database portability preserved.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
MemoryInterface.get_scenario_history_aggregates() and _build_scenario_history_aggregate_statement() combine SQL aggregation, retry/error accounting, latest-attempt selection, auxiliary name lookup, and typed aggregate-record construction. After page retrieval and attempt-to-work-unit matching have been extracted, these are the remaining core history-query responsibilities in the general memory interface.
This is M3 of three scenario-history extraction steps. Not ready yet: depends on #2768, after #2766. Wait for those boundaries to land, then move aggregation into the same internal query module and reassess readiness before adding help wanted.
Describe the solution you'd like
Extract history aggregate statement construction, execution, and row-to-ScenarioHistoryAggregate conversion. Use the matching logic from #2768 rather than duplicating it, and retain the public MemoryInterface.get_scenario_history_aggregates() method as a delegate.
- Preserve grouping by logical work unit, the existing latest-attempt ordering, and all success/completion/error/retry arithmetic.
- Keep aggregation database-side, with compact result rows and the existing backend-specific expression hooks.
- Preserve empty/default records for requested runs with no matching attempts and the existing sorted attack-name output.
- Finish wiring the page method from #2766 through the cohesive internal history-query implementation without changing its return shape.
- Keep legacy/unusable-plan handling and caller policy in their existing layers. Do not redesign the backend service or GUI.
Acceptance criteria:
- Public signatures and typed return values remain unchanged.
- Runs with no attempts retain their zero/default aggregates; empty input is handled as before.
- Repeated attempts, internal retries, error attempts, and transitions between success/error outcomes produce exactly the existing counters.
- Tied timestamps retain the ID tiebreaker; latest timestamps, sorted attack names, and mixed planned/legacy results remain unchanged.
- Runs outside a usable plan keep existing fallback behavior, while unmatched planned attempts remain excluded from counters.
- No full result-object hydration, Python-side replacement of SQL aggregation, or new per-run/per-attempt query loop is introduced.
- Existing memory and backend history coverage exercises the final delegated path and guards database portability.
Describe alternatives you've considered, if relevant
Do not combine this with new counter semantics, a schema migration, or broad extraction of all scenario persistence methods. Do not make a separate service for each extraction step. The intended result is one cohesive private query component reached through the existing memory API.
Additional context
Starting points: pyrit/memory/memory_interface.py, get_scenario_history_aggregates, _build_scenario_history_aggregate_statement, and the page entry point. Coverage: tests/unit/memory/memory_interface/test_interface_scenario_history.py and tests/unit/backend/test_scenario_run_service.py.
Series: #2766 (history pages), #2768 (attempt matching), then this issue (aggregate queries/records). Follow doc/code/framework.md and the applicable database, Python, and test instructions. Memory owns retrieval and database aggregation here, not scenario execution, scoring decisions, or presentation.
- Ngôn ngữ chính
- Python
- Star
- 4.6k
- Fork
- 944
- Merge trung bình
- 3 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 278
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/PyRIT
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG PuzzledConverter cannot select words carrying non-ASCII letters, so the mask falls on articles insteadCó thể đã có người làm @adimalkar đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
microsoft/PyRIT#3022 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG Configuration keeps runtime-status errors after polling recoversCó thể đã có người làm @rupayon123 đã nhận 15 ngày trước. Đang mởBug: triage GUI help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
microsoft/PyRIT#2868 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của microsoft/PyRIT
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 60/100
521xueweihan/HelloGitHub#3924 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
wilbowes/EchoMuse#869 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Claiming namespace `jft63`Đang mởnamespace operations
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
EclipseFdn/open-vsx.org#14043 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
test: TestServeUntilStale races the server's close against the client's sendall (BrokenPipeError under load)Có thể đã có người làm @evoludigit đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 89/100
Maintainer thường phản hồi trong vòng 1 ngày