Skip to content

fix(build): a directory gone from the worktree goes from the lane's copy (#628) - #633

Merged
7schmiede merged 1 commit into
mainfrom
fix/lane-copy-empty-dirs
Nov 26, 2026
Merged

7schmiede merged 1 commit into
mainfrom
fix/lane-copy-empty-dirs

Conversation

@7schmiede

Copy link
Copy Markdown
Member

What and why

Closes #628.

A lane's copy received the files of a directory renamed in the worktree
(git mv org/agents/a org/agents/b) and lost the old files, but kept the
old directory, empty. A service that reads one folder per definition
reported the phantom folder on every reload.

Snapshot::sync removed the files that left the snapshot and never the
directories this emptied. Now, after removing a file, it removes each
parent directory that is empty and that the source no longer has, up to the
copy's root. A directory that holds anything else (a build's output, a
prepared node_modules) stays, since remove_dir only removes an empty
one. The node's mirror already did this (safefs); a lane on a node runs
from a Snapshot of it and is covered by the same change.

Empty directories a copy kept before this release stay until it is made
anew (a sweep at start could take directories that are empty on purpose,
such as ensure_dirs). No card: no trust, concept, contract or term
changes.

Verified

  • Unit test a_directory_gone_from_the_source_goes_from_the_copy: red
    first at "the renamed directory stayed in the copy", green with the fix;
    a build's output in the copy stays.
  • Reproduced in a local lane (devstack up --on local): with 0.53.0 the
    renamed directory stayed empty in the copy; with this build it goes.
  • cargo fmt, cargo clippy --workspace --all-targets -D warnings,
    cargo test --workspace (916 passed).

Bug-Class: stale-copy

🤖 Generated with Claude Code

…opy (#628)

The snapshot's sync removed the files of a directory renamed or removed in
the worktree, but kept the directory, empty: a service that reads one
folder per entry saw a phantom one. Now a directory the removal leaves
empty, and the source no longer has, goes too; one that holds anything
else (a build's output) stays. Covers a lane here, a lane on a node and
the snapshot builds run in.

Bug-Class: stale-copy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit 0b27fb5 into main Nov 26, 2026
14 checks passed
@7schmiede
7schmiede deleted the fix/lane-copy-empty-dirs branch November 26, 2026 15:03
@7schmiede 7schmiede mentioned this pull request Nov 26, 2026
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.

Lane copy keeps directories that were moved or deleted in the worktree

1 participant