Repository navigation
Call every adapter before cdd-worktree-done removes the worktree - #125
Merged
Merged
Conversation
cdd-worktree-done resolved the code-host and tracker adapters from the feature worktree's own .cdd/ (the project rung), removed that worktree, and only then asked pr-merged and closed the issues through the deleted path (exit 127): squash-merged branches fell to the prompt and issues were never closed. Reorder: after the pull, decide the branch's fate (ancestry, pr-merged, the prompt) and close the issues, then remove the worktree, delete the branch and reap. The branch's own binding, validated up front, stays authoritative. An abort at the prompt now leaves the worktree in place. worktree-done-assert gains project-rung cases (adapters bound through relative .cdd/ symlinks into the worktree), which fail on the old order. No template edit: the template ships no copy of the helper. Closes #124 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DMH8wdKGv4rHqyWzQHjmSD
Issues now close before the worktree is removed, so a removal that fails afterwards left them closed under a "Nothing was deleted" line. A locked worktree, the foreseeable failure, is now refused up front, before the cd and any adapter call. For the rest (a declined sudo, a path git says is not a working tree) the message says the close already ran and a re-run is safe. worktree-done-assert gains both cases at the project rung; each fails on the previous helper. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DMH8wdKGv4rHqyWzQHjmSD
drabaioli
commented
Oct 4, 2026
drabaioli
left a comment
Owner
Author
There was a problem hiding this comment.
This PR add 209 lines for a fix. trim/compress/simplify as possible while keeping the fix correctness
Review on #125: 209 lines for a fix. Keep the reorder (every adapter call before the worktree is removed) and drop what it does not need: - the locked-worktree pre-check: closing issues for a confirmed merged PR is right even if the removal then fails, and a re-run is idempotent; a lock fails at removal with git's message, as before - the closed_note messaging: the "issue #N: closed" lines already print just above any removal failure - three of the four project-rung test cases (ancestry is covered by the machine-rung cases; lock and closed_note are gone) and their helpers - comment and doc verbosity Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DMH8wdKGv4rHqyWzQHjmSD
Owner
Author
|
Re the review summary (trim/simplify): addressed in 4f78a6a — the PR now adds 101 lines (from 209), most of them the removal block moving below the adapter calls. Dropped the locked-worktree pre-check and the "close already ran" messaging (a merged PR's issues are right to close even if removal then fails, and a re-run is idempotent), kept one project-rung test case, and compressed comments and docs. |
drabaioli
added a commit
that referenced
this pull request
Oct 6, 2026
…date (#126) * Keep the installed CDD helpers current: sync on pull, self-reload, update The install is a copy, so a merged helper fix changed nothing on the machine until someone re-ran install (the #124/#125 incident), open shells kept the old functions, and a curl install had no way to update. - Sync on pull: install, run from a CDD git checkout, writes a managed post-merge + post-rewrite hook into it. A pull that lands on the default branch with different helpers or adapters (cmp, never a version stamp) reinstalls both and prints one line. Other branches, amends and unchanged pulls do nothing. A foreign hook is never overwritten; under core.hooksPath nothing is written (both noted). - Self-reload: each public cdd-worktree* / cdd-state call re-sources its file when it changed on disk and re-dispatches, silently. - `bash ~/.cdd/tools/cdd-worktree.sh update`: on demand, a sparse blobless clone of upstream main's tools/; installs when it differs. cdd-state's unknown-verb / invalid-stage errors and the plan_written skew warning name it. The dispatch now exits explicitly, since update overwrites the script bash is running. New toolchain-sync gate (27 gates). install-smoke and adapter-bindings install from a non-git copy of tools/, so a check run never hooks the developer's checkout. Process doc §2.8, shell-helpers.md, ADR 0014, template BOOTSTRAP.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JyhD5C5M5Vsi6k7jzdzEwS * Reconcile README: how the installed helpers stay current Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JyhD5C5M5Vsi6k7jzdzEwS * Compress shell-helpers.md "Staying current" (PR #126 review) Trim the section to its invariants; mechanics stay in the code comments and the rationale in ADR 0014. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JyhD5C5M5Vsi6k7jzdzEwS --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cdd-worktree-doneresolved the code-host and tracker adapters from the feature worktree's own.cdd/, removed that worktree, then called them through the deleted path (exit 127): squash-merged branches fell to the keep/delete/abort prompt and issues were never closed.donedecides the branch's fate and closes the issues, then removes the worktree, deletes the branch and reaps. The branch's own binding (validated up front) stays authoritative; main's is never consulted. An abort at the prompt now leaves the worktree in place.sudo, "not a working tree") say the close already ran and a re-run is safe, instead of "Nothing was deleted".gcandresumeconfirmed unaffected (run from main, remove no worktree).Tests
scripts/worktree-done-assert.shgains project-rung cases (adapters bound via relative.cdd/symlinks into the feature worktree): squash-merged, ancestry-merged with refs, locked, and removal-fails-after-close. Each fails on the previous helper../scripts/ci.sh: 26/26 pass.Docs
doc/architecture/shell-helpers.md(teardown order, lock refusal, tracker close timing); one sentence in process doc §2.8. No template edit: the template ships no copy of the helper. No roadmap edit (off-roadmap regression fix).Closes #124
🤖 Generated with Claude Code
https://claude.ai/code/session_01DMH8wdKGv4rHqyWzQHjmSD