Skip to content

fix: preserve finding classification during deduplication - #462

Merged
rng1995 merged 5 commits into
mainfrom
naren/fix-pe3-occurrence-dedup
Aug 31, 2026
Merged

fix: preserve finding classification during deduplication#462
rng1995 merged 5 commits into
mainfrom
naren/fix-pe3-occurrence-dedup

Conversation

@rng1995

@rng1995 rng1995 commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • include classification and evidence in finding compaction identity
  • apply the same classification identity in raw, normalized, declared-marker, and continuity scan views so unsafe matches cannot be discarded before reporting
  • retain safe and unsafe matches that share a rule fingerprint as separate logical findings
  • canonicalize evidence into a bounded digest and fail closed for unsupported plugin metadata
  • preserve tag set semantics and highest-confidence compaction across location-specific context/snippets
  • add analyzer-to-report regressions for same-line, cross-file, JSON, SARIF, and normalized-obfuscation cases

Root cause

Deduplication grouped findings only by source scope, rule ID, and match fingerprint. Occurrence expansion then copied the selected representative's classification metadata to every grouped location. PE3 findings for a safe read-only /etc/passwd mount and unsafe access could therefore inherit whichever classification won representative selection.

The same incomplete identity was also used earlier in static view deduplication, where it could discard the unsafe finding before report compaction ever saw it. This was order-sensitive and also affected normalized security views.

The fix shares a classification-aware identity across both layers. View-origin tags are ignored only when comparing equivalent projections; meaningful classification and evidence remain distinct. Confidence and location-specific context stay outside the identity, preserving established compaction and highest-confidence selection. Ambiguous evidence never merges and cannot abort terminal/Markdown scans.

Validation

  • 339 focused deduplication, report, and pattern tests passed on the final local head
  • 592 large-file, continuity, normalized-view, and reconstruction regressions passed during final review
  • adversarial CLI scan retains both benign-mount and unsafe-access PE3 rows on the same line
  • Ruff lint/format and git diff --check passed

@rng1995
rng1995 force-pushed the naren/fix-pe3-occurrence-dedup branch from 15b29f8 to 5f51f9c Compare August 31, 2026 15:02
@rng1995 rng1995 changed the title fix: preserve occurrence-local metadata during deduplication fix: preserve finding classification during deduplication Aug 31, 2026
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
@rng1995
rng1995 force-pushed the naren/fix-pe3-occurrence-dedup branch from 5f51f9c to 0ea05d3 Compare August 31, 2026 15:06
@rng1995 rng1995 closed this Aug 31, 2026
@rng1995 rng1995 reopened this Aug 31, 2026
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
@rng1995
rng1995 merged commit 7805bb9 into main Aug 31, 2026
5 checks passed
@rng1995
rng1995 deleted the naren/fix-pe3-occurrence-dedup branch August 31, 2026 16:49
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