Skip to content

fix(sync): preserve tracked dangling symlinks through remote exec - #1925

Closed
alex09x wants to merge 3 commits into
mainfrom
fix/1889-dangling-tracked-symlink
Closed

alex09x wants to merge 3 commits into
mainfrom
fix/1889-dangling-tracked-symlink

Conversation

@alex09x

@alex09x alex09x commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Problem

A Git-tracked dangling symlink needed by generated Swift bindings is absent from the remote workspace after sync. The local link exists before target/bindings does; the build creates that target later, and SwiftPM then needs the original link identity to resolve the generated file.

Change

  • Add an optional full-workspace tracked-symlink manifest to SyncRequest; partial syncs do not claim ownership of the full link set.
  • The client collects mode 120000 entries from Git, keeps the original relative targets, and excludes link aliases from the regular file manifest so a followed file link cannot overwrite its link.
  • The gateway validates link paths and target confinement, creates links atomically, and keeps a gateway-local manifest so later full syncs remove only links it previously managed and whose targets still match.
  • The gateway acknowledges support in the existing sync response. A new client refuses to run a command when a tracked symlink is present and the gateway cannot confirm support or reports a failed link.
  • Old clients remain compatible because the request extension is optional and defaults to absent.

Reproduce and verify

Mitts Build 0.3.21, macOS ARM64:

  • mitts test --locked -p prod-code-protocol --test transport_security_acceptance test_packet_capture_wire_confidentiality — 1 passed.
  • mitts test --locked -p prod-code-gateway --lib 'sync::symlinks::tests::' — 2 passed. Covers dangling-link identity after the generated target appears, removal of a managed link, workspace-escape rejection, and the response acknowledgement.
  • mitts test --locked -p prod-code-mcp --lib 'sync::push::tests::' — 6 passed. Covers sending tracked links, filtering a followed file link from ordinary file deltas, and refusing a legacy gateway before command execution.
  • mitts test --locked -p prod-code-testkit --test wire_and_engines_1_scripted_gateway sync_messages_are_answered_as_if_the_tree_were_held — 1 passed.
  • Mitts formatting checks for prod-code-gateway, prod-code-mcp, prod-code-protocol, and prod-code-testkit — passed with 0 diffs.
  • Strict Clippy passed for prod-code-protocol. Strict Clippy for gateway and MCP is blocked by existing warnings in unrelated modules; one warning in the new gateway helper was fixed. No claim of a clean strict-Clippy run for those packages.

No performance claim. A live SwiftPM remote-exec run has not yet been done; the regression is covered by focused client and gateway tests, not a released-cluster test.

Measurements

None; no latency or performance claim.

Checks

The targeted Mitts tests above passed. No full test suite or live cluster was run.

Closes

Closes #1889

@alex09x alex09x added bug Something isn't working worktree Multi-worktree isolation and sync labels Nov 4, 2026
@alex09x alex09x changed the title fix(sync): preserve dangling links in seeded workspaces fix(sync): preserve tracked dangling symlinks through remote exec Nov 4, 2026
@alex09x

alex09x commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #1912, which now includes the tracked symlink protocol/client/gateway changes alongside ownership-aware sync for #1888 and #1895. Issue #1889 is linked from the consolidated PR and remains open until it merges.

@alex09x alex09x closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working worktree Multi-worktree isolation and sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Swift checkout sync drops a dangling tracked symlink needed by generated bindings

1 participant