Repository navigation
fix(repair): print no path commit during a merge, cherry-pick or revert (#16440) - #16638
Conversation
…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
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
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. View limit details
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Head: 0820aeb
What I inspected:
- Semantic owner:
edit_cagestays the only authority for path-commit hazards. The operation check lives inpath_commit_operation/operation_from_markersand feeds all three entry points.path_commit_hazardscovers the check seam and gap routes, the pilot premise and the editor. The held-target hazard ininline_target_is_uncommittedcovers a pilot target-only commit.safe_paths_differing_from_headcovers agent-status replay. - Producers: every printed
commit_prerequisite_commandpasses through one of those entry points. Check never prints a target-only commit (RepairRoute::commit_prerequisiterequires premise files). Pilot reads the held target withwith_hazardon the CLI path. - Markers:
rev-parse --git-pathruns 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 asUnverified, and the unit test pins that. - Text: the default
remedykeeps the earlier advisory byte-identical. An operation is named once with Git's own continue and abort commands, andgit -C <root> statusis 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 precommitexit 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
|
Exact-source review on |
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
|
Hosted shard 1 on The same push also carries the fail-closed fix from the review above: the marker presence check now uses Generated by Claude Code |
|
Qualification shard 1 failed the refusal-next-step test on exact |
EffortlessSteven
left a comment
There was a problem hiding this comment.
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:?}; rungit statusto check the repository state. The fail-closed behavior is unchanged: an unexpected shape still returns Err, which marks every pathUnverified. The unit test keeps itsstarts_with("unexpected git-path answer")assertion. No baseline was added. refusal_next_step::error_messages_name_a_next_step_or_are_baselinedpasses 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_commitandcheck_never_prints_a_commit_over_a_file_staged_apart, pluslsp_lifecycle::real_seam_start_prints_no_commit_during_a_mergeand the two staged-apart seam and memo tests. cargo xtask precommitexit 0 on this head.
Generated by Claude Code
|
Done in Generated by Claude Code |
🤖 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 statusand the editor print nogit 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)
git commit -m p -- gcannot do a partial commit during a mergeREVERT_HEADis cleared: the revert is droppedWhat changed
edit_cage: newPathCommitHazard::OperationInProgress(PathCommitOperation).path_commit_operationreadsrebase-merge,rebase-apply,MERGE_HEAD,CHERRY_PICK_HEADandREVERT_HEADviarev-parse --git-path(linked worktrees read their own state). Rebase state wins, and an unexpected answer is an error, which marks every pathUnverified. Wired intopath_commit_hazards(check seam and gap routes, pilot premise, editor), into the held inline target hazard (pilot target-only commit) and intosafe_paths_differing_from_head(agent-status replay).app/navigation.rs:PathCommitUnsafegainsremedy. An operation is named once with its--continue/--abortcommands and inspected withgit -C <root> status. The text for the earlier hazards is byte-identical.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 recordedcommit_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_HEADand the resolution are untouched.edit_cageunit testoperation_markers_decide_the_path_commit_operation: rebase precedence, each operation, and malformed answers.cargo xtask precommitexit 0;cargo clippy -p ripr --lib --tests -D warningsclean; 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