Skip to content

fix: deduplicate backlog queue items - #672

Open
ApexWorm wants to merge 1 commit into
peteromallet:mainfrom
ApexWorm:fix/backlog-deduplicate-objective-items
Open

fix: deduplicate backlog queue items#672
ApexWorm wants to merge 1 commit into
peteromallet:mainfrom
ApexWorm:fix/backlog-deduplicate-objective-items

Conversation

@ApexWorm

Copy link
Copy Markdown

Problem

desloppify backlog --count 10 can emit every mechanical finding twice. The persisted .desloppify/query.json likewise contains duplicate IDs, so this is queue construction rather than terminal rendering.

_build_backlog concatenates objective_items and review_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 passed
  • Ran this branch against a real 2,034-finding monorepo: requested 10 backlog items, received 10 unique IDs
  • python3 -m ruff check on both touched files — passed
  • python3 -m py_compile on both touched files — passed
  • git diff --check — passed
  • Full suite — 5,809 passed, 4 skipped; the two failures are duplicate collection paths for test_do_run_batches_dry_run_generates_packet_and_prompts. The same assertion failure reproduces on pristine upstream commit 3a7735d5, so it is unrelated to this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant