v0.2.37: feat: add duplicate-block mirror sweep
Summary
- preserve flagged ranges in cluster sites and accept
path:start-endsweep inputs - normalize and fingerprint a single flagged multi-line block, then search only changed files for exact copies
- report exact hits as
mirrorcandidates while retaining the existingtokencandidate 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 testsgit 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 (
mirrorvstoken) 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.