Skip to content

refactor(mutagen): one mechanism — pair on ssh, nothing on a schedule - #182

Merged
gapul merged 1 commit into
mainfrom
refactor/mutagen-ssh-only
Aug 9, 2026
Merged

refactor(mutagen): one mechanism — pair on ssh, nothing on a schedule#182
gapul merged 1 commit into
mainfrom
refactor/mutagen-ssh-only

Conversation

@gapul

@gapul gapul commented Aug 9, 2026

Copy link
Copy Markdown
Owner

~/Sync/<host> is supposed to mean "a machine I have actually talked to". The launchd agent broke that for the one host in peers: it ran at login and hourly, and mkdir -p'd the directory whether or not that machine had been touched — even on the many attempts where it then failed to create a session at all.

Since #179 the ssh path already covers pairing, so the agent, the peers list and the per-peer script all go. 89 lines deleted, 27 added.

The one thing peers carried that the ssh path did not is the -sync alias. That is now looked up rather than declared: if ssh_config defines <host>-sync, that entry is dialled, otherwise the host itself is. The convention is documented in the header instead of being encoded in a list of one.

Behaviour after this:

  • a directory under ~/Sync appears the first time you ssh to that host, and never otherwise
  • a failed pairing leaves nothing behind (the empty directory is removed again)
  • existing sessions are untouched — they live in the mutagen daemon, not in this module

Checked against stub ssh / mutagen with a fixture ssh_config that has both mvrx-nolang-dev and mvrx-nolang-dev-sync:

ssh mvrx-nolang-dev        -> create mvrx-nolang-dev  ->  mvrx-nolang-dev-sync:Sync/MacBook-Mini
ssh rpi4                   -> create rpi4             ->  rpi4:Sync/MacBook-Mini
ssh 10.0.0.1               -> (nothing)
ssh mvrx-nolang-dev-sync   -> (nothing)

Note the local directory keeps the host's name in both cases; only the dial target changes.

The launchd agent recreated ~/Sync/mvrx-nolang-dev at login and every hour whether or
not that machine had been touched, which is the opposite of what the directory is meant
to tell you. The ssh path already covers it; the -sync alias is now looked up from
ssh_config instead of being hard-coded in a peers list.
@gapul
gapul enabled auto-merge (squash) August 9, 2026 11:05
@gapul
gapul merged commit 87d12fb into main Aug 9, 2026
3 checks passed
@gapul
gapul deleted the refactor/mutagen-ssh-only branch August 9, 2026 11:12
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