watch: ignore filesystem access events !9

merged merged by cmc on 2026-10-18 20:22 UTC · krz/orgo:watch-ignore-access-events into main

Discussion

cmc

inotify's watch mask includes IN_OPEN, so reading a file raises an event on it — and a build reads every source file. Each rebuild triggered the next, as fast as the machine could build; under orgo serve the browser reloads every few milliseconds. macOS and Windows report no access events, so only Linux was affected.

is_change drops EventKind::Access(_) except Close(Write), which follows a write rather than a read. Non-access kinds are kept, including the backends' catch-all Any — FSEvents and the Windows backend report unclassified changes that way.

The end-to-end test now counts rebuilds through run_with instead of watching syntax.css's mtime, so "a quiet tree builds nothing" covers the build's own reads as well as its writes.

Verified on the Linux runner: build 43 (the test alone, no fix) fails with 12 rebuilds in 1.5s of an idle tree; build 45 (test + fix) passes. Build 46, triggered on main for a control, passes with the old mtime assertion — that check was blind to the loop, which is why CI stayed green.

Reported by a user against orgo serve.