Artifact 3a6f96095234d5acd6a2633fba9241263409576c58ccf41b5aa67075cb59de72:
- File
leaf/agent/autosync.go
— part of check-in
[eda7960b81]
at
2026-04-23 19:23:42
on branch trunk
— rename module to github.com/danmestas/EdgeSync
Fix the case-sensitive module path to match the actual GitHub repo URL (danmestas/EdgeSync). Remove tracked leaf/leaf binary and ignore .claude/skills/ scratchpad dirs. (user: [email protected], size: 1418) [annotate] [blame] [check-ins using] [more...]
package agent // TODO(v0.2.0): AutosyncCommit requires checkout.Checkout which is now internal // to libfossil. The public API needs a Checkout handle or the autosync workflow // needs to be reimplemented using libfossil.Repo methods. // // The autosync workflow is: pull -> ci-lock -> fork-check -> commit -> push. // This depends on checkout.Version(), checkout.WouldFork(), checkout.Commit(), // and sync.Sync() with CkinLock support. // // For now, the core agent sync (push/pull) works via libfossil.Repo.Sync(). // Autosync commit is deferred until the public API exposes checkout operations. import "errors" // AutosyncMode controls the autosync behavior around commit. type AutosyncMode int const ( AutosyncOff AutosyncMode = iota // no sync, commit directly AutosyncOn // pull before, push after AutosyncPullOnly // pull before, no push after ) var ( // ErrWouldFork is returned when committing would create a fork. ErrWouldFork = errors.New("would fork: run update first, or use --allow-fork or --branch") // ErrCkinLockHeld is returned when another client holds the check-in lock. ErrCkinLockHeld = errors.New("check-in lock held by another client") // ErrAutosyncNotImplemented is returned when autosync is attempted with v0.2.0. ErrAutosyncNotImplemented = errors.New("autosync commit not yet available with libfossil v0.2.0 handle API") )