Skip to content

feat(replay): group meaningful source-backed changes - #165

Merged
fcoury-oai merged 2 commits into
fcoury/pr-replayfrom
fcoury/pr-replay-semantic-changes
Jul 30, 2026
Merged

feat(replay): group meaningful source-backed changes#165
fcoury-oai merged 2 commits into
fcoury/pr-replayfrom
fcoury/pr-replay-semantic-changes

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Why

Raw Git hunks are not always meaningful review steps. A standalone blank-line hunk can inherit the name of a neighboring function, while a larger compatibility change can be reduced to its first added field and receive an unrelated pull-request summary. That makes PR Replay harder to trust precisely when reviewers are trying to understand what the original code actually does.

What changed

  • Add an immutable-hunk-backed semantic presentation overlay that groups related consecutive changes within the same file without discarding their original diffs, stable identities, source anchors, or prerequisite ordering.
  • Attach incidental whitespace changes to the nearest substantive change and combine derived-deserializer removal with the matching backwards-compatible deserialization implementation.
  • Generate change titles, explanations, and bounded supporting details from actual added/removed source, Rust syntax ownership, compatibility behavior, and relevant author-written rationale instead of neighboring hunk headers or unrelated PR text.
  • Apply, manually validate, undo, and recover every original hunk in a semantic group as one attributable editor operation while preserving individual original-hunk completion and inline-comment anchors.
  • Render a bounded summary of important secondary behavior beneath the selected change and document the semantic overlay and original-hunk invariants.
  • Cover whitespace-only hunks, unrelated neighboring symbols, backwards-compatible deserialization, cross-file isolation, duplicate/malformed groups, manual reconstruction, atomic apply/undo, crash recovery, and compact panel details.

How to Test

  1. From a repository with a pull request containing a formatting-only hunk followed by a real change, launch this branch and start Replay with Space R g. Confirm the blank line is not presented as an independent named change, the substantive change remains accurately named, and its original diff still includes both exact hunks.
  2. Review a change that removes derived deserialization, adds a field, introduces an explicit deserializer, and supplies a backwards-compatible default. Confirm Replay presents the full compatibility behavior with a relevant WHY and bounded supporting details rather than describing only the first field.
  3. Select a grouped change, press a, and confirm every displayed original hunk applies together. Press u and confirm the complete group reverts in one undo without overwriting reviewer-authored changes.
  4. Reconstruct the same grouped change manually and validate it; confirm all underlying original hunks are marked complete while the change list records one semantic completion.
  5. Apply a grouped change, restart with --resume, and confirm its progress, original source anchors, and single-step undo are restored.
  6. Run cargo test --lib and cargo clippy --all-targets --all-features -- -D warnings.

@fcoury
fcoury force-pushed the fcoury/pr-replay-semantic-changes branch from 5d76152 to 17d2db0 Compare July 30, 2026 19:40
@fcoury
fcoury force-pushed the fcoury/pr-replay-semantic-changes branch from 17d2db0 to 5298c15 Compare July 30, 2026 22:11
@fcoury-oai
fcoury-oai merged commit a05041d into fcoury/pr-replay Jul 30, 2026
2 checks passed
@fcoury-oai
fcoury-oai deleted the fcoury/pr-replay-semantic-changes branch July 30, 2026 23:52
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.

1 participant