Skip to content

Guard failed Worktree acquisition recovery around every Git attempt - #531

Merged
JacobStephens2 merged 4 commits into
mainfrom
issue-530
Oct 8, 2026
Merged

JacobStephens2 merged 4 commits into
mainfrom
issue-530

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

Failed Worktree acquisition retains work and changed resources that appear during recovery retries.

failed acquisition
  pin repository and eligible checkout instances
  remove identified attempt-owned review markers
  checkout removal: same instances + clean sampled head → verified absence
  ref deletion: new, unused expected head + verified checkout outcome → ref absence
  recheck authority around every Git attempt; retain uncertain partial effects

Closes #530

Evidence

  • Before: work_arriving_during_checkout_removal_retry_survives failed with the later ignored file missing; same_head_attachment_during_ref_removal_retry_survives failed 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.
  • All behavioral review reproducers were run as supplied before disposition. Confirmed failures were fixed and their tests retained.
  • Validation: cargo fmt --check, cargo clippy --all-targets -- -D warnings, and cargo test pass.

Test seams

  • Worktree::create_fresh, Worktree::continue_existing with absent and equal local Issue branches, and ReviewWorktree::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

  • Standards: None; all three findings addressed.
  • Spec: None; all three findings addressed.

Unread changed files: None on either axis; both reviewers read all five changed files.

CI notes

  • test-macos: Pre-existing two-second interruption timing flake in interrupting_a_live_session_after_cli_exit_stops_the_command_holding_stdout, reproduced under parallel test load on both issue-530 and base main at 1cf8fa9; no code or check changes.

Built with codex · gpt-6.1-sol · xhigh

@JacobStephens2
JacobStephens2 marked this pull request as draft October 8, 2026 00:00
@JacobStephens2
JacobStephens2 marked this pull request as ready for review October 8, 2026 03:07
@JacobStephens2
JacobStephens2 merged commit b56a858 into main Oct 8, 2026
13 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-530 branch October 8, 2026 10:40
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.

Deepen failed Worktree acquisition recovery with verified retry authority

1 participant