fix(watch): report failed directory adoption - #910
Conversation
code-review-graph reviewOverall risk: 0.70 (HIGH) — 11 changed function(s)/class(es), 12 affected flow(s), 5 test gap(s) Risk-scored changes
Affected execution flows
Test gaps
Token savings: this graph-backed report used ~40,721 fewer tokens (~70%) than reading every changed file in full (estimated, chars/4 approximation). Powered by code-review-graph — local-first analysis; no code leaves the CI runner. |
|
The core of this is right and it lands where I hoped: Three things in the new code need fixing before it goes in. 1. Raising the schedule limit does nothing for an ENOSPC that already cleared. The latch was correct for promotion — a recursive watch is never split back — so keep that irreversible and derive the flag instead: 2. 3. Health writes are amplified exactly when the machine is starved. Adding Smaller, worth doing in the same pass: One thing I am not holding against you, filed separately: if the promotion schedule fails, Everything else is green: 2986 passed, the three real- |
Problem
When
observer.schedule()raisesOSErrorwhile adopting a new directory,_schedule()logs the failure and returns, but_adopt_directory()still returnsTrue. The directory is therefore reported as adopted,degradedstays false, and watcher health gives no path-level evidence of the lost coverage.Change
_schedule()now reports whether registration succeeded.failed_paths._adopt_directory()only reports adoption when at least one planned watch was registered; parent promotion follows the same rule.crg-daemon statusreportspartialrather thanok.Validation
pytest tests/test_watch_robustness.py::TestNewDirectoryAdoption tests/test_daemon.py: 77 passed, 5 skipped.ruff checkon all changed Python files.git diff --check.Fixes #907