Skip to content

Review repeated changes once instead of re-reading each copy#33

Merged
gobetti merged 1 commit into
mainfrom
review-large-diffs-triage
Jul 14, 2026
Merged

Review repeated changes once instead of re-reading each copy#33
gobetti merged 1 commit into
mainfrom
review-large-diffs-triage

Conversation

@gobetti

@gobetti gobetti commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description

When the same change repeats across files (a migration applied to N modules, a field added to N definitions, a symbol renamed across callers), the review was re-reading every copy. On a 4-survey, ~9.5k-line ht-json migration (isapp/ht-json#1473) it spent ~30 turns re-analyzing each giant segments.json independently and tipped over max_turns.

Adds a short prompt step (## Repeated changes across files): review a repeated change once on one representative file, confirm the other occurrences are identical rather than re-reading each (diff <(git diff … fileA) <(git diff … fileB)), and focus the review on the distinct changes and on any file that deviates from the pattern (the highest-signal finding).

Deliberately not tied to diff size — it triggers on "the same change repeats across files," at any size, so uniformity gets checked regardless and the model isn't left to invent a size threshold. It carries two benefits: catches uniformity problems, and reads each repeated change once instead of N times.

The step recommends diff, so diff is added to the allow-list — read-only, like grep/jq/cat.

Honest scoping (from simulation): this reliably makes reviews pattern-aware and improves quality, but run-to-run turn variance is larger than the wording's effect, so it's an average/worst-case improvement, not a hard guarantee that the biggest multi-file migrations stay under a given cap. If a repo's bulk migrations keep tipping over, the reliable lever remains that repo's max_turns (or splitting the PR).

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Testing Done

Prompt + allow-list change to the shared review workflow; no functional/schema change. Validated the YAML parses. Behavior validated by reproducing the ht-json#1473 review locally: with the step, the review recognizes the uniform 4-survey migration and verifies it via a single byte-identical patch comparison rather than per-file deep-dives. diff is read-only and re-exposes nothing beyond the existing Read/Grep tools.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have added tests that prove my fix/feature works
  • New and existing tests pass locally
  • I have updated documentation as needed

@gobetti gobetti force-pushed the review-large-diffs-triage branch from 1e4f5b7 to 15542d3 Compare July 14, 2026 00:27
When the same change repeats across files (a migration applied to N
modules, a field added to N definitions, a symbol renamed across
callers), the review was re-reading every copy — on a 4-survey,
~9.5k-line ht-json migration it spent ~30 turns re-analyzing each
giant file independently and tipped over max_turns.

Add a short prompt step: review a repeated change once on one
representative file, then confirm the other occurrences are identical
(diff the per-file patch hunks against each other) rather than
re-reading each, and focus the review on the distinct changes and on
any file that deviates from the pattern (the highest-signal finding).
This also catches uniformity problems, and applies to any repeat, not
just large diffs.

The step recommends `diff <(git diff …) <(git diff …)`, so add `diff`
to the allow-list — it is read-only, like grep/jq/cat.
@gobetti gobetti force-pushed the review-large-diffs-triage branch from 15542d3 to ab017d3 Compare July 14, 2026 00:39
@gobetti gobetti changed the title Triage large diffs by concept instead of reading every line Review repeated changes once instead of re-reading each copy Jul 14, 2026
@gobetti gobetti merged commit 0f51589 into main Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants