Skip to content

Move Failed run preservation and retention into Worktree - #484

Merged
JacobStephens2 merged 2 commits into
mainfrom
issue-482
Oct 7, 2026
Merged

JacobStephens2 merged 2 commits into
mainfrom
issue-482

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

Worktree owns Failed run preservation and cleanup through one operation. Failed salvage retains the checkout and local Issue branch before Delivery reports the failure or handles the PR.

Delivery failure
  Worktree::preserve_failed_run(base, reason)
    arm retention
    abort merge → stage → compare with last-fetched Base branch
    when changed: failure marker commit → push
    allow cleanup only on success
  report original cause and account for the PR

Closes #482

Evidence

  • Before: a_staging_error_retains_uncommitted_work_and_the_local_branch_after_drop failed with worktree was removed when retention was left to the caller.
    After: All 13 real-Git Worktree preservation tests pass, including staging/merge-abort/commit/push failures, signal isolation, remote content and failure metadata. All 26 Delivery tests and the existing 12 Failed run binary tests pass.
  • cargo fmt --check and cargo clippy --all-targets -- -D warnings pass; full cargo test passes (1314 passed, 1 existing ignored test).
  • Review against main: Standards S1 addressed by removing the new internal call-order assertion; Spec found no gaps or scope creep.

Test seams: Worktree's preservation interface and observable local/remote Git state after drop; Delivery's Failed run outcome/reporting interface; existing binary Failed run and Claim coverage.

Merge Danger

Door: two-way

Blast Radius: preservation

Failed run salvage for Runs and Spec runs; no change to preservation policy or Git flags.

Unaddressed findings

Standards

None.

Spec

None.

Built with codex · gpt-6.1-sol · xhigh

@JacobStephens2
JacobStephens2 merged commit 39c846e into main Oct 7, 2026
13 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-482 branch October 7, 2026 04:12
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 7, 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 Worktree ownership of Failed run preservation

1 participant