Repository navigation
Guard failed Worktree acquisition recovery around every Git attempt - #531
Merged
Merged
Conversation
…g to fix on the branch) 2026-10-08T00:00:07Z, host thirdshift. Uncommitted work at the time of failure is included in this commit.
JacobStephens2
marked this pull request as draft
October 8, 2026 00:00
JacobStephens2
marked this pull request as ready for review
October 8, 2026 03:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Failed Worktree acquisition retains work and changed resources that appear during recovery retries.
Closes #530
Evidence
work_arriving_during_checkout_removal_retry_survivesfailed with the later ignored file missing;same_head_attachment_during_ref_removal_retry_survivesfailed with the attached branch absent.After: Both regressions pass. The 48 acquisition tests verify retained work, paths, registrations, refs/reflogs and original-cause diagnostics across all four acquisition kinds, including unchanged-authority retry controls.
cargo fmt --check,cargo clippy --all-targets -- -D warnings, andcargo testpass.Test seams
Worktree::create_fresh,Worktree::continue_existingwith absent and equal local Issue branches, andReviewWorktree::create, using real temporary repositories, bare origins, hooks and the existing isolated Git subprocess fault adapter.Merge Danger
Door: one-way
Blast Radius: Worktrees
Recovery removes clean owned checkouts and new refs after verifying authority; reverting the change cannot restore a mistaken deletion. Incomplete ownership capture retains partial effects for manual recovery.
Unaddressed findings
Unread changed files: None on either axis; both reviewers read all five changed files.
CI notes
interrupting_a_live_session_after_cli_exit_stops_the_command_holding_stdout, reproduced under parallel test load on bothissue-530and basemainat1cf8fa9; no code or check changes.Built with codex · gpt-6.1-sol · xhigh