Fixes the file watcher hanging on projects whose build folder is a symlink to an unresponsive or disconnected drive. Linked folders and folders on other drives are no longer opened or walked during exclusion planning.
Bug Fixes
Exclusion planning never follows symlinks or crosses drives; Linux watch scans and parent repository discovery apply the same boundary, and other-drive directories are reported as unsearched.
Planning runs within a two-second deadline and a daemon-wide two-worker budget, waiting for capacity rather than returning an empty plan; when kernel I/O stalls, it falls back to ordinary event filtering.
A retry loop (up to eight attempts with backoff) replans without consuming the matcher generation; when replanning stalls, installed exclusions are revalidated against the current matcher so watches on newly nonignored paths are restored, checking only Gitignore entries while other exclusion sources persist. Attempts, exhaustion, and last failure appear in health snapshots.
Boundary refresh is gated on topology events and reuses a cached root/device boundary, avoiding filesystem probes on ordinary content changes.
Linux matcher-replacement directory walks run on bounded helper workers sharing the planner's permits and deadline, off the event-forwarding thread; stalled walks surface through planning health and retry within the generation's budget. Walk results are discarded when the directory identity changed during planning, watches installed by concurrent create events are preserved if still live rather than reopened after reconciliation, and ignore-rule checks on the event thread match lexically without resolving symlinks or stat-ing paths.
When a link is replaced by a real folder, topology events reclassify the path and the watcher resumes watching it, with a recovery rescan on FSEvents and cursor replay on handoff.
Confidence Score: 5/5
The PR appears safe to merge; no new actionable issue was established.
Summary
The PR keeps watcher exclusion planning from walking through symlinks or onto other drives.
Watcher scans stop at linked folders and other drives.
Exclusion planning retries within a shared time and worker limit.
Linux watcher rebuilds resume local folders after boundary changes.
macOS watcher refreshes exclusions when folder links change.
The previous-review ancestry checks failed, so this review used the full PR diff. All seven supplied previous threads are unnumbered and were manually resolved by ualtinok without explanatory replies; none is reposted here.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Matcher changes] --> B[Bounded exclusion planner]
B --> C{Plan available?}
C -->|Yes| D[Replace exclusions]
C -->|No| E[Remove stale Gitignore exclusions]
E --> F[Retry within generation budget]
D --> G[Linux helper rebuild or macOS stream handoff]
E --> G
H[Topology event] --> I[Recheck external boundaries]
I --> G