Skip to content

docs(tend): hold PRs that can make wt delete more, not ones that edit deletion code - #4148

Merged
max-sixty merged 1 commit into
mainfrom
review-hold-scope
Sep 16, 2026
Merged

max-sixty merged 1 commit into
mainfrom
review-hold-scope

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

The data-loss hold in the tend review reference fired on proximity: a diff that edited a file containing a deletion command, or code near the force-delete path, was held for human review. That held #4146, which made the branch-deletion check stricter and which the reviewer itself called safer than what it replaced.

The hold now fires on what a diff can do: make worktrunk destroy something it used to keep, by adding a deletion, widening what an existing one can delete, or loosening a check that gates one (the dirty-worktree check, the integration check behind wt remove's branch deletion). The command list stays as examples of where deletions live, a held review names how the diff could make a deletion destroy more, and the regenerable / throwaway-environment bound is unchanged.

Eval: old vs new wording, whole reference pasted in
Case Expected Old New
Stricter has_added_changes_by_sha (the #4146 change) approve 0/3 3/3
Patch-id fix that stops a false squash-merge match approve 0/3 3/3
Reworded wt remove -D warning in a file calling remove_dir_all approve 0/3 3/3
Trash-sweep threshold one day → seven days approve — 3/3
Dirty check swapped to a command that misses untracked files hold 3/3 3/3
Squash-merge match loosened to "same file paths" hold 3/3 3/3
git worktree remove --force --force for locked worktrees hold 3/3 3/3
rename_into_trash moved above ensure_clean hold — 7/7
wt step prune path taken from the rendered worktree-path template hold — 7/7

The last two include four runs each of a variant that leaves the consequence out of the case. A third arm without a "code on the deletion path gets an ordinary review" sentence scored the same, so that sentence was cut. worktrunk-bot's suggested fourth trigger ("changes what an existing deletion targets or when it fires relative to its gate") held the reorder and retarget cases 3/3 too, and held the narrowing patch-id fix in 1 of 3 runs.

This was written by Claude Code on behalf of max-sixty

🤖 Generated with Claude Code

… deletion code

The data-loss hold in the tend review reference fired on proximity: a diff
that edited a file containing a deletion command, or code near the
force-delete path, was held for human review. It held a PR that made the
branch-deletion check strictly stricter, one the reviewer itself described
as safer than what it replaced.

The hold now fires on what the diff can do: add a deletion, widen what an
existing one can delete, or loosen a check that gates one (the dirty-worktree
check, the integration check behind `wt remove`'s branch deletion). The
command list stays as a list of where deletions live, and the regenerable /
throwaway-environment bound is unchanged.

Scored against six cases, three runs each, with the whole reference pasted
in: the old text held all three guardrails (a stricter integration check, a
data-loss fix that narrows the squash-merge match, a warning reword in a file
that calls `remove_dir_all`); the new text approved them and still held a
dirty check that stops seeing untracked files, a looser squash-merge match,
and `git worktree remove --force --force`. 18/18.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The three triggers cover a deletion's extent, but not a diff that changes an existing deletion's target or when it fires relative to its gate. stage_worktree_removal is the case its own docstring names: "the order below is easy to get subtly wrong, and getting it wrong destroys uncommitted work". A diff that moves rename_into_trash above worktree.ensure_clean("remove worktree", ...), or reorders the fsmonitor stop past it, adds no deletion, widens nothing, and leaves the gate's own text untouched — and deletes the uncommitted work the gate exists to refuse. Retargeting is the same shape: changing generate_removing_path so two concurrent removals stage into one path, or changing what PROMOTE_STAGING_DIR resolves to, makes remove_dir_all destroy something else rather than something more.

This is the case the removed sentence named — #3457 added it as "a change near the force-delete path holds even when the destructive line isn't in the diff" — and none of the eval's six cases has that shape, so the eval doesn't show it survives. The umbrella clause does cover it in principle, but the colon plus three or-joined items reads as the definition of that clause, so a reviewer holding a reordering diff against the list finds nothing that matches and approves.

The suggestions below add a fourth trigger and reword step 1 to fit it — a reordering doesn't make a deletion "destroy more".

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concern withdrawn on the eval data (replied inline). The reworded triggers hold the reorder and retarget cases and stop holding the stricter-check diffs that motivated the change; docs-only, checks green.

@max-sixty
max-sixty merged commit a4a389a into main Sep 16, 2026
42 checks passed
@max-sixty
max-sixty deleted the review-hold-scope branch September 16, 2026 21:31
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.

2 participants