Skip to content

e2e: two selectors scoping the same entity should produce per-flow findings with no duplication #11

Description

@Anand-rahul

What is missing

No existing spec has two selectors that scope the same entity. When two flows each scope TaskProcessor.Run and a diff touches it, the expected behaviour is exactly 2 findings (one per flow) — not 4 (duplication) and not 1 (collapsing).

Grepping all e2e yaml specs for 2 findings returns zero results.

Why it matters

In production, a function like an API entry point is often scoped by multiple flows (e.g., AuthSafety and RateLimitPolicy). If findings are duplicated or collapsed, review routing breaks silently.

Proposed test

Fixture: go-module-multi-method

Setup: install an overlay with two selectors (FlowAlpha, FlowBeta) both pointing at service.TaskProcessor.Run via anchor qualified_name. Apply demo.diff (which touches Run).

steps:
  - name: two_overlapping_selectors_produce_two_findings
    command: graph-harness validate-diff --diff demo.diff --json
    assert:
      - { type: exit_code, expected: 0 }
      - { type: contains, value: "2 findings" }
      - { type: contains, value: "FlowAlpha" }
      - { type: contains, value: "FlowBeta" }

Spec location: tests/e2e/specs/validate-diff/overlapping-selectors-no-duplicate-findings.yaml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions