Semantic Diff

#9403 Fix watch mode ignoring a file saved right after a rebuild started

1 commit

45dba2c9137d6be765c1d8d45f287d739e028498..pr-9403

074a99cc9 · cknitt + Claude · Nov 24, 2026, 07:47 UTC

Rebuild edits made between the watcher's two snapshots

After a build, the native watcher took one snapshot of the sources to find what changed and then a second as the baseline for the next round. A file saved between the two was in the baseline but was never reported to a build, so watch mode ignored it until the file changed again. That is the flaky "watch-retained-graph" test on macOS: B.res, saved right after C.res, never got recompiled. The changes now come from the snapshot that becomes the baseline, as the polling watcher already does.

A unit test injects the watcher's source discovery, which runs between the two snapshots, to edit a file exactly there, and checks that the next build reports it. It fails with the old snapshot order.