test: Add regression tests and `OutputWatcher` trait to prepare for daemon removal from `turbo watch` (#12171)
## Summary
- Defines the `OutputWatcher` trait that will replace `DaemonClient` in
`RunCache`/`TaskCache` when we remove the daemon from watch mode
- Adds regression tests that characterize current watch behavior and
must stay green throughout the daemon removal refactor
## What's here
**`OutputWatcher` trait** (`turborepo-run-cache`): Abstracts
`get_changed_outputs` and `notify_outputs_written` — the two operations
`TaskCache` uses to prevent infinite rebuild loops in watch mode.
Currently these go through the daemon's gRPC interface; the trait lets
us swap in an in-process `GlobWatcher` without changing `TaskCache`.
**8 mock-based unit tests** (`turborepo-run-cache`): Characterize the
trait contract — empty results, partial changes, error recovery for both
get and notify, lifecycle round-trips, per-hash independence, and `Send
+ Sync` compliance.
**3 GlobWatcher delegation tests** (`turborepo-filewatch`): Verify that
`GlobWatcher::watch_globs`/`get_changed_globs` satisfy the
`OutputWatcher` contract when called with raw strings and
`GlobSet::from_raw` — the exact path the future `InProcessOutputWatcher`
will use. Tests cover unchanged outputs, changed outputs, and exclusion
glob handling.
**2 E2E watch tests** (`watch_test.rs`):
- `watch_no_spurious_rebuild_after_settle` — After the initial build, no
further rebuilds occur when no files change. Guards against infinite
rebuild loops from cache restores triggering the file watcher.
- `watch_same_content_write_does_not_rebuild` — Writing identical
content to a source file does not trigger a rebuild. Guards against
hash-based deduplication regression.
## Testing
All 13 new tests pass locally. The 2 E2E tests are automatically
serialized via the existing nextest `turbo-watch-serial` group.