Skip to content

feat: add interactive plan review to --plan mode#114

Merged
umputun merged 4 commits intomasterfrom
interactive-plan-review
Feb 16, 2026
Merged

feat: add interactive plan review to --plan mode#114
umputun merged 4 commits intomasterfrom
interactive-plan-review

Conversation

@umputun
Copy link
Owner

@umputun umputun commented Feb 16, 2026

Add "Interactive review" option to the plan draft review menu in ralphex --plan. When selected, opens $EDITOR with the plan draft in a temp file. On save and close, computes a unified diff and feeds it back as revision feedback through the existing revise mechanism.

Related to #113

  • New editorFunc field on TerminalCollector for testability
  • Editor lookup: $VISUAL$EDITORvi
  • Diff computed via difflib.GetUnifiedDiffString (already vendored via testify)
  • Diff wrapped with interpretation preamble so Claude understands annotations
  • make_plan.txt prompt updated to document the new option and diff-format feedback
  • If editor closes without changes, re-shows the menu
  • Menu now shows 4 options: Accept, Revise, Interactive review, Reject

Add "Interactive review" option to the plan draft review menu. When
selected, opens $EDITOR with the plan content in a temp file. On save,
computes a unified diff and feeds it back as revision feedback with
interpretation instructions for Claude.

Includes editorFunc field on TerminalCollector for testability, computeDiff
using difflib, and updated make_plan.txt prompt to document the new option.
Copilot AI review requested due to automatic review settings February 16, 2026 03:40
@cloudflare-workers-and-pages
Copy link

Deploying ralphex with  Cloudflare Pages  Cloudflare Pages

Latest commit: b3c0d54
Status: ✅  Deploy successful!
Preview URL: https://b050f926.ralphex.pages.dev
Branch Preview URL: https://interactive-plan-review.ralphex.pages.dev

View logs

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an "Interactive review" option to the plan draft review menu in ralphex --plan mode, enabling users to edit plan drafts directly in their $EDITOR. When changes are saved, a unified diff is computed and fed back as revision feedback through the existing revise mechanism.

Changes:

  • Added interactive plan review via $EDITOR with automatic diff computation
  • Fixed bufio.Reader reuse bug in AskDraftReview to prevent data loss in loops
  • Refactored agents.go logging to only warn when frontmatter options are dropped
  • Updated prompts and documentation to describe the new interactive review workflow

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/input/input.go Core implementation: added openEditor and computeDiff methods, refactored AskDraftReview to support 4th option with looping, fixed bufio.Reader threading
pkg/input/input_test.go Comprehensive test coverage for new functionality including edge cases, error handling, and cleanup verification
pkg/config/defaults/prompts/make_plan.txt Updated prompt to document the new "Interactive review" option and diff-format feedback
pkg/config/agents.go Minor refactor to only warn when frontmatter options are actually dropped
cmd/ralphex/main.go Output formatting improvements with new toRelPath helper function
go.mod Promoted go-difflib from indirect to direct dependency
docs/plans/completed/2026-02-15-interactive-plan-review.md Comprehensive implementation plan document
README.md, CLAUDE.md, llms.txt Documentation updates describing the new interactive review feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@umputun umputun merged commit 0f055cf into master Feb 16, 2026
11 checks passed
@umputun umputun deleted the interactive-plan-review branch February 16, 2026 03:47
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