story-kit: create 121_story_test_coverage_io_watcher_rs

This commit is contained in:
Dave
2026-02-23 23:43:11 +00:00
parent daeb607b03
commit cb4e01ab09

View File

@@ -0,0 +1,27 @@
---
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