Repository navigation
fix(core): release an already detached missing worktree registration - #3426
Conversation
Operator release of a held follow-up handoff asks the settled-worktree release to free the branch. When the worktree directory is gone, only its Git registration is consulted; a registration whose HEAD is already a detached commit (failure cleanup or an earlier release did that) was reported as "not settled", and the release was refused with worktree_holds_unpublished_work although the branch was free and nothing was unpublished. #3423 sat behind such a hold for a day. The branch is free in that case, which is all a release needs: report it as released. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThis focused change fixes the stranded operator release by treating an already detached missing-worktree registration as successfully released. Ready to merge within scope, conditional on the remaining checks passing. ✅ Preserves retained work — The new success path leaves the registration, HEAD, index, and branch untouched; path matching and symbolic-HEAD refusal remain intact. ✅ Tests repeat release — The regression assertion exercises two consecutive releases, followed by checks that the registration survives and the branch can be checked out again. ✅ Retains release verification — The operator still independently checks branch registrations before marking the handoff released. Review was based on the supplied diff and context; no commands or tests were run. Current checks show no failures and five pending. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to No suggestions. ScoreThe implementation directly addresses the reported failure with a minimal change and targeted regression coverage. The supplied caller protections remain intact; final CI completion is pending. Score: 9/10 🤖 Review Details
🤖 Review by ProPR |
|
CI failed: Full Test Suite Shard 2/4 Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit b253a0f Summary of ChangesThe shard 2/4 failure was one test still checking the old behaviour, not a bug in the fix. Cause: Change: I updated that test to the new behaviour. An already-detached missing registration now releases ( Verification: I ran these suites locally with
I didn't run the rest of shard 2/4 locally; the CI log showed this as the only failing test. No preview, since nothing here is visible to a user. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…ehaviour, not a bug in the fix.
The shard 2/4 failure was one test still checking the old behaviour, not a bug in the fix.
**Cause:** `test/followupHandoffWorktreeRestore.integration.test.ts`, case 4 ("releasing a deleted worktree reports nothing to release instead of throwing"), deletes a worktree after detaching its HEAD. It then expected `releaseSettledWorktree` to return `false`. That `false` is exactly what this PR changes: when the operator release gets `false`, it answers `worktree_holds_unpublished_work`, which is what stranded #3423. With the fix the call returns `true`, so the old assertion failed (`true !== false`).
**Change:** I updated that test to the new behaviour. An already-detached missing registration now releases (`true`), the branch still shows no registrations, and after `git worktree prune` the call still returns `false`, because a path Git has no registration for is still left alone. I also renamed the test to say what it now checks. The production code is unchanged.
**Verification:** I ran these suites locally with `scripts/run-test-suite.mjs`, after rebuilding `packages/core`, and all pass:
- `followupHandoffWorktreeRestore.integration` (the one that failed in CI)
- `settledWorktreeRelease`, `worktreeLifecycle.integration`, `followupHandoffOperatorSerialization`, `followupHandoffRestartQualification`
- four other suites that detach a worktree and call the release: `followupHandoffReviewBlockers`, `followupHandoffRecovery`, `followupHandoffFindings`, `followupHandoffCancelledClaims`
I didn't run the rest of shard 2/4 locally; the CI log showed this as the only failing test.
No preview, since nothing here is visible to a user.
PR: #3426
Comment by: @propr-dev[bot] (ID: 6729056080)
Model: Claude Opus 5.5
Why
Releasing the operator-held follow-up handoff on #3423 (
POST /api/admin/followup-handoffs/integry/propr/3423/release) answered{"released":false,"reason":"worktree_holds_unpublished_work"}. The held worktree directory had been deleted by the host sweep, the clone's locallabels-fixhad zero commits ahead oforigin/labels-fix, and the worktree's Git registration already had a detached HEAD at the PR head. Nothing was unpublished.releaseBranchFromSettledWorktreehandles a missing directory throughdetachMissingWorktreeRegistration, which returnedfalsewhen the registration's HEAD was notref: refs/heads/<branch>. A HEAD that is already a bare commit means the branch is free, which is all the release needs; treating it as a refusal stranded the hold, and with it every later/fixon the PR (predecessor_awaiting_operator).What
detachMissingWorktreeRegistrationreturnstruefor a registration whose HEAD is already a detached commit. Everything else is unchanged: a registration still on another branch is left alone, an unknown path is left alone.test/settledWorktreeRelease.test.ts: releasing the same missing registration twice succeeds both times.worktreeLifecycle.integration,followupHandoffOperatorSerializationandfollowupHandoffRestartQualificationstill pass.🤖 Generated with Claude Code