Scenario progress double-counts an attack result after its timestamp is bumped
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start in ScenarioProgressReadModel._hydrate_new_deltas_async, where each page is appended with entry.deltas.extend(page) and nothing is deduplicated by attack_result_id. Then read get_scenario_attack_result_deltas_async to see how the keyset cursor over (timestamp, id) re-emits bumped rows. A re-emitted delta should update the cached copy of that attempt, not add a second one. Linked PR #3184 is already open against this, so check it before starting.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
The scenario progress read model double-counts an attack result whose row timestamp is later bumped.
get_scenario_attack_result_deltas_async pages rows in ascending keyset order over (timestamp, id), so any row whose timestamp moves forward compares greater than the stored cursor and is emitted again. That happens today: AttackService.update_attack_async and remove_human_score_async write "timestamp": datetime.now(UTC) on every edit, and promote_attack_conversation rewrites timestamps too.
ScenarioProgressReadModel._hydrate_new_deltas_async handles each page with entry.deltas.extend(page) and no dedup by attack_result_id, so the re-emitted row is appended as a second copy of the same attempt. The snapshot's results then contains the same attack twice, which inflates per-unit attempt counts and retry pressure for the lifetime of the cache entry.
Steps/Code to Reproduce
- Poll
GET /scenarios/{id}/progressonce so the read model caches the run's deltas and cursor. - Edit any attack result that belongs to that scenario (for example
PUT /attacks/{attack_result_id}), which bumps the row's timestamp. - Poll the scenario progress endpoint again.
The storage feed re-emits the edited row (keyset timestamp > cursor), and the read model appends it again.
Minimal reproduction against the read model:
memory.get_scenario_attack_result_deltas_async = AsyncMock(
side_effect=[([delta], False), ([bumped_delta_with_same_id], False)]
)
read_model = ScenarioProgressReadModel(memory=memory)
first = await read_model.get_snapshot_async(scenario_result_id="run", ...)
second = await read_model.get_snapshot_async(scenario_result_id="run", ...)
# second.results holds the same attack_result_id twice
Expected Results
A re-emitted delta updates the already cached copy of that attempt instead of adding a second one.
Actual Results
The same attack result id appears twice in the snapshot results, inflating attempt counts.
Screenshots
N/A
Versions
OS: macOS
Python version: 3.14
PyRIT version: installed from main (66c41fa)
- Ngôn ngữ chính
- Python
- Star
- 4.6k
- Fork
- 944
- Merge trung bình
- 2 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 358
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
-
BUG: label queries only return the final conversation of an attackCó thể đã có người làm @u7k4rs6 đã 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 85/100
microsoft/PyRIT#3095 · 4 bình luận · 1 người được giao ·
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 @joeyvictorino đã nhận 5 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 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Crescendo backtracking keeps the refused prompt when the objective target made a tool callCó thể đã có người làm @RachelWanggg đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG BinAsciiConverter UUencode output cannot be decoded when all words are convertedCó thể đã có người làm @barkha1research-ai đã nhận hôm nay. Đang mởBug: triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 2 ngày
-
FEAT Proposal: red-team decision models as targets (decision flip-rate testing)Có thể đã có người làm @shashank03-dev đã nhận hôm nay. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
microsoft/PyRIT#3246 · 2 bình luận ·
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ó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
huggingface/sentence-transformers#4186 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
QuantEcon/QuantEcon.py#988 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fabriziosalmi/certmate#1247 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
sujithputta02/Esapay#13 ·