a registered checkout follows main as changes land, not only when a coordinator session starts
State
question or idea
Created
2026-11-23 by contributor
Body
Requested by the operator: local checkouts should stay up to date automatically.
Today `valley flow sync` fetches every registered project and fast-forwards a clean checkout on its upstream branch; it runs in the background when a coordinator session starts and on demand. Between sessions, and during a long one, checkouts fall behind. A checkout on a detached HEAD is skipped without limit, so a clone flow itself left detached never catches up.
Shape to weigh, events before timers: the watch stream already carries change:integrated per project, so a running session can fast-forward that project's checkout when the event arrives, under the same never-reset rules. Machines with no session running have no listener; options there are the valley client fast-forwarding the default branch when a verb already fetches origin, or a host-pushed notification. A detached checkout that sits exactly on an ancestor of main with a clean tree could be reported, or re-attached, instead of silently skipped.
Comments
contributor2026-11-23 01:19 UTC
Two reporting defects seen on a real run of `valley flow sync`, to fix with this:
- a checkout that cannot fast-forward prints git's multi-line hint text into the table cell; it should be one line such as "skipped: diverged from main (1 ahead, 3 behind)".
- a branch whose change landed is reported as diverged, because a landing is a new commit with the same tree. When the branch tip's tree (or patch) equals a commit on main, say "landed as <commit>" so the operator knows the branch can be deleted.