Skip to content

feat: auto-merge sibling hits into semantic parents #148

Description

@Lucas-Bur

Parent

#83

What to build

Collapse multiple high-ranking child hits from the same semantic parent into one parent result. Auto-merging runs after ranking and filtering, preserves the best score and provenance, and avoids spending the output budget on overlapping fragments from one function or class.

Default policy: two or more selected children with the same parent ID collapse into the parent. The policy must remain deterministic when top-K or output budgets are applied.

Acceptance criteria

  • Two or more selected children from one parent collapse into one parent result
  • A single child remains a child result
  • Merged results preserve best score, rank provenance, file, and parent line range
  • Top-K and output-budget handling remain deterministic before and after merging
  • Results from different parents never merge
  • JSON output identifies merged results and contributing child IDs
  • Tests cover threshold, ordering, deduplication, and budget boundaries

Blocked by

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions