Skip to content

backlog: file #1294, and record that #1293's recreate-at-path remedy was tested and works - #450

Merged
wshallwshall merged 3 commits into
mainfrom
lander/worktree-cleanup-coverage
Aug 19, 2026
Merged

backlog: file #1294, and record that #1293's recreate-at-path remedy was tested and works#450
wshallwshall merged 3 commits into
mainfrom
lander/worktree-cleanup-coverage

Conversation

@wshallwshall

Copy link
Copy Markdown
Collaborator

Docs-only: docs/BACKLOG.md.

#1294 -- no cleanup path for the worktrees the prune tool must never touch

Filed explicitly as NOT a coverage bug, because the obvious reading of the measurement is wrong
and would license a dangerous change.

total registered worktrees        36
reachable by prune-merged.ps1     11   (<repo>-<name> siblings)
.claude/worktrees/*               12   excluded BY DESIGN
other (C:/mfw*, Temp, detached)   13   excluded

30 percent reachable. But the exclusions are deliberate and were paid for: that directory is where
EnterWorktree relocates a live session, the tool once removed an occupied worktree and left a
directory git no longer recognised, and its header records the resulting bias as fixed and not
negotiable -- a false SKIP is a minor annoyance, a false PRUNE destroys a session.

The defect is the missing middle. Today a worktree is either removed by the tool or invisible;
nothing produces the list. On 2026-08-19 the owner removed 12 of the excluded ones by hand off a
list assembled manually, which is exactly the work the item proposes to automate -- as a report,
not as a removal.
A wider fence was rejected on the fence's own receipt: it cannot see a session
writing by absolute path from elsewhere, 29 percent of writes by primary-seated sessions on this
repo.

The item also states that worktree_gate.ps1's refusal should not be relaxed to close it.

#1293 amendment -- route 1 tested on the live instance

#1293 listed three candidate remedies without picking one. Route 1 was then tested, owner-directed,
against its own live victim: recreate the worktree at the path recorded in the alloc claim, resolve
there, commit there.

The ledger gate reported Passed on a commit that could not have been made from anywhere else,
and PR #397 -- unresolvable by any session ten minutes earlier -- went DIRTY to MERGEABLE.

Bounded in the item: it confirms the mechanism and settles nothing about whether it should be the
documented remedy, since it stays adjacent to the rename-workaround CLAUDE.md section 5 forbids. The
distinction preserved is that it restores the condition the gate tests rather than bypassing the
test
.

Two details recorded for anyone repeating it: worktree add -B resets the local branch (here from
91a24061, verified an old main commit reachable from many refs before the reset was accepted),
and the ledger conflict was resolved against a computed target -- base 292/212, branch
293/213, main 310/230, so only 311/231 is correct, which is what parse_items returned. That
is what made "keep both sides" a verified claim rather than a hopeful one.

Ledger control

parse_items: 310/230 to 311/231 for the filing (+1/+1/0), and 311/231 unchanged for the
amendment (0/0/0). Number allocated with alloc.ps1.

…ol must not touch

Measured on this clone: 36 registered worktrees, 11 reachable by
prune-merged.ps1, 12 under .claude/worktrees and 13 others excluded. 30 percent
reachable. The owner removed 12 of the excluded ones by hand the same day, from
a list assembled manually, because nothing produces that list.

Filed explicitly as NOT a coverage bug. The exclusions are deliberate: that
directory is where EnterWorktree relocates live sessions, the tool once removed
an occupied worktree and left a directory git no longer recognised, and its
header records the resulting bias as fixed and not negotiable.

The defect is the missing middle. Today a worktree is either removed by the tool
or invisible; nothing says "these look finished, here are the commands, you
decide".

Proposes a REPORT-ONLY extension rather than a wider fence, because the
occupancy fence's own receipt records a 29 percent blind spot in one of its two
signals. Automating deletion of the directory live sessions occupy, behind that
fence, would trade the property the incident bought.

Also records that worktree_gate.ps1's refusal should NOT be relaxed to close
this -- the reporter makes the refusal cheap to live with, which is the correct
order.

parse_items 310/230 -> 311/231, the expected +1/+1/0.
…and works

Owner-directed. Recreated the worktree at the exact path recorded in #1264's
alloc claim, resolved PR #397's conflict there, and committed from it. The
ledger gate reported Passed on a commit that could not have been made from
anywhere else, and #397 went DIRTY to MERGEABLE.

Bounded deliberately: this confirms the mechanism (owns() compares a path
string, so restoring the path restores the referent) and settles nothing about
whether it should be the documented remedy -- it stays adjacent to the
rename-workaround CLAUDE.md section 5 forbids. The distinction kept in the item
is that it restores the condition the gate tests rather than bypassing the test.

Also records two things a repeat must not skip: worktree add -B resets the local
branch (here from 91a2406, verified to be an old main commit reachable from
many refs before the reset was accepted), and the ledger conflict was resolved
against a computed target -- 292/212 base, 293/213 branch, 310/230 main, so only
311/231 is correct, which is what parse_items returned.
@wshallwshall
wshallwshall enabled auto-merge (squash) August 19, 2026 14:30
@wshallwshall
wshallwshall merged commit 427c5de into main Aug 19, 2026
38 of 39 checks passed
@wshallwshall
wshallwshall deleted the lander/worktree-cleanup-coverage branch August 19, 2026 14:53
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.

1 participant