Repository navigation
fix(findings): check each moved duplicate's engagement on a manual duplicate mark - #16963
Merged
Merged
Conversation
…plicate mark Marking a finding as a duplicate moves that finding's own duplicates onto the cluster root with it, but the engagement deduplication check only compared the marked finding with the root. A duplicate of the marked finding that sat in a third engagement was moved under a root in another engagement while deduplication_on_engagement was on. The mark is now refused when any of those duplicates is in another engagement than the root's and either engagement has deduplication_on_engagement, and the message names that duplicate. A root outside the marked finding's product is refused like an original outside it (404). The Similar Findings docs say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HJqD5FkqTDyyjgEBBQKHdb
… cross-engagement duplicate A refused manual duplicate mark names a duplicate in another engagement and says to reset its duplicate status first, but the similar-findings calculator answered None for that row before reaching its reset branch, so no menu offered it. The calculator now keeps Reset duplicate status on a row that is a duplicate even when the engagement check refuses the linking actions; resetting only takes it out of its cluster. The docs say where the action is. A duplicate of the marked finding sitting in another product is refused (404), the same way a root in another product is, in the same single query, members in another product first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GLL1WfJLfxsDJMCrh85XNG
Maffooch
approved these changes
Nov 18, 2026
devGregA
approved these changes
Nov 18, 2026
blakeaowens
added a commit
that referenced
this pull request
Nov 18, 2026
#16963 added a product check to the mark route and a reset on duplicate rows in another engagement to the menu. The route keeps its product check on top of cluster_root(). The menu keeps this branch's version, which already offers the reset on any duplicate row; it returns the reset first, so the row renders it (the row template shows None alone when the first action is None, so the ["None", "reset"] list on dev never rendered the reset). The #16963 test now expects ["reset_finding_duplicate_status"] and checks the rendered link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0143hYTGieXXrTHYeTDhwri2
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.
Description
Marking a finding as a duplicate (
finding/<duplicate_id>/duplicate/<original_id>) moves that finding's own duplicates onto the cluster root with it. The engagement deduplication check only compared the marked finding with the root (since #16921), so a duplicate of the marked finding that sat in a third engagement was moved under a root in another engagement whilededuplication_on_engagementwas enabled.Reproduced on
devwithdojo_testdata.json: finding 4 re-pointed at finding 7 and moved to engagement 4 (same product as engagement 1), engagements 1 and 4 withdeduplication_on_engagement=True, thenPOST /finding/7/duplicate/3. Finding 7 lands under root 2 (engagement 1, correct), and finding 4 (engagement 4) is moved under 2 as well, with no refusal.What changed
mark_finding_duplicaterefuses the mark when any duplicate of the marked finding sits in another engagement than the root's and either engagement hasdeduplication_on_engagement. The message names that duplicate and says to reset its duplicate status first. The check is oneSELECT ... LIMIT 1over the members, the same at any cluster size.calculate_possible_related_actions_for_similar_findingkeeps "Reset duplicate status" on a row that is a duplicate even when the engagement check refuses the linking actions, so the reset the refusal names is reachable from that duplicate's row.Testing
unittests/test_mark_finding_duplicate_self_reference.py: five new tests that post to the real route and reload the rows. Ondev, four of them fail for the reported reason (the member is moved; the cross-product mark saves) and the control passes. With this change both modules pass, 31 of 31 (unittests/test_manual_duplicate_onto_mitigated.pyincluded). Four more tests cover a member in another product (engagement deduplication off and on) and the reset on a cross-engagement duplicate row (and nothing extra on a row that is not a duplicate); the first three fail without the change.ruff checkwith ruff 0.16.10 andruff.toml: clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01GLL1WfJLfxsDJMCrh85XNG