Skip to content

feat(replay): add guided pull request reconstruction - #162

Open
fcoury-oai wants to merge 67 commits into
masterfrom
fcoury/pr-replay
Open

feat(replay): add guided pull request reconstruction#162
fcoury-oai wants to merge 67 commits into
masterfrom
fcoury/pr-replay

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Why

A pull-request diff shows the finished change, but not how its author built it. PR Replay lets reviewers absorb a real change by reconstructing its original hunks, step by step, inside an explicitly approved scratch workspace. The original PR branch remains untouched.

What changed

  • Start Replay from a real GitHub PR, a local branch and its actual merge base, or a safe, entirely in-memory demo.
  • Show every original source-grounded change in a dedicated, focus-aware native pane with syntax and diff highlighting, scrolling, multi-file navigation, movable docks, keyboard and mouse resizing, and a pinned action bar.
  • Reconstruct hunks manually or apply each exact original patch as a single safely attributable and undoable editor transaction.
  • Pin original source commits and diff anchors; run Git, GitHub, and scratch preparation in bounded background workers with explicit confirmation and recoverable errors.
  • Resume verified scratch worktrees, exact review progress, notes, selected changes, and multiple in-progress reviews without replacing or silently adopting workspaces.
  • Verify whether the authenticated user is the original PR author; provide a durable local-only outbox for anchored inline comments, PR summaries, and author-only fix proposals.
  • Extend the typed editor-owned plugin API while preserving compatibility with existing plugins; document the complete workflow in docs/PR_REPLAY.md.

Review comments and fix proposals are deliberately local only in this milestone. Replay does not create a GitHub pending review, publish comments, submit an approval, edit the original PR branch, start an agent, stage, commit, or push. Portable save/load, explicitly approved GitHub reviews, and agent-assisted author updates will be separate follow-up milestones.

How to Test

  1. Run cargo run -p red, press Space R g, and choose Safe in-memory demo. Confirm the dedicated Replay pane opens beside an editable source buffer without creating files, branches, or network requests.
  2. With the Replay pane focused, use h/l to navigate changes and j/k to scroll. Confirm original line numbers, language-aware syntax, added/removed diff colors, meaningful change descriptions, clipped long lines, and the pinned action bar remain readable.
  3. Press i, manually reconstruct the displayed diff, and validate with Space R v. On another step, press a and then u; confirm exact one-step application and undo without an interrupting confirmation.
  4. Use Ctrl-w w and Ctrl-w H/J/K/L to move focus and reposition the pane. Resize with Ctrl-w >/< or Ctrl-w +/-, and drag the divider; confirm focus cues, layout, and syntax highlighting remain correct.
  5. Start a real GitHub PR or local-branch replay. Confirm the repository, immutable head, merge base, author, and exact scratch path are shown before creation; use [/] to navigate multi-file changes.
  6. Press c for an inline comment, s for a summary, and r for the local outbox. Verify draft editing and confirmed deletion; verify F is available only for the authenticated original PR author. Confirm no GitHub pending review or published comment is created.
  7. Restart with cargo run -p red -- --resume; confirm the original verified worktree, selected change, notes, drafts, and progress return. When several reviews exist, confirm the review picker identifies and reopens the chosen review without creating a replacement scratch branch.
  8. Run cargo test -p red --lib replay and cargo clippy --all-targets --all-features -- -D warnings. The complete all-feature workspace suite has also been verified.

@fcoury
fcoury force-pushed the fcoury/pr-replay branch from b58ea2e to aebdba0 Compare July 30, 2026 15:27
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