Skip to content

skills(running-tend): scope data-loss review hold to the diff, not the file#3457

Open
worktrunk-bot wants to merge 2 commits into
mainfrom
skills/data-loss-hold-scope-29292645605
Open

skills(running-tend): scope data-loss review hold to the diff, not the file#3457
worktrunk-bot wants to merge 2 commits into
mainfrom
skills/data-loss-hold-scope-29292645605

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Refines the data-loss-surface review hold so it keys on what the diff touches, not on unrelated contents of the same file.

In #3453 I held a creation-only change to plugins/worktrunk/hooks/hooks.json purely because that file also ships the WorktreeRemove hook (wt remove), even though the diff never touched the removal path. @max-sixty flagged that as overly conservative:

just as a process point, this is overly conservative, @worktrunk-bot you should be deciding based on whether the code actually touches code that is in data-destruction paths, not whether there are unrelated changes in the file; please fix the guidance here

The old "edits a file that already contains one" trigger fired on mere co-location. This adds a "Scope the hold to the diff, not the file" subsection that splits the two cases the trigger was conflating:

  • Source code (src/git/remove.rs) — still hold on proximity, because an edit near the force-delete path can change its behavior at a distance without the destructive line appearing in the diff. That rationale (the original "Both directions matter" note) is preserved.
  • Structured config with independent entries (hooks.json's separate hook objects, alias tables) — hold only when the diff touches the destructive entry itself. Editing the WorktreeCreate command can't change what the separate WorktreeRemove hook does, so an edit confined to a non-destructive entry no longer warrants a hold.

The distinction is whether an edit can reach a destruction path structurally, which is exactly the "does the code actually touch a data-destruction path" test.

Separate PR from the code change it came out of, per the skill-overlay convention. Triggered from #3453 (comment).

@max-sixty

Copy link
Copy Markdown
Owner

cut verbosity of change by 70%, rewrite existing docs rather than patching

@worktrunk-bot worktrunk-bot force-pushed the skills/data-loss-hold-scope-29292645605 branch from f26cba3 to 7e7bdb2 Compare July 14, 2026 07:11
@worktrunk-bot

Copy link
Copy Markdown
Collaborator Author

Done — force-pushed a rewrite. Instead of adding a new subsection, I rewrote the existing "Both directions matter" paragraph in place; the change is now +9/−4 (net +5 lines) versus the previous +20. Both the source-proximity and structured-config cases are kept, just folded into one paragraph.

@max-sixty

Copy link
Copy Markdown
Owner

still too verbose; this is not a super complex thing, it doesn't need examples. Thank you

@worktrunk-bot

Copy link
Copy Markdown
Collaborator Author

Trimmed to four lines, no examples — just the source-proximity vs. structured-entry rule.

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