Skip to content

W06.A.5 — mv-across-dirs LD_PRELOAD + planner Rename/Create suppression#49

Merged
espadonne merged 2 commits into
trunkfrom
worktree-w06a5-mv-shim
May 24, 2026
Merged

W06.A.5 — mv-across-dirs LD_PRELOAD + planner Rename/Create suppression#49
espadonne merged 2 commits into
trunkfrom
worktree-w06a5-mv-shim

Conversation

@espadonne
Copy link
Copy Markdown
Contributor

Summary

  • LD_PRELOAD the shim when invoking mv in mv-across-dirs-undo-fbsd.sh. With W06.A.3 (PR W06.A.3: wire LD_PRELOAD shim notifications into journal events #47) wiring landed, the shim's rename(2) interposer now fires for cross-watch moves and the daemon journals them as TreeOp::Rename.
  • Smoke gating tightened: all three cases (intra-watch, unwatched dst, unwatched src) must PASS — no more "documenting gaps" tail.
  • Planner fix: when the shim emits a TreeOp::Rename(to=P) AND the kqueue dir-diff also observes a TreeOp::Create(P) for the same mv (two views of one logical action), suppress the Create's Unlink inverse. The Rename's inverse (Rename(to → from)) is authoritative; the duplicate Unlink was deleting the just-restored file.

Results

On shit-fbsd (FreeBSD 14.4):

Case Before W06.A.5 After
case1 — intra-watch mv FAIL (file not restored) PASS (full undo)
case2 — mv to unwatched dst PARTIAL (dst leftover) PASS (full undo)
case3 — mv from unwatched src DATA LOSS PASS (full undo)

Full 11-smoke regression sweep green: rm, mkdir, chmod, touch-edit, pkg-install, service-restart, vim-edit, git-commit, cp-recursive, sed-inline, make-install.

Closes the W08 cross-watch-rename gap that motivated unifying W06 + W08.

Test plan

  • cargo test -p shit-planner --lib — 431 + 1 new test (rename_plus_duplicate_create_suppresses_unlink_inverse)
  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo build --workspace --release
  • mv-across-dirs-undo-fbsd.sh on shit-fbsd — case1/2/3 all PASS (full undo)
  • Full BSD smoke regression — 11/11 green
  • freebsd-smoke CI green on PR (watching)

@espadonne espadonne merged commit 7164b89 into trunk May 24, 2026
24 checks passed
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