Skip to content

Preserve retained Architecture review worktrees across retries - #506

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

JacobStephens2 merged 3 commits into
mainfrom
issue-505

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

Repeated Architect runs preserve review work retained by failed acquisition. Successfully acquired detached scratch remains recoverable after process death, including edits and detached commits.

review acquisition (one repository worktree lock)
  inspect stale checkout
    matching successful-acquisition evidence + pinned ownership → remove
    missing, replaced or uncertain evidence → retain with path, HEAD and reason
  add detached checkout and capture ownership
  prepare excluded checkout token + private administrative record
  publish record without replacement → acquisition succeeds

Closes #505

Evidence

  • Before: a_review_retry_preserves_work_retained_after_a_failed_hook failed: retry removed retained staged, untracked and ignored work, then returned success.
    After: That regression passes. Focused checks pass: 108 Worktree tests and 80 Architect lifecycle tests, including process death before publication, disposable detached commits, interruption, damaged evidence, substitutions and publication faults.
  • Git 2.55 initially pruned damaged registrations during fetch and optional launch fast-forward. The acquisition and command regressions failed before the fix and pass after it. Origin fetches and launch fast-forward now suppress implicit maintenance; the command regression also passes with Git 2.43.
  • Final validation: cargo fmt --check, cargo clippy --all-targets -- -D warnings, and RUST_TEST_THREADS=2 cargo test with Git 2.55 passed (1421 tests passed, 1 ignored).
  • CI passed: Linux and macOS tests, plus release builds and Rocky Linux/WSL smoke checks.
  • Two default-concurrency attempts hit existing interruption fixtures: the Spec-run start barrier and harness catalog signal check. Both passed in isolation; the complete suite passed with two workers, both before and after the Git maintenance fix. Linux CI also passes with the default test concurrency.

Reviewed against main (a2faf4f): one Standards finding and one Spec finding, both addressed. Both reviewers checked the Git maintenance fix and reported no additional findings.

Test seams

  • ReviewWorktree::create and scope-exit cleanup with real local Git: repeated acquisition, preserved work, disposable scratch, ownership substitution, publication failure and interruption. Existing Worktree interfaces verify fresh Run and Continuation behavior.
  • thirdshift architect --plan-only: process-death recovery and refusal before an agent session, including Base branch preparation with and without launch.pull.

Merge Danger

Door: two-way

Blast Radius: Worktrees

Unmarked legacy review paths and repository rules that negate token exclusion require Day shift resolution. The shared ownership inspector also rejects symlinked administrative Git backlinks. Durable eligibility applies only to detached Architecture reviews.

Unaddressed findings

Standards

None. The naming finding was addressed by renaming the destructive closure to inspect_and_remove.

Spec

None. The marker-exclusion finding was addressed by verifying effective Git exclusion before marker creation; the Spec reviewer confirmed the fix.

Built with codex · gpt-6.1-sol · xhigh

)

Git 2.55 prunes a missing-backlink worktree during automatic fetch and fast-forward maintenance. Inspect stale reviews before acquisition fetch; disable implicit maintenance in origin fetches and launch fast-forward preparation so uncertain registrations survive until ownership inspection. Cover both retry and Architect preflight, including launch.pull.
@JacobStephens2
JacobStephens2 merged commit f03ac2b into main Oct 7, 2026
13 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-505 branch October 7, 2026 11:16
@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 stale Architecture review recovery

1 participant