Repository navigation
Guard Worktree disposal through every Git attempt - #529
Merged
Merged
Conversation
Merged
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
Run cleanup, live Architecture review cleanup and eligible stale review disposal now share one private operation that owns authority across checkout, local Issue branch and configuration removal.
Live cleanup finishes after Command interruption; stale recovery remains interruptible and rechecks durable evidence. Healthy cleanup preserves other local and included configuration.
Closes #528
Evidence
cargo test --bin thirdshift checkout_replacement_during_removal_retry_is_retained_for_every_lifetime -- --nocaptureexited 101: replacement work was deleted on retry.After: passes for Run, live review and stale review disposal; the replacement checkout and its registration survive.
cargo test --bin thirdshift same_head_attachment_during_ref_removal_retry_retains_branch_and_configuration -- --nocaptureexited 101: a branch newly attached elsewhere at the same head was deleted.After: passes; the branch, manual checkout and configuration survive.
After: both pass, alongside controls for unchanged-authority retries, partial failures, repository changes, reappearing paths and success without the expected transition.
cargo test --bin thirdshift worktree::cleanup_tests::disposal_tests::stale_disposal_failure_identifies_detached_state -- --exact --nocapture, failed before the diagnostic fix and passed afterward; the test is retained.cargo fmt --check,cargo clippy --all-targets -- -D warnings, and the fullcargo testsuite all passed.Test seams
Pre-agreed in #528 decisions 12–13: Worktree scope exit (Run and live Architecture review cleanup) and ReviewWorktree acquisition (eligible stale review disposal), with real temporary repositories and the existing isolated Git fault adapter.
Review coverage
Reviewed against
main(fee9a58) usingthirdshift-code-review, including a follow-up on the fixes. Standards S1 (duplicated fault classifier) and Spec P1 (missing detached state in stale retention diagnostics) are addressed. Both axes read every changed file; unread changed files: none.Unaddressed findings
Merge Danger
Door: two-way
Internal disposal changes; no data migration or evidence-format change.
Blast Radius: Worktree
Cleanup may retain resources and report a warning when refreshed authority cannot be established. Advisory locks cannot exclude arbitrary external writes between the final check and Git's mutation (#528 decision 4).
CI notes
test-macos: existing timing-sensitive failure ininterrupting_a_live_session_after_cli_exit_stops_the_command_holding_stdout(2 s deadline includes Failed run preservation and cleanup); reproduced 3/3 on unchangedmain(54c31ee) with 10 ms per Git invocation while the stdout holder was already stopped; unmodified branch stress passed 4/5 before the same deadline failure.Built with codex · gpt-6.1-sol · xhigh