Skip to content

v0.2.39: feat: restore duplicate-block mirror sweep

Latest

Choose a tag to compare

@OrenAshkenazy OrenAshkenazy released this 13 Aug 20:55

Summary by Sourcery

Introduce mirror-based duplicate-block sweeps that can operate from a single multi-line finding, alongside existing token-based sibling sweeps.

New Features:

  • Support ranged sites (PATH:START-END) and exact normalized multi-line block matching, reported as mirror candidates distinct from token-intersection hits.
  • Allow single ranged findings to trigger duplicate-block sweeps without requiring multiple sites, while preserving safety constraints around identifier-like tokens and changed-file boundaries.

Bug Fixes:

  • Ensure token sweeps ignore flagged lines within multi-line ranges and never read sources outside the declared changed files.
  • Prevent duplicate reporting when mirror ranges overlap flagged spans or when token hits fall inside mirror blocks.
  • Refine status and reporting logic so mirror-only sweeps can return ok from a single ranged site, while token sweeps still enforce the two-site minimum.

Enhancements:

  • Add language-aware comment stripping, whitespace normalization, and indentation preservation for robust block fingerprinting.
  • Label candidates by class (mirror vs token) in both JSON and human-readable reports, and centralize candidate sorting/truncation.
  • Extend clustering to preserve multi-line anchored ranges and use synthetic corpora to exercise span clustering and mirror sweeps.
  • Clarify README and skill documentation around mirror vs token sweeps, including CLI usage for ranged sites.

Tests:

  • Add comprehensive tests for block normalization, mirror candidate discovery, interaction with token sweeps, and range parsing.
  • Replace prior external PR195-based clustering and sweep fixtures with small, repository-owned synthetic corpora for spans and mirrors.
  • Update request rereview tests to use a neutral example repository name instead of a real upstream repo.