Skip to content

fix(repair): print no path commit during a merge, cherry-pick or revert (#16440) - #16638

Merged
EffortlessSteven merged 5 commits into
mainfrom
claude/project-thread-9g17ji
Nov 29, 2026
Merged

EffortlessSteven merged 5 commits into
mainfrom
claude/project-thread-9g17ji

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

https://claude.ai/code/session_01YVdGzTog4paRbkjGfRRp4y

Governing issue or accepted claim: #16440
Acceptance delta (one sentence): While a merge, cherry-pick or revert is in progress, ripr check, ripr pilot, ripr agent status and the editor print no git commit -- <files> step and no repair start, and instead name the operation with its own continue and abort commands; a rebase stop keeps the commit step.

Closes #16570 (duplicate lane of #16440).

Source review: REVIEW_READY 365918d

Git behavior (2.43, scratch repositories)

State git commit -m p -- g
merge, resolution staged refused: cannot do a partial commit during a merge
cherry-pick conflict refused (same message)
conflicted revert rc 0, but REVERT_HEAD is cleared: the revert is dropped
rebase conflict stop rc 0, rebase state kept
rebase edit stop rc 0

What changed

  • edit_cage: new PathCommitHazard::OperationInProgress(PathCommitOperation). path_commit_operation reads rebase-merge, rebase-apply, MERGE_HEAD, CHERRY_PICK_HEAD and REVERT_HEAD via rev-parse --git-path (linked worktrees read their own state). Rebase state wins, and an unexpected answer is an error, which marks every path Unverified. Wired into path_commit_hazards (check seam and gap routes, pilot premise, editor), into the held inline target hazard (pilot target-only commit) and into safe_paths_differing_from_head (agent-status replay).
  • app/navigation.rs: PathCommitUnsafe gains remedy. An operation is named once with its --continue/--abort commands and inspected with git -C <root> status. The text for the earlier hazards is byte-identical.
  • Docs: OUTPUT_SCHEMA, RIPR-SPEC-0318, RIPR-SPEC-0129; changelog fragment.

Proof

  • check_repair_agree::a_merge_cherry_pick_or_revert_in_progress_prints_no_path_commit: real conflicted merge, cherry-pick and revert, checked on check, pilot terminal/Markdown/JSON and agent-status replay (a merge begun after pilot recorded commit_required). Asserts the marker and the staged resolution are untouched. Controls are an ordinary checkout, a rebase edit stop and a conflicted rebase pick, each of which keeps the commit. With the probe disabled, the test does not pass.
  • lsp_lifecycle::real_seam_start_prints_no_commit_during_a_merge: inert start and hover during a merge; MERGE_HEAD and the resolution are untouched.
  • edit_cage unit test operation_markers_decide_the_path_commit_operation: rebase precedence, each operation, and malformed answers.
  • Local: cargo xtask precommit exit 0; cargo clippy -p ripr --lib --tests -D warnings clean; the touched integration tests pass.

Review

An independent subagent review found nothing blocking. Its test gaps are fixed in this head: the rebase controls now assert the rebase stopped, a conflicted rebase pick control is added, the marker decision has a unit test, and the editor assertion checks the full git -C <root> status. Known limit: cherry-pick and revert are exercised on agent status only through the shared function, not each end to end.


Generated by Claude Code

…rt (#16440)

Git 2.43 refuses `git commit -- <files>` during a merge or a cherry-pick
("cannot do a partial commit during a merge"), and during a conflicted
revert the path commit succeeds but clears REVERT_HEAD, ending the revert.
The hazard owner (`edit_cage::path_commit_hazards` and the held-target
hazard) now reads the operation markers with `rev-parse --git-path` and
marks every path `OperationInProgress`; a rebase stop is not one, since Git
records a path commit there and keeps the rebase state. The shared
`PathCommitUnsafe` advisory names the operation once with its own continue
and abort commands and offers `git status`, so check, pilot, agent status
and the editor all withhold the commit and the start. Closes #16570.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzTog4paRbkjGfRRp4y
Review follow-up: the rebase edit-stop control now asserts the rebase
stopped, a conflicted rebase pick is a second control that keeps the
commit, and a unit test pins the marker decision (rebase precedence, each
operation, and an unexpected git-path answer as an error).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzTog4paRbkjGfRRp4y
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzTog4paRbkjGfRRp4y
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 54 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 137 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: ffdacc03-b95c-4619-abed-9e059fbff580
Commits

Reviewing files that changed from the base of the PR and between 5ba252e and 365918d.

Files selected for processing: 8

  • changelog.d/16440-no-path-commit-during-git-operation.md
  • crates/ripr/src/app/navigation.rs
  • crates/ripr/src/edit_cage/mod.rs
  • crates/ripr/tests/check_repair_agree.rs
  • crates/ripr/tests/lsp_lifecycle.rs
  • docs/OUTPUT_SCHEMA.md
  • docs/specs/RIPR-SPEC-0129-editor-integration-contract.md
  • docs/specs/RIPR-SPEC-0318-pilot-dirty-target-next-steps.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

SOURCE_REVIEW_READY

Head: 0820aeb

What I inspected:

  • Semantic owner: edit_cage stays the only authority for path-commit hazards. The operation check lives in path_commit_operation / operation_from_markers and feeds all three entry points. path_commit_hazards covers the check seam and gap routes, the pilot premise and the editor. The held-target hazard in inline_target_is_uncommitted covers a pilot target-only commit. safe_paths_differing_from_head covers agent-status replay.
  • Producers: every printed commit_prerequisite_command passes through one of those entry points. Check never prints a target-only commit (RepairRoute::commit_prerequisite requires premise files). Pilot reads the held target with with_hazard on the CLI path.
  • Markers: rev-parse --git-path runs at the canonical top-level, so a relative main-tree path and an absolute linked-worktree path both resolve. Rebase state takes precedence. An unexpected answer shape is an error, which withholds everything as Unverified, and the unit test pins that.
  • Text: the default remedy keeps the earlier advisory byte-identical. An operation is named once with Git's own continue and abort commands, and git -C <root> status is the inspect command.
  • Tests: real merge, cherry-pick and revert conflicts on check, pilot (terminal, Markdown, JSON), agent status and the editor. Each asserts that the marker and the staged resolution are untouched. The controls (ordinary checkout, rebase edit stop, conflicted rebase pick) keep the commit. With the probe forced to report no operation, the check/pilot test did not pass.
  • Docs: OUTPUT_SCHEMA, RIPR-SPEC-0318, RIPR-SPEC-0129 and the changelog fragment match the code.
  • Local: cargo xtask precommit exit 0 on this head. Clippy is clean on the lib and its tests.
  • Independent review: nothing blocking. Its test gaps are addressed in this head.

Hosted qualification is requested next with the merge-ready label.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Exact-source review on 0820aeb6, scoped to the stated fail-closed marker contract: path_commit_operation uses Path::exists(), which reports both absence and an error checking metadata as false. operation_from_markers also treats an empty row inside an otherwise five-row answer as an absent marker. Both cases can select Ok(None) even though the operation state was not established. Please pass a fallible presence probe (for example Path::try_exists) through the existing result and reject blank rows. Two deterministic unit controls, a marker lookup returning an error and a five-row response with an empty middle path, can pin existing Unverified routing without privileged filesystem setup. This is source evidence, not a claim that the real-conflict tests failed.

Review on #16638: Path::exists reports a metadata error as absent and a
blank git-path row was read as an absent marker, so either could select
"no operation" without establishing it. The presence test is now
try_exists through the existing result, and a blank row is an error, so
both route to Unverified. Unit controls pin both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzTog4paRbkjGfRRp4y
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzTog4paRbkjGfRRp4y

Copy link
Copy Markdown
Member Author

Hosted shard 1 on 0820aeb6 failed in refusal_next_step::error_messages_name_a_next_step_or_are_baselined. The new internal marker error, unexpected git-path answer: {markers:?}, named no next step. The message is reworded with a next step, and the policy test passes locally (23/23).

The same push also carries the fail-closed fix from the review above: the marker presence check now uses try_exists through the result, and a blank row is an error. Unit controls are added for both. Precommit is running on that head. I will re-request qualification when it passes.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Qualification shard 1 failed the refusal-next-step test on exact 0820aeb6. It found only the new malformed-marker text in edit_cage/mod.rs: unexpected git-path answer: {markers:?}. Keep the fail-closed behavior and append a read-only next step, e.g. run git status to inspect the current operation before committing. The existing malformed-answer check uses starts_with, so the test prefix can stay intact. No blanket baseline or commit suggestion needed; verify the refusal test and the active-operation controls on the next head.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

SOURCE_REVIEW_READY

Exact head 365918d5010b175b74a4d6008d585c9b3c3c2a73 (follow-up to b362bb2 / 0820aeb).

  • The malformed git-path answer message now names a read-only next step: unexpected git-path answer {markers:?}; run git status to check the repository state. The fail-closed behavior is unchanged: an unexpected shape still returns Err, which marks every path Unverified. The unit test keeps its starts_with("unexpected git-path answer") assertion. No baseline was added.
  • refusal_next_step::error_messages_name_a_next_step_or_are_baselined passes locally (the policy target, 23/23).
  • The active-operation controls pass on this head: check_repair_agree::a_merge_cherry_pick_or_revert_in_progress_prints_no_path_commit and check_never_prints_a_commit_over_a_file_staged_apart, plus lsp_lifecycle::real_seam_start_prints_no_commit_during_a_merge and the two staged-apart seam and memo tests.
  • cargo xtask precommit exit 0 on this head.

Generated by Claude Code

Copy link
Copy Markdown
Member Author

Done in 365918d5. The malformed-answer error now ends with a read-only next step (run git status to check the repository state), the starts_with prefix is unchanged, and no baseline was added. The refusal-next-step policy test and the merge, cherry-pick, revert and rebase controls pass on this head, and precommit exits 0. Qualification has been requested again.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Printed path commit cannot run during an unfinished merge or cherry-pick

2 participants