Skip to content

Resume merged branch cleanup before removing the worktree - #1724

Closed
eowca wants to merge 3 commits into
mainfrom
lean178/1116-resume-merged-cleanup
Closed

eowca wants to merge 3 commits into
mainfrom
lean178/1116-resume-merged-cleanup

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Resume merged branch cleanup before removing the worktree

Context and goal

  • Goal: An interrupted cleanup can finish on a subsequent merge invocation.
  • Problem: Removing the task worktree before deleting the local branch loses the checkout needed for retry.
  • Context: The earlier Finish merged branch cleanup before removing its worktree #1192 ruling uses a retained detached worktree and live merged-PR evidence as recovery proof. The documented residue branches were already removed.

Closes #1116

Acceptance

  • Check the exact merged PR head and local branch before detaching the clean linked worktree. Delete the branch at the expected head before removing that worktree.
  • A detached retry must find an exact merged PR for the previous branch and HEAD. Its worktree remains intact following branch deletion errors, and retry also works when the branch is already gone.
  • Preserve existing protections for moved refs, another worktree's checkout, ignored user files, and normal dirty-worktree behavior.

Notes

  • The focused cleanup suites passed, including interruption before ref deletion, interruption before worktree removal, a moved ref, and missing merged-PR proof. The size budget passed with three fewer test lines.
    Preserve the verified reference transaction and existing managed-worktree checks. The previous checkout name is a lookup hint. Only matching live merged-PR and ref evidence allows deletion.

Base

main @ 4e1c0a4

Validation

(no loopzero check run recorded)


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Review

  • primary, codex, 36995ce, request_changes

Co-Authored-By: Codex <noreply@openai.com>

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

loopzero primary review by codex on 36995ce9a4ebfed6f903486c741a1dc5e6ab0d32, 100.9s: request_changes (1 critical, 3 important, 0 suggestion)

Same-family fallback: independent reviewers failed: claude: not authenticated. Cross-family review is preferred.

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model gpt-6.2-astra (effort medium); CLI-reported model gpt-6.2-astra (effort medium); configured model gpt-6.2-astra (effort medium)
Raw reviewer output
Native Codex transcript retained in the restricted local review receipt; public evidence is publisher-derived, not backend attestation. Exact raw SHA256: 089b2d5f27fffa7715cd2974b5460e13648d83c43220a0439d195f2fe173b01b

Comment thread src/loopzero/worktree.py Resolved
Comment thread src/loopzero/cli.py Resolved
Comment thread src/loopzero/github.py Resolved
Comment thread src/loopzero/worktree.py Resolved
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Parked after review. The detached HEAD can advance between verification and removal. The current Git ref transaction cannot conditionally detach the verified symbolic HEAD, so this PR needs a cleanup design that protects both the checkout and its branch before it can land.

eowca and others added 2 commits November 26, 2026 10:22
Architecture-Review: unchanged; detached recovery still requires exact merged PR proof and now guards the local HEAD until removal.
Co-Authored-By: Codex <noreply@openai.com>
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #1760. This branch retains the cleanup fixes and the main merge, but the native delta reviewer refuses to include that base merge. The replacement uses the same head for a fresh review.

@eowca eowca closed this Nov 26, 2026
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.

Resume local branch cleanup after merge removes the worktree

1 participant