Lifecycle Guarantees
Watch’s CLI commands don’t just fire a signal and return — the important transitions wait for the daemon to confirm the change actually happened.
start/resumeonly return success after the daemon has confirmed that the root is actually being monitored — not just that a request was sent.pause/stopwait for the daemon’s teardown acknowledgement before returning.- Filesystem events are associated with the watch generation that observed them. A stale event from before a restart can never be organized as if it were current.
- Automatic mutation revalidates that the watch is still running and authorized immediately before it acts — not just at the moment the event first arrived.
- Files created while paused are not backfilled on resume. Only events from the moment of resume onward are handled.
Why this matters
Section titled “Why this matters”Without these guarantees, a script that runs sift watch start ~/Inbox immediately followed by dropping a file into ~/Inbox could race the daemon — the file might land before monitoring actually began. Because start only returns once monitoring is confirmed, that race doesn’t exist: if the command succeeded, the watch is genuinely live.
The single background daemon
Section titled “The single background daemon”All registered watches are served by one background daemon process, not one process per watch.
sift watch daemon statussift watch daemon stopdaemon stop asks the running daemon to shut down safely — every registered watch stays registered, just not actively monitored, until something starts it again.
Related
Section titled “Related”- Register and Start and Pause, Resume and Stop — the commands these guarantees apply to.
- Stability Window — the debounce that runs within an active, confirmed watch.
