Skip to content

v0.2.37: feat: add duplicate-block mirror sweep

Choose a tag to compare

@OrenAshkenazy OrenAshkenazy released this 09 Aug 20:14
· 4 commits to main since this release

Summary

  • preserve flagged ranges in cluster sites and accept path:start-end sweep inputs
  • normalize and fingerprint a single flagged multi-line block, then search only changed files for exact copies
  • report exact hits as mirror candidates while retaining the existing token candidate path
  • exclude flagged and overlapping ranges from both mirror and token results
  • cover range clustering and mirror detection with small repository-owned synthetic corpora

Validation

  • /opt/homebrew/bin/pytest -q — 838 passed
  • /opt/homebrew/bin/ruff check plugins/gh-review-loop/skills/gh-review-loop/scripts tests
  • git diff --check
  • repository-wide relationship scan — clean
  • recorded replay output remains byte-stable

Depends on the merged #79 range metadata support.

Closes #77.

Summary by Sourcery

Add exact duplicate-block mirror sweeps for multi-line findings and distinguish them from existing token-based sibling detection.

New Features:

  • Support parsing and preserving flagged multi-line ranges in sweep inputs and cluster sites.
  • Introduce mirror candidate detection by normalizing, fingerprinting, and matching multi-line code blocks across changed files.
  • Label sweep candidates by class (mirror vs token) and surface this in reports and CLI usage.

Bug Fixes:

  • Exclude flagged and overlapping ranges from both mirror and token sweep results.
  • Prevent sweeps from reading files or sites outside the declared changed-file set.

Enhancements:

  • Refine sweep status handling so a successful mirror match can be reported even when token-based patterns are too thin or have too few sites.
  • Share candidate truncation and sorting logic across mirror and token sweeps.
  • Improve report output to omit empty invariant-token sections and to explain truncation or fallback reasons more clearly.

Documentation:

  • Document ranged-site usage, mirror sweeps, and their interaction with token-based sweeps in the review-loop skill guide.

Tests:

  • Use repository-owned synthetic fixtures for mirror detection, span clustering, punctuation significance, range parsing, comment stripping, overlap exclusion, and report labelling.