Skip to main content

Module watch

Module watch 

Source
Expand description

Filesystem-watcher backstop.

Records FS changes even from actions that dodged the hook/shim/MCP, so the timeline and kintsugi undo stay complete — the honest guarantee is “nothing is unrecoverable”, not “nothing runs un-warned”. Observations are sent to the daemon over IPC so its single writer keeps the hash chain intact (never a second concurrent writer racing on prev_hash).

On by default for the work tree (via kintsugi init); also kintsugi watch <path>.

Scope is deliberately narrow so the append-only log stays signal, not noise: the backstop records the destructive filesystem changes it exists to catch — deletions and renames/moves — and not every file create or save (which a normal edit/build storm produces by the thousand, and which interception + snapshots already cover for agent writes). It also skips well-known build / VCS / editor-scratch paths entirely.

Functions§

is_ignored
Whether a path lives under a build/VCS/cache dir or is an editor scratch file, so the backstop can skip it. Keeps the log to changes a human would care about.
kind_label
Map a notify event kind to a stable label, or None to ignore it.
run
Watch roots recursively, forwarding each change to the daemon. Long-running.