Record a removal's outcome, publish it, and read one directory once
mesh/merge-gate pass: builds systemd → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery delivered

The record kept only the intent, so a failed unlink read as removed; each
link now gets a synced intent and outcome line, and the outcome is the
module's link.removal event so it is not only a file on one machine.
The put-back hint no longer advises a symlink, an aliased directory is
read once, a machine-wide removal from user scope is said, and the state
directory names no owner a machine without an account cannot resolve.
This commit is contained in:
jochen
2026-10-08 17:55:56 +02:00
parent 87c9d9f7e5
commit 1b368f9aaf
6 changed files with 286 additions and 29 deletions
@@ -147,6 +147,11 @@ type Manager struct {
// State is the module's state directory, where each removed link is recorded.
State string
Now func() time.Time
// Emit publishes one of this module's events (unlink.go).
Emit func(eventType string, body any) error
// Resolve is a directory's path with every link in it followed, so one directory reached by two
// names is searched once (on Arch /etc/xdg/systemd/user leads to /etc/systemd/user).
Resolve func(path string) (string, error)
}
var userBus = regexp.MustCompile(`(?i)Failed to connect to (user scope )?bus`)