---
name: "Add test coverage for io/watcher.rs (40% -> 70%+)"
---

# Story 121: Add test coverage for io/watcher.rs

Currently at 40% line coverage (238 lines, 142 missed). The file watcher is critical infrastructure — it drives pipeline advancement and auto-commits.

## What to test

- Story file detection and classification (which directory, what kind of move)
- Debounce/flush logic
- Git add/commit message generation
- Watcher pause/resume mechanism (added in story 119 for merge safety)
- Edge cases: rapid file changes, missing directories, git failures

## Notes

- Use temp directories for filesystem tests
- Mock git commands where needed
- The watcher pause lock is especially important to test given its role in merge safety

## Acceptance Criteria

- [ ] Line coverage for `io/watcher.rs` reaches 70%+
- [ ] Tests pass with `cargo test`
- [ ] `cargo clippy` clean
