fix: deduplicate backlog queue items - #672
Open
ApexWorm wants to merge 1 commit into
Open
Conversation
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.
Problem
desloppify backlog --count 10can emit every mechanical finding twice. The persisted.desloppify/query.jsonlikewise contains duplicate IDs, so this is queue construction rather than terminal rendering._build_backlogconcatenatesobjective_itemsandreview_issue_items. Review-issue partitioning intentionally includes triage findings, which can include those same mechanical items, so the combined backlog needs an identity boundary.Fix
Build the backlog in existing partition order while tracking IDs already present in the execution queue or an earlier backlog partition. This preserves first-occurrence ranking and existing lifecycle classification while emitting each non-empty ID once.
Add a regression assertion that an unplanned mechanical finding appears exactly once. The touched imports were also normalized by Ruff.
Verification
python3 -m pytest desloppify/tests/review/test_work_queue_plan_order_and_triage.py desloppify/tests/commands/test_cmd_backlog.py desloppify/tests/commands/test_next_queue_flow_direct.py -q— 31 passedpython3 -m ruff checkon both touched files — passedpython3 -m py_compileon both touched files — passedgit diff --check— passedtest_do_run_batches_dry_run_generates_packet_and_prompts. The same assertion failure reproduces on pristine upstream commit3a7735d5, so it is unrelated to this change.