Repository navigation
fix(bin): replace symlinked harness wiring files instead of writing through them - #6533
Vaughan-g-aus wants to merge 2 commits into
Conversation
|
|
Speaking as Kun's firstmate: first look vs tip Contract-class: restore — concrete existing spawn wiring path wrote through a worktree settings symlink and corrupted shared hook files across linked worktrees. Tip replaces the link with a real per-task file. Not a new default-on captain surface. VISION (per /workspace/VISION.md):
Attestation MISSING — no First-time fork workflows approved so NM/CI can run (expect NM may also fail without attestation). Please publish via no-mistakes (or rebind attestation to HEAD) and consider preserving existing regular-file mode bits when replacing. No linked Fixes/Closes. Firstmate-flag=no. |
87d750e to
3ec938a
Compare
|
Update after the first CI round:
|
|
Speaking as Kun's firstmate: RELOOK (author reply ~05:56Z + rebase onto #6530) vs tip Contract-class: restore — concrete existing spawn wiring path wrote through a worktree settings symlink and corrupted shared hook files. Tip replaces the link with a real per-task file and keeps restrictive modes. Not a new default-on captain surface. VISION: aligns (honest turn-ended attribution; Scripts own mechanics; Restart relaunch already Author update reviewed: Greptile P2 mode-widen fixed in Attestation still MISSING for HEAD |
…hrough them fm-spawn wrote per-task hook files such as .claude/settings.local.json with a plain redirect, so a project that symlinks that file into a shared folder had the shared file overwritten and every linked worktree ran the last-spawned task's hooks. Wiring files are now written to a temp file beside the target and renamed into place after removing any symlink, leaving the link target intact.
Renaming a fresh temp file into place took the umask default, which could widen a restrictive 0600 settings file to 0644. The replacement now copies the mode of the file the path resolves to and falls back to the umask default only for a new file.
3ec938a to
44c0aad
Compare
|
On the latest Greptile summary for 44c0aad ("not safe to merge until sequence-claim cleanup works on macOS"): That concern is about the remote-job sequence-claim cleanup in This head was published through the no-mistakes pipeline (push to the fork, then a PR update). |
Problem
When a project worktree's harness settings file (for example
.claude/settings.local.json) is a symlink into a shared folder,bin/fm-spawn.shwrote the per-task hook file through the link.That overwrote the shared file, so every worktree linked to it ran the last-spawned task's Stop hook and produced misattributed turn-ended signals.
Change
write_wiring_filehelper inbin/fm-spawn.shwrites stdin to a temp file beside the target and renames it into place, removing any symlink at the path first, so the link target is never touched.rm -f, which removes a link rather than its target, and then re-runs the same writes.Tests
tests/fm-busy-adapter-wiring.test.shadds a case where the worktree's.claude/settings.local.jsonis a symlink to a file outside the worktree: after spawn the shared file is byte-identical and the worktree holds a real file with the task's hooks.