Skip to content

overlap: a file main added that a stale lane also adds is not the reader's - #142

Merged
JulienMartel merged 1 commit into
mainfrom
worktree-overlap-inherited-adds
Sep 20, 2026
Merged

JulienMartel merged 1 commit into
mainfrom
worktree-overlap-inherited-adds

Conversation

@JulienMartel

Copy link
Copy Markdown
Contributor

What

scruff overlap no longer draws ⚠ "the whole file" on a file the reader inherited from main when a stale lane also adds that file. landed() now subtracts a whole-file add or delete from a side when that side's copy of the path is main's copy at the tip, byte for byte. A copy the side edited, or holds untracked, keeps the whole-file claim.

Why

Seen on hausfold.co against the lane scaffold-desktop-gallery: three loud rows on files the reader had never opened. landed() skipped every whole-file span on purpose, since a whole-file range would subsume a side's own edits to that file. But a reader cut from today's main carries every file main added since a stale lane's base, and when the lane adds them too (half-landed, or squash-merged and never reaped) both sides claim the whole file and the report calls it a collision. Identical content means inherited, not authored, so it comes out. Differing content means the side wrote something there, so it stays.

Verify

make check passes: 333 bats cases and the three Go packages, on macOS. Two new bats cases sit beside the squash-merge and add/add ones:

  • "overlap does not charge a reader with a file main added that a stale lane also adds" fails against the pre-fix binary (exit 4, ⚠ the whole file) and passes now (exit 0, none in your files), from a live checkout and with --committed-only.
  • "overlap still calls the reader's own edit to a file main added a collision" pins the loud side: the reader edits the inherited file, uncommitted and then committed, and both runs stay at exit 4 with "new.md the whole file".

"overlap still calls two lanes creating one new file a collision" is untouched and still passes.

Watch out

SPEC.md §7.3 subtraction 2 is reworded to match. No verb, flag, exit code or --json key moved, so ai/SKILL.md and the manual are unchanged. The safe direction is still to over-claim: anything git cannot compare stays on the side, and the merge-tree ✗ list is not touched, so a stale lane that conflicts with main on those files still shows there.

🤖 Generated with Claude Code

…der's

landed() left every whole-file span out of the subtraction, because a
whole-file add subsumes the side's own edits to that file. That over-claimed
the other way: a reader cut from today's main carries every file main added
since a stale lane's base, and when that lane adds them too (half-landed, or
squash-merged and never reaped) the report drew ⚠ "the whole file" on paths
the reader never opened.

Content decides now. A whole-file add or delete is subtracted only where the
side's copy of that path is main's copy at the tip byte for byte: the working
tree's copy for a live side, the tip's for a branch, and an untracked file
counts as the side's own. A copy the side went on to edit keeps the claim, so
the add/add two lanes both authored is as loud as before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@JulienMartel
JulienMartel merged commit 027c7a4 into main Sep 20, 2026
5 checks passed
@JulienMartel
JulienMartel deleted the worktree-overlap-inherited-adds branch September 20, 2026 09:16
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