Skip to content

Bind Worktree synchronization to acquired checkout ownership - #523

Merged
JacobStephens2 merged 3 commits into
mainfrom
issue-522
Oct 7, 2026
Merged

JacobStephens2 merged 3 commits into
mainfrom
issue-522

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

Worktree synchronization
  verify captured repository → hold ownership lock
  check acquired checkout + Issue branch around every Git attempt
Confirmed Self-merge
  verify captured Launch repository → delete stored Issue branch there

Ordinary operations reject changed ownership, including observations, no-ops, refs-lock waits and Git retries. Legitimate commits on the acquired Issue branch remain valid. Confirmed Self-merge completion uses the captured repository even after checkout replacement or interruption.

Closes #522

Evidence

  • Before: a switched checkout's Base branch merge returned Clean and advanced unrelated work; deletion could remove a replacement origin's branch.
    After: Worktree regressions refuse the wrong merge, retain unrelated work, and delete only the captured repository's origin branch.
  • Before: review regressions failed with fetch ran after ownership changed and merge retry mutated unrelated branch.
    After: both pass with ownership checked after lock waits and around every command attempt.
  • Focused checks: 145 Worktree tests, 22 Merge run tests and 64 Spec run tests; ordinary ownership refusal also exercises captured PR and Claim finishing.
  • Validation passed: cargo check --all-targets, cargo fmt --check, cargo clippy --all-targets -- -D warnings, and cargo test. Linux and macOS CI passed.

Test seams

  • Existing Worktree interface with real temporary Git repositories and local bare origin: synchronization ownership, operation locking/interruption, and captured-repository branch deletion.
  • Run command interface through the existing Merge run, Spec run and Failed run fixtures: completion, conflict Repair and failure finishing.

Merge Danger

Door: two-way

No migrations or irreversible data changes; the ownership implementation can be reverted.

Blast Radius: synchronization

Affects Delivery, Spec catch-up, Repair synchronization and confirmed Self-merge branch deletion. Changed or uncertain ownership now fails conservatively and follows existing preservation and cleanup behavior.

Unaddressed findings

Standards

None. The duplicate origin-sampling finding was addressed; re-review found no new findings.

Spec

None. The helper-internal execution finding was addressed for refs-lock waits and retries; re-review confirmed all gates remain intact.

Built with codex · gpt-6.1-sol · xhigh

@JacobStephens2
JacobStephens2 marked this pull request as ready for review October 7, 2026 17:41
@JacobStephens2
JacobStephens2 merged commit 535c307 into main Oct 7, 2026
13 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-522 branch October 7, 2026 17:42
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 8, 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.

Deepen ordinary Worktree synchronization with acquired checkout ownership

1 participant